1
0

decoupled some stuffs, news related tests, new commands file

This commit is contained in:
2020-12-08 14:47:34 +01:00
parent 804ed6ee5b
commit 53d01e04fe
6 changed files with 103 additions and 68 deletions

22
main.go
View File

@ -13,33 +13,13 @@ import (
func main() {
core.ConfigRegister.LoadConf()
core.CommandInit()
discord, err := discordgo.New("Bot " + core.ConfigRegister.Token)
if err != nil {
log.Println("error creating Discord session, ", err)
return
}
core.SetCommand(
[]string{"/ggd audio", "/ggd tts"},
"*Attach a TTS version of the message on the channel*",
"`/ggd [audio|tts] hello everyone`",
core.MessageAudio)
core.SetCommand(
[]string{"ping", "pong"},
"*Check if the bot is alive*",
"`[ping|pong]`",
core.MessagePing)
core.SetCommand(
[]string{"/ggd help", "/ggd info"},
"*Display the available list of commands*",
"`/ggd [help|info]`",
core.MessageHelp)
core.SetCommand(
[]string{"/ggd hat", "/ggd chapeau", "/ggd chapo"},
"*Hand over a set of fancy hats*",
"`/ggd [hat|chapeau|chapo]`",
core.MessageHat)
discord.AddHandler(core.MessageHandler)
discord.AddHandler(core.MessageTalkback)