ButtonBuilder

Represents a button component
export declare class ButtonBuilder extends ComponentBuilder<APIButtonComponent> 

constructor(data?)

Constructs a new instance of the ButtonBuilder class
NameTypeOptionalDescription
dataPartial<APIButtonComponent>YesNone
Readonly

data

:

Partial<DataType>

The API data associated with this component
Inherited from ComponentBuilder

setCustomId(customId)

:

this

Sets the custom id for this button
NameTypeOptionalDescription
customIdstringNo
The custom id to use for this button

setDisabled(disabled?)

:

this

Sets whether this button is disabled
NameTypeOptionalDescription
disabledbooleanYes
Whether to disable this button

setEmoji(emoji)

:

this

Sets the emoji to display on this button
NameTypeOptionalDescription
emojiAPIMessageComponentEmojiNo
The emoji to display on this button

setLabel(label)

:

this

Sets the label for this button
NameTypeOptionalDescription
labelstringNo
The label to display on this button

setStyle(style)

:

this

Sets the style of this button
NameTypeOptionalDescription
styleButtonStyleNo
The style of the button

setURL(url)

:

this

Sets the URL for this button
NameTypeOptionalDescription
urlstringNo
The URL to open when this button is clicked