feat(channels): add group chat support for Telegram

- Add GroupGate class for group access control with three policies:
  disabled (default), allowlist, and open
- Implement mention gating: bot only responds when @mentioned or replied to
  in groups (configurable per-group)
- Extend Envelope type with isGroup, isMentioned, isReplyToBot fields
- Update TelegramAdapter to detect group context and mentions
- Add comprehensive documentation for group chat setup and troubleshooting

This enables using Qwen Code bots in Telegram groups with fine-grained
access control and mention-based activation to prevent noise.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-25 02:04:27 +00:00
parent 8753245b5f
commit 90236465d3
9 changed files with 228 additions and 17 deletions

View file

@ -99,6 +99,10 @@ export const startCommand: CommandModule<object, { name: string }> = {
cwd: (rawConfig['cwd'] as string) || process.cwd(),
approvalMode: rawConfig['approvalMode'] as string | undefined,
instructions: rawConfig['instructions'] as string | undefined,
groupPolicy:
(rawConfig['groupPolicy'] as ChannelConfig['groupPolicy']) ||
'disabled',
groups: (rawConfig['groups'] as ChannelConfig['groups']) || {},
};
const cliEntryPath = findCliEntryPath();