1
0

initial commit

This commit is contained in:
2020-12-05 18:10:27 +01:00
commit 366e6a1e3f
7 changed files with 103 additions and 0 deletions

38
main.go Normal file
View File

@ -0,0 +1,38 @@
package main
import (
"ariona.fr/git/gator/gogodisco/core"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/bwmarrin/discordgo"
)
func main() {
var c config.Config
c.LoadConf()
discord, err := discordgo.New("Bot " + c.Token)
if err != nil {
fmt.Println("error creating Discord session, ", err)
return
}
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()
}