Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ButtonBuilder

Represents a validated button component

Hierarchy

  • ButtonBuilder

Index

Constructors

Properties

Accessors

  • get customId(): string
  • The custom Id of this button

    Returns string

  • get disabled(): undefined | boolean
  • Whether this button is disabled

    Returns undefined | boolean

  • get label(): undefined | string
  • The label of this button

    Returns undefined | string

  • get style(): ButtonStyle
  • The style of this button

    Returns ButtonStyle

  • The type of this component

    Returns Button

  • get url(): string
  • The url of this button

    Returns string

Methods

  • Sets the custom Id of this button

    example
    button.setCustomId('first_button');
    

    Parameters

    • customId: string

    Returns ButtonBuilder

  • Sets the disabled state of this button

    example
    button.setDisabled(true);
    

    Parameters

    • disabled: boolean = true

    Returns ButtonBuilder

  • Sets the emoji to display to the left of the button

    example
    button.setEmoji('😱');
    
    example
    button.setEmoji('<:funny:957998724506857472>');
    

    Parameters

    Returns ButtonBuilder

  • Sets the label of this button

    example
    button.setLabel('Click here to close the channel');
    

    Parameters

    • label: string

    Returns ButtonBuilder

  • Sets the style of this button

    example
    button.setStyle(ButtonStyle.Primary);
    

    Parameters

    Returns ButtonBuilder

  • Sets the custom Id of this button

    example
    button.setURL('https://helly.js.org');
    

    Parameters

    • url: string

    Returns ButtonBuilder

  • Returns the raw data of this button

    Returns APIButtonComponent

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM