Debug: Add logs to trace Telegram initialization

This commit is contained in:
shanshanzhong 2026-01-13 07:00:11 -08:00
parent 14489b6afd
commit e5e60f73c2

View File

@ -16,6 +16,7 @@ import (
func Telegram(svc *svc.ServiceContext) { func Telegram(svc *svc.ServiceContext) {
logger.Infof("Telegram Config Enable: %v", svc.Config.Telegram.Enable) logger.Infof("Telegram Config Enable: %v", svc.Config.Telegram.Enable)
if !svc.Config.Telegram.Enable { if !svc.Config.Telegram.Enable {
logger.Info("Telegram disabled, skipping initialization")
return return
} }
@ -45,6 +46,7 @@ func Telegram(svc *svc.ServiceContext) {
return return
} }
logger.Info("Initializing Telegram Bot API...")
bot, err := tgbotapi.NewBotAPI(usedToken) bot, err := tgbotapi.NewBotAPI(usedToken)
if err != nil { if err != nil {
logger.Error("[Init Telegram Config] New Bot API Error: ", logger.Field("error", err.Error())) logger.Error("[Init Telegram Config] New Bot API Error: ", logger.Field("error", err.Error()))