Commit graph

99 commits

Author SHA1 Message Date
vrubelroman
2a7385290e fix silent onboarding drop-off in /addgamer flow
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 33s
Set awaiting_addgamer_username as soon as the menu is shown so typing a
username directly (without tapping the button) is handled instead of
being silently ignored. Also stop reporting a valid username as "not
found" when Lichess returns a non-404 error (rate limit/timeout), and
surface an error message if the addgamer menu itself fails to send.
2026-07-03 12:23:40 +00:00
vrubelroman
e9516f8664 show tracked player's piece color inline, drop redundant result text
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 33s
Add a small circle (/) glued right after the tracked player's name
in the per-game table to show which color they played, since the
white/black split was no longer visible once the opponent's name was
dropped. Replace the '1-0'/'0-1'/'1/2-1/2' result text with a plain
'-' separator — the leading outcome circle already conveys win/loss/draw.
2026-07-03 10:12:45 +00:00
vrubelroman
26cb066515 simplify per-game table: tracked player only, no rating diff column
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 31s
Reworked the per-game row layout to be relative to the tracked player
instead of white/black: the tracked player's name+accuracy+rating are
always shown first, the opponent's rating+accuracy (no name) always
second, regardless of which color each side played in a given game -
this keeps columns aligned across rows even as the tracked player
switches sides. Dropped the rating-change-per-game column added
earlier; it pushed the line past mobile width limits.
2026-07-03 10:08:35 +00:00
vrubelroman
d479e14bf9 add per-game accuracy and outcome table to stats/notifications
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 31s
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'
2026-07-03 09:38:51 +00:00
vrubelroman
4a783225af fix periodic activity-check algorithm silently losing player activity
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 38s
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>
2026-07-02 19:29:06 +00:00
vrubelroman
75e62b57a1 remove admin web panel (LichessWebView) from the project
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 43s
Unused component that also carried several security issues (default
admin credentials, hardcoded Flask secret key, debug mode, plaintext
passwords). Cleaned up compose files, CI/CD pipeline, and docs
accordingly; also dropped the stale IS_PROD config docs in favor of
the current .env-based setup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-02 18:32:06 +00:00
vrubelroman
1fe8deb0de ci: add Forgejo CI/CD pipeline with docker save/load deploy to prod
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m24s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 18:55:21 +00:00
vrubelroman
8828375207 refactor: move bot tokens to .env, remove hardcoded credentials
- Remove IS_PROD flag and hardcoded tokens from config.py
- Read TELEGRAM_BOT_TOKEN and ADMINPANEL_TELEGRAM_BOT_TOKEN from env
- Add env_file: .env to lichess-bot and admin-bot in docker-compose.yml
- Add .env to .gitignore (no longer tracked)
- Add .env.example with test tokens
2026-06-30 18:15:44 +00:00
vrubelroman
a5e3e6903d some 2026-06-09 11:50:47 +00:00
vrubelroman
0e3a0bfc48 Change API host port to 8002 2026-03-21 23:14:51 +03:00
vrubelroman
63e28c279c fix by codex 2026-03-21 22:58:47 +03:00
vrubel
3ffcf97c3f isProd = false 2026-02-05 23:53:36 +03:00
vrubel
20f96d0e0a fix critical bugs 2026-02-05 01:38:33 +03:00
vrubelroman
0de0deb14f delay in config and setup = 5sec 2026-02-04 23:51:32 +03:00
vrubel
2ac38440da удалили сообщения That's all и Processing request... 2026-01-22 16:25:33 +03:00
vrubelroman
b3b6a54e2d пофиксил баг отправки уведомлений 2025-12-06 00:28:53 +03:00
vrubelroman
6d51cf135d после неудачных попыток добавить игрока предлагается добавить игрока 2025-12-03 13:09:40 +03:00
vrubelroman
977787c858 заменил картинки 2025-12-03 13:02:14 +03:00
vrubelroman
6ed6ab866e добавлены картинки с подсказкой как добавить игрока 2025-12-03 02:33:38 +03:00
vrubelroman
ce586dcddb ↳ (активный игрок меняется в меню /getgamers) - удалили этот текст 2025-12-01 15:12:31 +03:00
vrubelroman
31ed5cf114 еще больше упростил стартовый текст 2025-12-01 14:29:07 +03:00
vrubelroman
f458044543 убран блок информации из /start в /help 2025-12-01 13:52:26 +03:00
vrubelroman
f58bf8b6a7 add /sendusers0 2025-11-28 18:28:51 +03:00
vrubelroman
f08bc3a1dc bold text in /addgamer 2025-11-28 18:11:13 +03:00
vrubelroman
d04a08936c /addgamer выдает страничку игрока 2025-11-23 16:53:12 +03:00
vrubelroman
50c5e93343 версионность не в конфиге 2025-11-23 13:11:58 +03:00
vrubelroman
4b6790be14 убрана чувствительность к регистру в никнейме 2025-11-23 12:51:14 +03:00
vrubelroman
e6967db17d аутентификация к веб админке 2025-11-23 02:36:15 +03:00
vrubelroman
595c9419f4 проверка на дубликаты и ряд багов 2025-11-23 01:46:12 +03:00
vrubelroman
ab03728d00 bug fix /addtoken 2025-11-21 23:49:26 +03:00
vrubelroman
776f4f2c1f trivial bug fix design 2025-11-21 23:43:53 +03:00
vrubelroman
30fca57382 redisign /start 2025-11-21 23:35:44 +03:00
vrubelroman
965b8775b7 add command /profile 2025-11-21 23:16:35 +03:00
vrubelroman
56c1048bcc adding docs 2025-11-20 14:19:08 +03:00
vrubelroman
711adb4126 ru en in web interface 2025-11-20 13:45:50 +03:00
vrubelroman
0c9a66a73c fix bug today yesterday 2025-11-20 13:16:15 +03:00
vrubelroman
123749415a switch ru/en 2025-11-20 12:43:00 +03:00
vrubelroman
c16a11cf63 очередь запросов и интервал 7 сек 2025-11-20 03:23:38 +03:00
vrubelroman
4dc5539da2 bug today 2025-11-20 03:14:06 +03:00
vrubelroman
faf6ec0c35 count users without gamers 2025-11-20 02:22:44 +03:00
vrubelroman
ef9aa3d3df fix bug push from timer 2025-11-20 01:22:52 +03:00
vrubelroman
278c5b9c40 add token bug fix 2025-11-19 12:02:54 +03:00
vrubelroman
1f384c12ab add audio notifications 2025-11-18 19:39:52 +03:00
vrubelroman
9cb573db7d fix notifications 2025-11-18 16:28:07 +03:00
vrubelroman
24d53e731a rate limiter 0.2 sec 2025-11-18 15:10:19 +03:00
vrubelroman
e0e8fa8f6b fix 2025-11-18 14:43:38 +03:00
vrubelroman
54b263f20c fix push notification 2025-11-18 14:41:13 +03:00
vrubelroman
8a813be5cc new users and gamers today 2025-11-18 14:30:55 +03:00
vrubelroman
141022727d /addgamer after /addgamer 2025-11-18 14:23:54 +03:00
vrubelroman
0fe6be8601 add link to telegram profile user 2025-11-18 14:05:39 +03:00