package main import ( "fmt" "io/ioutil" "os" "os/signal" "strings" "syscall" "github.com/bwmarrin/discordgo" ) func main() { token, _ := ioutil.ReadFile("token.txt") dg, err := discordgo.New(strings.TrimSpace(string(token))) if err != nil { fmt.Println("Error creating Discord session:", err) return } dg.AddHandler(messageCreate) dg.AddHandler(checkPrestigeReact) err = dg.Open() if err != nil { fmt.Println("Error opening Discord session:", err) } go listenToLevelUpdate(dg) sc := make(chan os.Signal, 1) signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) <-sc dg.Close() db.Close() }