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
Options for btnrole function
Options | Type | Required | Default | Description |
---|---|---|---|---|
embed | Embed | โ | none | Embed sent with buttons |
data | Array | โ | none | Data to make buttons and send it. So it will work |
Options for data
Options | Type | Required | Default | Description |
---|---|---|---|---|
role | Embed | โ | none | Role ID for the button |
color | Button Style | โ | SECONDARY | Color for the button which gives roles |
emoji | Emoji ID | โ | none | Emoji of the button which gives roles |