diff --git a/LichessClientTG_bot/bot.py b/LichessClientTG_bot/bot.py index afe7ec4..694c193 100644 --- a/LichessClientTG_bot/bot.py +++ b/LichessClientTG_bot/bot.py @@ -260,6 +260,12 @@ class LichessBot: await update.message.reply_text(start_msg) self.counters.increment('start') + async def help_command(self, update: Update, context: ContextTypes.DEFAULT_TYPE): + """Help command handler""" + lang = self.get_user_language_from_update(update) + help_msg = t('help_message', lang) + await update.message.reply_text(help_msg) + async def start_and_addgamer(self, update: Update, context: ContextTypes.DEFAULT_TYPE): """Start command that shows welcome message and starts addgamer conversation""" try: @@ -1538,6 +1544,7 @@ class LichessBot: # Add handlers - ConversationHandler must be before general MessageHandler application.add_handler(CommandHandler("start", self.start_and_addgamer)) + application.add_handler(CommandHandler("help", self.help_command)) application.add_handler(CommandHandler("addgamer", self.addgamer_start)) application.add_handler(addtoken_conv) # Add before general MessageHandler application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, self.handle_username)) diff --git a/LichessClientTG_bot/i18n.py b/LichessClientTG_bot/i18n.py index 58cb218..4759e1a 100644 --- a/LichessClientTG_bot/i18n.py +++ b/LichessClientTG_bot/i18n.py @@ -27,6 +27,11 @@ TRANSLATIONS = { "✅ Wins: 8\n" "❌ Losses: 4\n" "🤝 Draws: 7\n\n" + "ℹ️ Commands and features info in /help" + ), + + # Help command + 'help_message': ( "📋 Available commands:\n\n" "➕ /addgamer — Add a Lichess player to track (username only)\n" "🔑 /addtoken — Add a player with a token to get puzzle data\n" @@ -39,7 +44,7 @@ TRANSLATIONS = { "⏱️ /setperiod — Set up periodic notifications for the active player\n" " ↳ (active player changes in the /getgamers menu)\n\n" "👤 /profile — View Lichess profile links for tracked players\n" - "🌍 /set_lang — Select bot language (English / Russian)\n" + "🌍 /set_lang — Select bot language\n" "💬 /support — Contact the developer for support and feedback" ), @@ -150,6 +155,11 @@ TRANSLATIONS = { "✅ Побед: 8\n" "❌ Поражений: 4\n" "🤝 Ничьих: 7\n\n" + "ℹ️ Информация о командах и возможностях в команде /help" + ), + + # Help command + 'help_message': ( "📋 Доступные команды:\n\n" "➕ /addgamer — Добавить игрока Lichess для отслеживания (только username)\n" "🔑 /addtoken — Добавить игрока с токеном для получения данных по пазлам\n"