Skip to main content

btnrole

This is an example of btnrole

TIP

It is now possible to make btnrole slash based too.

The package supports Auto Slash Recognition ! So no more slash options.

Required

const simplydjs = require("simply-djs");

interactionCreate Event

// interactionCreate Event
simplydjs.clickBtn(interaction);

messageCreate Event (btnrole command)

// messageCreate Event

simplydjs.btnrole(client, message, {
embed: embed,
data: [
{
role: "role-id",
label: "name", // default: *role name*
color: "color", // default: SECONDARY
emoji: "emoji id"
} // etc..
]
});
INFO

Customization++

  • You can create your own button with its CustomId in this format role- and role id after it.. the button role will work with that too...
// messageCreate event
const btn = new MessageButton()
.setLabel("btnrole")
.setStyle("DANGER")
.setCustomId("role-123456789012345678"); // role-(role id)
// send it

// in interactionCreate
simplydjs.clickBtn(interaction);

Output

image

Options for btnrole function

OptionsTypeRequiredDefaultDescription
embedEmbedโœ“noneEmbed sent with buttons
dataArrayโœ“noneData to make buttons and send it. So it will work

Options for data

OptionsTypeRequiredDefaultDescription
roleEmbedโœ“noneRole ID for the button
colorButton Styleโœ˜SECONDARYColor for the button which gives roles
emojiEmoji IDโœ˜noneEmoji of the button which gives roles