From 481965e8f284d672e3c58bb84e1c190dc89bc8bd Mon Sep 17 00:00:00 2001 From: Omelechko Danil Date: Mon, 23 Mar 2026 18:22:34 +0300 Subject: [PATCH] feat: /matches without args shows list of available leagues --- main.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 25a009b..7ee496c 100644 --- a/main.py +++ b/main.py @@ -1234,14 +1234,33 @@ async def handle_matches_cmd(message: Message): raw_text = message.text or "" parts = raw_text.split(maxsplit=1) sport_alias = parts[1].strip().lower() if len(parts) > 1 else None - if sport_alias and sport_alias not in config.ODDS_SPORTS: + + # Если лига не указана — показать список + if not sport_alias: + labels = { + "epl": "⚽ EPL (Англия)", + "ucl": "⚽ Champions League", + "laliga": "⚽ La Liga (Испания)", + "bundesliga": "⚽ Bundesliga (Германия)", + "seriea": "⚽ Serie A (Италия)", + "ligue1": "⚽ Ligue 1 (Франция)", + "europa": "⚽ Europa League", + } + lines = ["🏆 Доступные лиги для ставок:\n"] + for alias, name in labels.items(): + lines.append(f" {name} → /matches {alias}") + lines.append("\nПример: /matches epl") + await message.reply("\n".join(lines), parse_mode=None) + return + + if sport_alias not in config.ODDS_SPORTS: if message.from_user: clear_user_sport_context(message.from_user.id) available = " / ".join(config.ODDS_SPORTS.keys()) await message.reply(f"Неизвестная лига. Доступно: {available}", parse_mode=None) return if message.from_user: - if sport_alias and sport_alias in config.ODDS_SPORTS: + if sport_alias in config.ODDS_SPORTS: remember_user_sport_context(message.from_user.id, sport_alias) else: clear_user_sport_context(message.from_user.id)