Add more logs

This commit is contained in:
Matte23
2023-06-27 21:16:10 +02:00
parent 4f6af025cf
commit 21b541bdc1
6 changed files with 183 additions and 24 deletions

View File

@@ -18,7 +18,6 @@ package main
import (
"flag"
"fmt"
"os"
"os/signal"
"strings"
@@ -39,11 +38,11 @@ func init() {
}
func main() {
setupLogging()
// Create a new Discord session using the provided bot token.
dg, err := discordgo.New("Bot " + Token)
if err != nil {
fmt.Println("error creating Discord session,", err)
log.Fatal("Error creating Discord session,", err)
return
}
@@ -56,12 +55,12 @@ func main() {
// Open a websocket connection to Discord and begin listening.
err = dg.Open()
if err != nil {
fmt.Println("error opening connection,", err)
log.Fatal("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.")
log.Info("InnkeeperBot is now running. Press CTRL-C to exit.")
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
<-sc