package main import ( "ariona.fr/git/gator/gogodisco/core" "fmt" "os" "os/signal" "syscall" "github.com/bwmarrin/discordgo" ) func main() { var c core.Config c.LoadConf() discord, err := discordgo.New("Bot " + c.Token) if err != nil { fmt.Println("error creating Discord session, ", err) return } discord.AddHandler(core.MessagePing) discord.AddHandler(core.MessageAudio) err = discord.Open() if err != nil { fmt.Println("error opening connection, ", err) return } // Wait here until CTRL-C or other term signal is received. fmt.Println("Bot is now running. Press CTRL-C to exit.") sc := make(chan os.Signal, 1) signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) <-sc // Cleanly close down the Discord session. discord.Close() }