1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

feat: GuildMessageReactionsUpdatedEvent

This commit is contained in:
Mrs4s 2021-11-08 04:51:35 +08:00
parent fedd7f0507
commit b1d5a3d064
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
13 changed files with 7461 additions and 1653 deletions

View File

@ -220,6 +220,13 @@ type (
OperatorNick string
}
GuildMessageReactionsUpdatedEvent struct {
OperatorId uint64 // OperatorId 操作者TinyId, 只有自身消息被贴表情才会有值
EmojiId int32 // EmojiId 被贴的表情, 只有自身消息被贴表情才会有值
MessageId uint64
CurrentReactions []*message.GuildMessageEmojiReaction
}
OcrResponse struct {
Texts []*TextDetection `json:"texts"`
Language string `json:"language"`

View File

@ -15,6 +15,7 @@ type eventHandlers struct {
selfPrivateMessageHandlers []func(*QQClient, *message.PrivateMessage)
selfGroupMessageHandlers []func(*QQClient, *message.GroupMessage)
guildChannelMessageHandlers []func(*QQClient, *message.GuildChannelMessage)
guildMessageReactionsUpdatedHandlers []func(*QQClient, *GuildMessageReactionsUpdatedEvent)
groupMuteEventHandlers []func(*QQClient, *GroupMuteEvent)
groupRecalledHandlers []func(*QQClient, *GroupMessageRecalledEvent)
friendRecalledHandlers []func(*QQClient, *FriendMessageRecalledEvent)
@ -73,6 +74,10 @@ func (s *GuildService) OnGuildChannelMessage(f func(*QQClient, *message.GuildCha
s.c.eventHandlers.guildChannelMessageHandlers = append(s.c.eventHandlers.guildChannelMessageHandlers, f)
}
func (s *GuildService) OnGuildMessageReactionsUpdated(f func(*QQClient, *GuildMessageReactionsUpdatedEvent)) {
s.c.eventHandlers.guildMessageReactionsUpdatedHandlers = append(s.c.eventHandlers.guildMessageReactionsUpdatedHandlers, f)
}
func (c *QQClient) OnGroupMuted(f func(*QQClient, *GroupMuteEvent)) {
c.eventHandlers.groupMuteEventHandlers = append(c.eventHandlers.groupMuteEventHandlers, f)
}
@ -246,6 +251,17 @@ func (c *QQClient) dispatchGuildChannelMessage(msg *message.GuildChannelMessage)
}
}
func (c *QQClient) dispatchGuildMessageReactionsUpdatedEvent(e *GuildMessageReactionsUpdatedEvent) {
if e == nil {
return
}
for _, f := range c.eventHandlers.guildMessageReactionsUpdatedHandlers {
cover(func() {
f(c, e)
})
}
}
func (c *QQClient) dispatchGroupMuteEvent(e *GroupMuteEvent) {
if e == nil {
return

View File

@ -2,10 +2,9 @@ package client
import (
"fmt"
"github.com/Mrs4s/MiraiGo/message"
"github.com/Mrs4s/MiraiGo/binary"
"github.com/Mrs4s/MiraiGo/client/pb/channel"
"github.com/Mrs4s/MiraiGo/client/pb/msg"
"github.com/Mrs4s/MiraiGo/client/pb/oidb"
"github.com/Mrs4s/MiraiGo/internal/packets"
"github.com/Mrs4s/MiraiGo/utils"
@ -337,9 +336,48 @@ func decodeGuildMessagePushPacket(c *QQClient, _ *incomingPacketInfo, payload []
}
for _, m := range push.Msgs {
if m.Head.ContentHead.GetType() == 3841 {
if m.Head.ContentHead.GetSubType() != 2 {
// todo: 回头 event flow 的处理移出去重构下逻辑, 先暂时这样方便改
var common *msg.CommonElem
if m.Body != nil {
for _, e := range m.Body.RichText.Elems {
if e.CommonElem != nil {
common = e.CommonElem
break
}
}
}
if m.Head.ContentHead.GetSubType() == 2 { // todo: tips?
continue
}
if common == nil || common.GetServiceType() != 500 {
continue
}
eventBody := new(channel.EventBody)
if err := proto.Unmarshal(common.PbElem, eventBody); err != nil {
c.Error("failed to unmarshal guild channel event body: %v", err)
continue
}
if eventBody.UpdateMsg != nil {
if eventBody.UpdateMsg.GetEventType() == 1 || eventBody.UpdateMsg.GetEventType() == 2 { // todo: 撤回消息
continue
}
if eventBody.UpdateMsg.GetEventType() == 4 { // 消息贴表情更新 (包含添加或删除)
t, err := c.GuildService.pullRoamMsgByEventFlow(m.Head.RoutingHead.GetGuildId(), m.Head.RoutingHead.GetChannelId(), eventBody.UpdateMsg.GetMsgSeq(), eventBody.UpdateMsg.GetMsgSeq(), eventBody.UpdateMsg.GetEventVersion()-1)
if err != nil || len(t) == 0 {
c.Error("process guild event flow error: pull eventMsg message error: %v", err)
continue
}
// 自己的消息被贴表情会单独推送一个tips, 这里不需要解析
if t[0].Head.RoutingHead.GetFromTinyid() == c.GuildService.TinyId {
continue
}
// todo: 如果是别人消息被贴表情, 会在在后续继续推送一个 empty tips, 可以从那个消息获取到 OperatorId
c.dispatchGuildMessageReactionsUpdatedEvent(&GuildMessageReactionsUpdatedEvent{
MessageId: t[0].Head.ContentHead.GetSeq(),
CurrentReactions: decodeGuildMessageEmojiReactions(t[0]),
})
}
}
continue
}
if cm := c.parseGuildChannelMessage(m); cm != nil {
@ -386,23 +424,3 @@ func decodeGuildPushFirstView(c *QQClient, _ *incomingPacketInfo, payload []byte
}
return nil, nil
}
func (c *QQClient) parseGuildChannelMessage(msg *channel.ChannelMsgContent) *message.GuildChannelMessage {
guild := c.GuildService.FindGuild(msg.Head.RoutingHead.GetGuildId())
if guild == nil {
return nil // todo: sync guild info
}
// mem := guild.FindMember(msg.Head.RoutingHead.GetFromTinyid())
return &message.GuildChannelMessage{
Id: msg.Head.ContentHead.GetSeq(),
InternalId: msg.Body.RichText.Attr.GetRandom(),
GuildId: msg.Head.RoutingHead.GetGuildId(),
ChannelId: msg.Head.RoutingHead.GetChannelId(),
Time: int64(msg.Head.ContentHead.GetTime()),
Sender: &message.GuildSender{
TinyId: msg.Head.RoutingHead.GetFromTinyid(),
Nickname: string(msg.ExtInfo.GetFromNick()),
},
Elements: message.ParseMessageElems(msg.Body.RichText.Elems),
}
}

33
client/guild_eventflow.go Normal file
View File

@ -0,0 +1,33 @@
package client
import (
"github.com/Mrs4s/MiraiGo/client/pb/channel"
"github.com/Mrs4s/MiraiGo/internal/packets"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
)
func (s *GuildService) pullRoamMsgByEventFlow(guildId, channelId, beginSeq, endSeq, eventVersion uint64) ([]*channel.ChannelMsgContent, error) {
payload, _ := proto.Marshal(&channel.ChannelMsgReq{
ChannelParam: &channel.ChannelParam{
GuildId: &guildId,
ChannelId: &channelId,
BeginSeq: &beginSeq,
EndSeq: &endSeq,
Version: []uint64{eventVersion},
},
WithVersionFlag: proto.Uint32(2),
DirectMessageFlag: proto.Uint32(0),
})
seq := s.c.nextSeq()
packet := packets.BuildUniPacket(s.c.Uin, seq, "trpc.group_pro.synclogic.SyncLogic.GetChannelMsg", 1, s.c.OutGoingPacketSessionId, []byte{}, s.c.sigInfo.d2Key, payload)
rsp, err := s.c.sendAndWaitDynamic(seq, packet)
if err != nil {
return nil, errors.Wrap(err, "send packet error")
}
msgRsp := new(channel.ChannelMsgRsp)
if err = proto.Unmarshal(rsp, msgRsp); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
}
return msgRsp.ChannelMsg.Msgs, nil
}

65
client/guild_msg.go Normal file
View File

@ -0,0 +1,65 @@
package client
import (
"github.com/Mrs4s/MiraiGo/client/pb/channel"
"github.com/Mrs4s/MiraiGo/client/pb/msg"
"github.com/Mrs4s/MiraiGo/message"
"google.golang.org/protobuf/proto"
"strconv"
)
func (c *QQClient) parseGuildChannelMessage(msg *channel.ChannelMsgContent) *message.GuildChannelMessage {
guild := c.GuildService.FindGuild(msg.Head.RoutingHead.GetGuildId())
if guild == nil {
return nil // todo: sync guild info
}
// mem := guild.FindMember(msg.Head.RoutingHead.GetFromTinyid())
return &message.GuildChannelMessage{
Id: msg.Head.ContentHead.GetSeq(),
InternalId: msg.Body.RichText.Attr.GetRandom(),
GuildId: msg.Head.RoutingHead.GetGuildId(),
ChannelId: msg.Head.RoutingHead.GetChannelId(),
Time: int64(msg.Head.ContentHead.GetTime()),
Sender: &message.GuildSender{
TinyId: msg.Head.RoutingHead.GetFromTinyid(),
Nickname: string(msg.ExtInfo.GetFromNick()),
},
Elements: message.ParseMessageElems(msg.Body.RichText.Elems),
}
}
func decodeGuildMessageEmojiReactions(content *channel.ChannelMsgContent) (r []*message.GuildMessageEmojiReaction) {
r = []*message.GuildMessageEmojiReaction{}
var common *msg.CommonElem
for _, elem := range content.Body.RichText.Elems {
if elem.CommonElem != nil && elem.CommonElem.GetServiceType() == 38 {
common = elem.CommonElem
break
}
}
if common == nil {
return
}
serv38 := new(msg.MsgElemInfoServtype38)
_ = proto.Unmarshal(common.PbElem, serv38)
if len(serv38.ReactData) > 0 {
cnt := new(channel.MsgCnt)
_ = proto.Unmarshal(serv38.ReactData, cnt)
if len(cnt.EmojiReaction) == 0 {
return
}
for _, e := range cnt.EmojiReaction {
reaction := &message.GuildMessageEmojiReaction{
EmojiId: e.GetEmojiId(),
EmojiType: e.GetEmojiType(),
Count: int32(e.GetCnt()),
Clicked: e.GetIsClicked(),
}
if index, err := strconv.ParseInt(e.GetEmojiId(), 10, 32); err == nil {
reaction.Face = message.NewFace(int32(index))
}
r = append(r, reaction)
}
}
return
}

View File

@ -0,0 +1,821 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.14.0
// source: pb/channel/MsgResponsesSvr.proto
package channel
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type BatchGetMsgRspCountReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GuildMsgList []*GuildMsg `protobuf:"bytes,1,rep,name=guildMsgList" json:"guildMsgList,omitempty"`
}
func (x *BatchGetMsgRspCountReq) Reset() {
*x = BatchGetMsgRspCountReq{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BatchGetMsgRspCountReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BatchGetMsgRspCountReq) ProtoMessage() {}
func (x *BatchGetMsgRspCountReq) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BatchGetMsgRspCountReq.ProtoReflect.Descriptor instead.
func (*BatchGetMsgRspCountReq) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{0}
}
func (x *BatchGetMsgRspCountReq) GetGuildMsgList() []*GuildMsg {
if x != nil {
return x.GuildMsgList
}
return nil
}
type BatchGetMsgRspCountRsp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GuildMsgInfoList []*GuildMsgInfo `protobuf:"bytes,1,rep,name=guildMsgInfoList" json:"guildMsgInfoList,omitempty"`
}
func (x *BatchGetMsgRspCountRsp) Reset() {
*x = BatchGetMsgRspCountRsp{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BatchGetMsgRspCountRsp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BatchGetMsgRspCountRsp) ProtoMessage() {}
func (x *BatchGetMsgRspCountRsp) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BatchGetMsgRspCountRsp.ProtoReflect.Descriptor instead.
func (*BatchGetMsgRspCountRsp) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{1}
}
func (x *BatchGetMsgRspCountRsp) GetGuildMsgInfoList() []*GuildMsgInfo {
if x != nil {
return x.GuildMsgInfoList
}
return nil
}
type SvrChannelMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ChannelId *uint64 `protobuf:"varint,1,opt,name=channelId" json:"channelId,omitempty"`
Id []*MsgId `protobuf:"bytes,2,rep,name=id" json:"id,omitempty"`
}
func (x *SvrChannelMsg) Reset() {
*x = SvrChannelMsg{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SvrChannelMsg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SvrChannelMsg) ProtoMessage() {}
func (x *SvrChannelMsg) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SvrChannelMsg.ProtoReflect.Descriptor instead.
func (*SvrChannelMsg) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{2}
}
func (x *SvrChannelMsg) GetChannelId() uint64 {
if x != nil && x.ChannelId != nil {
return *x.ChannelId
}
return 0
}
func (x *SvrChannelMsg) GetId() []*MsgId {
if x != nil {
return x.Id
}
return nil
}
type ChannelMsgInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ChannelId *uint64 `protobuf:"varint,1,opt,name=channelId" json:"channelId,omitempty"`
RespData []*MsgRespData `protobuf:"bytes,2,rep,name=respData" json:"respData,omitempty"`
}
func (x *ChannelMsgInfo) Reset() {
*x = ChannelMsgInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChannelMsgInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChannelMsgInfo) ProtoMessage() {}
func (x *ChannelMsgInfo) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChannelMsgInfo.ProtoReflect.Descriptor instead.
func (*ChannelMsgInfo) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{3}
}
func (x *ChannelMsgInfo) GetChannelId() uint64 {
if x != nil && x.ChannelId != nil {
return *x.ChannelId
}
return 0
}
func (x *ChannelMsgInfo) GetRespData() []*MsgRespData {
if x != nil {
return x.RespData
}
return nil
}
type EmojiReaction struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
EmojiId *string `protobuf:"bytes,1,opt,name=emojiId" json:"emojiId,omitempty"`
EmojiType *uint64 `protobuf:"varint,2,opt,name=emojiType" json:"emojiType,omitempty"`
Cnt *uint64 `protobuf:"varint,3,opt,name=cnt" json:"cnt,omitempty"`
IsClicked *bool `protobuf:"varint,4,opt,name=isClicked" json:"isClicked,omitempty"`
}
func (x *EmojiReaction) Reset() {
*x = EmojiReaction{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EmojiReaction) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EmojiReaction) ProtoMessage() {}
func (x *EmojiReaction) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EmojiReaction.ProtoReflect.Descriptor instead.
func (*EmojiReaction) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{4}
}
func (x *EmojiReaction) GetEmojiId() string {
if x != nil && x.EmojiId != nil {
return *x.EmojiId
}
return ""
}
func (x *EmojiReaction) GetEmojiType() uint64 {
if x != nil && x.EmojiType != nil {
return *x.EmojiType
}
return 0
}
func (x *EmojiReaction) GetCnt() uint64 {
if x != nil && x.Cnt != nil {
return *x.Cnt
}
return 0
}
func (x *EmojiReaction) GetIsClicked() bool {
if x != nil && x.IsClicked != nil {
return *x.IsClicked
}
return false
}
type GuildMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GuildId *uint64 `protobuf:"varint,1,opt,name=guildId" json:"guildId,omitempty"`
ChannelMsgList []*SvrChannelMsg `protobuf:"bytes,2,rep,name=channelMsgList" json:"channelMsgList,omitempty"`
}
func (x *GuildMsg) Reset() {
*x = GuildMsg{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GuildMsg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GuildMsg) ProtoMessage() {}
func (x *GuildMsg) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GuildMsg.ProtoReflect.Descriptor instead.
func (*GuildMsg) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{5}
}
func (x *GuildMsg) GetGuildId() uint64 {
if x != nil && x.GuildId != nil {
return *x.GuildId
}
return 0
}
func (x *GuildMsg) GetChannelMsgList() []*SvrChannelMsg {
if x != nil {
return x.ChannelMsgList
}
return nil
}
type GuildMsgInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GuildId *uint64 `protobuf:"varint,1,opt,name=guildId" json:"guildId,omitempty"`
ChannelMsgInfoList []*ChannelMsgInfo `protobuf:"bytes,2,rep,name=channelMsgInfoList" json:"channelMsgInfoList,omitempty"`
}
func (x *GuildMsgInfo) Reset() {
*x = GuildMsgInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GuildMsgInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GuildMsgInfo) ProtoMessage() {}
func (x *GuildMsgInfo) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GuildMsgInfo.ProtoReflect.Descriptor instead.
func (*GuildMsgInfo) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{6}
}
func (x *GuildMsgInfo) GetGuildId() uint64 {
if x != nil && x.GuildId != nil {
return *x.GuildId
}
return 0
}
func (x *GuildMsgInfo) GetChannelMsgInfoList() []*ChannelMsgInfo {
if x != nil {
return x.ChannelMsgInfoList
}
return nil
}
type MsgCnt struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id *MsgId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
EmojiReaction []*EmojiReaction `protobuf:"bytes,2,rep,name=emojiReaction" json:"emojiReaction,omitempty"`
}
func (x *MsgCnt) Reset() {
*x = MsgCnt{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MsgCnt) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MsgCnt) ProtoMessage() {}
func (x *MsgCnt) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MsgCnt.ProtoReflect.Descriptor instead.
func (*MsgCnt) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{7}
}
func (x *MsgCnt) GetId() *MsgId {
if x != nil {
return x.Id
}
return nil
}
func (x *MsgCnt) GetEmojiReaction() []*EmojiReaction {
if x != nil {
return x.EmojiReaction
}
return nil
}
type MsgId struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version *uint64 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
Seq *uint64 `protobuf:"varint,2,opt,name=seq" json:"seq,omitempty"`
}
func (x *MsgId) Reset() {
*x = MsgId{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MsgId) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MsgId) ProtoMessage() {}
func (x *MsgId) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MsgId.ProtoReflect.Descriptor instead.
func (*MsgId) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{8}
}
func (x *MsgId) GetVersion() uint64 {
if x != nil && x.Version != nil {
return *x.Version
}
return 0
}
func (x *MsgId) GetSeq() uint64 {
if x != nil && x.Seq != nil {
return *x.Seq
}
return 0
}
type MsgRespData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id *MsgId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Cnt []byte `protobuf:"bytes,2,opt,name=cnt" json:"cnt,omitempty"`
}
func (x *MsgRespData) Reset() {
*x = MsgRespData{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MsgRespData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MsgRespData) ProtoMessage() {}
func (x *MsgRespData) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_MsgResponsesSvr_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MsgRespData.ProtoReflect.Descriptor instead.
func (*MsgRespData) Descriptor() ([]byte, []int) {
return file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP(), []int{9}
}
func (x *MsgRespData) GetId() *MsgId {
if x != nil {
return x.Id
}
return nil
}
func (x *MsgRespData) GetCnt() []byte {
if x != nil {
return x.Cnt
}
return nil
}
var File_pb_channel_MsgResponsesSvr_proto protoreflect.FileDescriptor
var file_pb_channel_MsgResponsesSvr_proto_rawDesc = []byte{
0x0a, 0x20, 0x70, 0x62, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x4d, 0x73, 0x67,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x53, 0x76, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x47, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x4d, 0x73,
0x67, 0x52, 0x73, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x2d, 0x0a, 0x0c,
0x67, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x09, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x0c, 0x67,
0x75, 0x69, 0x6c, 0x64, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x16, 0x42,
0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x4d, 0x73, 0x67, 0x52, 0x73, 0x70, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x52, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x10, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x73,
0x67, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x0d, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10,
0x67, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74,
0x22, 0x45, 0x0a, 0x0d, 0x53, 0x76, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73,
0x67, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12,
0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x73,
0x67, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x44,
0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4d, 0x73, 0x67, 0x52,
0x65, 0x73, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x44, 0x61, 0x74,
0x61, 0x22, 0x77, 0x0a, 0x0d, 0x45, 0x6d, 0x6f, 0x6a, 0x69, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52,
0x09, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x63, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09,
0x69, 0x73, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52,
0x09, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x5c, 0x0a, 0x08, 0x47, 0x75,
0x69, 0x6c, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64,
0x12, 0x36, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x4c, 0x69,
0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x53, 0x76, 0x72, 0x43, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x52, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x69, 0x0a, 0x0c, 0x47, 0x75, 0x69, 0x6c,
0x64, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x75, 0x69, 0x6c,
0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64,
0x49, 0x64, 0x12, 0x3f, 0x0a, 0x12, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67,
0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f,
0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x12, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x4c,
0x69, 0x73, 0x74, 0x22, 0x56, 0x0a, 0x06, 0x4d, 0x73, 0x67, 0x43, 0x6e, 0x74, 0x12, 0x16, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x73, 0x67, 0x49,
0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x0d, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x52, 0x65,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x45,
0x6d, 0x6f, 0x6a, 0x69, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x65, 0x6d,
0x6f, 0x6a, 0x69, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x05, 0x4d,
0x73, 0x67, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10,
0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, 0x71,
0x22, 0x37, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12,
0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x73,
0x67, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x6e, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x70, 0x62, 0x2f,
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x3b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
}
var (
file_pb_channel_MsgResponsesSvr_proto_rawDescOnce sync.Once
file_pb_channel_MsgResponsesSvr_proto_rawDescData = file_pb_channel_MsgResponsesSvr_proto_rawDesc
)
func file_pb_channel_MsgResponsesSvr_proto_rawDescGZIP() []byte {
file_pb_channel_MsgResponsesSvr_proto_rawDescOnce.Do(func() {
file_pb_channel_MsgResponsesSvr_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_channel_MsgResponsesSvr_proto_rawDescData)
})
return file_pb_channel_MsgResponsesSvr_proto_rawDescData
}
var file_pb_channel_MsgResponsesSvr_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_pb_channel_MsgResponsesSvr_proto_goTypes = []interface{}{
(*BatchGetMsgRspCountReq)(nil), // 0: BatchGetMsgRspCountReq
(*BatchGetMsgRspCountRsp)(nil), // 1: BatchGetMsgRspCountRsp
(*SvrChannelMsg)(nil), // 2: SvrChannelMsg
(*ChannelMsgInfo)(nil), // 3: ChannelMsgInfo
(*EmojiReaction)(nil), // 4: EmojiReaction
(*GuildMsg)(nil), // 5: GuildMsg
(*GuildMsgInfo)(nil), // 6: GuildMsgInfo
(*MsgCnt)(nil), // 7: MsgCnt
(*MsgId)(nil), // 8: MsgId
(*MsgRespData)(nil), // 9: MsgRespData
}
var file_pb_channel_MsgResponsesSvr_proto_depIdxs = []int32{
5, // 0: BatchGetMsgRspCountReq.guildMsgList:type_name -> GuildMsg
6, // 1: BatchGetMsgRspCountRsp.guildMsgInfoList:type_name -> GuildMsgInfo
8, // 2: SvrChannelMsg.id:type_name -> MsgId
9, // 3: ChannelMsgInfo.respData:type_name -> MsgRespData
2, // 4: GuildMsg.channelMsgList:type_name -> SvrChannelMsg
3, // 5: GuildMsgInfo.channelMsgInfoList:type_name -> ChannelMsgInfo
8, // 6: MsgCnt.id:type_name -> MsgId
4, // 7: MsgCnt.emojiReaction:type_name -> EmojiReaction
8, // 8: MsgRespData.id:type_name -> MsgId
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
}
func init() { file_pb_channel_MsgResponsesSvr_proto_init() }
func file_pb_channel_MsgResponsesSvr_proto_init() {
if File_pb_channel_MsgResponsesSvr_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_pb_channel_MsgResponsesSvr_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BatchGetMsgRspCountReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BatchGetMsgRspCountRsp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SvrChannelMsg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChannelMsgInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EmojiReaction); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GuildMsg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GuildMsgInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MsgCnt); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MsgId); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_MsgResponsesSvr_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MsgRespData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pb_channel_MsgResponsesSvr_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_pb_channel_MsgResponsesSvr_proto_goTypes,
DependencyIndexes: file_pb_channel_MsgResponsesSvr_proto_depIdxs,
MessageInfos: file_pb_channel_MsgResponsesSvr_proto_msgTypes,
}.Build()
File_pb_channel_MsgResponsesSvr_proto = out.File
file_pb_channel_MsgResponsesSvr_proto_rawDesc = nil
file_pb_channel_MsgResponsesSvr_proto_goTypes = nil
file_pb_channel_MsgResponsesSvr_proto_depIdxs = nil
}

