Skip to content

Commit

Permalink
Merge branch 'main' of github.com:csunibo/informabot
Browse files Browse the repository at this point in the history
  • Loading branch information
foxyseta committed Jul 29, 2023
2 parents 1958d1b + fb5e9c5 commit ba546c0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ import (
"github.com/csunibo/informabot/bot"
)

const tokenKey = "TOKEN"

func main() {
if len(os.Args) < 2 {
log.Fatalf("Usage: go run main.go <telegram-bot-token>")
token, found := os.LookupEnv(tokenKey)
if !found {
log.Fatal("token not found. please set the TOKEN environment variable")
}
bot.StartInformaBot(os.Args[1], false)

bot.StartInformaBot(token, false)
}

0 comments on commit ba546c0

Please sign in to comment.