Skip to content

Commit

Permalink
fixed help command alias, and added check to prevent future panics
Browse files Browse the repository at this point in the history
  • Loading branch information
caquillo07 committed Oct 9, 2020
1 parent b886870 commit 5579692
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.0
v1.3.1
2 changes: 1 addition & 1 deletion bot/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ The confidence level will display when this calculations fall under the rounding
}

// Alias for pre-established commands
b.commands["commands"] = &command{alias: "commands"}
b.commands["commands"] = &command{alias: "help"}
b.commands["pokemon"] = &command{alias: "pokedex"}
b.commands["dex"] = &command{alias: "pokedex"}
b.commands["info"] = &command{alias: "pokedex"}
Expand Down
5 changes: 4 additions & 1 deletion bot/den_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ func (b *Bot) handleMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
return
}
if botCmd.alias != "" {
botCmd = b.commands[botCmd.alias]
botCmd, ok = b.commands[botCmd.alias]
if !ok {
return
}
}

// Send this off on its own go routine to be able to handle many of them
Expand Down

0 comments on commit 5579692

Please sign in to comment.