From a154a63772bdef61ceb3dc72898b42c1c2033f48 Mon Sep 17 00:00:00 2001 From: Jabasukuriputo Wang Date: Sat, 25 Dec 2021 11:15:34 +0800 Subject: [PATCH] =?UTF-8?q?GuildSender=E7=9A=84nickname=E7=BB=99=E2=80=9C?= =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A2=91=E9=81=93=E6=98=B5=E7=A7=B0=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/guild_msg.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/guild_msg.go b/client/guild_msg.go index c1bb4d4a..bda38b57 100644 --- a/client/guild_msg.go +++ b/client/guild_msg.go @@ -330,6 +330,10 @@ func (s *GuildService) parseGuildChannelMessage(msg *channel.ChannelMsgContent) return nil } // mem := guild.FindMember(msg.Head.RoutingHead.GetFromTinyid()) + memberName := msg.ExtInfo.GetMemberName() + if memberName == nil { + memberName = msg.ExtInfo.GetFromNick() + } return &message.GuildChannelMessage{ Id: msg.Head.ContentHead.GetSeq(), InternalId: msg.Head.ContentHead.GetRandom(), @@ -338,7 +342,7 @@ func (s *GuildService) parseGuildChannelMessage(msg *channel.ChannelMsgContent) Time: int64(msg.Head.ContentHead.GetTime()), Sender: &message.GuildSender{ TinyId: msg.Head.RoutingHead.GetFromTinyid(), - Nickname: string(msg.ExtInfo.GetFromNick()), + Nickname: string(memberName), }, Elements: message.ParseMessageElems(msg.Body.RichText.Elems), }