fix: require slash for control commands

This commit is contained in:
Peter Steinberger
2026-01-06 07:05:08 +01:00
parent 7d896b5f67
commit b5c604b7b7
6 changed files with 41 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ export function parseSendPolicyCommand(raw?: string): {
if (!raw) return { hasCommand: false };
const trimmed = raw.trim();
if (!trimmed) return { hasCommand: false };
const match = trimmed.match(/^\/?send\b(?:\s+([a-zA-Z]+))?/i);
const match = trimmed.match(/^\/send\b(?:\s+([a-zA-Z]+))?/i);
if (!match) return { hasCommand: false };
const token = match[1]?.trim().toLowerCase();
if (!token) return { hasCommand: true };