Phase 9: Telegram bot management with chat discovery
Some checks failed
Validate / Hassfest (push) Has been cancelled

New entity + API:
- TelegramBot model (name, token, bot_username, bot_id)
- CRUD at /api/telegram-bots with token validation via getMe
- GET /{id}/chats: discover active chats via getUpdates
- GET /{id}/token: retrieve full token (for target config)

Frontend:
- /telegram-bots page: register bots, view discovered chats
  per bot (expandable), refresh on demand
- Targets page: select from registered bots (dropdown) instead
  of raw token input. Chat selector shows discovered chats
  when bot is selected, falls back to manual input.
  Bot token resolved server-side on save.

Nav icon uses monochrome symbol for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 17:45:58 +03:00
parent 5dee7c55ca
commit cf987cbfb4
9 changed files with 440 additions and 10 deletions

View File

@@ -9,6 +9,7 @@
"trackers": "Trackers",
"trackingConfigs": "Tracking",
"templateConfigs": "Templates",
"telegramBots": "Bots",
"targets": "Targets",
"users": "Users",
"logout": "Logout"
@@ -159,6 +160,25 @@
"confirmDelete": "Delete this user?",
"joined": "joined"
},
"telegramBot": {
"title": "Telegram Bots",
"description": "Register and manage Telegram bots",
"addBot": "Add Bot",
"name": "Display name",
"namePlaceholder": "Family notifications bot",
"token": "Bot Token",
"tokenPlaceholder": "123456:ABC-DEF...",
"noBots": "No bots registered yet.",
"chats": "Chats",
"noChats": "No chats found. Send a message to the bot first.",
"refreshChats": "Refresh",
"selectBot": "Select bot",
"selectChat": "Select chat",
"private": "Private",
"group": "Group",
"supergroup": "Supergroup",
"channel": "Channel"
},
"trackingConfig": {
"title": "Tracking Configs",
"description": "Define what events and assets to react to",