mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 19:24:37 +00:00
fix(feishu): preserve explicit target routing hints (#31594) (thanks @liuxiaopai-ai)
This commit is contained in:
@@ -8,18 +8,22 @@ export function resolveFeishuSendTarget(params: {
|
||||
to: string;
|
||||
accountId?: string;
|
||||
}) {
|
||||
const target = params.to.trim();
|
||||
const account = resolveFeishuAccount({ cfg: params.cfg, accountId: params.accountId });
|
||||
if (!account.configured) {
|
||||
throw new Error(`Feishu account "${account.accountId}" not configured`);
|
||||
}
|
||||
const client = createFeishuClient(account);
|
||||
const receiveId = normalizeFeishuTarget(params.to);
|
||||
const receiveId = normalizeFeishuTarget(target);
|
||||
if (!receiveId) {
|
||||
throw new Error(`Invalid Feishu target: ${params.to}`);
|
||||
}
|
||||
// Preserve explicit routing prefixes (chat/group/user/dm/open_id) when present.
|
||||
// normalizeFeishuTarget strips these prefixes, so infer type from the raw target first.
|
||||
const withoutProviderPrefix = target.replace(/^(feishu|lark):/i, "");
|
||||
return {
|
||||
client,
|
||||
receiveId,
|
||||
receiveIdType: resolveReceiveIdType(receiveId),
|
||||
receiveIdType: resolveReceiveIdType(withoutProviderPrefix),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user