Button

Button

Helps to construct a button for a message.

Methods

setCustomID(id) → {Button}

Description:
  • Set the custom id of the button.

Source:
See:
Parameters:
Name Type Description
id String

The custom id of the button.

Returns:
Type
Button

setDisabled(disabled) → {Button}

Description:
  • Disables the button from being clickable.

Source:
Parameters:
Name Type Description
disabled Boolean

Whether this button should be displayed as disabled.

Returns:
Type
Button

setEmoji(emoji) → {Button}

Description:
  • Sets the emoji to be displayed on the button.

Source:
Parameters:
Name Type Description
emoji String

The emoji to display on the button. For a custom emoji, it should be in the format "<:bitcoin:844240546246950922>".

Returns:
Type
Button

setLabel(label) → {Button}

Description:
  • Sets the text on the button.

Source:
Parameters:
Name Type Description
label String

The text to display on the button.

Returns:
Type
Button

setStyle(style) → {Button}

Description:
  • Sets the style of the button.

Source:
See:
Parameters:
Name Type Description
style Number

The button style.

Returns:
Type
Button

setURL(url) → {Button}

Description:
  • Sets the url of the button.

Source:
Parameters:
Name Type Description
url String

The url for a link button.

Returns:
Type
Button

toJSON() → {Object}

Description:
  • Returns the correct Discord format for a button.

Source:
Returns:
Type
Object