fix: initialize grammy bot before handling updates

This commit is contained in:
admin
2026-05-05 13:33:33 +00:00
Unverified
parent 4094f4b3eb
commit 6a496e833f

View File

@@ -236,6 +236,14 @@ export async function initBot(config, api, tools, skills, agents) {
const bot = new Bot(botToken);
bot.api.config.use(autoRetry({ maxRetryAttempts: 5, maxDelaySeconds: 60 }));
// Initialize the bot to get bot info
try {
await bot.init();
logger.info('✓ Bot initialized');
} catch (e) {
logger.warn('⚠ Bot init failed (webhook will still work):', e.message);
}
// Register bot command menu
const cmdList = [
{ command: 'start', description: '🚀 Show help' },