mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix lint
This commit is contained in:
+28
-16
@@ -54,10 +54,13 @@ module.exports = class CommandDispatcher {
|
|||||||
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
|
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
return { command, error: stripIndents`
|
return {
|
||||||
The "${arg.label || arg.key}" argument is required.
|
command,
|
||||||
${arg.invalidText}
|
error: stripIndents`
|
||||||
` };
|
The "${arg.label || arg.key}" argument is required.
|
||||||
|
${arg.invalidText}
|
||||||
|
`
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,10 +70,13 @@ module.exports = class CommandDispatcher {
|
|||||||
if (typeof valid === 'string') {
|
if (typeof valid === 'string') {
|
||||||
return { command, error: valid };
|
return { command, error: valid };
|
||||||
} else if (!valid) {
|
} else if (!valid) {
|
||||||
return { command, error: stripIndents`
|
return {
|
||||||
An invalid value was provided for one of the "${arg.label || arg.key}" arguments.
|
command,
|
||||||
${arg.invalidText}
|
error: stripIndents`
|
||||||
` };
|
An invalid value was provided for one of the "${arg.label || arg.key}" arguments.
|
||||||
|
${arg.invalidText}
|
||||||
|
`
|
||||||
|
};
|
||||||
}
|
}
|
||||||
parsedArgs.push(await arg.parse(parsedArg, msg, arg));
|
parsedArgs.push(await arg.parse(parsedArg, msg, arg));
|
||||||
}
|
}
|
||||||
@@ -80,10 +86,13 @@ module.exports = class CommandDispatcher {
|
|||||||
const parsedArg = i + 1 === command.args.length ? parsed._.slice(i).join(' ') : parsed._[i]?.toString();
|
const parsedArg = i + 1 === command.args.length ? parsed._.slice(i).join(' ') : parsed._[i]?.toString();
|
||||||
if (arg.isEmpty(parsedArg, msg, arg)) {
|
if (arg.isEmpty(parsedArg, msg, arg)) {
|
||||||
if (arg.default === null) {
|
if (arg.default === null) {
|
||||||
return { command, error: stripIndents`
|
return {
|
||||||
The "${arg.label || arg.key}" argument is required.
|
command,
|
||||||
${arg.invalidText}
|
error: stripIndents`
|
||||||
` };
|
The "${arg.label || arg.key}" argument is required.
|
||||||
|
${arg.invalidText}
|
||||||
|
`
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
|
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
|
||||||
continue;
|
continue;
|
||||||
@@ -93,10 +102,13 @@ module.exports = class CommandDispatcher {
|
|||||||
if (typeof valid === 'string') {
|
if (typeof valid === 'string') {
|
||||||
return { command, error: valid };
|
return { command, error: valid };
|
||||||
} else if (!valid) {
|
} else if (!valid) {
|
||||||
return { command, error: stripIndents`
|
return {
|
||||||
An invalid value was provided for the "${arg.label || arg.key}" argument.
|
command,
|
||||||
${arg.invalidText}
|
error: stripIndents`
|
||||||
` };
|
An invalid value was provided for the "${arg.label || arg.key}" argument.
|
||||||
|
${arg.invalidText}
|
||||||
|
`
|
||||||
|
};
|
||||||
}
|
}
|
||||||
finalResult[arg.key] = await arg.parse(parsedArg, msg, arg);
|
finalResult[arg.key] = await arg.parse(parsedArg, msg, arg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user