Binding to the DEBUG environment variable is not necessary
This commit is contained in:
parent
a151b08142
commit
2ac0df3494
@ -76,7 +76,7 @@ func (b *Bot) RegisterHandlers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Run() error {
|
func Run() error {
|
||||||
setupConfig()
|
initConfig()
|
||||||
|
|
||||||
if err := lib.SeedMathRand(); err != nil {
|
if err := lib.SeedMathRand(); err != nil {
|
||||||
log.Warn(err)
|
log.Warn(err)
|
||||||
@ -115,7 +115,7 @@ func Run() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupConfig() {
|
func initConfig() {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
C = NewConfig()
|
C = NewConfig()
|
||||||
@ -127,7 +127,8 @@ func setupConfig() {
|
|||||||
viper.SetConfigType("toml")
|
viper.SetConfigType("toml")
|
||||||
viper.AddConfigPath(".")
|
viper.AddConfigPath(".")
|
||||||
|
|
||||||
viper.BindEnv("DEBUG")
|
viper.SetDefault("debug", false)
|
||||||
|
|
||||||
viper.BindEnv("DISCORD_TOKEN")
|
viper.BindEnv("DISCORD_TOKEN")
|
||||||
viper.BindEnv("OPEN_WEATHER_MAP_TOKEN")
|
viper.BindEnv("OPEN_WEATHER_MAP_TOKEN")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user