Skip to main content

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

ParameterTypeDescription
styleExtendedButtonStyleSet the style of the button
labelstringThe text that is shown in the button
emojistringCustom emoji (or) System emoji that is shown in the button
export interface CustomizableButton {
style?: ExtendedButtonStyle;
label?: string;
emoji?: string;
}