export interface SlashCommand {
	name: string;
	args: string[];
}

/** 解析用户输入的斜杠命令，非斜杠命令返回 null */
export function parseSlashCommand(raw: string): SlashCommand | null {
	const trimmed = raw.trim();
	if (!trimmed.startsWith('/')) return null;
	const parts = trimmed.slice(1).split(/\s+/);
	return { name: parts[0].toLowerCase(), args: parts.slice(1) };
}
