fix: relax slash command parsing

This commit is contained in:
Peter Steinberger
2026-01-08 03:22:14 +01:00
parent 36b443f4f3
commit ad5c87c193
18 changed files with 226 additions and 31 deletions

View File

@@ -16,8 +16,11 @@ export function parseActivationCommand(raw?: string): {
if (!raw) return { hasCommand: false };
const trimmed = raw.trim();
if (!trimmed) return { hasCommand: false };
const match = trimmed.match(/^\/activation(?:\s+([a-zA-Z]+))?\s*$/i);
const match = trimmed.match(
/^\/activation(?:\s*:\s*([a-zA-Z]+)?\s*|\s+([a-zA-Z]+)\s*)?$/i,
);
if (!match) return { hasCommand: false };
const mode = normalizeGroupActivation(match[1]);
const token = match[1] ?? match[2];
const mode = normalizeGroupActivation(token);
return { hasCommand: true, mode };
}