Class ButtonBuilder

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 ButtonBuilder

    Remarks

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

  • Sets whether this button is disabled.

    Parameters

    • Optional disabled: boolean

      Whether to disable this button

    Returns ButtonBuilder

  • Sets the label for this button.

    Parameters

    • label: string

      The label to use

    Returns ButtonBuilder

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

    Parameters

    • skuId: string

      The SKU id to use

    Returns ButtonBuilder

    Remarks

    Only available when using premium-style buttons.

  • Sets the style of this button.

    Parameters

    Returns ButtonBuilder

  • Sets the URL for this button.

    Parameters

    • url: string

      The URL to use

    Returns ButtonBuilder

    Remarks

    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://.

  • Serializes this builder to API-compatible JSON data.

    Returns APIButtonComponent

    Remarks

    This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.

Generated using TypeDoc