diff --git a/main.go b/main.go index 51d1a90..9aa7d66 100644 --- a/main.go +++ b/main.go @@ -11,20 +11,26 @@ import ( "gopkg.in/telebot.v4" ) -type ConfigSpec struct { - Token string `yaml:"token"` +const ( + confFile string = "config.yml" + cronFile string = "cron.yml" + matchFile string = "tokens.yml" +) + +type configSpec struct { + TGToken string `yaml:"tg_bot_token"` } func main() { - var conf ConfigSpec - config.Parse("config.yml", &conf) + var conf configSpec + config.Parse(confFile, &conf) pref := telebot.Settings{ - Token: conf.Token, + Token: conf.TGToken, Poller: &telebot.LongPoller{Timeout: 10 * time.Second}, } - tokenMatcher := matcher.InitMatcher("tokens.yml") + tokenMatcher := matcher.InitMatcher(matchFile) bot, err := telebot.NewBot(pref) if err != nil {