-
Notifications
You must be signed in to change notification settings - Fork 1
Adding Commands
Yiping Su edited this page Apr 13, 2020
·
1 revision
I created Isabelle with the intention of making her into an Animal Crossing: New Horizons bot. If you want her to have extra features such as moderation or fun commands, you can add your own relatively easily.
Commands are split into two components:
- The definition file located in
cmd/
- Command loading inside
isabellebot/bot.go
Make sure to create your command definition in cmd/
and add the command to the command loader like below.
// compileCommands contains all commands the bot should add to the bot command map
func (b *Bot) compileCommands() {
b.addCommand("search", cmd.Search)
b.addCommand("help", cmd.Help)
b.addCommand("list", cmd.List)
b.addCommand("event", cmd.Event)
b.addCommand("queue", cmd.Queue)
b.addCommand("close", cmd.Close)
b.addCommand("unregister", cmd.Unregister)
b.addCommand("trade", cmd.Trade)
b.addCommand("offer", cmd.Offer)
b.addCommand("rep", cmd.Rep)
b.addCommand("accept", cmd.Accept)
b.addCommand("reject", cmd.Reject)
}