Skip to content

Commit

Permalink
Ignore duplicate spaces between command args (#485)
Browse files Browse the repository at this point in the history
* Filter out empty strings from command args

* Use trim and regex instead of filter
  • Loading branch information
noahm authored and abalabahaha committed May 29, 2019
1 parent 56ffea8 commit ae2fac1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/command/CommandClient.js
Expand Up @@ -146,7 +146,7 @@ class CommandClient extends Client {

msg.command = false;
if((!this.commandOptions.ignoreSelf || msg.author.id !== this.user.id) && (!this.commandOptions.ignoreBots || !msg.author.bot) && (msg.prefix = this.checkPrefix(msg))) {
const args = msg.content.replace(/<@!/g, "<@").substring(msg.prefix.length).split(" ");
const args = msg.content.replace(/<@!/g, "<@").substring(msg.prefix.length).trim().split(/\s+/g);
const label = args.shift();
const command = this.resolveCommand(label);
if(command !== undefined) {
Expand Down

0 comments on commit ae2fac1

Please sign in to comment.