CustomizableButton
Just a blueprint of the button customization used in all of the functions that has buttons!
Types
Object
tip
Converting ButtonBuilder to CustomizableButton
This option seems weird and un-intuitive ? Don't worry ! You can change your existing ButtonBuilder to CustomizableButton in one line !
const { ButtonStyle } = require('discord.js')
const simplydjs = require('simply-djs')
const button = new ButtonBuilder()
.setLabel("This is easy")
.setStyle(ButtonStyle.Primary)
simplydjs.someFunction(interaction, {
button: button.toJSON()
})
The .toJSON()
method changes your ButtonBuilder to APIButtonComponent
which is identical to CustomizableButton
Properties
Parameter | Type | Description |
---|---|---|
style | ExtendedButtonStyle | Set the style of the button |
label | string | The text that is shown in the button |
emoji | string | Custom emoji (or) System emoji that is shown in the button |
export interface CustomizableButton {
style?: ExtendedButtonStyle;
label?: string;
emoji?: string;
}