Carbon
CoreClasses

Button

Extends

  • BaseButton

Constructors

new Button()

new Button(data?): Button

Parameters

ParameterType
data?object
data.additionalData?ComponentAdditionalData

Returns

Button

Inherited from

BaseButton.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited from
additionalDatapublicnull | ComponentAdditionalDatanull-BaseButton.additionalData
customIdabstractstringundefinedThe custom ID of the componentBaseButton.customId
deferpublicbooleanfalseWhether the component response should be automatically deferredBaseButton.defer
disabledpublicbooleanfalseThe disabled state of the buttonBaseButton.disabled
emoji?publicobjectundefinedThe emoji of the buttonBaseButton.emoji
emoji.animated?publicbooleanundefined--
emoji.id?publicstringundefined--
emoji.namepublicstringundefined--
ephemeralpublicbooleanfalseWhether the component response should be ephemeralBaseButton.ephemeral
labelabstractstringundefinedThe label of the buttonBaseButton.label
stylepublicButtonStyleButtonStyle.PrimaryThe style of the buttonBaseButton.style
typepublicComponentTypeComponentType.ButtonThe type of the componentBaseButton.type

Methods

createId()

createId(additionalData): string

Create a custom ID to use for this component that embeds additional data that you want to be handed

Parameters

ParameterTypeDescription
additionalDatanull | ComponentAdditionalDataThe additional data that you want to be passed in this component's custom ID

Returns

string

The custom ID to use

Inherited from

BaseButton.createId


run()

abstract run(interaction): Promise<void>

Parameters

ParameterType
interactionButtonInteraction

Returns

Promise<void>


serialize()

serialize(): APIButtonComponent

Returns

APIButtonComponent

Overrides

BaseButton.serialize

On this page

Edit on GitHub