#95 : Replaced : with / for commands

This commit is contained in:
Dennis Postma 2024-09-28 21:26:27 +02:00
parent 46fdb3edb6
commit e8aee51248

View File

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