This commit is contained in:
Dragon Fire
2021-06-05 21:52:10 -04:00
parent 8b89475a33
commit c7bb7936a1
2 changed files with 9 additions and 9 deletions
+8 -8
View File
@@ -5,17 +5,17 @@ module.exports = class Argument {
Object.defineProperty(this, 'client', { value: client });
this.key = options.key.toLowerCase();
this.label = options.label;
this.label = options.label || null;
this.typeID = options.type.toLowerCase();
this.min = options.min;
this.max = options.max;
this.oneOf = options.oneOf;
this.default = options.default;
this.min = options.min || null;
this.max = options.max || null;
this.oneOf = options.oneOf || null;
this.default = options.default || null;
this.infinite = options.infinite || false;
this.avatarSize = options.avatarSize || 2048;
this.validator = options.validate;
this.parser = options.parse;
this.emptyChecker = options.isEmpty;
this.validator = options.validate || null;
this.parser = options.parse || null;
this.emptyChecker = options.isEmpty || null;
}
get type() {
+1 -1
View File
@@ -58,7 +58,7 @@ module.exports = class CommandDispatcher {
}
const parsedArg = parsed._[i]?.toString();
if (arg.isEmpty(parsedArg, msg, arg)) {
if (arg.default) {
if (arg.default === null) {
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
continue;
} else {