View File

@ -0,0 +1,56 @@
syntax = "proto2";
option go_package = "pb/channel;channel";
message BatchGetMsgRspCountReq {
repeated GuildMsg guildMsgList = 1;
}
message BatchGetMsgRspCountRsp {
repeated GuildMsgInfo guildMsgInfoList = 1;
}
message SvrChannelMsg {
optional uint64 channelId = 1;
repeated MsgId id = 2;
}
message ChannelMsgInfo {
optional uint64 channelId = 1;
repeated MsgRespData respData = 2;
}
message EmojiReaction {
optional string emojiId = 1;
optional uint64 emojiType = 2;
optional uint64 cnt = 3;
optional bool isClicked = 4;
}
message GuildMsg {
optional uint64 guildId = 1;
repeated SvrChannelMsg channelMsgList = 2;
}
message GuildMsgInfo {
optional uint64 guildId = 1;
repeated ChannelMsgInfo channelMsgInfoList = 2;
}
message MsgCnt {
optional MsgId id = 1;
repeated EmojiReaction emojiReaction = 2;
}
message MsgId {
optional uint64 version = 1;
optional uint64 seq = 2;
}
message MsgRespData {
optional MsgId id = 1;
optional bytes cnt = 2;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,327 @@
syntax = "proto2";
package channel;
option go_package = "pb/channel;channel";
message AppChannelMsg {
optional string summary = 1;
optional string msg = 2;
optional uint64 expireTimeMs = 3;
optional uint32 schemaType = 4;
optional string schema = 5;
}
message CategoryChannelInfo {
optional uint32 channelIndex = 1;
optional uint64 channelId = 2;
}
message CategoryInfo {
optional uint32 categoryIndex = 1;
repeated CategoryChannelInfo channelInfo = 2;
optional bytes categoryName = 3;
optional uint64 categoryId = 4;
}
message ChanInfoFilter {
optional uint32 channelName = 2;
optional uint32 creatorId = 3;
optional uint32 createTime = 4;
optional uint32 guildId = 5;
optional uint32 msgNotifyType = 6;
optional uint32 channelType = 7;
optional uint32 speakPermission = 8;
optional uint32 lastMsgSeq = 11;
optional uint32 lastCntMsgSeq = 12;
optional VoiceChannelInfoFilter voiceChannelInfoFilter = 14;
optional LiveChannelInfoFilter liveChannelInfoFilter = 15;
optional uint32 bannedSpeak = 16;
}
message ChangeChanInfo {
optional uint64 guildId = 1;
optional uint64 chanId = 2;
optional uint64 operatorId = 3;
optional MsgSeq infoSeq = 4;
optional uint32 updateType = 5;
optional ChanInfoFilter chanInfoFilter = 6;
optional ServChannelInfo chanInfo = 7;
}
message ChangeGuildInfo {
optional uint64 guildId = 1;
optional uint64 operatorId = 2;
optional MsgSeq infoSeq = 3;
optional MsgSeq faceSeq = 4;
optional uint32 updateType = 5;
optional GuildInfoFilter guildInfoFilter = 6;
optional GuildInfo guildInfo = 7;
}
message ChannelID {
optional uint64 chanId = 1;
}
message ServChannelInfo {
optional uint64 channelId = 1;
optional bytes channelName = 2;
optional uint64 creatorId = 3;
optional uint64 createTime = 4;
optional uint64 guildId = 5;
optional uint32 msgNotifyType = 6;
optional uint32 channelType = 7;
optional uint32 speakPermission = 8;
optional MsgSeq lastMsgSeq = 11;
optional MsgSeq lastCntMsgSeq = 12;
optional VoiceChannelInfo voiceChannelInfo = 14;
optional LiveChannelInfo liveChannelInfo = 15;
optional uint32 bannedSpeak = 16;
}
message CommGrayTips {
optional uint64 busiType = 1;
optional uint64 busiId = 2;
optional uint32 ctrlFlag = 3;
optional uint64 templId = 4;
repeated TemplParam templParam = 5;
optional bytes content = 6;
optional uint64 tipsSeqId = 10;
optional bytes pbReserv = 100;
message TemplParam {
optional bytes name = 1;
optional bytes value = 2;
}
}
message CreateChan {
optional uint64 guildId = 1;
optional uint64 operatorId = 3;
repeated ChannelID createId = 4;
}
message CreateGuild {
optional uint64 operatorId = 1;
optional uint64 guildId = 2;
}
message DestroyChan {
optional uint64 guildId = 1;
optional uint64 operatorId = 3;
repeated ChannelID deleteId = 4;
}
message DestroyGuild {
optional uint64 operatorId = 1;
optional uint64 guildId = 2;
}
message EventBody {
optional ReadNotify readNotify = 1;
optional CommGrayTips commGrayTips = 2;
optional CreateGuild createGuild = 3;
optional DestroyGuild destroyGuild = 4;
optional JoinGuild joinGuild = 5;
optional KickOffGuild kickOffGuild = 6;
optional QuitGuild quitGuild = 7;
optional ChangeGuildInfo changeGuildInfo = 8;
optional CreateChan createChan = 9;
optional DestroyChan destroyChan = 10;
optional ChangeChanInfo changeChanInfo = 11;
optional SetAdmin setAdmin = 12;
optional SetMsgRecvType setMsgRecvType = 13;
optional UpdateMsg updateMsg = 14;
optional SetTop setTop = 17;
optional SwitchVoiceChannel switchChannel = 18;
optional UpdateCategory updateCategory = 21;
optional UpdateVoiceBlockList updateVoiceBlockList = 22;
optional SetMute setMute = 23;
optional LiveRoomStatusChangeMsg liveStatusChangeRoom = 24;
optional SwitchLiveRoom switchLiveRoom = 25;
repeated MsgEvent events = 39;
optional SchedulerMsg scheduler = 40;
optional AppChannelMsg appChannel = 41;
optional AppChannelMsg weakMsgAppChannel = 46;
}
message GroupProStatus {
optional uint32 isEnable = 1;
optional uint32 isBanned = 2;
optional uint32 isFrozen = 3;
}
message GuildInfo {
optional uint64 guildCode = 2;
optional uint64 ownerId = 3;
optional uint64 createTime = 4;
optional uint32 memberMaxNum = 5;
optional uint32 memberNum = 6;
optional uint32 guildType = 7;
optional bytes guildName = 8;
repeated uint64 robotList = 9;
repeated uint64 adminList = 10;
optional uint32 robotMaxNum = 11;
optional uint32 adminMaxNum = 12;
optional bytes profile = 13;
optional uint64 faceSeq = 14;
optional GroupProStatus guildStatus = 15;
optional uint32 channelNum = 16;
optional MsgSeq memberChangeSeq = 5002;
optional MsgSeq guildInfoChangeSeq = 5003;
optional MsgSeq channelChangeSeq = 5004;
}
message GuildInfoFilter {
optional uint32 guildCode = 2;
optional uint32 ownerId = 3;
optional uint32 createTime = 4;
optional uint32 memberMaxNum = 5;
optional uint32 memberNum = 6;
optional uint32 guildType = 7;
optional uint32 guildName = 8;
optional uint32 robotList = 9;
optional uint32 adminList = 10;
optional uint32 robotMaxNum = 11;
optional uint32 adminMaxNum = 12;
optional uint32 profile = 13;
optional uint32 faceSeq = 14;
optional uint32 guildStatus = 15;
optional uint32 channelNum = 16;
optional uint32 memberChangeSeq = 5002;
optional uint32 guildInfoChangeSeq = 5003;
optional uint32 channelChangeSeq = 5004;
}
message JoinGuild {
optional uint64 memberId = 3;
optional uint32 memberType = 4;
optional uint64 memberTinyid = 5;
}
message KickOffGuild {
optional uint64 memberId = 3;
optional uint32 setBlack = 4;
optional uint64 memberTinyid = 5;
}
message LiveChannelInfo {
optional uint64 roomId = 1;
optional uint64 anchorUin = 2;
optional bytes name = 3;
}
message LiveChannelInfoFilter {
optional uint32 isNeedRoomId = 1;
optional uint32 isNeedAnchorUin = 2;
optional uint32 isNeedName = 3;
}
message LiveRoomStatusChangeMsg {
optional uint64 guildId = 1;
optional uint64 channelId = 2;
optional uint64 roomId = 3;
optional uint64 anchorTinyid = 4;
optional uint32 action = 5;
}
message MsgEvent {
optional uint64 seq = 1;
optional uint64 eventType = 2;
optional uint64 eventVersion = 3;
}
message MsgSeq {
optional uint64 seq = 1;
optional uint64 time = 2;
}
message QuitGuild {}
message ReadNotify {
optional uint64 channelId = 1;
optional uint64 guildId = 2;
optional MsgSeq readMsgSeq = 3;
optional MsgSeq readCntMsgSeq = 4;
optional bytes readMsgMeta = 5;
}
message SchedulerMsg {
optional bytes creatorHeadUrl = 1;
optional string wording = 2;
optional uint64 expireTimeMs = 3;
}
message SetAdmin {
optional uint64 guildId = 1;
optional uint64 chanId = 2;
optional uint64 operatorId = 3;
optional uint64 adminId = 4;
optional uint64 adminTinyid = 5;
optional uint32 operateType = 6;
}
message SetMsgRecvType {
optional uint64 guildId = 1;
optional uint64 chanId = 2;
optional uint64 operatorId = 3;
optional uint32 msgNotifyType = 4;
}
message SetMute {
optional uint32 action = 1;
optional uint64 tinyID = 2;
}
message SetTop {
optional uint32 action = 1;
}
message SwitchDetail {
optional uint64 guildId = 1;
optional uint64 channelId = 2;
optional uint32 platform = 3;
}
message SwitchLiveRoom {
optional uint64 guildId = 1;
optional uint64 channelId = 2;
optional uint64 roomId = 3;
optional uint64 tinyid = 4;
optional uint32 action = 5;
}
message SwitchVoiceChannel {
optional uint64 memberId = 1;
optional SwitchDetail enterDetail = 2;
optional SwitchDetail leaveDetail = 3;
}
message UpdateCategory {
repeated CategoryInfo categoryInfo = 1;
optional CategoryInfo noClassifyCategoryInfo = 2;
}
message UpdateMsg {
optional uint64 msgSeq = 1;
optional bool origMsgUncountable = 2;
optional uint64 eventType = 3;
optional uint64 eventVersion = 4;
optional uint64 operatorTinyid = 5;
optional uint64 operatorRole = 6;
optional uint64 reason = 7;
optional uint64 timestamp = 8;
}
message UpdateVoiceBlockList {
optional uint32 action = 1;
optional uint64 objectTinyid = 2;
}
message VoiceChannelInfo {
optional uint32 memberMaxNum = 1;
}
message VoiceChannelInfoFilter {
optional uint32 memberMaxNum = 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ syntax = "proto2";
package msg;
option go_package = "github.com/Mrs4s/MiraiGo/client/pb/msg;msg";
option go_package = "pb/msg;msg";
message GetMessageRequest {
optional SyncFlag syncFlag = 1;
@ -776,6 +776,11 @@ message MsgElemInfo_servtype33 {
optional bytes buf = 4;
}
message MsgElemInfo_servtype38 {
optional bytes reactData = 1;
optional bytes replyData = 2;
}
message SubMsgType0x4Body {
optional NotOnlineFile notOnlineFile = 1;
optional uint32 msgTime = 2;

View File

@ -46,16 +46,6 @@ type (
// OriginalElements []*msg.Elem
}
GuildChannelMessage struct {
Id uint64
InternalId int32
GuildId uint64
ChannelId uint64
Time int64
Sender *GuildSender
Elements []IMessageElement
}
SendingMessage struct {
Elements []IMessageElement
}
@ -68,11 +58,6 @@ type (
IsFriend bool
}
GuildSender struct {
TinyId uint64
Nickname string
}
AnonymousInfo struct {
AnonymousId string
AnonymousNick string

26
message/message_guild.go Normal file
View File

@ -0,0 +1,26 @@
package message
type (
GuildChannelMessage struct {
Id uint64
InternalId int32
GuildId uint64
ChannelId uint64
Time int64
Sender *GuildSender
Elements []IMessageElement
}
GuildMessageEmojiReaction struct {
EmojiId string
EmojiType uint64
Face *FaceElement
Count int32
Clicked bool
}
GuildSender struct {
TinyId uint64
Nickname string
}
)