diff --git a/client/pb/oidb/oidb0xb77.pb.go b/client/pb/oidb/oidb0xb77.pb.go index 714f17f4..f4479287 100644 --- a/client/pb/oidb/oidb0xb77.pb.go +++ b/client/pb/oidb/oidb0xb77.pb.go @@ -14,6 +14,7 @@ type DB77ReqBody struct { SendType uint32 `protobuf:"varint,10,opt"` RecvUin uint64 `protobuf:"varint,11,opt"` RichMsgBody *DB77RichMsgBody `protobuf:"bytes,12,opt"` + RecvGuildId uint64 `protobuf:"varint,19,opt"` } func (x *DB77ReqBody) GetAppId() uint64 { @@ -86,6 +87,13 @@ func (x *DB77ReqBody) GetRichMsgBody() *DB77RichMsgBody { return nil } +func (x *DB77ReqBody) GetRecvGuildId() uint64 { + if x != nil { + return x.RecvGuildId + } + return 0 +} + type DB77ClientInfo struct { Platform uint32 `protobuf:"varint,1,opt"` SdkVersion string `protobuf:"bytes,2,opt"` diff --git a/client/pb/oidb/oidb0xb77.proto b/client/pb/oidb/oidb0xb77.proto index 2f5d952b..53cfef80 100644 --- a/client/pb/oidb/oidb0xb77.proto +++ b/client/pb/oidb/oidb0xb77.proto @@ -13,6 +13,7 @@ message DB77ReqBody { uint32 sendType = 10; uint64 recvUin = 11; DB77RichMsgBody richMsgBody = 12; + uint64 recvGuildId = 19; } message DB77ClientInfo { diff --git a/client/richmsg.go b/client/richmsg.go index 10210e25..801b6de0 100644 --- a/client/richmsg.go +++ b/client/richmsg.go @@ -77,7 +77,7 @@ func (c *QQClient) SendGroupMusicShare(target int64, msg *message.MusicShareElem } }) defer c.onGroupMessageReceipt(eid) - _, _ = c.sendAndWait(c.buildRichMsgSendingPacket(target, msg, 1)) // rsp is empty chunk + _, _ = c.sendAndWait(c.buildRichMsgSendingPacket(0, target, msg, 1)) // rsp is empty chunk select { case ret := <-ch: return ret, nil @@ -88,11 +88,17 @@ func (c *QQClient) SendGroupMusicShare(target int64, msg *message.MusicShareElem // SendFriendMusicShare 发送好友音乐卡片 func (c *QQClient) SendFriendMusicShare(target int64, msg *message.MusicShareElement) { - _, _ = c.sendAndWait(c.buildRichMsgSendingPacket(target, msg, 0)) + _, _ = c.sendAndWait(c.buildRichMsgSendingPacket(0, target, msg, 0)) +} + +// SendGuildMusicShare 发送频道音乐卡片 +func (c *QQClient) SendGuildMusicShare(guildID, channelID uint64, msg *message.MusicShareElement) { + // todo(wdvxdr): message receipt? + _, _ = c.sendAndWait(c.buildRichMsgSendingPacket(guildID, int64(channelID), msg, 3)) } // OidbSvc.0xb77_9 -func (c *QQClient) buildRichMsgSendingPacket(target int64, msg *message.MusicShareElement, sendType uint32) (uint16, []byte) { +func (c *QQClient) buildRichMsgSendingPacket(guild uint64, target int64, msg *message.MusicShareElement, sendType uint32) (uint16, []byte) { seq := c.nextSeq() tp := musicType[msg.MusicType] // MusicType body := &oidb.DB77ReqBody{ @@ -121,6 +127,7 @@ func (c *QQClient) buildRichMsgSendingPacket(target int64, msg *message.MusicSha PictureUrl: msg.PictureUrl, MusicUrl: msg.MusicUrl, }, + RecvGuildId: guild, } b, _ := proto.Marshal(body) payload := c.packOIDBPackage(2935, 9, b)