1
0

dynamically generated help message

This commit is contained in:
2020-12-07 19:33:33 +01:00
parent 95c0d12fa3
commit 2c767fa8ff
4 changed files with 63 additions and 23 deletions

22
main.go
View File

@ -12,16 +12,28 @@ import (
)
func main() {
core.Config.LoadConf()
discord, err := discordgo.New("Bot " + core.Config.Token)
core.ConfigRegister.LoadConf()
discord, err := discordgo.New("Bot " + core.ConfigRegister.Token)
if err != nil {
fmt.Println("error creating Discord session, ", err)
return
}
core.SetCommand([]string{"/ggd audio", "/gogodisco audio"}, core.MessageAudio)
core.SetCommand([]string{"ping", "pong"}, core.MessagePing)
core.SetCommand([]string{"/ggd help", "/gogodisco help"}, core.MessageHelp)
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)
discord.AddHandler(core.MessageHandler)