1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-08 04:55:55 +08:00

fix image error.

This commit is contained in:
Mrs4s 2020-08-27 23:51:38 +08:00
parent 0894f2ac44
commit 0e7c30e854

View File

@ -367,12 +367,18 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message.
if group { if group {
rsp, err := bot.Client.QueryGroupImage(1, hash, size) rsp, err := bot.Client.QueryGroupImage(1, hash, size)
if err != nil { if err != nil {
if url != "" {
return bot.ToElement(t, map[string]string{"file": url}, group)
}
return nil, err return nil, err
} }
return rsp, nil return rsp, nil
} }
rsp, err := bot.Client.QueryFriendImage(1, hash, size) rsp, err := bot.Client.QueryFriendImage(1, hash, size)
if err != nil { if err != nil {
if url != "" {
return bot.ToElement(t, map[string]string{"file": url}, group)
}
return nil, err return nil, err
} }
return rsp, nil return rsp, nil