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 IsToMe #17

Merged
merged 2 commits into from Apr 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 12 additions & 5 deletions bot.go
Expand Up @@ -166,15 +166,22 @@ func preprocessMessageEvent(e *Event) {
// preprocessNoticeEvent 更新事件
func preprocessNoticeEvent(e *Event) {
switch e.NoticeType {
case "group_upload", "friend_add", "friend_recall":
case "group_upload", "friend_add", "friend_recall", "client_status", "offline_file":
//
case "group_admin", "group_decrease", "group_increase", "group_ban", "group_recall", "honor":
case "group_admin", "group_decrease", "group_increase", "group_ban", "group_recall", "group_card", "essence":
if e.UserID == e.SelfID {
e.IsToMe = true
}
case "poke", "lucky_king":
if e.TargetID == e.SelfID {
e.IsToMe = true
case "notify":
switch e.SubType {
case "honor":
if e.TargetID == e.SelfID {
e.IsToMe = true
}
case "poke", "lucky_king":
if e.TargetID == e.SelfID {
e.IsToMe = true
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块和上面可以简化, e.IsToMe = e.TargetID == e.SelfID

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经修改了

}
}
}
Expand Down