openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
19 lines (18 loc) • 779 B
JavaScript
import { c as normalizeOptionalString } from "./string-coerce-mnp54Vah.js";
import { r as normalizeCommandBody } from "./commands-registry-normalize-BwQxckuw.js";
import "./commands-registry-wvHlpYBK.js";
//#region src/auto-reply/reply/btw-command.ts
const BTW_COMMAND_RE = /^\/btw(?::|\s|$)/i;
function isBtwRequestText(text, options) {
if (!text) return false;
const normalized = normalizeCommandBody(text, options).trim();
return BTW_COMMAND_RE.test(normalized);
}
function extractBtwQuestion(text, options) {
if (!text) return null;
const match = normalizeCommandBody(text, options).trim().match(/^\/btw(?:\s+(.*))?$/i);
if (!match) return null;
return normalizeOptionalString(match[1]) ?? "";
}
//#endregion
export { isBtwRequestText as n, extractBtwQuestion as t };