MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / QueryFriendImage

Method QueryFriendImage

client/operation.go:563–577  ·  view source on GitHub ↗

QueryFriendImage 获取私聊图片

(md5 []byte, fileUUID string)

Source from the content-addressed store, hash-verified

561
562// QueryFriendImage 获取私聊图片
563func (c *QQClient) QueryFriendImage(md5 []byte, fileUUID string) (*message2.ImageElement, error) {
564 switch {
565 case fileUUID != "":
566 rkeyInfo := c.GetCachedRkeyInfo(entity.FriendRKey)
567 return &message2.ImageElement{
568 URL: fmt.Sprintf("https://multimedia.nt.qq.com.cn/download?appid=1406&fileid=%s&rkey=%s", fileUUID, rkeyInfo.RKey),
569 }, nil
570 case len(md5) == 16:
571 return &message2.ImageElement{
572 URL: fmt.Sprintf("http://gchat.qpic.cn/gchatpic_new/0/0-0-%X/0", md5),
573 }, nil
574 default:
575 return nil, errors.New("invalid parameters")
576 }
577}
578
579// FetchUserInfo 获取用户信息
580func (c *QQClient) FetchUserInfo(uid string) (*entity.User, error) {

Callers

nothing calls this directly

Calls 1

GetCachedRkeyInfoMethod · 0.95

Tested by

no test coverage detected