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

Method SetGroupMemberName

client/operation.go:216–238  ·  view source on GitHub ↗

SetGroupMemberName 设置群成员昵称

(groupUin, uin uint32, name string)

Source from the content-addressed store, hash-verified

214
215// SetGroupMemberName 设置群成员昵称
216func (c *QQClient) SetGroupMemberName(groupUin, uin uint32, name string) error {
217 uid := c.GetUID(uin, groupUin)
218 if uid == "" {
219 return errors.New("uid not found")
220 }
221 pkt, err := oidb2.BuildSetGroupMemberNameReq(groupUin, uid, name)
222 if err != nil {
223 return err
224 }
225 resp, err := c.sendOidbPacketAndWait(pkt)
226 if err != nil {
227 return err
228 }
229 err = oidb2.ParseSetGroupMemberNameResp(resp)
230 if err != nil {
231 return err
232 }
233 if m := c.GetCachedMemberInfo(uin, groupUin); m != nil {
234 m.MemberCard = name
235 c.cache.RefreshGroupMember(groupUin, m)
236 }
237 return nil
238}
239
240// KickGroupMember 踢出群成员,可选是否拒绝加群请求
241func (c *QQClient) KickGroupMember(groupUin, uin uint32, rejectAddRequest bool) 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