mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Fix
This commit is contained in:
@@ -5,6 +5,7 @@ module.exports = class Argument {
|
|||||||
Object.defineProperty(this, 'client', { value: client });
|
Object.defineProperty(this, 'client', { value: client });
|
||||||
|
|
||||||
this.key = options.key.toLowerCase();
|
this.key = options.key.toLowerCase();
|
||||||
|
this.label = options.label;
|
||||||
this.typeID = options.type.toLowerCase();
|
this.typeID = options.type.toLowerCase();
|
||||||
this.min = options.min;
|
this.min = options.min;
|
||||||
this.max = options.max;
|
this.max = options.max;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ module.exports = class CommandDispatcher {
|
|||||||
for (let i = 0; i < command.args.length; i++) {
|
for (let i = 0; i < command.args.length; i++) {
|
||||||
const arg = command.args[i];
|
const arg = command.args[i];
|
||||||
if (arg.infinite) {
|
if (arg.infinite) {
|
||||||
const infinite = parsed._.slice(i);
|
const infinite = parsed._.slice(i).map(j => j.toString());
|
||||||
const parsedArgs = [];
|
const parsedArgs = [];
|
||||||
for (const parsedArg of infinite) {
|
for (const parsedArg of infinite) {
|
||||||
if (arg.isEmpty(parsedArg, msg, arg)) {
|
if (arg.isEmpty(parsedArg, msg, arg)) {
|
||||||
@@ -56,7 +56,7 @@ module.exports = class CommandDispatcher {
|
|||||||
finalResult[arg.key] = parsedArgs;
|
finalResult[arg.key] = parsedArgs;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const parsedArg = parsed._[i];
|
const parsedArg = parsed._[i].toString();
|
||||||
if (arg.isEmpty(parsedArg, msg, arg)) {
|
if (arg.isEmpty(parsedArg, msg, arg)) {
|
||||||
if (arg.default) {
|
if (arg.default) {
|
||||||
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
|
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
|
||||||
|
|||||||
Reference in New Issue
Block a user