You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Goff/djpianalto.com/goff/exts/init.go

18 lines
797 B

package exts
import "github.com/MikeModder/anpan"
func AddCommandHandlers(h *anpan.CommandHandler) {
// Arguments:
// name - command name - string
// desc - command description - string
// owneronly - only allow owners to run - bool
// hidden - hide command from non-owners - bool
// perms - permissisions required - anpan.Permission (int)
// type - command type, sets where the command is available
// run - function to run - func(anpan.Context, []string) / CommandRunFunc
h.AddCommand("ping", "Check the bot's ping", false, false, 0, anpan.CommandTypeEverywhere, pingCommand)
h.AddCommand("say", "Repeat a message", false, false, 0, anpan.CommandTypeEverywhere, sayCommand)
h.AddCommand("user", "Show info about a user", false, false, 0, anpan.CommandTypeEverywhere, userCommand)
}