Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:at处理不完善 #6

Merged
merged 3 commits into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions coolq/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,23 @@
// }
// 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)
Expand Down Expand Up @@ -317,7 +331,7 @@
}
m.Elements = bot.uploadMedia(source, m.Elements)
for _, e := range m.Elements {
switch i := e.(type) {

Check failure on line 334 in coolq/bot.go

View workflow job for this annotation

GitHub Actions / lint

singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
case *msg.Poke:
_ = bot.Client.FriendPoke(uint32(i.Target))
return 0
Expand Down
Loading