From 2ac0df34946c64d7c0d18059df908632894270d0 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Thu, 8 Sep 2022 02:23:38 -0500 Subject: [PATCH] Binding to the DEBUG environment variable is not necessary --- bot/bot.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/bot.go b/bot/bot.go index 96b3c2e..3416b41 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -76,7 +76,7 @@ func (b *Bot) RegisterHandlers() { } func Run() error { - setupConfig() + initConfig() if err := lib.SeedMathRand(); err != nil { log.Warn(err) @@ -115,7 +115,7 @@ func Run() error { return nil } -func setupConfig() { +func initConfig() { var err error C = NewConfig() @@ -127,7 +127,8 @@ func setupConfig() { viper.SetConfigType("toml") viper.AddConfigPath(".") - viper.BindEnv("DEBUG") + viper.SetDefault("debug", false) + viper.BindEnv("DISCORD_TOKEN") viper.BindEnv("OPEN_WEATHER_MAP_TOKEN")