mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
feat: ChannelService.GetUserProfile & pull self guild profile on login
This commit is contained in:
parent
4dfdc22a70
commit
c8b4e19b19
@ -13,8 +13,10 @@ import (
|
|||||||
type (
|
type (
|
||||||
// ChannelService 频道模块内自身的信息
|
// ChannelService 频道模块内自身的信息
|
||||||
ChannelService struct {
|
ChannelService struct {
|
||||||
TinyId uint64
|
TinyId uint64
|
||||||
ChannelCount uint32
|
Nickname string
|
||||||
|
AvatarUrl string
|
||||||
|
GuildCount uint32
|
||||||
// Guilds 由服务器推送的频道列表
|
// Guilds 由服务器推送的频道列表
|
||||||
Guilds []*GuildInfo
|
Guilds []*GuildInfo
|
||||||
|
|
||||||
@ -40,11 +42,12 @@ type (
|
|||||||
Role int32 // 0 = member 1 = admin 2 = owner ?
|
Role int32 // 0 = member 1 = admin 2 = owner ?
|
||||||
}
|
}
|
||||||
|
|
||||||
GuildMemberProfile struct {
|
// GuildUserProfile 频道系统用户资料
|
||||||
|
GuildUserProfile struct {
|
||||||
TinyId uint64
|
TinyId uint64
|
||||||
Nickname string
|
Nickname string
|
||||||
AvatarUrl string
|
AvatarUrl string
|
||||||
JoinTime int64
|
JoinTime int64 // 只有 GetGuildMemberProfileInfo 函数才会有
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChannelInfo 子频道信息
|
// ChannelInfo 子频道信息
|
||||||
@ -75,13 +78,54 @@ func (c *QQClient) syncChannelFirstView() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.ChannelService.TinyId = firstViewRsp.GetSelfTinyid()
|
c.ChannelService.TinyId = firstViewRsp.GetSelfTinyid()
|
||||||
c.ChannelService.ChannelCount = firstViewRsp.GetGuildCount()
|
c.ChannelService.GuildCount = firstViewRsp.GetGuildCount()
|
||||||
|
if self, err := c.ChannelService.GetUserProfile(c.ChannelService.TinyId); err == nil {
|
||||||
|
c.ChannelService.Nickname = self.Nickname
|
||||||
|
c.ChannelService.AvatarUrl = self.AvatarUrl
|
||||||
|
} else {
|
||||||
|
c.Error("get self guild profile error: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ChannelService) GetUserProfile(tinyId uint64) (*GuildUserProfile, error) {
|
||||||
|
seq := s.c.nextSeq()
|
||||||
|
flags := binary.DynamicProtoMessage{}
|
||||||
|
for i := 3; i <= 29; i++ {
|
||||||
|
flags[uint64(i)] = uint32(1)
|
||||||
|
}
|
||||||
|
flags[99] = uint32(1)
|
||||||
|
flags[100] = uint32(1)
|
||||||
|
payload := s.c.packOIDBPackageDynamically(3976, 1, binary.DynamicProtoMessage{
|
||||||
|
1: flags,
|
||||||
|
3: tinyId,
|
||||||
|
4: uint32(0),
|
||||||
|
})
|
||||||
|
packet := packets.BuildUniPacket(s.c.Uin, seq, "OidbSvcTrpcTcp.0xfc9_1", 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")
|
||||||
|
}
|
||||||
|
pkg := new(oidb.OIDBSSOPkg)
|
||||||
|
oidbRsp := new(channel.ChannelOidb0Xfc9Rsp)
|
||||||
|
if err = proto.Unmarshal(rsp, pkg); err != nil {
|
||||||
|
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||||
|
}
|
||||||
|
if err = proto.Unmarshal(pkg.Bodybuffer, oidbRsp); err != nil {
|
||||||
|
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||||
|
}
|
||||||
|
// todo: 解析个性档案
|
||||||
|
return &GuildUserProfile{
|
||||||
|
TinyId: tinyId,
|
||||||
|
Nickname: oidbRsp.Profile.GetNickname(),
|
||||||
|
AvatarUrl: oidbRsp.Profile.GetAvatarUrl(),
|
||||||
|
JoinTime: oidbRsp.Profile.GetJoinTime(),
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ChannelService) GetGuildMembers(guildId uint64) (bots []*GuildMemberInfo, members []*GuildMemberInfo, admins []*GuildMemberInfo, err error) {
|
func (s *ChannelService) GetGuildMembers(guildId uint64) (bots []*GuildMemberInfo, members []*GuildMemberInfo, admins []*GuildMemberInfo, err error) {
|
||||||
seq := s.c.nextSeq()
|
seq := s.c.nextSeq()
|
||||||
u1 := uint32(1)
|
u1 := uint32(1)
|
||||||
payload := s.c.packOIDBPackage(3931, 1, binary.DynamicProtoMessage{ // todo: 可能还需要处理翻页的情况?
|
payload := s.c.packOIDBPackageDynamically(3931, 1, binary.DynamicProtoMessage{ // todo: 可能还需要处理翻页的情况?
|
||||||
1: guildId, // guild id
|
1: guildId, // guild id
|
||||||
2: uint32(3),
|
2: uint32(3),
|
||||||
3: uint32(0),
|
3: uint32(0),
|
||||||
@ -91,7 +135,7 @@ func (s *ChannelService) GetGuildMembers(guildId uint64) (bots []*GuildMemberInf
|
|||||||
6: uint32(0),
|
6: uint32(0),
|
||||||
8: uint32(500), // max response?
|
8: uint32(500), // max response?
|
||||||
14: uint32(2),
|
14: uint32(2),
|
||||||
}.Encode())
|
})
|
||||||
packet := packets.BuildUniPacket(s.c.Uin, seq, "OidbSvcTrpcTcp.0xf5b_1", 1, s.c.OutGoingPacketSessionId, []byte{}, s.c.sigInfo.d2Key, payload)
|
packet := packets.BuildUniPacket(s.c.Uin, seq, "OidbSvcTrpcTcp.0xf5b_1", 1, s.c.OutGoingPacketSessionId, []byte{}, s.c.sigInfo.d2Key, payload)
|
||||||
rsp, err := s.c.sendAndWaitDynamic(seq, packet)
|
rsp, err := s.c.sendAndWaitDynamic(seq, packet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -126,7 +170,7 @@ func (s *ChannelService) GetGuildMembers(guildId uint64) (bots []*GuildMemberInf
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ChannelService) GetGuildMemberProfileInfo(guildId, tinyId uint64) (*GuildMemberProfile, error) {
|
func (s *ChannelService) GetGuildMemberProfileInfo(guildId, tinyId uint64) (*GuildUserProfile, error) {
|
||||||
seq := s.c.nextSeq()
|
seq := s.c.nextSeq()
|
||||||
flags := binary.DynamicProtoMessage{}
|
flags := binary.DynamicProtoMessage{}
|
||||||
for i := 3; i <= 29; i++ {
|
for i := 3; i <= 29; i++ {
|
||||||
@ -134,11 +178,11 @@ func (s *ChannelService) GetGuildMemberProfileInfo(guildId, tinyId uint64) (*Gui
|
|||||||
}
|
}
|
||||||
flags[99] = uint32(1)
|
flags[99] = uint32(1)
|
||||||
flags[100] = uint32(1)
|
flags[100] = uint32(1)
|
||||||
payload := s.c.packOIDBPackage(3976, 1, binary.DynamicProtoMessage{
|
payload := s.c.packOIDBPackageDynamically(3976, 1, binary.DynamicProtoMessage{
|
||||||
1: flags,
|
1: flags,
|
||||||
3: tinyId,
|
3: tinyId,
|
||||||
4: guildId,
|
4: guildId,
|
||||||
}.Encode())
|
})
|
||||||
packet := packets.BuildUniPacket(s.c.Uin, seq, "OidbSvcTrpcTcp.0xf88_1", 1, s.c.OutGoingPacketSessionId, []byte{}, s.c.sigInfo.d2Key, payload)
|
packet := packets.BuildUniPacket(s.c.Uin, seq, "OidbSvcTrpcTcp.0xf88_1", 1, s.c.OutGoingPacketSessionId, []byte{}, s.c.sigInfo.d2Key, payload)
|
||||||
rsp, err := s.c.sendAndWaitDynamic(seq, packet)
|
rsp, err := s.c.sendAndWaitDynamic(seq, packet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -153,7 +197,7 @@ func (s *ChannelService) GetGuildMemberProfileInfo(guildId, tinyId uint64) (*Gui
|
|||||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||||
}
|
}
|
||||||
// todo: 解析个性档案
|
// todo: 解析个性档案
|
||||||
return &GuildMemberProfile{
|
return &GuildUserProfile{
|
||||||
TinyId: tinyId,
|
TinyId: tinyId,
|
||||||
Nickname: oidbRsp.Profile.GetNickname(),
|
Nickname: oidbRsp.Profile.GetNickname(),
|
||||||
AvatarUrl: oidbRsp.Profile.GetAvatarUrl(),
|
AvatarUrl: oidbRsp.Profile.GetAvatarUrl(),
|
||||||
|
@ -654,6 +654,10 @@ func (c *QQClient) packOIDBPackage(cmd, serviceType int32, body []byte) []byte {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *QQClient) packOIDBPackageDynamically(cmd, serviceType int32, msg binary.DynamicProtoMessage) []byte {
|
||||||
|
return c.packOIDBPackage(cmd, serviceType, msg.Encode())
|
||||||
|
}
|
||||||
|
|
||||||
func (c *QQClient) packOIDBPackageProto(cmd, serviceType int32, msg proto.Message) []byte {
|
func (c *QQClient) packOIDBPackageProto(cmd, serviceType int32, msg proto.Message) []byte {
|
||||||
b, _ := proto.Marshal(msg)
|
b, _ := proto.Marshal(msg)
|
||||||
return c.packOIDBPackage(cmd, serviceType, b)
|
return c.packOIDBPackage(cmd, serviceType, b)
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
package channel
|
package channel
|
||||||
|
|
||||||
import (
|
import (
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -99,7 +98,7 @@ type ChannelOidb0Xf88Rsp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Profile *GuildMemberProfile `protobuf:"bytes,1,opt,name=profile" json:"profile,omitempty"`
|
Profile *GuildUserProfile `protobuf:"bytes,1,opt,name=profile" json:"profile,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ChannelOidb0Xf88Rsp) Reset() {
|
func (x *ChannelOidb0Xf88Rsp) Reset() {
|
||||||
@ -134,7 +133,54 @@ func (*ChannelOidb0Xf88Rsp) Descriptor() ([]byte, []int) {
|
|||||||
return file_unknown_proto_rawDescGZIP(), []int{1}
|
return file_unknown_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ChannelOidb0Xf88Rsp) GetProfile() *GuildMemberProfile {
|
func (x *ChannelOidb0Xf88Rsp) GetProfile() *GuildUserProfile {
|
||||||
|
if x != nil {
|
||||||
|
return x.Profile
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ChannelOidb0Xfc9Rsp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Profile *GuildUserProfile `protobuf:"bytes,1,opt,name=profile" json:"profile,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ChannelOidb0Xfc9Rsp) Reset() {
|
||||||
|
*x = ChannelOidb0Xfc9Rsp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_unknown_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ChannelOidb0Xfc9Rsp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ChannelOidb0Xfc9Rsp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ChannelOidb0Xfc9Rsp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_unknown_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 ChannelOidb0Xfc9Rsp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ChannelOidb0Xfc9Rsp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_unknown_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ChannelOidb0Xfc9Rsp) GetProfile() *GuildUserProfile {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Profile
|
return x.Profile
|
||||||
}
|
}
|
||||||
@ -152,7 +198,7 @@ type GuildAdminInfo struct {
|
|||||||
func (x *GuildAdminInfo) Reset() {
|
func (x *GuildAdminInfo) Reset() {
|
||||||
*x = GuildAdminInfo{}
|
*x = GuildAdminInfo{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_unknown_proto_msgTypes[2]
|
mi := &file_unknown_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -165,7 +211,7 @@ func (x *GuildAdminInfo) String() string {
|
|||||||
func (*GuildAdminInfo) ProtoMessage() {}
|
func (*GuildAdminInfo) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GuildAdminInfo) ProtoReflect() protoreflect.Message {
|
func (x *GuildAdminInfo) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_unknown_proto_msgTypes[2]
|
mi := &file_unknown_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -178,7 +224,7 @@ func (x *GuildAdminInfo) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GuildAdminInfo.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GuildAdminInfo.ProtoReflect.Descriptor instead.
|
||||||
func (*GuildAdminInfo) Descriptor() ([]byte, []int) {
|
func (*GuildAdminInfo) Descriptor() ([]byte, []int) {
|
||||||
return file_unknown_proto_rawDescGZIP(), []int{2}
|
return file_unknown_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildAdminInfo) GetAdmins() []*GuildMemberInfo {
|
func (x *GuildAdminInfo) GetAdmins() []*GuildMemberInfo {
|
||||||
@ -203,7 +249,7 @@ type GuildMemberInfo struct {
|
|||||||
func (x *GuildMemberInfo) Reset() {
|
func (x *GuildMemberInfo) Reset() {
|
||||||
*x = GuildMemberInfo{}
|
*x = GuildMemberInfo{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_unknown_proto_msgTypes[3]
|
mi := &file_unknown_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -216,7 +262,7 @@ func (x *GuildMemberInfo) String() string {
|
|||||||
func (*GuildMemberInfo) ProtoMessage() {}
|
func (*GuildMemberInfo) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GuildMemberInfo) ProtoReflect() protoreflect.Message {
|
func (x *GuildMemberInfo) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_unknown_proto_msgTypes[3]
|
mi := &file_unknown_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -229,7 +275,7 @@ func (x *GuildMemberInfo) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GuildMemberInfo.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GuildMemberInfo.ProtoReflect.Descriptor instead.
|
||||||
func (*GuildMemberInfo) Descriptor() ([]byte, []int) {
|
func (*GuildMemberInfo) Descriptor() ([]byte, []int) {
|
||||||
return file_unknown_proto_rawDescGZIP(), []int{3}
|
return file_unknown_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberInfo) GetTitle() string {
|
func (x *GuildMemberInfo) GetTitle() string {
|
||||||
@ -267,7 +313,8 @@ func (x *GuildMemberInfo) GetTinyId() uint64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
type GuildMemberProfile struct {
|
// 频道系统用户资料
|
||||||
|
type GuildUserProfile struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
@ -279,23 +326,23 @@ type GuildMemberProfile struct {
|
|||||||
JoinTime *int64 `protobuf:"varint,16,opt,name=joinTime" json:"joinTime,omitempty"` // uncertainty
|
JoinTime *int64 `protobuf:"varint,16,opt,name=joinTime" json:"joinTime,omitempty"` // uncertainty
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) Reset() {
|
func (x *GuildUserProfile) Reset() {
|
||||||
*x = GuildMemberProfile{}
|
*x = GuildUserProfile{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_unknown_proto_msgTypes[4]
|
mi := &file_unknown_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) String() string {
|
func (x *GuildUserProfile) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*GuildMemberProfile) ProtoMessage() {}
|
func (*GuildUserProfile) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) ProtoReflect() protoreflect.Message {
|
func (x *GuildUserProfile) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_unknown_proto_msgTypes[4]
|
mi := &file_unknown_proto_msgTypes[5]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -306,33 +353,33 @@ func (x *GuildMemberProfile) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use GuildMemberProfile.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GuildUserProfile.ProtoReflect.Descriptor instead.
|
||||||
func (*GuildMemberProfile) Descriptor() ([]byte, []int) {
|
func (*GuildUserProfile) Descriptor() ([]byte, []int) {
|
||||||
return file_unknown_proto_rawDescGZIP(), []int{4}
|
return file_unknown_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) GetTinyId() uint64 {
|
func (x *GuildUserProfile) GetTinyId() uint64 {
|
||||||
if x != nil && x.TinyId != nil {
|
if x != nil && x.TinyId != nil {
|
||||||
return *x.TinyId
|
return *x.TinyId
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) GetNickname() string {
|
func (x *GuildUserProfile) GetNickname() string {
|
||||||
if x != nil && x.Nickname != nil {
|
if x != nil && x.Nickname != nil {
|
||||||
return *x.Nickname
|
return *x.Nickname
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) GetAvatarUrl() string {
|
func (x *GuildUserProfile) GetAvatarUrl() string {
|
||||||
if x != nil && x.AvatarUrl != nil {
|
if x != nil && x.AvatarUrl != nil {
|
||||||
return *x.AvatarUrl
|
return *x.AvatarUrl
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GuildMemberProfile) GetJoinTime() int64 {
|
func (x *GuildUserProfile) GetJoinTime() int64 {
|
||||||
if x != nil && x.JoinTime != nil {
|
if x != nil && x.JoinTime != nil {
|
||||||
return *x.JoinTime
|
return *x.JoinTime
|
||||||
}
|
}
|
||||||
@ -356,34 +403,39 @@ var file_unknown_proto_rawDesc = []byte{
|
|||||||
0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x17, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x41,
|
0x17, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x41,
|
||||||
0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49,
|
0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49,
|
||||||
0x6e, 0x66, 0x6f, 0x22, 0x4c, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4f, 0x69,
|
0x6e, 0x66, 0x6f, 0x22, 0x4a, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4f, 0x69,
|
||||||
0x64, 0x62, 0x30, 0x78, 0x66, 0x38, 0x38, 0x52, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x07, 0x70, 0x72,
|
0x64, 0x62, 0x30, 0x78, 0x66, 0x38, 0x38, 0x52, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x72,
|
||||||
0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x68,
|
0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x68,
|
||||||
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65,
|
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50,
|
||||||
0x72, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c,
|
0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22,
|
||||||
0x65, 0x22, 0x42, 0x0a, 0x0e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49,
|
0x4a, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4f, 0x69, 0x64, 0x62, 0x30, 0x78,
|
||||||
0x6e, 0x66, 0x6f, 0x12, 0x30, 0x0a, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20,
|
0x66, 0x63, 0x39, 0x52, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c,
|
||||||
0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x47, 0x75,
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
|
||||||
0x69, 0x6c, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x61,
|
0x6c, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, 0x69,
|
||||||
0x64, 0x6d, 0x69, 0x6e, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d,
|
0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x42, 0x0a, 0x0e, 0x47,
|
||||||
0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74,
|
0x75, 0x69, 0x6c, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, 0x0a,
|
||||||
0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12,
|
0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
|
||||||
0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x65, 0x6d,
|
||||||
0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6c,
|
0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x22,
|
||||||
0x61, 0x73, 0x74, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01,
|
0x95, 0x01, 0x0a, 0x0f, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49,
|
||||||
0x28, 0x03, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x54, 0x69, 0x6d,
|
0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63,
|
||||||
0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x18,
|
0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63,
|
||||||
0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x22, 0x82, 0x01,
|
0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x70, 0x65,
|
||||||
0x0a, 0x12, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x72, 0x6f,
|
0x61, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6c, 0x61,
|
||||||
0x66, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x02,
|
0x73, 0x74, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72,
|
||||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08,
|
0x6f, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12,
|
||||||
0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
0x16, 0x0a, 0x06, 0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||||
0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74,
|
0x06, 0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x22, 0x80, 0x01, 0x0a, 0x10, 0x47, 0x75, 0x69, 0x6c,
|
||||||
0x61, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61,
|
0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||||
0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69,
|
0x74, 0x69, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x74, 0x69,
|
||||||
0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69,
|
0x6e, 0x79, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x6d, 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x3b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
|
0x12, 0x1c, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x06, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x1a,
|
||||||
|
0x0a, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03,
|
||||||
|
0x52, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f,
|
||||||
|
0x3b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -398,25 +450,27 @@ func file_unknown_proto_rawDescGZIP() []byte {
|
|||||||
return file_unknown_proto_rawDescData
|
return file_unknown_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_unknown_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
var file_unknown_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
var file_unknown_proto_goTypes = []interface{}{
|
var file_unknown_proto_goTypes = []interface{}{
|
||||||
(*ChannelOidb0Xf5BRsp)(nil), // 0: channel.ChannelOidb0xf5bRsp
|
(*ChannelOidb0Xf5BRsp)(nil), // 0: channel.ChannelOidb0xf5bRsp
|
||||||
(*ChannelOidb0Xf88Rsp)(nil), // 1: channel.ChannelOidb0xf88Rsp
|
(*ChannelOidb0Xf88Rsp)(nil), // 1: channel.ChannelOidb0xf88Rsp
|
||||||
(*GuildAdminInfo)(nil), // 2: channel.GuildAdminInfo
|
(*ChannelOidb0Xfc9Rsp)(nil), // 2: channel.ChannelOidb0xfc9Rsp
|
||||||
(*GuildMemberInfo)(nil), // 3: channel.GuildMemberInfo
|
(*GuildAdminInfo)(nil), // 3: channel.GuildAdminInfo
|
||||||
(*GuildMemberProfile)(nil), // 4: channel.GuildMemberProfile
|
(*GuildMemberInfo)(nil), // 4: channel.GuildMemberInfo
|
||||||
|
(*GuildUserProfile)(nil), // 5: channel.GuildUserProfile
|
||||||
}
|
}
|
||||||
var file_unknown_proto_depIdxs = []int32{
|
var file_unknown_proto_depIdxs = []int32{
|
||||||
3, // 0: channel.ChannelOidb0xf5bRsp.bots:type_name -> channel.GuildMemberInfo
|
4, // 0: channel.ChannelOidb0xf5bRsp.bots:type_name -> channel.GuildMemberInfo
|
||||||
3, // 1: channel.ChannelOidb0xf5bRsp.members:type_name -> channel.GuildMemberInfo
|
4, // 1: channel.ChannelOidb0xf5bRsp.members:type_name -> channel.GuildMemberInfo
|
||||||
2, // 2: channel.ChannelOidb0xf5bRsp.adminInfo:type_name -> channel.GuildAdminInfo
|
3, // 2: channel.ChannelOidb0xf5bRsp.adminInfo:type_name -> channel.GuildAdminInfo
|
||||||
4, // 3: channel.ChannelOidb0xf88Rsp.profile:type_name -> channel.GuildMemberProfile
|
5, // 3: channel.ChannelOidb0xf88Rsp.profile:type_name -> channel.GuildUserProfile
|
||||||
3, // 4: channel.GuildAdminInfo.admins:type_name -> channel.GuildMemberInfo
|
5, // 4: channel.ChannelOidb0xfc9Rsp.profile:type_name -> channel.GuildUserProfile
|
||||||
5, // [5:5] is the sub-list for method output_type
|
4, // 5: channel.GuildAdminInfo.admins:type_name -> channel.GuildMemberInfo
|
||||||
5, // [5:5] is the sub-list for method input_type
|
6, // [6:6] is the sub-list for method output_type
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
6, // [6:6] is the sub-list for method input_type
|
||||||
5, // [5:5] is the sub-list for extension extendee
|
6, // [6:6] is the sub-list for extension type_name
|
||||||
0, // [0:5] is the sub-list for field type_name
|
6, // [6:6] is the sub-list for extension extendee
|
||||||
|
0, // [0:6] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_unknown_proto_init() }
|
func init() { file_unknown_proto_init() }
|
||||||
@ -450,7 +504,7 @@ func file_unknown_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_unknown_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_unknown_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GuildAdminInfo); i {
|
switch v := v.(*ChannelOidb0Xfc9Rsp); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -462,7 +516,7 @@ func file_unknown_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_unknown_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_unknown_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GuildMemberInfo); i {
|
switch v := v.(*GuildAdminInfo); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -474,7 +528,19 @@ func file_unknown_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_unknown_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_unknown_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GuildMemberProfile); i {
|
switch v := v.(*GuildMemberInfo); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_unknown_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*GuildUserProfile); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -492,7 +558,7 @@ func file_unknown_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_unknown_proto_rawDesc,
|
RawDescriptor: file_unknown_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 5,
|
NumMessages: 6,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@ -13,7 +13,11 @@ message ChannelOidb0xf5bRsp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ChannelOidb0xf88Rsp {
|
message ChannelOidb0xf88Rsp {
|
||||||
optional GuildMemberProfile profile = 1;
|
optional GuildUserProfile profile = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ChannelOidb0xfc9Rsp {
|
||||||
|
optional GuildUserProfile profile = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GuildAdminInfo {
|
message GuildAdminInfo {
|
||||||
@ -28,7 +32,8 @@ message GuildMemberInfo {
|
|||||||
optional uint64 tinyId = 8;
|
optional uint64 tinyId = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GuildMemberProfile {
|
// 频道系统用户资料
|
||||||
|
message GuildUserProfile {
|
||||||
optional uint64 tinyId = 2;
|
optional uint64 tinyId = 2;
|
||||||
optional string nickname = 3;
|
optional string nickname = 3;
|
||||||
optional string avatarUrl = 6;
|
optional string avatarUrl = 6;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user