diff --git a/LichessClientTG_bot/bot.py b/LichessClientTG_bot/bot.py
index df8f50a..f7e28a2 100644
--- a/LichessClientTG_bot/bot.py
+++ b/LichessClientTG_bot/bot.py
@@ -618,11 +618,29 @@ class LichessBot:
lang = self.db.get_user_language(user_id)
if gamer_to_delete:
username = gamer_to_delete['username']
+ was_active = gamer_to_delete.get('is_active', False)
+ total_gamers_before = len(gamers)
+
deleted = self.db.remove_user_gamer(user_id, gamer_id)
if deleted:
+ # Check how many gamers remain after deletion
+ remaining_gamers = self.db.get_user_gamers(user_id)
+ remaining_count = len(remaining_gamers)
+
+ # Determine which message to show
+ if remaining_count == 0:
+ # Last gamer deleted
+ message = t('last_gamer_deleted', lang, username=username)
+ elif was_active:
+ # Active gamer deleted but there are other gamers
+ message = t('active_gamer_deleted', lang, username=username)
+ else:
+ # Regular deletion
+ message = t('gamer_deleted', lang, username=username)
+
await query.edit_message_text(
- t('gamer_deleted', lang, username=username),
+ message,
parse_mode='HTML'
)
else:
diff --git a/LichessClientTG_bot/i18n.py b/LichessClientTG_bot/i18n.py
index c5eb5fa..5c2e904 100644
--- a/LichessClientTG_bot/i18n.py
+++ b/LichessClientTG_bot/i18n.py
@@ -66,6 +66,8 @@ TRANSLATIONS = {
'loading_gamers': "š Loading player list...",
'select_gamer_to_delete': "šļø Select player to delete:\n\n",
'gamer_deleted': "ā
Player {username} removed from tracked list.",
+ 'active_gamer_deleted': "ā
Player {username} removed from tracked list.\n\nā ļø You deleted the active player. Use the /getgamers command to select a player for which the /today, /yesterday, /week commands will work.",
+ 'last_gamer_deleted': "ā
Player {username} removed from tracked list.\n\nā ļø You deleted the last player. Use the /addgamer command to add a new tracked player.",
'delete_failed': "ā Failed to delete player",
# Stats commands