openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 984 B
JavaScript
import { r as logVerbose } from "./globals-GTrXU4s9.js";
//#region src/auto-reply/reply/commands-crestodian.ts
const handleCrestodianCommand = async (params, allowTextCommands) => {
if (!allowTextCommands) return null;
const { extractCrestodianRescueMessage, runCrestodianRescueMessage } = await import("./crestodian/rescue-message.js");
if (extractCrestodianRescueMessage(params.command.commandBodyNormalized) === null) return null;
if (!params.command.isAuthorizedSender) {
logVerbose(`Ignoring /crestodian from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
return { shouldContinue: false };
}
return {
shouldContinue: false,
reply: { text: await runCrestodianRescueMessage({
cfg: params.cfg,
command: params.command,
commandBody: params.command.commandBodyNormalized,
agentId: params.agentId,
isGroup: params.isGroup
}) ?? "Crestodian did not find a rescue request." }
};
};
//#endregion
export { handleCrestodianCommand as t };