Skip to content

ModalInputComponent ​

classe · Source

Represents one of Discord's v14 modal-only input components. This includes file uploads, radio groups, checkbox groups, and checkboxes.

Extends: BaseMessageComponent

Properties ​

type ​

nullable

type: MessageComponentType

The type of this component Source

data ​

data: MessageComponentOptions

The data for this component Source

id ​

readonly

id: number

The id of this component Source

Methods ​

setFileTypes ​

setFileTypes(types: FileUploadType | string): ModalInputComponent

Sets the allowed file types for a file upload component. Parameters

NameTypeDescription
typesFileUploadType | stringThe allowed file types

Returns: ModalInputComponent — This component

js
// Only allow images and dot-prefixed extensions, up to 10 entries
new ModalInputComponent({ type: 'FILE_UPLOAD' })
  .setFileTypes('image', '.png', '.jpg')

Source

Unofficial software. Not affiliated with or supported by Discord.