commented code
This commit is contained in:
@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user