This commit is contained in:
Dragon Fire
2021-06-05 18:46:14 -04:00
parent f3e70dc79d
commit 7b6be3159e
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -5,6 +5,7 @@ module.exports = class Argument {
Object.defineProperty(this, 'client', { value: client });
this.key = options.key.toLowerCase();
this.label = options.label;
this.typeID = options.type.toLowerCase();
this.min = options.min;
this.max = options.max;
+2 -2
View File
@@ -38,7 +38,7 @@ module.exports = class CommandDispatcher {
for (let i = 0; i < command.args.length; i++) {
const arg = command.args[i];
if (arg.infinite) {
const infinite = parsed._.slice(i);
const infinite = parsed._.slice(i).map(j => j.toString());
const parsedArgs = [];
for (const parsedArg of infinite) {
if (arg.isEmpty(parsedArg, msg, arg)) {
@@ -56,7 +56,7 @@ module.exports = class CommandDispatcher {
finalResult[arg.key] = parsedArgs;
break;
}
const parsedArg = parsed._[i];
const parsedArg = parsed._[i].toString();
if (arg.isEmpty(parsedArg, msg, arg)) {
if (arg.default) {
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;