Add command to list commands

This commit is contained in:
2021-05-05 23:09:29 -04:00
parent 51f9f10b17
commit 06da80de97

View File

@ -61,6 +61,23 @@ func setupCommands() {
Exec: Status, Exec: Status,
} }
commands = append(commands, status) commands = append(commands, status)
listCommands := Command{
Name: "List Commands",
RequiresAdmin: false,
Keywords: []string{"help", "commands", "cmd", "cmds"},
Exec: Commands,
}
commands = append(commands, listCommands)
}
func Commands(b BotCommand) bool {
defer log.PanicSafe()
print := "Available commands:\n"
for _, cmd := range commands {
print += fmt.Sprintf("```%+v\n%+v\n%+v```\n", cmd.Name, cmd.Keywords, cmd.Help)
}
return true
} }
func Reboot(b BotCommand) bool { func Reboot(b BotCommand) bool {