diff --git a/worker/src/bot.py b/worker/src/bot.py index f644519..b829b06 100644 --- a/worker/src/bot.py +++ b/worker/src/bot.py @@ -223,12 +223,13 @@ async def _refresh_kw_card(bot, chat_id: int, message_id: int, kw_id_full: str): # ── handler registration + global commands ──────────────────────────────── def register_handlers(app: Application) -> None: - # Set the bot's command menu (shown when user types /) - app.bot.set_my_commands([ - {"command": "start", "description": "Open main menu"}, - {"command": "admin", "description": "Admin panel (admins only)"}, - ]) + async def _setup_commands(application: Application) -> None: + await application.bot.set_my_commands([ + {"command": "start", "description": "Open main menu"}, + {"command": "admin", "description": "Admin panel (admins only)"}, + ]) + app.post_init(_setup_commands) app.add_handler(CommandHandler("start", start_handler)) app.add_handler(CommandHandler("admin", admin_handler)) app.add_handler(CallbackQueryHandler(callback_router))