#6457: fix(telegram): register commands for group scope + preserve topic thread params
channel: telegram
Cluster:
Telegram Command Fixes
### Problem
- Telegram forum topics can show "This command is not available" for slash commands unless bot commands are registered for group scope.
- Some auth/diagnostic command responses could be sent without `message_thread_id` and land in the General topic.
### Fix
- Register Telegram bot commands with both default scope and `all_group_chats` scope via `setMyCommands`.
- Ensure auth/diagnostic `sendMessage` responses in `resolveTelegramCommandAuth` include correct forum topic thread params (omitting General topic id=1 as required).
- Ensure plugin-command "Command not found" message also preserves topic thread params.
### Tests
- Updated `src/telegram/bot-native-commands.test.ts` to assert `setMyCommands` is called with `all_group_chats` scope.
- Ran: `pnpm vitest run src/telegram/bot-native-commands.test.ts`
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates Telegram native command handling in two ways: (1) it registers bot commands for both the default scope and the `all_group_chats` scope to avoid Telegram forum-topic clients showing “This command is not available”, and (2) it preserves forum topic routing (via `message_thread_id`, omitting General topic id=1) for auth/diagnostic and “Command not found” replies so responses stay in the invoking topic.
The changes are localized to `src/telegram/bot-native-commands.ts`, with a small test update in `src/telegram/bot-native-commands.test.ts` to cover the added group-scope registration behavior.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge, with one functional follow-up needed to keep command scopes consistent when disabling commands.
- Changes are small and targeted (adding thread params to a few sendMessage calls and registering commands in an additional Telegram scope). Main risk is behavioral inconsistency: group-scoped commands may remain registered if native commands are later disabled, since the disable path only clears the default scope.
- src/telegram/bot-native-commands.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#11132: fix(telegram): guard command menu overflow and doctor warnings
by kiminbean · 2026-02-07
83.9%
#7261: fix(telegram): preserve DM topic thread id for outbound media
by ViffyGwaanl · 2026-02-02
82.8%
#19213: Telegram: preserve DM topic thread in direct replies
by Kemalau · 2026-02-17
82.5%
#14443: fix(telegram): skip General topic thread ID for all chat types (#14...
by lailoo · 2026-02-12
82.2%
#11240: Fix #10875: Clear Telegram commands before registering to prevent d...
by divol89 · 2026-02-07
81.6%
#3368: fix: sessions navigation, DM thread display, and DM thread delivery...
by Lukavyi · 2026-01-28
81.5%
#11920: Telegram: create forum topics via message tool (thread-create)
by larsderidder · 2026-02-08
81.1%
#12936: fix(telegram): omit message_thread_id for private DM chats
by omair445 · 2026-02-09
80.9%
#6192: Telegram: fix DM Topics thread routing
by ViffyGwaanl · 2026-02-01
80.3%
#14991: fix(telegram): deduplicate skill commands by skillName to prevent B...
by smartchainark · 2026-02-12
79.4%