← Back to PRs

#12758: fix(telegram): drop message_thread_id=1 for DM chats

by yukihamada open 2026-02-09 16:29 View on GitHub →
## 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