crude implementation for a global command object/register
This commit is contained in:
11
main.go
11
main.go
@ -12,17 +12,16 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
var c core.Config
|
||||
c.LoadConf()
|
||||
|
||||
discord, err := discordgo.New("Bot " + c.Token)
|
||||
core.Config.LoadConf()
|
||||
discord, err := discordgo.New("Bot " + core.Config.Token)
|
||||
if err != nil {
|
||||
fmt.Println("error creating Discord session, ", err)
|
||||
return
|
||||
}
|
||||
|
||||
discord.AddHandler(core.MessagePing)
|
||||
discord.AddHandler(core.MessageAudio)
|
||||
core.SetCommand([]string{"/ggd audio", "/gogodisco audio"}, core.MessageAudio, discord)
|
||||
core.SetCommand([]string{"/ggd ping", "/gogodisco ping"}, core.MessagePing, discord)
|
||||
core.SetCommand([]string{"/ggd help", "/gogodisco help"}, core.MessageHelp, discord)
|
||||
|
||||
err = discord.Open()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user