Fixed error thrown when getArgs called on a command with no arguments
This commit is contained in:
parent
edb7836e55
commit
5c34ed7286
@ -38,7 +38,7 @@ class ChatService extends BaseService {
|
|||||||
|
|
||||||
public getArgs(command: string, message: string): string[] | undefined {
|
public getArgs(command: string, message: string): string[] | undefined {
|
||||||
if (!this.isCommand(message, command)) return
|
if (!this.isCommand(message, command)) return
|
||||||
return message.split(`/${command} `)[1].split(' ')
|
return message.slice(`/${command} `.length).split(' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user