2023-07-08 20:51:26 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import "github.com/bwmarrin/discordgo"
|
|
|
|
|
|
|
|
var commandMap map[string]Command
|
|
|
|
|
|
|
|
type Command struct {
|
|
|
|
Run func(*discordgo.Session)
|
|
|
|
Description string
|
|
|
|
}
|
|
|
|
|
|
|
|
func Setup() {
|
|
|
|
commandMap = make(map[string]Command)
|
|
|
|
|
|
|
|
commandMap["q"] = Command{
|
|
|
|
Run: QuitCommand,
|
|
|
|
Description: "quit comcord",
|
|
|
|
}
|
|
|
|
|
|
|
|
commandMap["h"] = Command{
|
|
|
|
Run: HelpCommand,
|
|
|
|
Description: "command help",
|
|
|
|
}
|
2023-07-09 20:00:49 +00:00
|
|
|
|
|
|
|
commandMap["c"] = Command{
|
|
|
|
Run: ClearCommand,
|
|
|
|
Description: "clear",
|
|
|
|
}
|
2023-07-11 03:46:47 +00:00
|
|
|
|
|
|
|
commandMap["e"] = Command{
|
|
|
|
Run: EmoteCommand,
|
|
|
|
Description: "emote",
|
|
|
|
}
|
2023-07-08 20:51:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetCommand(key string) (Command, bool) {
|
|
|
|
command, has := commandMap[key]
|
|
|
|
return command, has
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetAllCommands() map[string]Command {
|
|
|
|
return commandMap
|
|
|
|
}
|