Skip to main content

DiscordButtonComponent

@discordeno/bot


Documentation / @discordeno/bot / DiscordButtonComponent

Interface: DiscordButtonComponent

Defined in: packages/types/dist/types/discord.d.ts:1669

https://discord.com/developers/docs/interactions/message-components#buttons-button-object

Properties

custom_id?

optional custom_id: string

Defined in: packages/types/dist/types/discord.d.ts:1686

A dev-defined unique string sent on click (max 100 characters).

Remarks

A button of style Link or Premium cannot have a custom_id


disabled?

optional disabled: boolean

Defined in: packages/types/dist/types/discord.d.ts:1711

Whether or not this button is disabled


emoji?

optional emoji: object

Defined in: packages/types/dist/types/discord.d.ts:1695

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

animated?

optional animated: boolean

Whether this emoji is animated

id?

optional id: string

Emoji id

name?

optional name: string

Emoji name

Remarks

A button of style Premium cannot have an emoji


label?

optional label: string

Defined in: packages/types/dist/types/discord.d.ts:1679

Text that appears on the button

Remarks

A label can have a max of 80 characters A button of style Premium cannot have a label


sku_id?

optional sku_id: string

Defined in: packages/types/dist/types/discord.d.ts:1718

Identifier for a purchasable SKU

Remarks

Buttons of style Premium must have a sku_id, any other button with a different style can not have a a sku_id


style

style: ButtonStyles

Defined in: packages/types/dist/types/discord.d.ts:1688

For different styles/colors of the buttons


type

type: Button

Defined in: packages/types/dist/types/discord.d.ts:1671

All button components have type 2


url?

optional url: string

Defined in: packages/types/dist/types/discord.d.ts:1709

Url for link buttons that can navigate a user to the web.

Remarks

Buttons of style Link must have an url, any other button with a different style can not have an url