Constructor
new Button()
- Source
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:
Name | Type | Description |
---|---|---|
custom_id | string |
- Source
Returns:
- Type:
- Button
setDisabled(disabled) → {Button}
set the button as disabled or not
Parameters:
Name | Type | Description |
---|---|---|
disabled | boolean |
- Source
Returns:
- Type:
- Button
setEmoji(emoji) → {Button}
Set the button emoji
Parameters:
Name | Type | Description |
---|---|---|
emoji | object |
- Source
Returns:
- Type:
- Button
setLabel(label) → {Button}
Set the button label
Parameters:
Name | Type | Description |
---|---|---|
label | string |
- Source
Returns:
- Type:
- Button
setStyle(style) → {Button}
Set the button style
Parameters:
Name | Type | Description |
---|---|---|
style | number |
- Source
Returns:
- Type:
- Button
setURL(url) → {Button}
Set the button url
Parameters:
Name | Type | Description |
---|---|---|
url | string |
- Source
Returns:
- Type:
- Button