Button

Create a button

Constructor

new Button()

Example
const { ButtonStyles, Button } = require("interactions.js");

const button = new Button()
 .setStyle(ButtonStyles.Secondary) // Set the style of the button
 .setLabel('Button') // Set the label of the button
 .setEmoji('🎊') // Set the emoji of the button
 .setCustomId('custom') // Set the custom id of the button

Methods

setCustomId(custom_id) → {Button}

Set the button custom id

Parameters:
NameTypeDescription
custom_idstring
Returns:
Type: 
Button

setDisabled(disabled) → {Button}

set the button as disabled or not

Parameters:
NameTypeDescription
disabledboolean
Returns:
Type: 
Button

setEmoji(emoji) → {Button}

Set the button emoji

Parameters:
NameTypeDescription
emojiobject
Returns:
Type: 
Button

setLabel(label) → {Button}

Set the button label

Parameters:
NameTypeDescription
labelstring
Returns:
Type: 
Button

setStyle(style) → {Button}

Set the button style

Parameters:
NameTypeDescription
stylenumber
Returns:
Type: 
Button

setURL(url) → {Button}

Set the button url

Parameters:
NameTypeDescription
urlstring
Returns:
Type: 
Button