feat: add group/channel support for Telegram bot

- Add TELEGRAM_GROUP_IDS configuration setting to enable optional group/channel filtering
- Add _is_group_enabled() authorization check to all command handlers
- Add group/channel authorization check to message_handler
- All handlers now verify both user authorization and group authorization
- If TELEGRAM_GROUP_IDS is not configured, bot accepts messages from any group
- If TELEGRAM_GROUP_IDS is configured, bot only processes messages from those groups

This enables the bot to be used in group chats and channels with Topics/Threads support.
This commit is contained in:
Daniel Wagner
2026-07-26 12:26:57 +10:00
parent a3ca696546
commit 669b57a317
3 changed files with 42 additions and 6 deletions
+1
View File
@@ -11,6 +11,7 @@ class Settings(BaseSettings):
# Telegram
telegram_bot_token: str = ""
telegram_allowed_user_ids: list[int] = []
telegram_group_ids: list[int] = []
# LLM (OpenAI-compatible)
openai_api_key: str = ""