1
0
forked from noxious/server
This commit is contained in:
2024-08-20 01:50:05 +02:00
parent 706107ba4d
commit cb90e0cdf8
4 changed files with 56 additions and 19 deletions

12
src/utilities/Chat.ts Normal file
View File

@ -0,0 +1,12 @@
export function isCommand(message: string, command?: string) {
if (command) {
return message.startsWith(`:${command} `)
}
return message.startsWith(':')
}
export function getArgs(command: string, message: string): string[] | undefined
{
if (!isCommand(message, command)) return
return message.split(`:${command} `)[1].split(' ')
}