UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

19 lines (18 loc) • 782 B
import { l as normalizeOptionalString } from "./string-coerce-1VuiLaaR.mjs"; import { n as normalizeCommandBody } from "./commands-registry-normalize-BXXav9x1.mjs"; import "./commands-registry-DbGlcGcR.mjs"; //#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 };