fix(telegram): use group allowlist for native command auth in groups#30272
fix(telegram): use group allowlist for native command auth in groups#30272pushkarsingh32 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Native Telegram slash commands in groups incorrectly checked the DM allowlist (allowFrom) instead of the group allowlist (groupAllowFrom). This caused authorized group members to be rejected with "You are not authorized" when they weren't in the DM allowlist. Use effectiveGroupAllow (already resolved from groupAllowFrom and per-group/topic overrides) for group contexts, keeping DM allowlist logic only for direct messages. Fixes openclaw#30234
Greptile SummaryThis PR fixes a bug where native Telegram slash commands in group chats were incorrectly using the DM allowlist (
Confidence Score: 5/5
Last reviewed commit: 63e5644 |
|
Thanks for the PR! This duplicates #29175, which was submitted first with the same group allowlist fix for native command auth. Closing in favor of the earlier submission. This is an AI-assisted triage review. If we got this wrong, feel free to reopen or start a new PR — happy to revisit. |
Summary
Root cause:
resolveTelegramCommandAuthalways usednormalizeDmAllowFromWithStore(DM allowlist) for the final sender authorization, even in group contexts. Users ingroupAllowFrombut not inallowFromwere rejected.Fix: Use
effectiveGroupAllow(already resolved fromgroupAllowFromand per-group/topic overrides) for group contexts. Keep DM allowlist logic only for direct messages.Changes
src/telegram/bot-native-commands.ts: Branch auth logic based onisGroup— useeffectiveGroupAllowfor groups,normalizeDmAllowFromWithStorefor DMsTest plan
groupAllowFrom: [userId]but no top-levelallowFrom/status) in the groupFixes #30234