Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fix: message template config fail (#70)
Browse files Browse the repository at this point in the history
消息模版配置失效
  • Loading branch information
indes committed Oct 11, 2020
1 parent 0ba61ba commit c1518d2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions config/autoload.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,23 @@ func init() {
viper.SetConfigFile(filepath.Join(workDir, "config.yml"))
}

fmt.Println(logo)
err := viper.ReadInConfig() // Find and read the config file
if err != nil { // Handle errors reading the config file
panic(fmt.Errorf("Fatal error config file: %s", err))
}

initTPL()
if *testTpl {
validateTPL()
os.Exit(0)
}

// 由于test mode检测机制与-testtpl冲突,所以该代码必须放到validateTPL后面
if RunMode == TestMode {
return
}

fmt.Println(logo)
err := viper.ReadInConfig() // Find and read the config file
if err != nil { // Handle errors reading the config file
panic(fmt.Errorf("Fatal error config file: %s", err))
}
BotToken = viper.GetString("bot_token")
Socks5 = viper.GetString("socks5")
UserAgent = viper.GetString("user_agent")
Expand Down

0 comments on commit c1518d2

Please sign in to comment.