LichessStatTgWeb/docs/USER_GUIDE.md

180 lines
22 KiB
Markdown
Raw Normal View History

# Руководство пользователя бота @LichessStat_bot
Бот в Telegram: [@LichessStat_bot](https://t.me/LichessStat_bot). Он следит за игроками Lichess.org, которых вы добавили, показывает их статистику по запросу и сам присылает уведомления о сыгранных партиях (и решённых пазлах, если вы дали боту свой Lichess-токен).
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
Руководство соответствует текущей версии бота (`/support` показывает её номер).
## 1. Начало работы
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
1. Откройте бота и отправьте `/start`. Бот присылает одно короткое сообщение: что он делает и просьбу прислать имя игрока на Lichess (пример — `DrNykterstein`). Под ним две кнопки: **❓ Где взять имя** (картинка-подсказка) и переключение языка **🇬🇧 English** / **🇷🇺 Русский** — язык выбирается по настройкам Telegram, одно нажатие меняет его на месте.
2. Пришлите имя игрока обычным текстом — ничего нажимать не нужно. Бот принимает имя в любом виде: `DrNykterstein`, `@DrNykterstein`, ссылку на профиль `https://lichess.org/@/DrNykterstein`, «add DrNykterstein»; регистр не важен.
3. Бот ответит «✅ Добавлен DrNykterstein» со ссылкой на профиль. С этого момента раз в час приходит отчёт о сыгранных партиях (период меняется через `/setperiod`). Следующего игрока добавляют так же — просто присылают имя; `/addgamer` лишь повторяет просьбу прислать имя.
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
Если игроки уже есть, `/start` показывает, за кем вы следите, и три команды: `/today`, `/addgamer`, `/help`.
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
### Где взять имя игрока
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
Это имя из адреса профиля на Lichess: `https://lichess.org/@/<имя>`. Кнопка **❓ Где взять имя** показывает его на картинке. Бот сохранит написание так, как оно записано у Lichess.
### Что бот может ответить на присланное имя
| Ответ | Что это значит |
|---|---|
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
| ❌ На Lichess нет игрока … | Такого аккаунта нет. Первая строка показывает имя так, как бот его понял; проверьте буквы и пришлите ещё раз |
| ⛔ Аккаунт … закрыт на Lichess — партий не будет. | Аккаунт закрыт владельцем или Lichess; бот его не добавляет |
| ⚠️ Lichess не отвечает. Пришлите имя ещё раз через минуту. | Lichess не ответил; имя может быть правильным |
| ℹ️ … уже в вашем списке. | Этот игрок уже есть у вас |
| ℹ️ Имя на Lichess — латинские буквы, цифры, «-» и «_», без пробелов. | Текст не похож на имя (кириллица, пробелы, длиннее 20 символов) — на Lichess бот его не проверял |
| ℹ️ Похоже, это Chess.com. Бот работает только с Lichess. | В тексте есть chess.com |
### Подсказки, если бот «не понял»
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
- Любой текст без «/» бот считает именем игрока (кроме ввода токена после `/addtoken`).
- На фото, стикер, контакт и другие не-текстовые сообщения бот отвечает «ℹ️ Я читаю только текст…», на неизвестную команду (`/tody`) — «ℹ️ Такой команды нет. /help — список команд.».
- Если игроков ещё нет, `/today`, `/getgamers`, `/delgamer`, `/setperiod` и другие команды отвечают «📭 Вы пока никого не отслеживаете» и просят прислать имя.
## 2. Команды
| Команда | Что делает |
|---|---|
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
| `/start` | Первый экран: просьба прислать имя игрока (или список ваших игроков, если они есть) |
| `/addgamer` | Просьба прислать имя игрока — то же, что просто прислать имя |
| `/addtoken` | Добавить игрока по его Lichess-токену — нужно для статистики по пазлам (см. раздел 5) |
| `/getgamers` | Состояние ваших игроков: когда играл, как часто приходят отчёты; рейтинги — по кнопке |
| `/delgamer` | Удалить игрока из списка |
| `/today`, `/yesterday`, `/week` | Партии за сегодня / вчера / последние 7 дней по всем вашим игрокам — одним сообщением |
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
| `/year` (`/lastYear_or_1000games`) | Статистика за последний год или за последние 1000 рейтинговых партий — по всем игрокам |
| `/setperiod` | Выбрать игрока и период уведомлений (или выключить их) |
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
| `/profile` | Ссылка на профиль Lichess выбранного игрока (в `/help` не показывается) |
| `/lang` (`/set_lang`) | Язык бота: 🇷🇺 Русский / 🇬🇧 English (при первом обращении язык берётся из настроек Telegram; кнопка есть и на первом экране) |
| `/help` | Список команд |
| `/support` | Контакт разработчика ([@vrubelr](https://t.me/vrubelr)) и версия бота |
| `/cancel` | Выйти из ввода токена после `/addtoken` |
У каждого пользователя свой список игроков; одного и того же игрока могут отслеживать несколько человек, и настройки (период, токен) у каждого свои.
### `/getgamers`
Экран состояния — отвечает мгновенно, без запросов к Lichess:
```
👥 Игроки — 3
🟢 DrNykterstein
играл сегодня · раз в час
⚪ Zhigalko_Sergei
12 дней тихо · раз в час
⛔ Alexandr_Fier
аккаунт закрыт
Ещё игрок — просто пришлите имя.
[📈 Рейтинги]
```
- Первая строка игрока — когда он последний раз был на Lichess (по данным, которые бот обновляет раз в 15 минут): 🟢 «играл сегодня» / «играл вчера», ⚪ «N дней тихо», 💤 «N дней тихо» (от 30 дней) / «больше 3 месяцев тихо», ⛔ «аккаунт закрыт», ❓ «не найден на Lichess», ⚪ «ещё не проверял» (игрок добавлен только что). Игроки отсортированы: сначала играющие, затем по длине тишины.
- После точки — как часто по нему приходят отчёты: «раз в час», «раз в день», «раз в 6 ч», или «🔕 отчёты выключены». Это то же написание, что в `/setperiod`.
- Кнопка **📈 Рейтинги** запрашивает у Lichess рейтинги ⚡ bullet / 🔥 blitz / 🐇 rapid (по игроку, с паузой — на десятках игроков это занимает время, кнопка на это время показывает ⏳) и добавляет к сообщению таблицу; «—» — рейтинга в этом режиме нет.
- «Активного игрока» выбирать не нужно — все команды статистики работают сразу по всем игрокам.
### `/delgamer`
Список игроков с рейтингами и кнопка 🗑️ у каждого. После удаления уведомления по нему перестают приходить. Если удалили последнего игрока, бот попросит прислать имя нового.
## 3. Статистика по запросу
`/today`, `/yesterday` и `/week` — одно сообщение на всех ваших игроков. Пока бот собирает данные, оно показывает «🔄 Собираю партии за сегодня…», затем редактируется в результат:
```
📊 Сегодня, 21 октября
DrNykterstein — 5 партий
🔥 Blitz 3105 (+12) · 3/5 побед
± цвет точн. соперник
🟢 +8 белые 91 % 2990 · 79 %
🟢 +7 чёрные 88 % 3011 · 84 %
🔴 -9 белые 79 % 3080 · 92 %
⚪ 0 чёрные — 3102 · —
🟢 +6 белые 93 % 2950 · 71 %
🧩 Пазлы: 14 из 17 решены
Zhigalko_Sergei — не играл
[📅 Вчера] [📅 Неделя]
```
- Блок игрока устроен так же, как периодический отчёт (раздел 4): строка режима с рейтингом, изменением и победами, строки партий, пазлы. Для `/week` строки партий не показываются — только строки режимов.
- Кто не играл — одной строкой «не играл»; закрытый или не найденный на Lichess аккаунт — своим статусом; если по игроку не удалось получить данные — «⚠️ не удалось получить данные», остальные игроки показываются. Если не играл никто — «📭 Сегодня никто из ваших игроков не играл».
- Кнопки под результатом переключают период на месте: из «Сегодня» — «📅 Вчера» и «📅 Неделя», и т. д.
- Строка пазлов появляется, только если игрок решал задачи (данные о пазлах за день/неделю Lichess отдаёт без токена).
- Игроки, которые по данным Lichess не заходили на сайт с начала периода, и закрытые аккаунты не запрашиваются — это ускоряет команду у тех, кто следит за десятками игроков. Между остальными игроками бот делает паузу в 1 с.
- «Сегодня» и «вчера» — календарные дни; `/week` — последние 7 дней включая сегодня. Очень длинный результат (десятки игравших) приходит несколькими сообщениями.
### `/year` (`/lastYear_or_1000games`)
Для каждого игрока бот запрашивает рейтинговые партии за последние 365 дней (Lichess отдаёт не больше 1000 последних). Команда медленная — бот предупреждает об этом и между игроками делает паузу. Ответ по игроку: заголовок с датами («📈 Имя: за год, 523 партии / 22.10.2025–21.10.2026, рейтинговые» или «последние 1000 партий / с …») и по три строки на режим:
```
🔥 Blitz 2257 (+45)
523 партии · +250 −230 =43
точность 78 %
```
— рейтинг и его изменение за период, число партий и счёт побед/поражений/ничьих, средняя точность по проанализированным партиям (для blitz/rapid/classical).
## 4. Уведомления (`/setperiod`)
1. `/setperiod` → кнопка с игроком (рядом его текущий период: «раз в час», «раз в день», «🔕 отчёты выключены»…).
2. Затем выбор периода: **❌ Отключить уведомления**, **⏰ раз в 15 мин**, **раз в 30 мин**, **раз в час**, **раз в 2 ч**, **раз в 3 ч**, **раз в 6 ч**, **раз в 12 ч**, **раз в день**.
3. Бот подтверждает: «✅ Имя: отчёты раз в час».
После добавления игрока период по умолчанию — 1 час. Уведомление приходит только если за прошедшее окно игрок сыграл партии (или решал пазлы — при подключённом токене); пустых сообщений бот не шлёт. Партия засчитывается в то окно, в котором она **закончилась**: партия, начатая в 14:58 и доигранная в 15:06, попадёт в уведомление за 15:00–16:00.
Пример отчёта (за окно в 1 час):
```
♟️ DrNykterstein — 5 партий
🔥 Blitz 3105 (+12) · 3/5 побед
🐇 Rapid 2890 (−4)
± цвет точн. соперник
🟢 +8 белые 91 % 2990 · 79 %
🟢 +7 чёрные 88 % 3011 · 84 %
🔴 -9 белые 79 % 3080 · 92 %
⚪ 0 чёрные — 3102 · —
🟢 +6 белые 93 % 2950 · 71 %
🧩 Пазлы: 14 из 17 решены
/today — весь день
```
- Первая строка — кто и сколько партий. Затем по строке на режим (⚡ Bullet, 🔥 Blitz, 🐇 Rapid, ♟️ Classical — только те, где были партии): рейтинг после окна, его изменение в скобках и, если партий две и больше, число побед.
- Строки партий (для blitz, rapid и classical; bullet — только строка режима): результат 🟢 выигрыш / 🔴 проигрыш / ⚪ ничья, изменение рейтинга в этой партии, цвет фигур игрока, его точность, затем рейтинг и точность соперника. «—» — партия не проанализирована на Lichess (точность есть только у проанализированных партий). Больше 10 строк не показывается — дальше «…и ещё N партий — /today».
- «🧩 Пазлы» — только при подключённом токене (раздел 5) и только если пазлы были.
- Если бот какое-то время не работал (обновление, сбой), он закрывает пропущенное одним отчётом за всё окно; при окне от 6 часов под первой строкой будет «за последние N часов». Если простой был дольше, чем «период + 2 часа», старая активность уже не присылается.
- **Закрытый аккаунт.** Если игрок закрыл аккаунт на Lichess, бот один раз пришлёт «⛔ Аккаунт … на Lichess закрыт. Уведомления по нему приостановлены; если его откроют, они возобновятся автоматически» и перестанет его проверять. Когда аккаунт снова откроют, придёт «✅ Аккаунт … на Lichess снова активен, уведомления возобновлены». В `/getgamers` и `/delgamer` такой игрок помечен ⛔.
- **Аккаунта больше нет.** Если игрок удалил аккаунт или сменил имя, так что Lichess больше не знает прежнего ника, бот ставит его на паузу точно так же, один раз прислав «❌ Аккаунта … на Lichess больше нет (удалён или переименован). Уведомления по нему приостановлены»; в `/getgamers` и `/delgamer` он помечен ❓. Если ник снова появится на Lichess, уведомления возобновятся с тем же сообщением «✅ … снова активен»; под новым ником игрока нужно добавить заново через `/addgamer`.
- **Игрок давно не играет.** Если игрок не заходил на Lichess 30 дней, бот один раз спросит: «💤 Имя не заходил на Lichess 30 дней. Отчётов по нему не было с 21 сентября. Продолжать следить?» с кнопками «✅ Да, оставить» и «🗑 Удалить». «Да» — вопрос не повторится ещё 90 дней; «Удалить» — игрок удаляется сразу, без второго подтверждения. Без ответа ничего не меняется: сам бот игроков не удаляет. Для закрытых и не найденных аккаунтов этого вопроса нет — у них свои уведомления (выше).
- Если вы заблокировали бота, уведомления по всем вашим игрокам выключаются (период сбрасывается). После разблокировки включите их заново через `/setperiod`.
- Бот проверяет игроков с задержкой: за один период может прийти уведомление с опозданием на несколько минут — это нормально.
## 5. Пазлы и токен (`/addtoken`)
Статистика по пазлам в **уведомлениях** доступна только для аккаунта, чей токен вы дали боту (обычно это ваш собственный аккаунт или аккаунт ученика/ребёнка с его согласия):
1. Создайте токен на https://lichess.org/account/oauth/token/create, отметив только право `puzzle:read`.
onboarding phase 1: one-screen /start, any text is a player name, URL/@ normalisation, next-step texts, /addtoken trap closed Analysis: docs/analysis/onboarding_funnel.md (56% of users never add a player; drop happens on the first screen; non-ru/en users convert at 25%). Design: docs/design/onboarding.md. - /start: one message. New user: promise + "send a Lichess username, e.g. DrNykterstein" with [❓ Где взять имя] / [🇬🇧 English] (language switch edits the message in place). Returning user: their players + /today /addgamer /help. - /addgamer asks for the name directly (the two-button menu from 2025-12-03 is gone). - Any non-command text in a private chat is a player-name attempt: no awaiting flag, PicklePersistence removed. onboarding.normalise_username accepts lichess.org URLs, @name, quotes, "add Name"; chess.com and non-name text get their own hints; nothing is sent to Lichess for them. - Every reply ends with the next step (success: hourly report is on, /today, send another name). One no_players empty state for /today, /week, /getgamers, /delgamer, /setperiod, /profile, /year. - /help: 18 lines in three groups; /year and /lang aliases; command menu set from code for en (default) and ru at startup (set_my_commands). - /addtoken trap: non-lip_ text gets a hint instead of "invalid token"; any other command inside the conversation ends it and runs; /cancel outside a conversation answers "nothing to cancel". - All echoed input html-escaped. Terminology unified: игрок / имя на Lichess / отчёт (player / Lichess username / report). - events: user_start screen=, addgamer_input kind= normalised=, addgamer_result format|chesscom, lang_set via=, addtoken_result not_a_token; text in_flow= gone. - i18n: 18 dead keys removed, 21 added; docs (README, USER_GUIDE, about, CURRENT_STATE, CHANGELOG Unreleased) updated; 107 bot tests (was 61). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-21 07:36:31 +00:00
2. Отправьте боту `/addtoken`, затем сам токен. Чтобы передумать — `/cancel`. Если вместо токена прислать имя игрока (всё, что не начинается с `lip_`), бот объяснит, что `/addtoken` нужен только для пазлов, и попросит нажать `/cancel` и прислать имя.
3. Бот определит игрока по токену и добавит его («✅ Игрок … добавлен с токеном!»); если игрок уже был в списке — просто сохранит токен («✅ Токен добавлен для игрока …!»). Период уведомлений для нового игрока — 1 час.
Если токен не принят («❌ Неверный токен. Попробуйте еще раз.»), бот продолжает ждать токен — пришлите правильный или `/cancel`. Если позже Lichess отзовёт токен, придёт одно сообщение «⚠️ Lichess отклонил сохранённый токен для …», статистика по пазлам для этого игрока выключится, а отслеживание партий продолжится; новый токен можно дать через `/addtoken` ещё раз.
## 6. Частые вопросы
**Уведомления не приходят.** Посмотрите `/getgamers`: там видно, когда игрок последний раз играл и как часто по нему приходят отчёты («раз в час»); если стоит «🔕 отчёты выключены» — включите через `/setperiod`. Если игрок помечен ⛔, его аккаунт закрыт; если ❓ — такого ника на Lichess больше нет. Помните, что отчёты приходят только при наличии партий за окно: «12 дней тихо» означает, что игрок не играл, а не что бот сломался.
**`/today` показал «не играл», хотя игрок играл.** Lichess считает «сегодня» по своим суткам; партия, сыгранная около полуночи, может попасть во «вчера». В списке отдельных партий и в `/lastYear_or_1000games` учитываются только рейтинговые партии.
**Можно ли добавить много игроков?** Да, ограничения нет; но `/today` по длинному списку выполняется дольше (запросы к Lichess идут по очереди).
**Связь с разработчиком** — `/support` или [@vrubelr](https://t.me/vrubelr), на русском или английском.