Separate args with any whitespace

This commit is contained in:
TheEssem 2021-04-14 16:42:18 -05:00
parent cc82d32840
commit b3d3df2cb7

View file

@ -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) {