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

Method SetGroupAvatar

client/operation.go:1282–1299  ·  view source on GitHub ↗

SetGroupAvatar 设置群头像

(groupUin uint32, avatar io.ReadSeeker)

Source from the content-addressed store, hash-verified

1280
1281// SetGroupAvatar 设置群头像
1282func (c *QQClient) SetGroupAvatar(groupUin uint32, avatar io.ReadSeeker) error {
1283 if avatar == nil {
1284 return errors.New("avatar is nil")
1285 }
1286 extra := highway.GroupAvatarExtra{
1287 Type: 101,
1288 GroupUin: groupUin,
1289 Field3: &highway.GroupAvatarExtraField3{Field1: 1},
1290 Field5: 3,
1291 Field6: 1,
1292 }
1293 extStream, err := proto.Marshal(&extra)
1294 if err != nil {
1295 return err
1296 }
1297 md5, size := crypto.ComputeMd5AndLength(avatar)
1298 return c.highwayUpload(3000, avatar, uint64(size), md5, extStream)
1299}
1300
1301// SetEssenceMessage 设置群聊精华消息
1302func (c *QQClient) SetEssenceMessage(groupUin, seq, random uint32, isSet bool) error {

Callers

nothing calls this directly

Calls 3

highwayUploadMethod · 0.95
MarshalFunction · 0.92
ComputeMd5AndLengthFunction · 0.92

Tested by

no test coverage detected