Add command to list commands
This commit is contained in:
17
commands.go
17
commands.go
@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user