fix: initialize grammy bot before handling updates
This commit is contained in:
@@ -235,6 +235,14 @@ export async function initBot(config, api, tools, skills, agents) {
|
||||
// ── Create grammy bot ──
|
||||
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 = [
|
||||
|
||||
Reference in New Issue
Block a user