Search...

ButtonBuilder

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

Extends

ComponentBuilder<APIButtonComponent

constructor(data?)

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

setCustomId(customId)

:

this

Sets the custom id for this button
NameTypeOptionalDescription
customIdstringNoThe custom id to use for this button

setDisabled(disabled?)

:

this

Sets whether this button is disabled
NameTypeOptionalDescription
disabledbooleanYesWhether to disable this button

setEmoji(emoji)

:

this

Sets the emoji to display on this button
NameTypeOptionalDescription
emojiAPIMessageComponentEmojiNoThe emoji to display on this button

setLabel(label)

:

this

Sets the label for this button
NameTypeOptionalDescription
labelstringNoThe label to display on this button

setStyle(style)

:

this

Sets the style of this button
NameTypeOptionalDescription
styleButtonStyleNoThe style of the button

setURL(url)

:

this

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

toJSON()

:

APIButtonComponent