bold text in /addgamer

This commit is contained in:
vrubelroman 2025-11-28 18:11:13 +03:00
parent d04a08936c
commit f08bc3a1dc
2 changed files with 10 additions and 8 deletions

View file

@ -263,10 +263,13 @@ class LichessBot:
async def start_and_addgamer(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""Start command that shows welcome message and starts addgamer conversation"""
try:
# Clear any existing conversation state
if context and hasattr(context, "user_data"):
context.user_data.clear()
# Run the regular start command
await self.start(update, context)
# Start addgamer conversation and return state
return await self.addgamer_start(update, context)
# Start addgamer conversation
await self.addgamer_start(update, context)
except Exception as e:
logger.error(f"Error in start_and_addgamer: {e}")
import traceback
@ -275,7 +278,6 @@ class LichessBot:
await update.message.reply_text(f"Error: {e}")
except:
pass
return ConversationHandler.END
async def addgamer_start(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""Start addgamer command - simple username only"""
@ -292,7 +294,7 @@ class LichessBot:
# Mark that we are awaiting a username reply
if context and hasattr(context, "user_data"):
context.user_data['awaiting_addgamer_username'] = True
await update.message.reply_text(t('addgamer_prompt', lang))
await update.message.reply_text(t('addgamer_prompt', lang), parse_mode='HTML')
logger.info(f"Addgamer prompt sent to user {user_id}")
self.counters.increment('addgamer')
except Exception as e: