#12758: fix(telegram): drop message_thread_id=1 for DM chats
Cluster:
Messaging Platform Improvements
## Summary
Fixes #12625 — cron job announcements fail in Telegram DMs with "message thread not found" error.
- `buildTelegramThreadParams()` now drops `message_thread_id=1` for DM chats (not just forum groups)
- Changed scope check from `=== "forum"` to `!== "none"` so both forum and DM scopes correctly omit the thread parameter
- Updated test expectations and added edge case coverage for `scope: "none"`
## Root Cause
Commit `19b8416a8` introduced a regression where `message_thread_id=1` is sent for DM chats. Telegram's API rejects this for DMs with "message thread not found". The fix in `buildTelegramThreadParams` only stripped thread_id=1 for `scope === "forum"`, missing the `"dm"` case.
## Test plan
- [x] `pnpm test src/telegram/bot/helpers.test.ts` — 25/25 tests pass
- [x] `pnpm build` — type check passes
- [x] `pnpm check` — no lint/format issues in changed files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Most Similar PRs
#17952: fix(telegram): support message_thread_id for DM topics
by timbrinded · 2026-02-16
82.5%
#17968: fix(telegram): restore DM topic thread ids with send-path fallback
by Leonccaa · 2026-02-16
79.9%
#14443: fix(telegram): skip General topic thread ID for all chat types (#14...
by lailoo · 2026-02-12
79.4%
#12936: fix(telegram): omit message_thread_id for private DM chats
by omair445 · 2026-02-09
76.6%
#7261: fix(telegram): preserve DM topic thread id for outbound media
by ViffyGwaanl · 2026-02-02
75.5%
#19050: fix(telegram): skip message_thread_id for private chats to prevent ...
by Limitless2023 · 2026-02-17
75.4%
#19213: Telegram: preserve DM topic thread in direct replies
by Kemalau · 2026-02-17
75.3%
#3368: fix: sessions navigation, DM thread display, and DM thread delivery...
by Lukavyi · 2026-01-28
75.1%
#17432: fix(telegram): skip message_thread_id for private chats in sticker/...
by clawinho · 2026-02-15
73.4%
#13580: fix(telegram): skip updateLastRoute when dmScope isolates DM sessions
by lailoo · 2026-02-10
71.9%