Hierarchy

  • ButtonBuilder
    • ButtonBuilder

Constructors

Properties

data: Partial<APIButtonComponent>

The API data associated with this component.

Methods

  • Sets the custom id for this button.

    Parameters

    • customId: string

      The custom id to use

    Returns this

    This method is only applicable to buttons that are not using the Link button style.

  • Sets whether this button is disabled.

    Parameters

    • Optionaldisabled: boolean

      Whether to disable this button

    Returns this

  • Sets the emoji to display on this button.

    Parameters

    • emoji: ComponentEmojiResolvable

      The emoji to use

    Returns this

  • Parameters

    • execute: ButtonInteractionExecute

    Returns this

  • Sets the label for this button.

    Parameters

    • label: string

      The label to use

    Returns this

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

    Parameters

    • skuId: string

      The SKU id to use

    Returns this

    Only available when using premium-style buttons.

  • Sets the style of this button.

    Parameters

    • style: ButtonStyle

      The style to use

    Returns this

  • Sets the URL for this button.

    Parameters

    • url: string

      The URL to use

    Returns this

    This method is only available to buttons using the Link button style. Only three types of URL schemes are currently supported: https://, http://, and discord://.

  • {@inheritDoc ComponentBuilder.toJSON}

    Returns APIButtonComponent

  • Parameters

    • other: APIButtonComponent | JSONEncodable<APIButtonComponent>

    Returns ButtonBuilder