chore: remove dead code

This commit is contained in:
RockYang
2023-12-29 09:02:55 +08:00
parent e9467341fa
commit 3f74b94784
10 changed files with 5 additions and 390 deletions

View File

@@ -104,7 +104,7 @@ func (b *Bot) messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
return
}
// ignore messages for self
if m.Author.ID == s.State.User.ID {
if m.Author == nil || m.Author.ID == s.State.User.ID {
return
}
@@ -136,7 +136,7 @@ func (b *Bot) messageUpdate(s *discordgo.Session, m *discordgo.MessageUpdate) {
return
}
// ignore messages for self
if m.Author.ID == s.State.User.ID {
if m.Author == nil || m.Author.ID == s.State.User.ID {
return
}