Search...

ButtonBuilder

Represents a button component
declare class ButtonBuilder extends ComponentBuilder<APIButtonComponent> 
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 componentInherited from ComponentBuilder

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