diff --git a/deno/payloads/v8/_interactions/_applicationCommands/chatInput.ts b/deno/payloads/v8/_interactions/_applicationCommands/chatInput.ts index 7b94cd4c..bd64163d 100644 --- a/deno/payloads/v8/_interactions/_applicationCommands/chatInput.ts +++ b/deno/payloads/v8/_interactions/_applicationCommands/chatInput.ts @@ -26,11 +26,14 @@ interface APIApplicationCommandOptionBase { * https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */ export type APIApplicationCommandOption = - | APIApplicationCommandArgumentOptions + | APIApplicationCommandStringArgumentOptions | APIApplicationCommandSubCommandOptions | APIApplicationCommandOptionBase | APIApplicationCommandChannelOptions - | APIApplicationCommandAutocompleteOptions; + | APIApplicationCommandOptionBase + | APIApplicationCommandNumberArgumentOptions + | APIApplicationCommandStringAutocompleteOptions + | APIApplicationCommandNumericAutocompleteOptions; /** * This type is exported as a way to make it stricter for you when you're writing your commands @@ -48,6 +51,31 @@ export interface APIApplicationCommandSubCommandOptions extends Omit { + type: ApplicationCommandOptionType.String; + choices?: APIApplicationCommandOptionChoice[]; +} + +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array, + * but they can have a `choices`, a `min_value` and `max_value` field + */ +export interface APIApplicationCommandNumberArgumentOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + choices?: APIApplicationCommandOptionChoice[]; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted + */ + max_value?: number; + autocomplete?: false; +} export interface APIApplicationCommandArgumentOptions extends Omit { type: @@ -64,15 +92,32 @@ export interface APIApplicationCommandArgumentOptions * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, * but they can a `autocomplete` field where it's set to `true` */ -export interface APIApplicationCommandAutocompleteOptions +export interface APIApplicationCommandStringAutocompleteOptions extends Omit { - type: - | ApplicationCommandOptionType.String - | ApplicationCommandOptionType.Integer - | ApplicationCommandOptionType.Number; + type: ApplicationCommandOptionType.String; autocomplete: true; } +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, + * but they can a `autocomplete` field where it's set to `true` + */ +export interface APIApplicationCommandNumericAutocompleteOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + autocomplete: true; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + max_value?: number; +} + /** * This type is exported as a way to make it stricter for you when you're writing your commands * diff --git a/deno/payloads/v9/_interactions/_applicationCommands/chatInput.ts b/deno/payloads/v9/_interactions/_applicationCommands/chatInput.ts index ad9eca09..adceb7c0 100644 --- a/deno/payloads/v9/_interactions/_applicationCommands/chatInput.ts +++ b/deno/payloads/v9/_interactions/_applicationCommands/chatInput.ts @@ -26,11 +26,14 @@ interface APIApplicationCommandOptionBase { * https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */ export type APIApplicationCommandOption = - | APIApplicationCommandArgumentOptions + | APIApplicationCommandStringArgumentOptions | APIApplicationCommandSubCommandOptions | APIApplicationCommandOptionBase | APIApplicationCommandChannelOptions - | APIApplicationCommandAutocompleteOptions; + | APIApplicationCommandOptionBase + | APIApplicationCommandNumberArgumentOptions + | APIApplicationCommandStringAutocompleteOptions + | APIApplicationCommandNumericAutocompleteOptions; /** * This type is exported as a way to make it stricter for you when you're writing your commands @@ -48,7 +51,7 @@ export interface APIApplicationCommandSubCommandOptions extends Omit { type: | ApplicationCommandOptionType.String @@ -64,15 +67,53 @@ export interface APIApplicationCommandArgumentOptions * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, * but they can a `autocomplete` field where it's set to `true` */ -export interface APIApplicationCommandAutocompleteOptions +export interface APIApplicationCommandStringAutocompleteOptions extends Omit { - type: - | ApplicationCommandOptionType.String - | ApplicationCommandOptionType.Integer - | ApplicationCommandOptionType.Number; + type: ApplicationCommandOptionType.String; autocomplete: true; } +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, + * but they can a `autocomplete` field where it's set to `true` + */ +export interface APIApplicationCommandNumericAutocompleteOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + autocomplete: true; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + max_value?: number; +} + +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array, + * but they can have a `choices`, a `min_value` and `max_value` field + */ +export interface APIApplicationCommandNumberArgumentOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + choices?: APIApplicationCommandOptionChoice[]; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted + */ + max_value?: number; + autocomplete?: false; +} + /** * This type is exported as a way to make it stricter for you when you're writing your commands * diff --git a/payloads/v8/_interactions/_applicationCommands/chatInput.ts b/payloads/v8/_interactions/_applicationCommands/chatInput.ts index e01990d2..9da1baa8 100644 --- a/payloads/v8/_interactions/_applicationCommands/chatInput.ts +++ b/payloads/v8/_interactions/_applicationCommands/chatInput.ts @@ -26,11 +26,14 @@ interface APIApplicationCommandOptionBase { * https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */ export type APIApplicationCommandOption = - | APIApplicationCommandArgumentOptions + | APIApplicationCommandStringArgumentOptions | APIApplicationCommandSubCommandOptions | APIApplicationCommandOptionBase | APIApplicationCommandChannelOptions - | APIApplicationCommandAutocompleteOptions; + | APIApplicationCommandOptionBase + | APIApplicationCommandNumberArgumentOptions + | APIApplicationCommandStringAutocompleteOptions + | APIApplicationCommandNumericAutocompleteOptions; /** * This type is exported as a way to make it stricter for you when you're writing your commands @@ -48,6 +51,31 @@ export interface APIApplicationCommandSubCommandOptions extends Omit { + type: ApplicationCommandOptionType.String; + choices?: APIApplicationCommandOptionChoice[]; +} + +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array, + * but they can have a `choices`, a `min_value` and `max_value` field + */ +export interface APIApplicationCommandNumberArgumentOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + choices?: APIApplicationCommandOptionChoice[]; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted + */ + max_value?: number; + autocomplete?: false; +} export interface APIApplicationCommandArgumentOptions extends Omit { type: @@ -64,15 +92,32 @@ export interface APIApplicationCommandArgumentOptions * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, * but they can a `autocomplete` field where it's set to `true` */ -export interface APIApplicationCommandAutocompleteOptions +export interface APIApplicationCommandStringAutocompleteOptions extends Omit { - type: - | ApplicationCommandOptionType.String - | ApplicationCommandOptionType.Integer - | ApplicationCommandOptionType.Number; + type: ApplicationCommandOptionType.String; autocomplete: true; } +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, + * but they can a `autocomplete` field where it's set to `true` + */ +export interface APIApplicationCommandNumericAutocompleteOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + autocomplete: true; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + max_value?: number; +} + /** * This type is exported as a way to make it stricter for you when you're writing your commands * diff --git a/payloads/v9/_interactions/_applicationCommands/chatInput.ts b/payloads/v9/_interactions/_applicationCommands/chatInput.ts index f26602ac..08a6b281 100644 --- a/payloads/v9/_interactions/_applicationCommands/chatInput.ts +++ b/payloads/v9/_interactions/_applicationCommands/chatInput.ts @@ -26,11 +26,14 @@ interface APIApplicationCommandOptionBase { * https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */ export type APIApplicationCommandOption = - | APIApplicationCommandArgumentOptions + | APIApplicationCommandStringArgumentOptions | APIApplicationCommandSubCommandOptions | APIApplicationCommandOptionBase | APIApplicationCommandChannelOptions - | APIApplicationCommandAutocompleteOptions; + | APIApplicationCommandOptionBase + | APIApplicationCommandNumberArgumentOptions + | APIApplicationCommandStringAutocompleteOptions + | APIApplicationCommandNumericAutocompleteOptions; /** * This type is exported as a way to make it stricter for you when you're writing your commands @@ -48,7 +51,7 @@ export interface APIApplicationCommandSubCommandOptions extends Omit { type: | ApplicationCommandOptionType.String @@ -64,15 +67,53 @@ export interface APIApplicationCommandArgumentOptions * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, * but they can a `autocomplete` field where it's set to `true` */ -export interface APIApplicationCommandAutocompleteOptions +export interface APIApplicationCommandStringAutocompleteOptions extends Omit { - type: - | ApplicationCommandOptionType.String - | ApplicationCommandOptionType.Integer - | ApplicationCommandOptionType.Number; + type: ApplicationCommandOptionType.String; autocomplete: true; } +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array, + * but they can a `autocomplete` field where it's set to `true` + */ +export interface APIApplicationCommandNumericAutocompleteOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + autocomplete: true; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + max_value?: number; +} + +/** + * This type is exported as a way to make it stricter for you when you're writing your commands + * + * In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array, + * but they can have a `choices`, a `min_value` and `max_value` field + */ +export interface APIApplicationCommandNumberArgumentOptions + extends Omit { + type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number; + choices?: APIApplicationCommandOptionChoice[]; + /** + * If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. + */ + min_value?: number; + /** + * if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted + */ + max_value?: number; + autocomplete?: false; +} + /** * This type is exported as a way to make it stricter for you when you're writing your commands *