mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:24:31 +00:00
fix(telegram): include DM topic thread id in replies (#18586)
This commit is contained in:
@@ -114,7 +114,7 @@ export function resolveTelegramThreadSpec(params: {
|
||||
* Build thread params for Telegram API calls (messages, media).
|
||||
*
|
||||
* IMPORTANT: Thread IDs behave differently based on chat type:
|
||||
* - DMs (private chats): Never send thread_id (threads don't exist)
|
||||
* - DMs (private chats): Include message_thread_id when present (DM topics)
|
||||
* - Forum topics: Skip thread_id=1 (General topic), include others
|
||||
* - Regular groups: Thread IDs are ignored by Telegram
|
||||
*
|
||||
@@ -130,9 +130,8 @@ export function buildTelegramThreadParams(thread?: TelegramThreadSpec | null) {
|
||||
}
|
||||
const normalized = Math.trunc(thread.id);
|
||||
|
||||
// Never send thread_id for DMs (threads don't exist in private chats)
|
||||
if (thread.scope === "dm") {
|
||||
return undefined;
|
||||
return normalized > 0 ? { message_thread_id: normalized } : undefined;
|
||||
}
|
||||
|
||||
// Telegram rejects message_thread_id=1 for General forum topic
|
||||
|
||||
Reference in New Issue
Block a user