feat: add require_mention option for Telegram group chats - #2000
Conversation
Add support for respond_to_mentions_only behavior in Telegram groups:
- New config option telegram.require_mention (via env TELEGRAM_REQUIRE_MENTION)
- Bot fetches its own username on connect for mention checking
- In group chats, when enabled, only responds when @mentioned
- DMs are not affected (always respond)
Usage in config.yaml:
telegram:
require_mention: true
Or via env:
TELEGRAM_REQUIRE_MENTION=true
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) SummaryThis PR adds a ArchitectureTwo changes: Issues🔴 Critical: Duplicate of existing functionalityThe Telegram adapter already has a complete
The PR adds duplicate code:
🟡 Moderate: New mention check is less completeThe new
🟢 Useful: Config.py YAML bridgeThe Suggestions
Cross-file ImpactTouches AssessmentRequest changes — The implementation is largely a duplicate of existing functionality. Keep the config.py YAML bridge (useful), but remove the redundant telegram.py changes and instead verify that the existing |
Summary
Add support for mention-based response in Telegram group chats. When enabled, the bot will only respond in groups when explicitly @mentioned, preventing noisy conversations when multiple bots are present.
Changes
Configuration
config.yaml:
Environment variable:
Behavior
Use Case
This feature is useful when running multiple AI agents (e.g., Hermes + OpenClaw) in the same Telegram group - users can control which bot responds by @mentioning the specific one they want.