Games-of-period responses can now include a per-game breakdown
(include_games) with Lichess post-analysis accuracy, plus which side
the tracked player was on and their rating change for that game.
- lichess_client.py requests accuracy=true from Lichess; stats_service
computes per-mode average accuracy and builds GameRow entries
(tracked_is_white, tracked_rating_diff) for blitz/rapid/classical
- /games/{username}/period gained an include_games query param
- formatters.py renders a column-aligned monospace table per game:
outcome circle (win/loss/draw relative to the tracked player),
rating change, accuracy, names/ratings, result — for today/yesterday
and periodic notifications; week keeps an aggregate accuracy line
- usernames are Markdown-escaped before formatting since messages are
now sent with parse_mode='Markdown'
Errors from Lichess (timeouts/5xx/invalid tokens) were being disguised
as "no activity" (HTTP 200, games_count/puzzles_in_period=0), causing
the bot to silently advance its checkpoint past real, undetected
activity. Puzzle-fetch failures weren't counted as errors at all, and
the periodic task died permanently after 5 consecutive errors with no
way to recover short of a manual restart. /setperiod also unconditionally
reset the checkpoint, dropping the window between the last check and
the command.
- API now returns success=false/502 on real errors instead of masking
them as zero activity (models.py, stats_service.py, main.py)
- Puzzle-fetch errors are now treated the same as game-fetch errors:
retry the same window instead of reporting "no puzzles"
- Notification delivery failures no longer silently advance the
checkpoint
- Replaced the hard 5-error kill switch with capped backoff that keeps
retrying indefinitely, plus an admin-bot notification if a player's
monitoring has been failing for a prolonged period (~2h+)
- /setperiod only clears the checkpoint when disabling notifications,
preserving continuity when a period is just changed
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- При добавлении игрока через /addgamer автоматически устанавливается период в 60 минут
- При добавлении нового игрока через /addtoken автоматически устанавливается период в 60 минут
- Работает как при первом добавлении, так и при последующих
- Added try-except block to handle errors when fetching player ratings
- Added detailed logging to track all players being processed
- Ensures all 4 players are displayed correctly
- /adduser заменен на /addgamer (просто username без токена)
- Добавлена команда /addtoken (токен для получения данных по задачам)
- /addtoken добавляет токен к существующему игроку или создает нового
- Обновлены описания команд в /start и документации
- Добавлено описание команды /delgamer
- Добавлен метод remove_user_gamer в database.py
- Добавлена команда /delgamer с интерактивным списком игроков
- Добавлен callback handler для удаления игроков
- Если игрок удаляется у всех пользователей, он удаляется из gamers
- Игроки показываются с рейтингами и статусом
- Исправлен баг с двойным ответом в /getgamers (добавлена обработка ошибок)
- Добавлена автоматическая миграция токенов при инициализации БД
- Исправлен веб-интерфейс - теперь берет токены из user_gamers
- Улучшен start.sh - создает бэкап базы перед перезапуском
- Добавлен export_db.sh для экспорта базы данных
- start.sh безопасно обновляет проект и сохраняет все данные
Теперь пользователь получает более подробную информацию:
- Зачем нужен токен (для получения данных по задачам)
- Где создать токен (настройки профиля)
- Какие права дать (только puzzle:read)
- Что делать если токен не нужен