mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-05 03:23:50 +08:00
add: SetAdmin().
This commit is contained in:
parent
dde8bded28
commit
808a63a78e
@ -915,6 +915,28 @@ func (c *QQClient) buildGroupMutePacket(groupCode, memberUin int64, time uint32)
|
|||||||
return seq, packet
|
return seq, packet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OidbSvc.0x55c_1
|
||||||
|
func (c *QQClient) buildGroupAdminSetPacket(groupCode, member int64, flag bool) (uint16, []byte) {
|
||||||
|
seq := c.nextSeq()
|
||||||
|
req := &oidb.OIDBSSOPkg{
|
||||||
|
Command: 1372,
|
||||||
|
ServiceType: 1,
|
||||||
|
Bodybuffer: binary.NewWriterF(func(w *binary.Writer) {
|
||||||
|
w.WriteUInt32(uint32(groupCode))
|
||||||
|
w.WriteUInt32(uint32(member))
|
||||||
|
w.WriteByte(func() byte {
|
||||||
|
if flag {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}())
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
payload, _ := proto.Marshal(req)
|
||||||
|
packet := packets.BuildUniPacket(c.Uin, seq, "OidbSvc.0x55c_1", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload)
|
||||||
|
return seq, packet
|
||||||
|
}
|
||||||
|
|
||||||
// MultiMsg.ApplyUp
|
// MultiMsg.ApplyUp
|
||||||
func (c *QQClient) buildMultiApplyUpPacket(data, hash []byte, buType int32, groupUin int64) (uint16, []byte) {
|
func (c *QQClient) buildMultiApplyUpPacket(data, hash []byte, buType int32, groupUin int64) (uint16, []byte) {
|
||||||
seq := c.nextSeq()
|
seq := c.nextSeq()
|
||||||
|
@ -803,6 +803,10 @@ func (c *QQClient) editMemberSpecialTitle(groupCode, memberUin int64, title stri
|
|||||||
_, _ = c.sendAndWait(c.buildEditSpecialTitlePacket(groupCode, memberUin, title))
|
_, _ = c.sendAndWait(c.buildEditSpecialTitlePacket(groupCode, memberUin, title))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *QQClient) setGroupAdmin(groupCode, memberUin int64, flag bool) {
|
||||||
|
_, _ = c.sendAndWait(c.buildGroupAdminSetPacket(groupCode, memberUin, flag))
|
||||||
|
}
|
||||||
|
|
||||||
func (c *QQClient) updateGroupName(groupCode int64, newName string) {
|
func (c *QQClient) updateGroupName(groupCode int64, newName string) {
|
||||||
_, _ = c.sendAndWait(c.buildGroupNameUpdatePacket(groupCode, newName))
|
_, _ = c.sendAndWait(c.buildGroupNameUpdatePacket(groupCode, newName))
|
||||||
}
|
}
|
||||||
|
@ -246,6 +246,12 @@ func (m *GroupMemberInfo) EditCard(card string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *GroupMemberInfo) SetAdmin(flag bool) {
|
||||||
|
if m.Group.OwnerUin == m.Group.client.Uin {
|
||||||
|
m.Group.client.setGroupAdmin(m.Group.Code, m.Uin, flag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *GroupMemberInfo) EditSpecialTitle(title string) {
|
func (m *GroupMemberInfo) EditSpecialTitle(title string) {
|
||||||
if m.Group.SelfPermission() == Owner && len(title) <= 18 {
|
if m.Group.SelfPermission() == Owner && len(title) <= 18 {
|
||||||
m.Group.client.editMemberSpecialTitle(m.Group.Code, m.Uin, title)
|
m.Group.client.editMemberSpecialTitle(m.Group.Code, m.Uin, title)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user