1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 12:03:50 +08:00

Merge pull request #821 from sam01101/dev.at_name

添加CQ:at显示检查
This commit is contained in:
Mrs4s 2021-04-11 20:51:34 +08:00 committed by GitHub
commit e1f1f715e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,7 +285,7 @@ func (bot *CQBot) CQSendGroupMessage(groupID int64, i interface{}, autoEscape bo
} }
fixAt := func(elem []message.IMessageElement) { fixAt := func(elem []message.IMessageElement) {
for _, e := range elem { for _, e := range elem {
if at, ok := e.(*message.AtElement); ok && at.Target != 0 { if at, ok := e.(*message.AtElement); ok && at.Target != 0 && at.Display == "" {
at.Display = "@" + func() string { at.Display = "@" + func() string {
mem := group.FindMember(at.Target) mem := group.FindMember(at.Target)
if mem != nil { if mem != nil {