Skip to main content

Component

Documentation


Documentation / @discordeno/bot / Component

Interface: Component

Defined in: bot/src/transformers/types.ts:512

Properties

accentColor?

optional accentColor: number

Defined in: bot/src/transformers/types.ts:572

Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF


accessory?

optional accessory: Component

Defined in: bot/src/transformers/types.ts:554

A thumbnail or a button component, with a future possibility of adding more compatible components


channelTypes?

optional channelTypes: ChannelTypes[]

Defined in: bot/src/transformers/types.ts:532

List of channel types to include in a channel select menu options list


components?

optional components: Component[]

Defined in: bot/src/transformers/types.ts:546

a list of child components


content?

optional content: string

Defined in: bot/src/transformers/types.ts:556

Text that will be displayed similar to a message


customId?

optional customId: string

Defined in: bot/src/transformers/types.ts:516

a developer-defined identifier for the component, max 100 characters


defaultValues?

optional defaultValues: DiscordComponentDefaultValue[]

Defined in: bot/src/transformers/types.ts:548

List of default values for auto-populated select menu components; number of default values must be in the range defined by min_values and max_values


description?

optional description: string

Defined in: bot/src/transformers/types.ts:558

Alt text for the media


disabled?

optional disabled: boolean

Defined in: bot/src/transformers/types.ts:520

whether the component is disabled, default false


divider?

optional divider: boolean

Defined in: bot/src/transformers/types.ts:564

Whether a visual divider should be displayed in the component. Defaults to true


emoji?

optional emoji: Pick<Partial<Emoji>, "id" | "name" | "animated">

Defined in: bot/src/transformers/types.ts:528

Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis.


file?

optional file: UnfurledMediaItem

Defined in: bot/src/transformers/types.ts:568

This unfurled media item is unique in that it only supports attachment references using the attachment://<filename> syntax


id?

optional id: number

Defined in: bot/src/transformers/types.ts:552

Optional identifier for component


items?

optional items: MediaGalleryItem[]

Defined in: bot/src/transformers/types.ts:562

1 to 10 media gallery items


label?

optional label: string

Defined in: bot/src/transformers/types.ts:524

text that appears on the button (max 80 characters)


maxLength?

optional maxLength: number

Defined in: bot/src/transformers/types.ts:544

The maximum input length for a text input. Between 1-4000.


maxValues?

optional maxValues: number

Defined in: bot/src/transformers/types.ts:540

The maximum number of items that can be selected. Default 1. Between 1-25.


media?

optional media: UnfurledMediaItem

Defined in: bot/src/transformers/types.ts:570

This unfurled media item is unique in that it only supports attachment references using the attachment://<filename> syntax


minLength?

optional minLength: number

Defined in: bot/src/transformers/types.ts:542

The minimum input length for a text input. Between 0-4000.


minValues?

optional minValues: number

Defined in: bot/src/transformers/types.ts:538

The minimum number of items that must be selected. Default 1. Between 1-25.


name?

optional name: string

Defined in: bot/src/transformers/types.ts:574

The name of the file. This field is ignored and provided by the API as part of the response


options?

optional options: SelectOption[]

Defined in: bot/src/transformers/types.ts:534

The choices! Maximum of 25 items.


placeholder?

optional placeholder: string

Defined in: bot/src/transformers/types.ts:536

A custom placeholder text if nothing is selected. Maximum 150 characters.


required?

optional required: boolean

Defined in: bot/src/transformers/types.ts:518

whether this component is required to be filled, default true


size?

optional size: number

Defined in: bot/src/transformers/types.ts:576

The size of the file in bytes. This field is ignored and provided by the API as part of the response


skuId?

optional skuId: bigint

Defined in: bot/src/transformers/types.ts:550

Identifier for a purchasable SKU, only available when using premium-style buttons


spacing?

optional spacing: SeparatorSpacingSize

Defined in: bot/src/transformers/types.ts:566

Size of separator padding — 1 for small padding, 2 for large padding. Defaults to 1


spoiler?

optional spoiler: boolean

Defined in: bot/src/transformers/types.ts:560

Whether the thumbnail should be a spoiler (or blurred out). Defaults to false


style?

optional style: ButtonStyles | TextStyles

Defined in: bot/src/transformers/types.ts:522

For different styles/colors of the buttons


type

type: MessageComponentTypes

Defined in: bot/src/transformers/types.ts:514

component type


url?

optional url: string

Defined in: bot/src/transformers/types.ts:530

optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url


value?

optional value: string

Defined in: bot/src/transformers/types.ts:526

the dev-define value of the option, max 100 characters for select or 4000 for input.