Refactor Telegram bot configuration and deep link handling
CI / Backend (build + test) (push) Successful in 1m15s
CI / Frontend (lint + typecheck + build) (push) Successful in 29s

- Removed the `BotUsername` property from `TelegramOptions` and updated the `.env.example` to reflect this change, as the bot's username is now dynamically retrieved via the Bot API.
- Introduced `ITelegramBotInfo` to cache the bot's username, improving the handling of deep links in `TelegramEndpoints`.
- Updated API documentation to clarify that the deep link is now dependent on the bot's token and its availability through the Bot API, enhancing clarity for developers.
This commit is contained in:
Leonid Pershin
2026-07-02 15:44:40 +03:00
parent f731249e78
commit 0d05ff52e9
8 changed files with 79 additions and 18 deletions
+3 -2
View File
@@ -36,9 +36,10 @@ Roles__DefaultUserMaxConfigs=3
# ── Telegram-бот ──────────────────────────────────────────────────────────
# Если BotToken пуст — бот не стартует, панель работает без него. Транспорт — только long polling
# (webhook не реализован, отдельного режима/URL для него нет).
# (webhook не реализован, отдельного режима/URL для него нет). Username бота для диплинков
# (кнопка «Привязать Telegram»/QR) панель узнаёт сама через Bot API (getMe) — задавать его отдельно
# не нужно и негде (раньше был Telegram__BotUsername — убран, чтобы не ломать диплинк опечаткой/пробелом).
Telegram__BotToken=
Telegram__BotUsername=PnvPanelBot
# Telegram id(ы) администраторов (через запятую). Дают права админа в боте (кнопки активации)
# и получают уведомления о запросах на активацию. Узнать id: @userinfobot.
# Не связано с сид-админом выше — привязка Telegram к сид-админу делается вручную в UI.