- cancel_sub: add parse_mode=MARKDOWN_V2 so users don't see literal backslashes
- /removeplayer: add CommandHandler that was advertised in /start but missing from handlers
- parse_standings: raise SNo limit 300→5000 to support large open tournaments
- call_bbp_with_checklist: close mkstemp fd to fix resource leak
- _warmup_cache_sync: make time.sleep(1.0) conditional on HTTP fetch, skip for cache hits
- _warmup_cache_sync: derive start_tnr from max(max_tnr_seen, max cached tnr) instead of hardcoded 1445000
- main: remove duplicate print('Client bot started') after blocking run_polling()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- check_all_subscriptions: quick pre-check (1 req, art=4 only) before
full fetch; full fetch only when results_count or current_round changed.
Interval 60s → 300s. Saves ~10,000 req/day per active subscription.
- rescan_existing_tournaments: filter to tournaments ended within last 30
days (or no end_date). Drops from ~2000 cached TNRs to ~30-100 active
ones per run, saving ~22,000 req/day.
- warmup: sleep 1s per TNR instead of 20ms per 500 — spreads initial
full-scan over hours rather than minutes.
- parser: extract _normalize_url helper, add fetch_tournament_quick().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- fetch_fide_player: parse rapid and blitz ratings from FIDE profile
- subscriptions: add rapid/blitz columns (auto-migration)
- /myplayers card: show rapid (📍) and blitz (⚡) ratings
- /addplayer confirmation: show rapid/blitz alongside standard rating
- find_player_in_cache: extract instant SQL-only search from scan_for_player
- /addplayer: use find_player_in_cache instead of full HTTP scan — instant response
- tournament names in /myplayers and /addplayer are now hyperlinks
- add_player_watch: ON CONFLICT DO UPDATE to reactivate deleted players
- my_players: try/except per card with plain-text fallback, error logged to stderr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- /myplayers: each player card gets inline 🗑 button — tap to remove instantly
- removal via CallbackQueryHandler (remove:<fide_id>), no text command needed
- /removeplayer command removed
- no-players message localized (ru/en) via LOCALE
- /myplayers header and labels (round, pts) also localized
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- scan_for_player: remove hardcoded TNR range (1434k-1450k), search full cache
- discover_max_tnr: start from cache MAX(tnr) instead of stuck-at-500k value
- addplayer: if no tournament found, add fide_only watch instead of asking for URL
- rescan_new_tournaments: deactivate fide_only entry when real tournament found
- /myplayers: card layout grouped by player, removal by FIDE ID
- /removeplayer: now accepts FIDE ID, removes all subscriptions for that player
- fix MarkdownV2 escaping: dates (hyphens), <> in messages, title='None'
- check_all_subscriptions: skip fide_only entries; interval 5min → 1min
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- _build_table_rows: filter to ±5 boards around player
- Normalize names (strip commas) for matching FIDE vs pairings format
- Highlight subscribed player with ✅ emoji
- Reduce name column width to compensate for emoji
- Add tournament name to pairing header
- Manual URL flow: look up subscription to highlight player
- Fix MarkdownV2 escaping for em-dash
- _pad_col теперь обрезает имена длиннее колонки (с многоточием)
- Разделительная линия (────┼────┼────) после каждой пары
- chunk_size кратен 3 (white + black + border)
- Очки выровнены по самой длинной фамилии
- format_pairings возвращает структуру (title/rows/header/footer)
- _render_chunks разбивает пары на группы по ~30 пар
- Каждый чанк — свой code-блок с заголовком
- Убраны разделители между парами (экономия ~50% размера)
- Fallback plain text при любой ошибке MarkdownV2
Формат:
# │ Игрок │ О
───┼────────────────────────┼────
1 │ Мармылев Александр Д. │ 4.0
│ Нестеров Мирон А. │ 4.0
Внутри code-блока MarkdownV2 не нужен (literal text).
- Очки теперь через _md_escape (4.0 → 4\.0)
- Каждая пара в две строки (белые сверху, чёрные снизу)
- Защита: при ошибке MarkdownV2 парсинга — plain text
- Экранрованы точки в статусных сообщениях
- client_bot.py: вывод пар в моноширинной таблице ()
с учётом ширины кириллицы и обрезкой длинных имён
- admin_bot.py: /stat в MarkdownV2
- Оба бота: все сообщения в ParseMode.MARKDOWN_V2
- Клиентский бот: принимает ссылку на chess-results.com,
проверяет наличие результатов/жеребьёвки, считает пары
следующего тура, выводит в HTML-формате
- Админский бот: /stat — уникальные пользователи,
всего запросов, запросов за сегодня
- Статистика через SQLite (volume bot-data)
- Оба бота в docker-compose с автоперезапуском
- .env.example с тестовыми токенами
- .env в .gitignore