This commit is contained in:
Dragon Fire
2021-06-05 21:57:40 -04:00
parent b3a48fe14a
commit e33b34afb6
2 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -58,11 +58,11 @@ module.exports = class CommandDispatcher {
}
const parsedArg = parsed._[i]?.toString();
if (arg.isEmpty(parsedArg, msg, arg)) {
if (arg.default !== null) {
if (arg.default === null) {
return `The "${arg.label || arg.key}" argument is required.`;
} else {
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
continue;
} else {
return `The "${arg.label || arg.key}" argument is required.`;
}
}
const valid = await arg.validate(parsedArg, msg, arg);