//Note that you need the Node module installed!
let button = new disbut.MessageButton()
.setStyle('red') //default: blurple
.setLabel('My First Button!') //default: NO_LABEL_PROVIDED
.setID('click_to_function') //note: if you use the style "url" you must provide url using .setURL('https://example.com')
.setDisabled(); //disables the button | default: false
message.channel.send('Hey, i am powered by https://npmjs.com/discord-buttons', button);
/*
Need more help? Add me on discord: Dwagon#0069
Discord.js ^13.8.1
*/
const { MessageButton, MessageActionRow } = require('discord.js');
const buttonVerify = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('firstButton')
.setLabel('First Button')
.setStyle('PRIMARY')
.setDisabled(false), // Set it to "true" if you don't want people to be able to use the button at all
)
.addComponents(
new MessageButton()
.setCustomId('secondButton')
.setLabel('Second Button')
.setStyle('SECONDARY')
.setDisabled(false),
)
.addComponents(
new MessageButton()
.setCustomId('thirdButton')
.setLabel('Third Button')
.setStyle('SUCCESS')
.setDisabled(false),
)
.addComponents(
new MessageButton()
.setCustomId('fourthButton')
.setLabel('Fourth Button')
.setStyle('DANGER')
.setDisabled(false),
)
.addComponents(
new MessageButton()
.setLabel('Fifth Button')
.setURL("https://www.codegrepper.com/")
.setStyle('LINK')
.setDisabled(false),
);
/*
Button style
PRIMARY - Blue
SECONDARY - Gray
SUCCESS - Green
DANGER - Red
LINK - Cannot put a customId to it
*/