Files
openclaw/extensions/feishu/src/sequential-key.ts
Nimrod Gutman 4b4ec4dbc2 fix(feishu): route /btw through out-of-band lanes (#64324)
* fix(feishu): route /btw through out-of-band lanes

* fix(feishu): bound btw out-of-band lanes

* fix: route feishu btw out-of-band (#64324) (thanks @ngutman)
2026-04-10 17:48:15 +03:00

26 lines
759 B
TypeScript

import { isAbortRequestText, isBtwRequestText } from "openclaw/plugin-sdk/reply-runtime";
import { parseFeishuMessageEvent, type FeishuMessageEvent } from "./bot.js";
export function getFeishuSequentialKey(params: {
accountId: string;
event: FeishuMessageEvent;
botOpenId?: string;
botName?: string;
}): string {
const { accountId, event, botOpenId, botName } = params;
const chatId = event.message.chat_id?.trim() || "unknown";
const baseKey = `feishu:${accountId}:${chatId}`;
const parsed = parseFeishuMessageEvent(event, botOpenId, botName);
const text = parsed.content.trim();
if (isAbortRequestText(text)) {
return `${baseKey}:control`;
}
if (isBtwRequestText(text)) {
return `${baseKey}:btw`;
}
return baseKey;
}