Skip to main content

betterBtnRole

This is an example of betterBtnRole

info

This is a slash only function | You can't use this function with normal message

With Customization

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

interactionCreate Event (btn-add command)

// interactionCreate event

simplydjs.betterBtnRole(client, interaction, {
type: "add",

// Slash Option Customization
chSlash: 'channel', // Custom Channel Option [Names]
idSlash: 'message ID', // Custom ID Option [Names]
roleSlash: 'role', // Custom Role Option [Names]
labelSlash: 'name', // Custom Label Option [Names]
styleSlash: 'color', // Custom Style Option [Names]
emojiSlash: 'emoji' // Custom Emoji Option [Names]
});

interactionCreate Event (btn-remove command)

simplydjs.betterBtnRole(client, interaction, {
type: "remove",

// Slash Option Customization
chSlash: 'channel', // Custom Channel Option [Names]
idSlash: 'message ID', // Custom ID Option [Names]
roleSlash: 'role', // Custom Role Option [Names]
});

Slash Command Type

// btnrole-add
{
name: 'btnrole-add',
description: 'Button roles is slash ?!',
options: [
{
name: 'channel',
type: 'CHANNEL',
description: 'channel of that message',
required: true,
},
{
name: 'message',
type: 'STRING',
description: 'the message',
required: true,
},
{
name: 'role',
type: 'ROLE',
description: 'what role',
required: true,
},
{
name: 'label',
type: 'STRING',
description: 'name of the button ?',
required: false,
},
{
name: 'style',
type: 'STRING',
description: 'color of the button',
required: false,
choices: [
{
name: 'PRIMARY',
value: 'PRIMARY'
},
{
name: 'SECONDARY',
value: 'SECONDARY'
},
{
name: 'SUCCESS',
value: 'SUCCESS'
},
{
name: 'DANGER',
value: 'DANGER'
},
]
},
{
name: 'emoji',
type: 'STRING',
description: 'emoji maybe ?',
required: false,
},
],

}
// btnrole-remove
{
name: 'btnrole-remove',
description: 'Button roles removal is slash ?!',
options: [
{
name: 'channel',
type: 'CHANNEL',
description: 'channel of that message',
required: true,
},
{
name: 'message',
type: 'STRING',
description: 'the message',
required: true,
},
{
name: 'role',
type: 'ROLE',
description: 'what role',
required: true,
},

],

}

Output

image

image

Options for betterBtnRole function

OptionsTypeRequiredDefaultDescription
typeString (add/remove)โœ“noneType of the betterBtnRole to use

Slash Customization.

OptionsTypeRequiredDefaultDescription
chSlashStringโœ˜channelCustom Channel Option name (Customizability++)
idSlashStringโœ˜messageCustom Message ID Option name
roleSlashStringโœ˜roleCustom Role Option name
labelSlashStringโœ˜labelCustom Label Option name
roleSlashStringโœ˜styleCustom Style Option name
emojiSlashStringโœ˜emojiCustom Emoji Option name