discord-role-react

0.0.5 • Public • Published

discord-role-react


discord-role-react is a package that allow you to easily create buttons to add roles.

Install

npm install discord-role-react

Setup

const discord = require('discord.js');
const client = new discord.Client();
require('discord-buttons')(client); // must be below your discord.Client()
require('discord-role-react')(client); // must be below your discord.Client()

You absolutly need to require both discord-buttons and discord-role-react !


Method

channel.createReactRoleMessage(content/embed, Setuprole);

Example

const embed = new Discord.MessageEmbed().setColor("BLURPLE").setDescription("Click to add role !")

const Setuprole = new disreact.RoleSetup()
    .addRole({role: "833098076050030635", emoji: "👍", style: "green" })
    .addRole({role: "833098076050030635", label: "member", style: "red" })
    .addRole({role: "833098076050030635", label: "news", emoji: "📰" })

message.channel.createReactRoleMessage(embed, Setuprole)
// or 
message.channel.createReactRoleMessage("Click to add role !", Setuprole)
  • You can put max 25 roles.
  • If you don't precise any style, it will be "grey".

Contact

Discord

Dependents (0)

Package Sidebar

Install

npm i discord-role-react

Weekly Downloads

0

Version

0.0.5

License

Apache-2.0

Unpacked Size

17 kB

Total Files

4

Last publish

Collaborators

  • gaetan20