btnRole
A Button Role System that lets you create button roles with your own message. | Requires: manageBtn()
Program
- Javascript
- Typescript
const simplydjs = require("simply-djs");
import simplydjs from "simply-djs";
simplydjs.btnRole(interaction, {
data: {...}, // data object (required)
// options (optional)
})
NOTE
This is totally different from betterBtnRole !
betterBtnRole
is an system which is an button role builder. where,
btnRole
is a function that sends your message (with embeds) with the buttons necessary for the button role.
Output
Arguments:
simplydjs.btnRole(
interaction: Discord.Message | Discord.CommandInteraction,
options: btnOptions
)
- interaction:
Discord.Message
|Discord.CommandInteraction
- options:
btnOptions
Options btnOptions
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
embed | MessageEmbed | ✅ | none | The embed of your message that is sent with the necessary buttons |
content | string | ❌ | none | The content of your message that is sent with the necessary buttons |
data | dataObj[] | ✅ | none | The data necessary to create the buttons. (Array of dataObj) |
dataObj option
dataObj
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
role | Role ID | ✅ | none | The role to be given when a button is clicked |
label | string | ❌ | {Role name} | The label of the button you're trying to create |
emoji | string | ❌ | none | The emoji of the button you're trying to create |
style | MessageButtonStyle | ❌ | PRIMARY | The style of the button that is getting created. |
url | string | ❌ | none | The URL that needs to be redirected when clicked (Only when the style is LINK ) |