2020-11-06 17:45:31 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func sendNotification(text string) {
|
|
|
|
log.Println("Notification:", text)
|
|
|
|
if appConfig.Notifications.Telegram.Enabled {
|
2020-11-09 18:54:06 +00:00
|
|
|
err := sendTelegramMessage(text, appConfig.Notifications.Telegram.BotToken, appConfig.Notifications.Telegram.ChatID)
|
2020-11-06 17:45:31 +00:00
|
|
|
if err != nil {
|
2020-11-09 18:54:06 +00:00
|
|
|
log.Println("Failed to send Telegram notification:", err.Error())
|
2020-11-06 17:45:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|