fix: unblock control commands during active runs
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
listChatCommandsForConfig,
|
||||
normalizeCommandBody,
|
||||
} from "./commands-registry.js";
|
||||
import { isAbortTrigger } from "./reply/abort.js";
|
||||
|
||||
export function hasControlCommand(
|
||||
text?: string,
|
||||
@@ -31,3 +32,16 @@ export function hasControlCommand(
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isControlCommandMessage(
|
||||
text?: string,
|
||||
cfg?: ClawdbotConfig,
|
||||
options?: CommandNormalizeOptions,
|
||||
): boolean {
|
||||
if (!text) return false;
|
||||
const trimmed = text.trim();
|
||||
if (!trimmed) return false;
|
||||
if (hasControlCommand(trimmed, cfg, options)) return true;
|
||||
const normalized = normalizeCommandBody(trimmed, options).trim().toLowerCase();
|
||||
return isAbortTrigger(normalized);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user