mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
member mute supported.
This commit is contained in:
parent
39aac304f5
commit
2accd73f8b
@ -57,4 +57,5 @@ qq-android协议的golang实现 移植于Mirai
|
||||
- [x] 修改群成员Card
|
||||
- [x] 修改群成员头衔
|
||||
- [ ] 群成员邀请
|
||||
- [ ] T出群成员
|
||||
- [x] 群成员禁言/解除禁言
|
||||
- [x] T出群成员
|
||||
|
@ -794,3 +794,22 @@ func (c *QQClient) buildGroupKickPacket(groupCode, memberUin int64, kickMsg stri
|
||||
packet := packets.BuildUniPacket(c.Uin, seq, "OidbSvc.0x8a0_0", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload)
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
// OidbSvc.0x570_8
|
||||
func (c *QQClient) buildGroupMutePacket(groupCode, memberUin int64, time uint32) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
req := &oidb.OIDBSSOPkg{
|
||||
Command: 1392,
|
||||
ServiceType: 8,
|
||||
Bodybuffer: binary.NewWriterF(func(w *binary.Writer) {
|
||||
w.WriteUInt32(uint32(groupCode))
|
||||
w.WriteByte(32)
|
||||
w.WriteUInt16(1)
|
||||
w.WriteUInt32(uint32(memberUin))
|
||||
w.WriteUInt32(time)
|
||||
}),
|
||||
}
|
||||
payload, _ := proto.Marshal(req)
|
||||
packet := packets.BuildUniPacket(c.Uin, seq, "OidbSvc.0x570_8", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload)
|
||||
return seq, packet
|
||||
}
|
||||
|
@ -465,6 +465,10 @@ func (c *QQClient) groupMuteAll(groupCode int64, mute bool) {
|
||||
_, _ = c.sendAndWait(c.buildGroupMuteAllPacket(groupCode, mute))
|
||||
}
|
||||
|
||||
func (c *QQClient) groupMute(groupCode, memberUin int64, time uint32) {
|
||||
_, _ = c.sendAndWait(c.buildGroupMutePacket(groupCode, memberUin, time))
|
||||
}
|
||||
|
||||
func (c *QQClient) kickGroupMember(groupCode, memberUin int64, msg string) {
|
||||
_, _ = c.sendAndWait(c.buildGroupKickPacket(groupCode, memberUin, msg))
|
||||
}
|
||||
|
@ -215,6 +215,14 @@ func (m *GroupMemberInfo) Kick(msg string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *GroupMemberInfo) Mute(time uint32) {
|
||||
if m.Uin != m.Group.client.Uin && m.Manageable() {
|
||||
if time < 2592000 {
|
||||
m.Group.client.groupMute(m.Group.Code, m.Uin, time)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (m *GroupMemberInfo) Manageable() bool {
|
||||
if m.Uin == m.Group.client.Uin {
|
||||
return true
|
||||
|
Loading…
x
Reference in New Issue
Block a user