diff --git a/deno/payloads/v10/_interactions/modalSubmit.ts b/deno/payloads/v10/_interactions/modalSubmit.ts index f3341945..856bee36 100644 --- a/deno/payloads/v10/_interactions/modalSubmit.ts +++ b/deno/payloads/v10/_interactions/modalSubmit.ts @@ -40,10 +40,25 @@ export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitCom values: string[]; } +export interface APIModalSubmitRadioGroupComponent extends APIBaseModalSubmitComponent { + value?: string; +} + +export interface APIModalSubmitCheckboxGroupComponent extends APIBaseModalSubmitComponent { + values: string[]; +} + +export interface APIModalSubmitCheckboxComponent extends APIBaseModalSubmitComponent { + value: boolean; +} + export type ModalSubmitComponent = | APIModalSubmitChannelSelectComponent + | APIModalSubmitCheckboxComponent + | APIModalSubmitCheckboxGroupComponent | APIModalSubmitFileUploadComponent | APIModalSubmitMentionableSelectComponent + | APIModalSubmitRadioGroupComponent | APIModalSubmitRoleSelectComponent | APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent diff --git a/deno/payloads/v10/message.ts b/deno/payloads/v10/message.ts index d8f472d1..3a8189bb 100644 --- a/deno/payloads/v10/message.ts +++ b/deno/payloads/v10/message.ts @@ -1034,6 +1034,24 @@ export enum ComponentType { * Component for uploading files */ FileUpload, + /** + * Single-choice set of radio group option + * + * @unstable This component is not publicly released and is currently in preview. + */ + RadioGroup = 21, + /** + * Multi-select group of checkboxes + * + * @unstable This component is not publicly released and is currently in preview. + */ + CheckboxGroup, + /** + * Single checkbox for binary choice + * + * @unstable This component is not publicly released and is currently in preview. + */ + Checkbox, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // /** @@ -1690,11 +1708,134 @@ export interface APIFileUploadComponent extends APIBaseComponent { + /** + * Id for the radio group; max 100 characters + */ + custom_id: string; + /** + * 2-10 radio group options within the radio group component + */ + options: APIRadioGroupOption[]; + /** + * Whether the radio group requires selection before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#radio-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APIRadioGroupOption { + /** + * The value of the radio group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the radio group option; max 100 characters + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupComponent extends APIBaseComponent { + /** + * Id for the checkbox group; max 100 characters + */ + custom_id: string; + /** + * Checkbox group option within the component; max 10 + */ + options: APICheckboxGroupOption[]; + /** + * Minimum number of checkbox that can be selected; min 0, max 10 + * + * @defaultValue `1` + */ + min_values?: number; + /** + * Maximum number of checkbox that can be selected; min 1, max 10 + * + * @defaultValue {@link APICheckboxGroupComponent.options} length + */ + max_values?: number; + /** + * Whether selecting within the group is required before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupOption { + /** + * The value of the checkbox group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the checkbox group option; max 100 characters; + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxComponent extends APIBaseComponent { + /** + * Id for the checkbox; max 100 characters + */ + custom_id: string; + /** + * Whether this checkbox is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object} */ @@ -1775,7 +1916,13 @@ export type APIComponentInModalActionRow = APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components} */ -export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent; +export type APIComponentInLabel = + | APICheckboxComponent + | APICheckboxGroupComponent + | APIFileUploadComponent + | APIRadioGroupComponent + | APISelectMenuComponent + | APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#section} diff --git a/deno/payloads/v9/_interactions/modalSubmit.ts b/deno/payloads/v9/_interactions/modalSubmit.ts index f3341945..856bee36 100644 --- a/deno/payloads/v9/_interactions/modalSubmit.ts +++ b/deno/payloads/v9/_interactions/modalSubmit.ts @@ -40,10 +40,25 @@ export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitCom values: string[]; } +export interface APIModalSubmitRadioGroupComponent extends APIBaseModalSubmitComponent { + value?: string; +} + +export interface APIModalSubmitCheckboxGroupComponent extends APIBaseModalSubmitComponent { + values: string[]; +} + +export interface APIModalSubmitCheckboxComponent extends APIBaseModalSubmitComponent { + value: boolean; +} + export type ModalSubmitComponent = | APIModalSubmitChannelSelectComponent + | APIModalSubmitCheckboxComponent + | APIModalSubmitCheckboxGroupComponent | APIModalSubmitFileUploadComponent | APIModalSubmitMentionableSelectComponent + | APIModalSubmitRadioGroupComponent | APIModalSubmitRoleSelectComponent | APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent diff --git a/deno/payloads/v9/message.ts b/deno/payloads/v9/message.ts index 3c525782..dbbe083a 100644 --- a/deno/payloads/v9/message.ts +++ b/deno/payloads/v9/message.ts @@ -1029,6 +1029,24 @@ export enum ComponentType { * Component for uploading files */ FileUpload, + /** + * Single-choice set of radio group option + * + * @unstable This component is not publicly released and is currently in preview. + */ + RadioGroup = 21, + /** + * Multi-select group of checkboxes + * + * @unstable This component is not publicly released and is currently in preview. + */ + CheckboxGroup, + /** + * Single checkbox for binary choice + * + * @unstable This component is not publicly released and is currently in preview. + */ + Checkbox, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // /** @@ -1685,11 +1703,134 @@ export interface APIFileUploadComponent extends APIBaseComponent { + /** + * Id for the radio group; max 100 characters + */ + custom_id: string; + /** + * 2-10 radio group options within the radio group component + */ + options: APIRadioGroupOption[]; + /** + * Whether the radio group requires selection before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#radio-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APIRadioGroupOption { + /** + * The value of the radio group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the radio group option; max 100 characters + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupComponent extends APIBaseComponent { + /** + * Id for the checkbox group; max 100 characters + */ + custom_id: string; + /** + * Checkbox group option within the component; max 10 + */ + options: APICheckboxGroupOption[]; + /** + * Minimum number of checkbox that can be selected; min 0, max 10 + * + * @defaultValue `1` + */ + min_values?: number; + /** + * Maximum number of checkbox that can be selected; min 1, max 10 + * + * @defaultValue {@link APICheckboxGroupComponent.options} length + */ + max_values?: number; + /** + * Whether selecting within the group is required before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupOption { + /** + * The value of the checkbox group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the checkbox group option; max 100 characters; + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxComponent extends APIBaseComponent { + /** + * Id for the checkbox; max 100 characters + */ + custom_id: string; + /** + * Whether this checkbox is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object} */ @@ -1770,7 +1911,13 @@ export type APIComponentInModalActionRow = APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components} */ -export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent; +export type APIComponentInLabel = + | APICheckboxComponent + | APICheckboxGroupComponent + | APIFileUploadComponent + | APIRadioGroupComponent + | APISelectMenuComponent + | APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#section} diff --git a/payloads/v10/_interactions/modalSubmit.ts b/payloads/v10/_interactions/modalSubmit.ts index b2b1b90d..84c9e89c 100644 --- a/payloads/v10/_interactions/modalSubmit.ts +++ b/payloads/v10/_interactions/modalSubmit.ts @@ -40,10 +40,25 @@ export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitCom values: string[]; } +export interface APIModalSubmitRadioGroupComponent extends APIBaseModalSubmitComponent { + value?: string; +} + +export interface APIModalSubmitCheckboxGroupComponent extends APIBaseModalSubmitComponent { + values: string[]; +} + +export interface APIModalSubmitCheckboxComponent extends APIBaseModalSubmitComponent { + value: boolean; +} + export type ModalSubmitComponent = | APIModalSubmitChannelSelectComponent + | APIModalSubmitCheckboxComponent + | APIModalSubmitCheckboxGroupComponent | APIModalSubmitFileUploadComponent | APIModalSubmitMentionableSelectComponent + | APIModalSubmitRadioGroupComponent | APIModalSubmitRoleSelectComponent | APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent diff --git a/payloads/v10/message.ts b/payloads/v10/message.ts index b44c8045..dff2ad34 100644 --- a/payloads/v10/message.ts +++ b/payloads/v10/message.ts @@ -1034,6 +1034,24 @@ export enum ComponentType { * Component for uploading files */ FileUpload, + /** + * Single-choice set of radio group option + * + * @unstable This component is not publicly released and is currently in preview. + */ + RadioGroup = 21, + /** + * Multi-select group of checkboxes + * + * @unstable This component is not publicly released and is currently in preview. + */ + CheckboxGroup, + /** + * Single checkbox for binary choice + * + * @unstable This component is not publicly released and is currently in preview. + */ + Checkbox, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // /** @@ -1690,11 +1708,134 @@ export interface APIFileUploadComponent extends APIBaseComponent { + /** + * Id for the radio group; max 100 characters + */ + custom_id: string; + /** + * 2-10 radio group options within the radio group component + */ + options: APIRadioGroupOption[]; + /** + * Whether the radio group requires selection before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#radio-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APIRadioGroupOption { + /** + * The value of the radio group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the radio group option; max 100 characters + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupComponent extends APIBaseComponent { + /** + * Id for the checkbox group; max 100 characters + */ + custom_id: string; + /** + * Checkbox group option within the component; max 10 + */ + options: APICheckboxGroupOption[]; + /** + * Minimum number of checkbox that can be selected; min 0, max 10 + * + * @defaultValue `1` + */ + min_values?: number; + /** + * Maximum number of checkbox that can be selected; min 1, max 10 + * + * @defaultValue {@link APICheckboxGroupComponent.options} length + */ + max_values?: number; + /** + * Whether selecting within the group is required before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupOption { + /** + * The value of the checkbox group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the checkbox group option; max 100 characters; + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxComponent extends APIBaseComponent { + /** + * Id for the checkbox; max 100 characters + */ + custom_id: string; + /** + * Whether this checkbox is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object} */ @@ -1775,7 +1916,13 @@ export type APIComponentInModalActionRow = APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components} */ -export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent; +export type APIComponentInLabel = + | APICheckboxComponent + | APICheckboxGroupComponent + | APIFileUploadComponent + | APIRadioGroupComponent + | APISelectMenuComponent + | APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#section} diff --git a/payloads/v9/_interactions/modalSubmit.ts b/payloads/v9/_interactions/modalSubmit.ts index b2b1b90d..84c9e89c 100644 --- a/payloads/v9/_interactions/modalSubmit.ts +++ b/payloads/v9/_interactions/modalSubmit.ts @@ -40,10 +40,25 @@ export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitCom values: string[]; } +export interface APIModalSubmitRadioGroupComponent extends APIBaseModalSubmitComponent { + value?: string; +} + +export interface APIModalSubmitCheckboxGroupComponent extends APIBaseModalSubmitComponent { + values: string[]; +} + +export interface APIModalSubmitCheckboxComponent extends APIBaseModalSubmitComponent { + value: boolean; +} + export type ModalSubmitComponent = | APIModalSubmitChannelSelectComponent + | APIModalSubmitCheckboxComponent + | APIModalSubmitCheckboxGroupComponent | APIModalSubmitFileUploadComponent | APIModalSubmitMentionableSelectComponent + | APIModalSubmitRadioGroupComponent | APIModalSubmitRoleSelectComponent | APIModalSubmitStringSelectComponent | APIModalSubmitTextInputComponent diff --git a/payloads/v9/message.ts b/payloads/v9/message.ts index 7729ff99..c5463d22 100644 --- a/payloads/v9/message.ts +++ b/payloads/v9/message.ts @@ -1029,6 +1029,24 @@ export enum ComponentType { * Component for uploading files */ FileUpload, + /** + * Single-choice set of radio group option + * + * @unstable This component is not publicly released and is currently in preview. + */ + RadioGroup = 21, + /** + * Multi-select group of checkboxes + * + * @unstable This component is not publicly released and is currently in preview. + */ + CheckboxGroup, + /** + * Single checkbox for binary choice + * + * @unstable This component is not publicly released and is currently in preview. + */ + Checkbox, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // /** @@ -1685,11 +1703,134 @@ export interface APIFileUploadComponent extends APIBaseComponent { + /** + * Id for the radio group; max 100 characters + */ + custom_id: string; + /** + * 2-10 radio group options within the radio group component + */ + options: APIRadioGroupOption[]; + /** + * Whether the radio group requires selection before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#radio-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APIRadioGroupOption { + /** + * The value of the radio group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the radio group option; max 100 characters + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupComponent extends APIBaseComponent { + /** + * Id for the checkbox group; max 100 characters + */ + custom_id: string; + /** + * Checkbox group option within the component; max 10 + */ + options: APICheckboxGroupOption[]; + /** + * Minimum number of checkbox that can be selected; min 0, max 10 + * + * @defaultValue `1` + */ + min_values?: number; + /** + * Maximum number of checkbox that can be selected; min 1, max 10 + * + * @defaultValue {@link APICheckboxGroupComponent.options} length + */ + max_values?: number; + /** + * Whether selecting within the group is required before submitting the modal + * + * @defaultValue `true` + */ + required?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox-group-option-structure} + * @unstable This feature is not publicly released and is currently in preview. + */ +export interface APICheckboxGroupOption { + /** + * The value of the checkbox group option; max 100 characters + */ + value: string; + /** + * The label text; max 100 characters + */ + label: string; + /** + * An optional description for the checkbox group option; max 100 characters; + */ + description?: string; + /** + * Whether this option is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + +/** + * @see {@link https://discord.com/developers/docs/components/reference#checkbox} + * @unstable This component is not publicly released and is currently in preview. + */ +export interface APICheckboxComponent extends APIBaseComponent { + /** + * Id for the checkbox; max 100 characters + */ + custom_id: string; + /** + * Whether this checkbox is selected by default + * + * @defaultValue `false` + */ + default?: boolean; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object} */ @@ -1770,7 +1911,13 @@ export type APIComponentInModalActionRow = APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components} */ -export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent; +export type APIComponentInLabel = + | APICheckboxComponent + | APICheckboxGroupComponent + | APIFileUploadComponent + | APIRadioGroupComponent + | APISelectMenuComponent + | APITextInputComponent; /** * @see {@link https://discord.com/developers/docs/components/reference#section}