diff options
| author | Mel <einebeere@gmail.com> | 2022-04-04 00:18:04 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-04-04 00:18:04 +0200 |
| commit | b80bda2da026086523f1de8f460637a376c53bf2 (patch) | |
| tree | f9b31f2e42582e72b4a0859eb0abc7aad1a02c50 /cmd | |
| parent | 4cbe353d824d5064ee6f72f4693ee3c759b50e0a (diff) | |
| download | jinx-b80bda2da026086523f1de8f460637a376c53bf2.tar.zst jinx-b80bda2da026086523f1de8f460637a376c53bf2.zip | |
Grab bot token from enviroment variables
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/bot/main.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cmd/bot/main.go b/cmd/bot/main.go index b709ffc..51661e8 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -1,11 +1,18 @@ package main -import "jinx/pkg/bot" +import ( + "jinx/pkg/bot" + "log" + "os" +) func main() { - err := bot.Start() + token := os.Getenv("BOT_TOKEN") + if token == "" { + log.Fatal("`BOT_TOKEN` is not set.") + } - if err != nil { + if err := bot.Start(token); err != nil { panic(err) } } |
