Preview environment

class ButtonBuilder

export declare class ButtonBuilder extends ComponentBuilder<APIButtonComponent>

A builder that creates API-compatible JSON data for buttons.

Constructors

constructor()

Creates a new button from API data.

readonly
data : Partial<APIButtonComponent>

The API data associated with this component.

Inherited from: ComponentBuilder

setCustomId(
customId: string
) : this

Sets the custom id for this button.

setDisabled(
disabled?: boolean
) : this

Sets whether this button is disabled.

setEmoji() : this

Sets the emoji to display on this button.

setLabel(
label: string
) : this

Sets the label for this button.

setSKUId(
skuId: Snowflake
) : this

Sets the SKU id that represents a purchasable SKU for this button.

setStyle() : this

Sets the style of this button.

setURL(
url: string
) : this

Sets the URL for this button.

toJSON() : APIButtonComponent

Serializes this builder to API-compatible JSON data.