feat(ApplicationCommand): add min_length and max_length for string option (v13) (#8217)

This commit is contained in:
MateoDeveloper
2022-07-06 13:39:55 -05:00
committed by GitHub
parent f457cdd2de
commit a93f4b1ba2
2 changed files with 34 additions and 3 deletions

21
typings/index.d.ts vendored
View File

@@ -3877,7 +3877,7 @@ export interface ApplicationCommandChoicesData extends Omit<BaseApplicationComma
}
export interface ApplicationCommandChoicesOption extends Omit<BaseApplicationCommandOptionsData, 'autocomplete'> {
type: Exclude<CommandOptionChoiceResolvableType, ApplicationCommandOptionTypes>;
type: CommandOptionChoiceResolvableType;
choices?: ApplicationCommandOptionChoiceData[];
autocomplete?: false;
}
@@ -3890,12 +3890,26 @@ export interface ApplicationCommandNumericOptionData extends ApplicationCommandC
max_value?: number;
}
export interface ApplicationCommandStringOptionData extends ApplicationCommandChoicesData {
type: ApplicationCommandOptionTypes.STRING;
minLength?: number;
min_length?: number;
maxLength?: number;
max_length?: number;
}
export interface ApplicationCommandNumericOption extends ApplicationCommandChoicesOption {
type: Exclude<CommandOptionNumericResolvableType, ApplicationCommandOptionTypes>;
type: CommandOptionNumericResolvableType;
minValue?: number;
maxValue?: number;
}
export interface ApplicationCommandStringOption extends ApplicationCommandChoicesOption {
type: ApplicationCommandOptionTypes.STRING;
minLength?: number;
maxLength?: number;
}
export interface ApplicationCommandSubGroupData extends Omit<BaseApplicationCommandOptionsData, 'required'> {
type: 'SUB_COMMAND_GROUP' | ApplicationCommandOptionTypes.SUB_COMMAND_GROUP;
options?: ApplicationCommandSubCommandData[];
@@ -3914,6 +3928,7 @@ export interface ApplicationCommandSubCommandData extends Omit<BaseApplicationCo
| ApplicationCommandChannelOptionData
| ApplicationCommandAutocompleteOption
| ApplicationCommandNumericOptionData
| ApplicationCommandStringOptionData
)[];
}
@@ -3937,6 +3952,7 @@ export type ApplicationCommandOptionData =
| ApplicationCommandChoicesData
| ApplicationCommandAutocompleteOption
| ApplicationCommandNumericOptionData
| ApplicationCommandStringOptionData
| ApplicationCommandSubCommandData;
export type ApplicationCommandOption =
@@ -3945,6 +3961,7 @@ export type ApplicationCommandOption =
| ApplicationCommandChannelOption
| ApplicationCommandChoicesOption
| ApplicationCommandNumericOption
| ApplicationCommandStringOption
| ApplicationCommandSubCommand;
export interface ApplicationCommandOptionChoiceData {