Some checks failed
Validate / Hassfest (push) Has been cancelled
- IMPORTANT constraint: all asset commands only search within tracked albums, never expose untracked content - /search uses Immich CLIP semantic search (natural language) - /find uses text search (filename, description) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.9 KiB
2.9 KiB
Phase 10: Telegram Bot Commands
Status: Pending Parent: primary-plan.md
Goal
Define and implement Telegram bot commands that users can invoke directly from chat to interact with the Immich Watcher system. The server auto-registers commands with Telegram's BotFather API whenever the command config changes.
Proposed Commands
Informational
/status— Show tracker status (active trackers, last event, server health)/albums— List tracked albums with asset counts/events [N]— Show last N events (default 5)
On-Demand Notifications
/summary— Trigger periodic summary now/latest [album]— Show latest assets from an album (or all)/memory— Trigger "On This Day" memory notification now/random [album]— Send random photo(s) from an album
Asset Browsing
IMPORTANT: All asset commands MUST only search within albums that are tracked by the tracker(s) associated with the bot's target. Never expose assets from untracked albums.
/search <query>— Semantic/smart search via Immich CLIP ("dog on beach", "birthday party")/find <text>— Text search by filename, description/person <name>— Find photos with a specific person/place <location>— Find photos by city/country/location/favorites [album]— Show favorite assets/people— List detected people across albums
Management
/help— Show available commands with descriptions
Tasks
1. Command registry model [ ]
- New entity or config: list of enabled commands per bot
- Admin can enable/disable individual commands per bot
- Default set of commands enabled on bot registration
2. Auto-register commands with Telegram [ ]
- Call
setMyCommandsAPI when commands config changes - Call on bot creation and on config update
- Store command descriptions in i18n (EN/RU based on bot locale setting)
3. Webhook command handler [ ]
- Extend existing webhook handler to route
/commandmessages - Parse command + arguments
- Execute corresponding logic (reuse existing services)
- Return formatted response
4. Implement each command [ ]
/status,/albums,/events— read from DB/summary,/memory,/latest,/random— call watcher/notifier services/search,/favorites,/people— call Immich API via core client/trackers,/targets— read from DB, optional inline keyboard for toggle/help— auto-generated from enabled commands
5. Frontend: command config per bot [ ]
- On telegram-bots page, expandable "Commands" section per bot
- Checkboxes to enable/disable each command
- Bot locale selector (for command descriptions language)
- "Sync Commands" button (calls setMyCommands)
Acceptance Criteria
- Commands registered with Telegram and visible in bot menu
- Each command returns a useful response
- Commands auto-sync when config changes
- Admin can enable/disable commands per bot via UI