mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-16 20:40:45 +00:00
16 lines
444 B
TypeScript
16 lines
444 B
TypeScript
export function resolveThreadBindingConversationIdFromBindingId(params: {
|
|
accountId: string;
|
|
bindingId?: string;
|
|
}): string | undefined {
|
|
const bindingId = params.bindingId?.trim();
|
|
if (!bindingId) {
|
|
return undefined;
|
|
}
|
|
const prefix = `${params.accountId}:`;
|
|
if (!bindingId.startsWith(prefix)) {
|
|
return undefined;
|
|
}
|
|
const conversationId = bindingId.slice(prefix.length).trim();
|
|
return conversationId || undefined;
|
|
}
|