From ebd920e1361e428ed842b135c24db64e2af7462f Mon Sep 17 00:00:00 2001 From: Asuza Date: Sun, 6 Oct 2024 08:05:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E9=87=8D=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/gocq/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gocq/main.go b/cmd/gocq/main.go index 33d607cd0..16c40be82 100644 --- a/cmd/gocq/main.go +++ b/cmd/gocq/main.go @@ -138,7 +138,7 @@ func LoginInteract() { } else { log.Info("将使用 device.json 内的设备信息运行Bot.") var err error - if device, err = auth.LoadOrSaveDevice("device"); err != nil { + if device, err = auth.LoadOrSaveDevice("device.json"); err != nil { log.Fatalf("加载设备信息失败: %v", err) } } From 0699f24708a699d0c2248739e85c0322a8c1e944 Mon Sep 17 00:00:00 2001 From: Asuza Date: Sun, 6 Oct 2024 14:29:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:at=E5=A4=84=E7=90=86=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coolq/bot.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/coolq/bot.go b/coolq/bot.go index c6cac2684..2300cce5c 100644 --- a/coolq/bot.go +++ b/coolq/bot.go @@ -283,9 +283,23 @@ func (bot *CQBot) SendGroupMessage(groupID int64, m *message.SendingMessage) (in // } // return bot.InsertGroupMessage(ret, source), nil case *message.AtElement: - self := bot.Client.GetCachedMemberInfo(bot.Client.Uin, uint32(groupID)) - if i.TargetUin == 0 && self.Permission == entity.Member { - e = message.NewText("@全体成员") + if i.TargetUin == 0 { + self := bot.Client.GetCachedMemberInfo(bot.Client.Uin, uint32(groupID)) + if self.Permission != entity.Member { + e = message.NewText("@全体成员") + } else { + continue + } + } else { + member := bot.Client.GetCachedMemberInfo(i.TargetUin, uint32(groupID)) + if member != nil { + i.TargetUid = member.Uid + if member.MemberCard != "" { + i.Display = "@" + member.MemberCard + } else { + i.Display = "@" + member.MemberName + } + } } } newElem = append(newElem, e)