Skip to content

Commit

Permalink
Add extra logging to check guild counts
Browse files Browse the repository at this point in the history
  • Loading branch information
HotaruBlaze committed Feb 28, 2024
1 parent 44ecae2 commit 757642f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"math/big"
"os"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -52,6 +53,15 @@ func InitDiscord() {
}

func ready(s *discordgo.Session, event *discordgo.Ready) {
// Check if bot is in any discord servers first
if len(event.Guilds) == 0 {
log.Errorln("[Discord] Bot is not in any Discord servers")
os.Exit(1)
}
if len(event.Guilds) > 1 {
log.Warnln("[Discord] Bot is in more than 1 Discord server, this can have unintended results.")
}

// Set the playing status.
err := s.UpdateGameStatus(0, "")
if err != nil {
Expand Down

0 comments on commit 757642f

Please sign in to comment.