-
-
Notifications
You must be signed in to change notification settings - Fork 567
feat: added support for Telegram message thread ID #4158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for specifying Telegram message thread IDs in notifications.
- Introduces a new
messageThreadIdfield across UI, API, and database schema - Updates the Telegram agent to include
message_thread_idin API calls when provided - Adds validation, type definitions, and documentation updates for the new field
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsTelegram.tsx | Added UI field, validation, and form mapping for thread ID |
| src/components/Settings/Notifications/NotificationsTelegram.tsx | Added system settings UI and schema update for thread ID |
| server/routes/user/usersettings.ts | Extended user settings routes to read and write thread ID |
| server/lib/settings.ts | Updated settings interface and default values for thread ID |
| server/lib/notifications/agents/telegram.ts | Included thread ID in message payload when present |
| server/interfaces/api/userSettingsInterfaces.ts | Exposed telegramMessageThreadId in API response |
| server/entity/UserSettings.ts | Added database column for telegramMessageThreadId |
| docs/using-overseerr/notifications/webhooks.md | Documented new template variable for thread ID |
| docs/using-overseerr/notifications/telegram.md | Added documentation for obtaining thread ID |
Comments suppressed due to low confidence (2)
server/routes/user/usersettings.ts:324
- The 'telegramMessageThreadId' value from the request body is assigned without server-side validation or sanitization. It would be safer to validate that this value matches the expected numeric pattern before storing or using it.
telegramMessageThreadId: req.body.telegramMessageThreadId,
server/lib/notifications/agents/telegram.ts:184
- There are no tests covering the new inclusion of 'message_thread_id' in the Telegram payload. Consider adding unit tests to verify that the thread ID is correctly added when provided and omitted when absent.
...(settings.options.messageThreadId
| ), | ||
| telegramMessageThreadId: Yup.string() | ||
| .nullable() | ||
| .matches(/^\d*$/, intl.formatMessage(messages.validationTelegramChatId)), |
Copilot
AI
Jun 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation message for 'telegramMessageThreadId' reuses the chat ID error key and message, which may confuse users. Consider adding a dedicated validation message key (e.g., validationTelegramThreadId) with an appropriate message.
| .matches(/^\d*$/, intl.formatMessage(messages.validationTelegramChatId)), | |
| .matches(/^\d*$/, intl.formatMessage(messages.validationTelegramThreadId)), |
| ), | ||
| messageThreadId: Yup.string() | ||
| .nullable() | ||
| .matches(/^\d*$/, intl.formatMessage(messages.validationChatIdRequired)), |
Copilot
AI
Jun 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This validation for 'messageThreadId' reuses the chat ID error message. You should define a specific validation message for the thread ID (e.g., validationMessageThreadIdRequired) to provide clear feedback.
| .matches(/^\d*$/, intl.formatMessage(messages.validationChatIdRequired)), | |
| .matches(/^\d*$/, intl.formatMessage(messages.validationMessageThreadIdRequired)), |
|
Duplicate #4134 |
Description
This PR adds support for Telegram message thread IDs, allowing notifications to be sent to specific threads/topics within Telegram groups. This feature is particularly useful for organizing different types of notifications in group chats.
Key changes:
messageThreadIdfield to Telegram notification settings in both system and user settingsThe message thread ID is optional and can be configured at both the system level (for all notifications) and user level (for individual user notifications). When configured, notifications will be sent to the specified thread within the Telegram group chat.
Screenshot (if UI-related)
To-Dos
yarn buildyarn i18n:extract