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

Method SetGroupAdmin

client/operation.go:191–213  ·  view source on GitHub ↗

SetGroupAdmin 设置群管理员

(groupUin, uin uint32, isAdmin bool)

Source from the content-addressed store, hash-verified

189
190// SetGroupAdmin 设置群管理员
191func (c *QQClient) SetGroupAdmin(groupUin, uin uint32, isAdmin bool) error {
192 uid := c.GetUID(uin, groupUin)
193 if uid == "" {
194 return errors.New("uid not found")
195 }
196 pkt, err := oidb2.BuildSetGroupAdminReq(groupUin, uid, isAdmin)
197 if err != nil {
198 return err
199 }
200 resp, err := c.sendOidbPacketAndWait(pkt)
201 if err != nil {
202 return err
203 }
204 err = oidb2.ParseSetGroupAdminResp(resp)
205 if err != nil {
206 return err
207 }
208 if m := c.GetCachedMemberInfo(uin, groupUin); m != nil {
209 m.Permission = entity.Admin
210 c.cache.RefreshGroupMember(groupUin, m)
211 }
212 return nil
213}
214
215// SetGroupMemberName 设置群成员昵称
216func (c *QQClient) SetGroupMemberName(groupUin, uin uint32, name string) error {

Callers

nothing calls this directly

Calls 4

GetUIDMethod · 0.95
sendOidbPacketAndWaitMethod · 0.95
GetCachedMemberInfoMethod · 0.95
RefreshGroupMemberMethod · 0.80

Tested by

no test coverage detected