type fixes

This commit is contained in:
Erik 2022-07-29 18:57:14 +03:00
parent 8867da5463
commit 60a67a6522
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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