fix(telegram): preserve DM topic threadId in deliveryContext

When receiving messages in Telegram DM topics (Topics in Private Chats),
the threadId was not saved in the session's deliveryContext, causing
replies to go to General chat instead of the topic.

Now we pass threadId to updateLastRoute for DM topics.

Fixes #8891
This commit is contained in:
damaozi
2026-02-05 03:40:46 +08:00
committed by Ayaan Zaidi
parent a4d1af1b11
commit 8860d2ed7f

View File

@@ -637,6 +637,8 @@ export const buildTelegramMessageContext = async ({
channel: "telegram",
to: String(chatId),
accountId: route.accountId,
// Preserve DM topic threadId for replies (fixes #8891)
threadId: dmThreadId != null ? String(dmThreadId) : undefined,
}
: undefined,
onRecordError: (err) => {