Skip to content

feat(telegram): treat reply to bot message as mention in group chats#2975

Open
Jlan45 wants to merge 2 commits into
sipeed:mainfrom
Jlan45:main
Open

feat(telegram): treat reply to bot message as mention in group chats#2975
Jlan45 wants to merge 2 commits into
sipeed:mainfrom
Jlan45:main

Conversation

@Jlan45
Copy link
Copy Markdown

@Jlan45 Jlan45 commented May 30, 2026

📝 Description

Telegram group chats now treat replying to a bot message as equivalent to @mentioning the bot. When mention_only: true is configured, users can trigger bot responses by either @mentioning or replying to the bot. Previously, only explicit @mentions were recognized.

🗣️ Type of Change

✨ New feature (non-breaking change which adds functionality)

🤖 AI Code Generation

🛠️ Mostly AI-generated (AI draft, Human verified/modified)

🔗 Related Issue

None

📚 Technical Context (Skip for Docs)

  • Reference URL:
  • Reasoning:

🧪 Test Environment

  • Hardware: PVE LXC
  • OS: Ubuntu 22.04
  • Model/Provider: Minimax-M2.7
  • Channels: Telegram

📸 Evidence (Optional)

Click to view Logs/Screenshots image

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 30, 2026

CLA assistant check
All committers have signed the CLA.

@afjcjsbx
Copy link
Copy Markdown
Collaborator

Hi, the new reply shortcut bypasses the filter that currently prevents processing bot commands addressed to another bot.

In telegram.go, any reply to a message from our bot forces isMentioned = true. Consequently, a message like /new@otherbot would still be processed if it's a reply to our bot, even though the standard behavior correctly considers that command "not ours" in normal scenarios—as demonstrated by the "command for another bot" test in telegram_group_command_filter_test.go.

In groups with multiple bots, this could cause our bot to erroneously react to commands explicitly intended for someone else. I would suggest preserving that filter within the ReplyToMessage path as well, or at least adding a regression test covering the reply + /cmd@otherbot edge case.

@Jlan45
Copy link
Copy Markdown
Author

Jlan45 commented May 31, 2026

OK, I'll add the test func

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants