split string by whitespace (\s+) instead of ' '

This commit is contained in:
Erik 2022-11-29 19:18:37 +02:00
parent a0e5b7fa3a
commit 67bb6309b8
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -102,7 +102,7 @@ class ModmailClient extends Client {
const roles = member.roles.cache.map((r) => r.id); const roles = member.roles.cache.map((r) => r.id);
if (!roles.some((r) => this._options.staffRoles.includes(r)) && !member.hasPermission('ADMINISTRATOR')) return; if (!roles.some((r) => this._options.staffRoles.includes(r)) && !member.hasPermission('ADMINISTRATOR')) return;
const [ rawCommand, ...args ] = content.split(' '); const [ rawCommand, ...args ] = content.split(/\s+/u);
const commandName = rawCommand.substring(prefix.length); const commandName = rawCommand.substring(prefix.length);
const command = this.registry.find(commandName); const command = this.registry.find(commandName);
if (!command) return; if (!command) return;