type fixes
This commit is contained in:
parent
8867da5463
commit
60a67a6522
@ -49,7 +49,11 @@ class CommandOption implements ICommandOption {
|
|||||||
this.name = def.name;
|
this.name = def.name;
|
||||||
this.aliases = def.aliases || [];
|
this.aliases = def.aliases || [];
|
||||||
|
|
||||||
this.options = def.options || [];
|
this.options = [];
|
||||||
|
for (const opt of def.options || []) {
|
||||||
|
if (opt instanceof CommandOption) this.options.push(opt);
|
||||||
|
else this.options.push(new CommandOption(opt));
|
||||||
|
}
|
||||||
this.choices = def.choices || [];
|
this.choices = def.choices || [];
|
||||||
|
|
||||||
this.strict = def.strict || false;
|
this.strict = def.strict || false;
|
||||||
|
@ -72,7 +72,7 @@ type CommandOptionDefinition = {
|
|||||||
name: string;
|
name: string;
|
||||||
aliases?: string[];
|
aliases?: string[];
|
||||||
// eslint-disable-next-line no-use-before-define
|
// eslint-disable-next-line no-use-before-define
|
||||||
options?: CommandOption[];
|
options?: (CommandOption|CommandOptionDefinition)[];
|
||||||
type?: OptionType;
|
type?: OptionType;
|
||||||
strict?: boolean
|
strict?: boolean
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user