mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-06 12:03:50 +08:00
fix issue of get_msg image url empty. #503
This commit is contained in:
parent
6e3501a6f8
commit
6ea4bd829e
@ -10,6 +10,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"math/rand"
|
||||
"net/url"
|
||||
"path"
|
||||
"runtime"
|
||||
@ -871,7 +872,7 @@ func (bot *CQBot) makeImageElem(d map[string]string, group bool) (message.IMessa
|
||||
return nil, errors.New("invalid hash")
|
||||
}
|
||||
if group {
|
||||
rsp, err := bot.Client.QueryGroupImage(1, hash, size)
|
||||
rsp, err := bot.Client.QueryGroupImage(int64(rand.Uint32()), hash, size)
|
||||
if err != nil {
|
||||
if url != "" {
|
||||
return bot.makeImageElem(map[string]string{"file": url}, group)
|
||||
@ -880,7 +881,7 @@ func (bot *CQBot) makeImageElem(d map[string]string, group bool) (message.IMessa
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
rsp, err := bot.Client.QueryFriendImage(1, hash, size)
|
||||
rsp, err := bot.Client.QueryFriendImage(int64(rand.Uint32()), hash, size)
|
||||
if err != nil {
|
||||
if url != "" {
|
||||
return bot.makeImageElem(map[string]string{"file": url}, group)
|
||||
|
Loading…
x
Reference in New Issue
Block a user