diff --git a/auth.go b/auth.go index eabcf2f..a05a4f7 100644 --- a/auth.go +++ b/auth.go @@ -16,6 +16,9 @@ func reqPass(w http.ResponseWriter, r *http.Request) { username := r.URL.Query()["UserName"][0] log.LogInfo("reqPass username is %+v.", username) var userID string + if &dg == nil { + log.LogError("Discord session was nill.") + } g, err := dg.Guild(config.GuildID) log.LogInfo("reqPass guild is %+v.", config.GuildID) if err == nil { diff --git a/main.go b/main.go index 4b79f40..93cefb5 100644 --- a/main.go +++ b/main.go @@ -57,7 +57,8 @@ func main() { } log.LogCritical("SetupToken: %+v\nRebootToken: %+v", setupToken, rebootToken) - dg, err := discordgo.New("Bot " + token) + var err error + dg, err = discordgo.New("Bot " + token) if err != nil { log.LogErrorType(err) log.LogPanic("Unable to create bot using token.")