Security/quality

This commit is contained in:
HugeFrog24
2026-03-05 01:51:59 +01:00
parent 6e2d2fce2f
commit e1a9261699
30 changed files with 2823 additions and 295 deletions
Executable → Regular
+5 -11
View File
@@ -47,19 +47,13 @@ func main() {
return
}
// Initialize TelegramClient with the bot's handleUpdate method
tgClient, err := initTelegramBot(cfg.TelegramToken, bot.handleUpdate)
if err != nil {
ErrorLogger.Printf("Error initializing Telegram client for bot %s: %v", cfg.ID, err)
return
}
// Start the bot in a separate goroutine
go bot.Start(ctx)
// Assign the TelegramClient to the bot
bot.tgBot = tgClient
// Keep the bot running until the context is cancelled
<-ctx.Done()
// Start the bot
InfoLogger.Printf("Starting bot %s...", cfg.ID)
bot.Start(ctx)
InfoLogger.Printf("Bot %s stopped", cfg.ID)
}(config)
}