QueryFriendImage 获取私聊图片
(md5 []byte, fileUUID string)
| 561 | |
| 562 | // QueryFriendImage 获取私聊图片 |
| 563 | func (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 获取用户信息 |
| 580 | func (c *QQClient) FetchUserInfo(uid string) (*entity.User, error) { |
nothing calls this directly
no test coverage detected