From b3d3df2cb7f22b047a8cae9709ba171421ff1d7a Mon Sep 17 00:00:00 2001 From: TheEssem Date: Wed, 14 Apr 2021 16:42:18 -0500 Subject: [PATCH] Separate args with any whitespace --- events/messageCreate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/messageCreate.js b/events/messageCreate.js index 49b47e7..312b576 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -60,9 +60,9 @@ module.exports = async (client, message) => { const replace = isMention ? `@${client.user.username} ` : prefix; const content = message.cleanContent.substring(replace.length).trim(); const rawContent = message.content.substring(prefix.length).trim(); - const args = content.split(/ +/g); + const args = content.split(/\s+/g); args.shift(); - const command = rawContent.split(/ +/g).shift().toLowerCase(); + const command = rawContent.split(/\s+/g).shift().toLowerCase(); // don't run if message is in a disabled channel if (message.channel.guild) {