mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:47:39 +00:00
fix: handle forum/topics in Telegram DM thread routing (#17980)
resolveTelegramThreadSpec now checks isForum in the non-group path. DMs with forum/topics enabled return scope 'forum' so each topic gets its own session, while plain DM threads keep scope 'dm'.
This commit is contained in:
@@ -101,13 +101,15 @@ export function resolveTelegramThreadSpec(params: {
|
||||
scope: params.isForum ? "forum" : "none",
|
||||
};
|
||||
}
|
||||
if (params.messageThreadId == null) {
|
||||
return { scope: "dm" };
|
||||
// DM with forum/topics enabled — treat like a forum, not a flat DM
|
||||
if (params.isForum && params.messageThreadId != null) {
|
||||
return { id: params.messageThreadId, scope: "forum" };
|
||||
}
|
||||
return {
|
||||
id: params.messageThreadId,
|
||||
scope: "dm",
|
||||
};
|
||||
// Preserve thread ID for non-forum DM threads (session routing, #8891)
|
||||
if (params.messageThreadId != null) {
|
||||
return { id: params.messageThreadId, scope: "dm" };
|
||||
}
|
||||
return { scope: "dm" };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user