mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
add GroupInfo.UpdateMemo
This commit is contained in:
parent
1ff595e6ee
commit
3823090846
@ -6,6 +6,8 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
|
||||||
"github.com/Mrs4s/MiraiGo/binary"
|
"github.com/Mrs4s/MiraiGo/binary"
|
||||||
"github.com/Mrs4s/MiraiGo/binary/jce"
|
"github.com/Mrs4s/MiraiGo/binary/jce"
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb"
|
"github.com/Mrs4s/MiraiGo/client/pb"
|
||||||
@ -20,7 +22,6 @@ import (
|
|||||||
"github.com/Mrs4s/MiraiGo/protocol/packets"
|
"github.com/Mrs4s/MiraiGo/protocol/packets"
|
||||||
"github.com/Mrs4s/MiraiGo/protocol/tlv"
|
"github.com/Mrs4s/MiraiGo/protocol/tlv"
|
||||||
"github.com/Mrs4s/MiraiGo/utils"
|
"github.com/Mrs4s/MiraiGo/utils"
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -846,6 +847,16 @@ func (c *QQClient) buildGroupNameUpdatePacket(groupCode int64, newName string) (
|
|||||||
return c.buildGroupOperationPacket(body)
|
return c.buildGroupOperationPacket(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *QQClient) buildGroupMemoUpdatePacket(groupCode int64, newMemo string) (uint16, []byte) {
|
||||||
|
body := &oidb.D89AReqBody{
|
||||||
|
GroupCode: groupCode,
|
||||||
|
StGroupInfo: &oidb.D89AGroupinfo{
|
||||||
|
IngGroupMemo: []byte(newMemo),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return c.buildGroupOperationPacket(body)
|
||||||
|
}
|
||||||
|
|
||||||
// OidbSvc.0x89a_0
|
// OidbSvc.0x89a_0
|
||||||
func (c *QQClient) buildGroupMuteAllPacket(groupCode int64, mute bool) (uint16, []byte) {
|
func (c *QQClient) buildGroupMuteAllPacket(groupCode int64, mute bool) (uint16, []byte) {
|
||||||
body := &oidb.D89AReqBody{
|
body := &oidb.D89AReqBody{
|
||||||
|
@ -16,6 +16,8 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
|
||||||
"github.com/Mrs4s/MiraiGo/binary"
|
"github.com/Mrs4s/MiraiGo/binary"
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/longmsg"
|
"github.com/Mrs4s/MiraiGo/client/pb/longmsg"
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
||||||
@ -23,7 +25,6 @@ import (
|
|||||||
"github.com/Mrs4s/MiraiGo/message"
|
"github.com/Mrs4s/MiraiGo/message"
|
||||||
"github.com/Mrs4s/MiraiGo/protocol/packets"
|
"github.com/Mrs4s/MiraiGo/protocol/packets"
|
||||||
"github.com/Mrs4s/MiraiGo/utils"
|
"github.com/Mrs4s/MiraiGo/utils"
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type QQClient struct {
|
type QQClient struct {
|
||||||
@ -754,6 +755,10 @@ func (c *QQClient) updateGroupName(groupCode int64, newName string) {
|
|||||||
_, _ = c.sendAndWait(c.buildGroupNameUpdatePacket(groupCode, newName))
|
_, _ = c.sendAndWait(c.buildGroupNameUpdatePacket(groupCode, newName))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *QQClient) updateGroupMemo(groupCode int64, newMemo string) {
|
||||||
|
_, _ = c.sendAndWait(c.buildGroupMemoUpdatePacket(groupCode, newMemo))
|
||||||
|
}
|
||||||
|
|
||||||
func (c *QQClient) groupMuteAll(groupCode int64, mute bool) {
|
func (c *QQClient) groupMuteAll(groupCode int64, mute bool) {
|
||||||
_, _ = c.sendAndWait(c.buildGroupMuteAllPacket(groupCode, mute))
|
_, _ = c.sendAndWait(c.buildGroupMuteAllPacket(groupCode, mute))
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,13 @@ func (g *GroupInfo) UpdateName(newName string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *GroupInfo) UpdateMemo(newMemo string) {
|
||||||
|
if g.AdministratorOrOwner() {
|
||||||
|
g.client.updateGroupMemo(g.Code, newMemo)
|
||||||
|
g.Memo = newMemo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (g *GroupInfo) MuteAll(mute bool) {
|
func (g *GroupInfo) MuteAll(mute bool) {
|
||||||
if g.AdministratorOrOwner() {
|
if g.AdministratorOrOwner() {
|
||||||
g.client.groupMuteAll(g.Code, mute)
|
g.client.groupMuteAll(g.Code, mute)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user