create stable command parser

This commit is contained in:
2025-06-25 02:11:17 +02:00
parent dc087c3599
commit 273f5e3674
3 changed files with 13 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
import { commandPrefix } from "..";
/** Helper function to extract arguments from commands */
export default function parseCommandArgs(input: string) {
const a = input.slice(commandPrefix.length);
const sliceLength = a.startsWith('use') ? 2 : 1;
const b = a.trim().split(' ').slice(sliceLength);
return b;
};