mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-09-17 08:47:24 +00:00
feat: add file_types for file uploads (#1708)
This commit is contained in:
+5
-2
@@ -2,8 +2,11 @@ import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
export type FileUploadType = 'audio' | 'image' | 'video' | `.${string}`;
|
||||
|
||||
export interface APIApplicationCommandAttachmentOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment> {
|
||||
file_types?: FileUploadType[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Attachment,
|
||||
|
||||
Generated
+13
-1
@@ -5,7 +5,12 @@ import type { _NonNullableFields } from '../../utils/internals.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIChannel, APIThreadChannel, APIThreadMember, ChannelType } from './channel.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions.ts';
|
||||
import type {
|
||||
APIInteractionDataResolved,
|
||||
APIMessageInteraction,
|
||||
APIMessageInteractionMetadata,
|
||||
FileUploadType,
|
||||
} from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
@@ -1890,6 +1895,13 @@ export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.F
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Allowed file types that can be uploaded; max 10
|
||||
*
|
||||
* If only dot-prefixed extensions are specified, you must also include `.jpg` for image uploads
|
||||
* and both `.mp4` and `.mov` for video uploads because of mobile platform limitations.
|
||||
*/
|
||||
file_types?: FileUploadType[];
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal
|
||||
*
|
||||
|
||||
+5
-2
@@ -2,8 +2,11 @@ import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
export type FileUploadType = 'audio' | 'image' | 'video' | `.${string}`;
|
||||
|
||||
export interface APIApplicationCommandAttachmentOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment> {
|
||||
file_types?: FileUploadType[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Attachment,
|
||||
|
||||
Generated
+13
-1
@@ -5,7 +5,12 @@ import type { _NonNullableFields } from '../../utils/internals.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIChannel, APIThreadChannel, APIThreadMember, ChannelType } from './channel.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions.ts';
|
||||
import type {
|
||||
APIInteractionDataResolved,
|
||||
APIMessageInteraction,
|
||||
APIMessageInteractionMetadata,
|
||||
FileUploadType,
|
||||
} from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
@@ -1885,6 +1890,13 @@ export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.F
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Allowed file types that can be uploaded; max 10
|
||||
*
|
||||
* If only dot-prefixed extensions are specified, you must also include `.jpg` for image uploads
|
||||
* and both `.mp4` and `.mov` for video uploads because of mobile platform limitations.
|
||||
*/
|
||||
file_types?: FileUploadType[];
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal
|
||||
*
|
||||
|
||||
@@ -2,8 +2,11 @@ import type { Snowflake } from '../../../../../globals';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
export type FileUploadType = 'audio' | 'image' | 'video' | `.${string}`;
|
||||
|
||||
export interface APIApplicationCommandAttachmentOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment> {
|
||||
file_types?: FileUploadType[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Attachment,
|
||||
|
||||
+13
-1
@@ -5,7 +5,12 @@ import type { _NonNullableFields } from '../../utils/internals';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIChannel, APIThreadChannel, APIThreadMember, ChannelType } from './channel';
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
|
||||
import type {
|
||||
APIInteractionDataResolved,
|
||||
APIMessageInteraction,
|
||||
APIMessageInteractionMetadata,
|
||||
FileUploadType,
|
||||
} from './interactions';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
@@ -1890,6 +1895,13 @@ export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.F
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Allowed file types that can be uploaded; max 10
|
||||
*
|
||||
* If only dot-prefixed extensions are specified, you must also include `.jpg` for image uploads
|
||||
* and both `.mp4` and `.mov` for video uploads because of mobile platform limitations.
|
||||
*/
|
||||
file_types?: FileUploadType[];
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal
|
||||
*
|
||||
|
||||
@@ -2,8 +2,11 @@ import type { Snowflake } from '../../../../../globals';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
|
||||
import type { ApplicationCommandOptionType } from './shared';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
export type FileUploadType = 'audio' | 'image' | 'video' | `.${string}`;
|
||||
|
||||
export interface APIApplicationCommandAttachmentOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment> {
|
||||
file_types?: FileUploadType[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Attachment,
|
||||
|
||||
+13
-1
@@ -5,7 +5,12 @@ import type { _NonNullableFields } from '../../utils/internals';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIChannel, APIThreadChannel, APIThreadMember, ChannelType } from './channel';
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
|
||||
import type {
|
||||
APIInteractionDataResolved,
|
||||
APIMessageInteraction,
|
||||
APIMessageInteractionMetadata,
|
||||
FileUploadType,
|
||||
} from './interactions';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
@@ -1885,6 +1890,13 @@ export interface APIFileUploadComponent extends APIBaseComponent<ComponentType.F
|
||||
* Maximum number of items that can be uploaded (defaults to 1); max 10
|
||||
*/
|
||||
max_values?: number;
|
||||
/**
|
||||
* Allowed file types that can be uploaded; max 10
|
||||
*
|
||||
* If only dot-prefixed extensions are specified, you must also include `.jpg` for image uploads
|
||||
* and both `.mp4` and `.mov` for video uploads because of mobile platform limitations.
|
||||
*/
|
||||
file_types?: FileUploadType[];
|
||||
/**
|
||||
* Whether the file upload requires files to be uploaded before submitting the modal
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user