Skip to content

feat(telegram): support group bot mentions and replies - #1

Open
me2seeks wants to merge 2 commits into
M4n5ter:mainfrom
me2seeks:main
Open

me2seeks wants to merge 2 commits into
M4n5ter:mainfrom
me2seeks:main

Conversation

@me2seeks

Copy link
Copy Markdown
  • add allowed_bot_users support to Telegram config parsing and the launcher-generated managed config template
  • allow group and supergroup messages to target the bot by explicit mention or by replying to the current bot
  • preserve the existing group chat allowlist behavior and cover the new Telegram handling with TypeScript tests

Details

This change updates Telegram group message handling so the gateway can respond to approved bot senders and to user replies to the current bot, instead of only accepting direct mentions.
It keeps the existing group allowlist model in place:

  • group chats must still be present in allowed_chats
  • human senders must still be present in allowed_users
  • bot senders must now be present in allowed_bot_users
    When a group message passes allowlist checks, it is now treated as targeting the current bot when either of the following is true:
  • the message explicitly mentions the bot
  • the message replies to a message previously sent by the current bot
    The change also updates the managed launcher template so newly initialized Telegram configs include allowed_bot_users = [] by default.

Testing

  • cargo test -p opencode-gateway-launcher
  • bun test packages/opencode-plugin/src/config/gateway.test.ts packages/opencode-plugin/src/telegram/*.test.ts packages/opencode-plugin/src/runtime/tool-activity.test.ts

Add Telegram bot allowlisting for group and supergroup messages so the gateway can accept mentions from approved bots.

Keep the existing group chat allowlist checks, treat replies to the current bot as bot-targeted messages alongside explicit mentions, and update the launcher-generated config template to include allowed_bot_users.

Cover the new mention and reply behavior with TypeScript tests to preserve the replyContext prompt flow.
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.

1 participant