Skip to content

Commit

Permalink
Fixed telegram connection handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-bali committed Sep 4, 2023
1 parent 723b0b8 commit 6fc088d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,10 @@ func loadConfig() {
}

func connectTelegram() {
bot, err := tgbotapi.NewBotAPI(getConfig().Alert.Telegram.Token)
var err error
tgbot, err = tgbotapi.NewBotAPI(getConfig().Alert.Telegram.Token)
if err != nil {
log("Unable to connect to Telegram: " + err.Error())
tgbot = bot
}
log("Connected to telegram bot")
}
Expand Down

0 comments on commit 6fc088d

Please sign in to comment.