From c4745579ed41c5f198f34865ca815dbfd05b3061 Mon Sep 17 00:00:00 2001 From: Jose Lago Date: Wed, 17 Jun 2026 13:36:31 +0200 Subject: [PATCH] fix: swap stats/admin back buttons, fix summary message KeyError --- worker/src/bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/src/bot.py b/worker/src/bot.py index eb0fe3c..fa94116 100644 --- a/worker/src/bot.py +++ b/worker/src/bot.py @@ -509,7 +509,7 @@ async def _handle_callback(update: Update, context: ContextTypes.DEFAULT_TYPE) - chat_id=chat_id, text=text, parse_mode="HTML", reply_markup=kb, ) - name = user["first_name"] or "there" + name = update.effective_user.first_name or "there" # type: ignore[union-attr] summary_chat_id = update.effective_chat.id # type: ignore[union-attr] try: await context.bot.send_message( @@ -539,7 +539,7 @@ async def _handle_callback(update: Update, context: ContextTypes.DEFAULT_TYPE) - await query.edit_message_text( text=text, parse_mode="HTML", reply_markup=InlineKeyboardMarkup([ - [InlineKeyboardButton("↩ Back", callback_data="back:admin")], + [InlineKeyboardButton("↩ Back", callback_data="menu:")], ]), ) @@ -851,7 +851,7 @@ async def _handle_callback(update: Update, context: ContextTypes.DEFAULT_TYPE) - kb = InlineKeyboardMarkup([ [InlineKeyboardButton("➕ Add User", callback_data="admin_add"), InlineKeyboardButton("🗑 Remove User", callback_data="admin_remove")], - [InlineKeyboardButton("↩ Back", callback_data="menu:")], + [InlineKeyboardButton("↩ Back", callback_data="back:admin")], ]) await query.edit_message_text(text=text, parse_mode="HTML", reply_markup=kb)