diff --git a/discord-bot-core/Command.js b/discord-bot-core/Command.js index 0dbe88b..233c7b4 100644 --- a/discord-bot-core/Command.js +++ b/discord-bot-core/Command.js @@ -7,6 +7,10 @@ module.exports = class Command { this.admin = admin; this.invoke = invoke; - this.expectedParamCount = this.syntax.split(/ +/).length - 1; + const params = this.syntax.split(/ +/); + const optionalParams = params.filter(x => x.match(/^\[.+\]$/)); + + this.maxParamCount = params.length - 1; + this.expectedParamCount = this.maxParamCount - optionalParams.length; } }; \ No newline at end of file