mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
17 lines
538 B
TypeScript
17 lines
538 B
TypeScript
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;
|
|
};
|
|
|
|
export function parseCheerArgs(input: string) {
|
|
const a = input.slice(commandPrefix.length);
|
|
const sliceLength = a.startsWith('testcheer') ? 2 : 0;
|
|
const b = a.trim().split(' ').slice(sliceLength);
|
|
return b;
|
|
};
|