Buttons Documentation
Last updated
Last updated
Messages can be sent with the components key to add buttons and other components (when discord brings them out), you can edit and add new buttons via editing the message, this is useful for the disabled
key to stopping people from clicking it.
Extending the message payload.
Extending the interaction data payload.
Key
Value
components?
list of Component
Key
Value
Description
type
the type of component
style?
the style of button
custom_id?
string
the internal id of the button, set this yourself, mutually exclusive with url
label?
string
the text on the button
url?
string
used to set the url for hyperlinks
emoji?
used for an emoji in the button text
disabled?
boolean
used to enabled and disable the button - defaults to false
components?
list of Component
children components
Key
ID
Description
buttons
1
used as the parent of buttons, takes a list of components with the components
key with the type of 2
button
2
an actual button
Key
ID
Description
blurple
1
a blurple-colored button
grey
2
a grey-colored button
green
3
a green-colored button
red
4
a red-colored button
hyperlink
5
a grey hyperlink button, set the link in the url
key
Key
Value
name?
string
id?
snowflake
Key
Value
custom_id?
string
component_type?