mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 02:40:08 +00:00
feat: Add support for file upload components (#1372)
This commit is contained in:
6
deno/payloads/v10/_interactions/modalSubmit.ts
generated
6
deno/payloads/v10/_interactions/modalSubmit.ts
generated
@@ -9,7 +9,6 @@ import type {
|
||||
import type { APIBaseComponent } from '../message.ts';
|
||||
|
||||
export interface APIBaseModalSubmitComponent<T extends ComponentType> extends APIBaseComponent<T> {
|
||||
type: T;
|
||||
custom_id: string;
|
||||
}
|
||||
|
||||
@@ -38,8 +37,13 @@ export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmit
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitComponent<ComponentType.FileUpload> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitFileUploadComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
|
||||
2
deno/payloads/v10/_interactions/responses.ts
generated
2
deno/payloads/v10/_interactions/responses.ts
generated
@@ -2,6 +2,7 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APIFileUploadComponent,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../message.ts';
|
||||
@@ -133,6 +134,7 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APIFileUploadComponent
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
|
||||
28
deno/payloads/v10/message.ts
generated
28
deno/payloads/v10/message.ts
generated
@@ -1027,6 +1027,10 @@ export enum ComponentType {
|
||||
* Container associating a label and description with a component
|
||||
*/
|
||||
Label,
|
||||
/**
|
||||
* Component for uploading files
|
||||
*/
|
||||
FileUpload,
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
@@ -1654,6 +1658,28 @@ export interface APILabelComponent extends APIBaseComponent<ComponentType.Label>
|
||||
component: APIComponentInLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#file-upload}
|
||||
*/
|
||||
export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.FileUpload> {
|
||||
/**
|
||||
* Id for the file upload; max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* Minimum number of items that must be uploaded (defaults to 1); min 0, max 10
|
||||
*/
|
||||
min_values?: number;
|
||||
/**
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal (defaults to `true`)
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object}
|
||||
*/
|
||||
@@ -1734,7 +1760,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
6
deno/payloads/v9/_interactions/modalSubmit.ts
generated
6
deno/payloads/v9/_interactions/modalSubmit.ts
generated
@@ -9,7 +9,6 @@ import type {
|
||||
import type { APIBaseComponent } from '../message.ts';
|
||||
|
||||
export interface APIBaseModalSubmitComponent<T extends ComponentType> extends APIBaseComponent<T> {
|
||||
type: T;
|
||||
custom_id: string;
|
||||
}
|
||||
|
||||
@@ -38,8 +37,13 @@ export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmit
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitComponent<ComponentType.FileUpload> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitFileUploadComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
|
||||
2
deno/payloads/v9/_interactions/responses.ts
generated
2
deno/payloads/v9/_interactions/responses.ts
generated
@@ -2,6 +2,7 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9.ts';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APIFileUploadComponent,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../message.ts';
|
||||
@@ -133,6 +134,7 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APIFileUploadComponent
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
|
||||
28
deno/payloads/v9/message.ts
generated
28
deno/payloads/v9/message.ts
generated
@@ -1022,6 +1022,10 @@ export enum ComponentType {
|
||||
* Container associating a label and description with a component
|
||||
*/
|
||||
Label,
|
||||
/**
|
||||
* Component for uploading files
|
||||
*/
|
||||
FileUpload,
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
@@ -1649,6 +1653,28 @@ export interface APILabelComponent extends APIBaseComponent<ComponentType.Label>
|
||||
component: APIComponentInLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#file-upload}
|
||||
*/
|
||||
export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.FileUpload> {
|
||||
/**
|
||||
* Id for the file upload; max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* Minimum number of items that must be uploaded (defaults to 1); min 0, max 10
|
||||
*/
|
||||
min_values?: number;
|
||||
/**
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal (defaults to `true`)
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object}
|
||||
*/
|
||||
@@ -1729,7 +1755,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
@@ -9,7 +9,6 @@ import type {
|
||||
import type { APIBaseComponent } from '../message';
|
||||
|
||||
export interface APIBaseModalSubmitComponent<T extends ComponentType> extends APIBaseComponent<T> {
|
||||
type: T;
|
||||
custom_id: string;
|
||||
}
|
||||
|
||||
@@ -38,8 +37,13 @@ export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmit
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitComponent<ComponentType.FileUpload> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitFileUploadComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APIFileUploadComponent,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../message';
|
||||
@@ -133,6 +134,7 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APIFileUploadComponent
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
|
||||
@@ -1027,6 +1027,10 @@ export enum ComponentType {
|
||||
* Container associating a label and description with a component
|
||||
*/
|
||||
Label,
|
||||
/**
|
||||
* Component for uploading files
|
||||
*/
|
||||
FileUpload,
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
@@ -1654,6 +1658,28 @@ export interface APILabelComponent extends APIBaseComponent<ComponentType.Label>
|
||||
component: APIComponentInLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#file-upload}
|
||||
*/
|
||||
export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.FileUpload> {
|
||||
/**
|
||||
* Id for the file upload; max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* Minimum number of items that must be uploaded (defaults to 1); min 0, max 10
|
||||
*/
|
||||
min_values?: number;
|
||||
/**
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal (defaults to `true`)
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object}
|
||||
*/
|
||||
@@ -1734,7 +1760,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
@@ -9,7 +9,6 @@ import type {
|
||||
import type { APIBaseComponent } from '../message';
|
||||
|
||||
export interface APIBaseModalSubmitComponent<T extends ComponentType> extends APIBaseComponent<T> {
|
||||
type: T;
|
||||
custom_id: string;
|
||||
}
|
||||
|
||||
@@ -38,8 +37,13 @@ export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmit
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitComponent<ComponentType.FileUpload> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitFileUploadComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APIFileUploadComponent,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../message';
|
||||
@@ -133,6 +134,7 @@ export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APIFileUploadComponent
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
|
||||
@@ -1022,6 +1022,10 @@ export enum ComponentType {
|
||||
* Container associating a label and description with a component
|
||||
*/
|
||||
Label,
|
||||
/**
|
||||
* Component for uploading files
|
||||
*/
|
||||
FileUpload,
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
@@ -1649,6 +1653,28 @@ export interface APILabelComponent extends APIBaseComponent<ComponentType.Label>
|
||||
component: APIComponentInLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#file-upload}
|
||||
*/
|
||||
export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.FileUpload> {
|
||||
/**
|
||||
* Id for the file upload; max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* Minimum number of items that must be uploaded (defaults to 1); min 0, max 10
|
||||
*/
|
||||
min_values?: number;
|
||||
/**
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal (defaults to `true`)
|
||||
*/
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-snapshot-object}
|
||||
*/
|
||||
@@ -1729,7 +1755,7 @@ export type APIComponentInModalActionRow = APITextInputComponent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#label-label-child-components}
|
||||
*/
|
||||
export type APIComponentInLabel = APISelectMenuComponent | APITextInputComponent;
|
||||
export type APIComponentInLabel = APIFileUploadComponent | APISelectMenuComponent | APITextInputComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#section}
|
||||
|
||||
Reference in New Issue
Block a user