Component
Documentation / @discordeno/bot / Component
Interface: Component
Defined in: transformers/types.ts:638
Properties
accentColor?
optionalaccentColor?:number
Defined in: transformers/types.ts:699
Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF
accessory?
optionalaccessory?:Component
Defined in: transformers/types.ts:681
A thumbnail or a button component, with a future possibility of adding more compatible components
channelTypes?
optionalchannelTypes?:ChannelTypes[]
Defined in: transformers/types.ts:658
List of channel types to include in a channel select menu options list
component?
optionalcomponent?:Component
Defined in: transformers/types.ts:705
The component within the label
components?
optionalcomponents?:Component[]
Defined in: transformers/types.ts:673
a list of child components
content?
optionalcontent?:string
Defined in: transformers/types.ts:683
Text that will be displayed similar to a message
customId?
optionalcustomId?:string
Defined in: transformers/types.ts:642
a developer-defined identifier for the component, max 100 characters
default?
optionaldefault?:boolean
Defined in: transformers/types.ts:709
Whether the checkbox is selected by default (Checkbox component).
defaultValues?
optionaldefaultValues?:ComponentDefaultValue[]
Defined in: transformers/types.ts:675
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?
optionaldescription?:string
Defined in: transformers/types.ts:685
Alt text for the media
disabled?
optionaldisabled?:boolean
Defined in: transformers/types.ts:646
whether the component is disabled, default false
divider?
optionaldivider?:boolean
Defined in: transformers/types.ts:691
Whether a visual divider should be displayed in the component. Defaults to true
emoji?
optionalemoji?:Pick<Partial<Emoji>,"id"|"name"|"animated">
Defined in: transformers/types.ts:654
Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis.
file?
optionalfile?:UnfurledMediaItem
Defined in: transformers/types.ts:695
This unfurled media item is unique in that it only supports attachment references using the attachment://<filename> syntax
fileTypes?
optionalfileTypes?:string[]
Defined in: transformers/types.ts:729
The accepted file types for the file upload
Remarks
The supported values are image, video, audio or any dot prefixed extension (e.g. .pdf)
Extensions are case-insensitive and are normalized to lowercase, so .PDF and .pdf are equivalent.
Discord recommends using the provided file groups rather than listing extensions individually.
If you do list extensions individually, include .jpg for image uploads and both .mp4 and .mov for video uploads,
as some mobile clients rely on those extensions.
This feature only checks the file extension against the filename and does not inspect the file contents. You are still responsible for validating the actual contents of the file.
Up to 10 file types.
id?
optionalid?:number
Defined in: transformers/types.ts:679
Optional identifier for component
items?
optionalitems?:MediaGalleryItem[]
Defined in: transformers/types.ts:689
1 to 10 media gallery items
label?
optionallabel?:string
Defined in: transformers/types.ts:650
text that appears on the button (max 80 characters)
maxLength?
optionalmaxLength?:number
Defined in: transformers/types.ts:671
The maximum input length for a text input. Between 1-4000.
maxValues?
optionalmaxValues?:number
Defined in: transformers/types.ts:667
The maximum number of items that can be selected. Default 1. Between 1-25.
media?
optionalmedia?:UnfurledMediaItem
Defined in: transformers/types.ts:697
This unfurled media item is unique in that it only supports attachment references using the attachment://<filename> syntax
minLength?
optionalminLength?:number
Defined in: transformers/types.ts:669
The minimum input length for a text input. Between 0-4000.
minValues?
optionalminValues?:number
Defined in: transformers/types.ts:665
The minimum number of items that must be selected. Default 1. Between 1-25.
name?
optionalname?:string
Defined in: transformers/types.ts:701
The name of the file. This field is ignored and provided by the API as part of the response
options?
optionaloptions?:SelectOption[] |RadioGroupOption[] |CheckboxGroupOption[]
Defined in: transformers/types.ts:661
The string select options or the radio or checkbox group options
placeholder?
optionalplaceholder?:string
Defined in: transformers/types.ts:663
A custom placeholder text if nothing is selected. Maximum 150 characters.
required?
optionalrequired?:boolean
Defined in: transformers/types.ts:644
whether this component is required to be filled, default true
resolved?
optionalresolved?:InteractionDataResolved
Defined in: transformers/types.ts:711
Resolved entities from selected options
size?
optionalsize?:number
Defined in: transformers/types.ts:703
The size of the file in bytes. This field is ignored and provided by the API as part of the response
skuId?
optionalskuId?:bigint
Defined in: transformers/types.ts:677
Identifier for a purchasable SKU, only available when using premium-style buttons
spacing?
optionalspacing?:SeparatorSpacingSize
Defined in: transformers/types.ts:693
Size of separator padding — 1 for small padding, 2 for large padding. Defaults to 1
spoiler?
optionalspoiler?:boolean
Defined in: transformers/types.ts:687
Whether the thumbnail should be a spoiler (or blurred out). Defaults to false
style?
optionalstyle?:ButtonStyles|TextStyles
Defined in: transformers/types.ts:648
For different styles/colors of the buttons
type
type:
MessageComponentTypes
Defined in: transformers/types.ts:640
component type
url?
optionalurl?:string
Defined in: transformers/types.ts:656
optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url
value?
optionalvalue?:string|boolean
Defined in: transformers/types.ts:652
the dev-define value of the option, max 100 characters for select or 4000 for input; or boolean for checkbox response.
values?
optionalvalues?:string[]
Defined in: transformers/types.ts:707
The text of the selected options