mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 23:00:46 +00:00
29 lines
777 B
TypeScript
29 lines
777 B
TypeScript
import {
|
|
isAbortRequestText,
|
|
isBtwRequestText,
|
|
} from "openclaw/plugin-sdk/command-primitives-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;
|
|
}
|