1
0

commented code

This commit is contained in:
2022-05-07 11:03:14 +02:00
parent 6bbae4da79
commit e8d5293911
5 changed files with 24 additions and 5 deletions

View File

@ -5,19 +5,22 @@ import (
"log"
)
// represent a command to input to the bot through a Discord message
type Command struct {
name string
desc string
example string
name string // name identifier
desc string // description
example string // usage example
command func(
s *discordgo.Session,
m *discordgo.MessageCreate,
message string)
message string) // command (a callback)
}
// register containing commands associated with their aliases
var CommandRegister = make(
map[string]Command)
// associate a Command with an alias within the command register
func SetCommand(
aliases []string,
desc string,
@ -34,6 +37,7 @@ func SetCommand(
}
}
// add commands to the register
func CommandInit() {
SetCommand(
[]string{"/ggd audio", "/ggd tts"},