From c36cd986234ba37303edb66d0a17fbfc435ea5a5 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 30 Dec 2020 11:43:21 -0500 Subject: [PATCH] Authy --- auth.go | 3 +++ main.go | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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.")