Discord Reaction Role
Discord Reaction Role is a powerful Node.js module that allows you to easily create reactions roles !
Installation
npm i discord-reaction-role
Exemple
Lunch of the module
const Discord = client = settings = prefix: "r!" token: "Your Discord Token"; // Requires Manager from discord-reaction-roleconst ReactionRoleManager = ;// Starts updating currents reaction rolesconst manager = client storage: "./reaction-role.json";// We now have a reactionRoleManager property to access the manager everywhere!clientreactionRoleManager = manager; client; client;
- client: the discord client (your discord bot instance)
- options.storage: the json file that will be used to store reaction roles
Start
clientreactionRoleManager
Delete
clientreactionRoleManager;
Fetch the reaction role
// The list of all the reaction roles let allReactionRoles = clientreactionRoleManagerreactionRole; // [ {ReactionRole}, {ReactionRole} ] let onServer = clientreactionRoleManagerreactionRole;
Events
reactionRoleAdded
clientreactionRoleManager
reactionRoleRemoved
clientreactionRoleManager;
Custom database
An example with quick.db
const Discord = ;const ReactionRolesManager = ;const client = ; const settings = prefix: 'r!' token: 'Your bot token'; const db = ;if !db db; const reactionRoleManager = async { return db; } async { db; return true; } async { const array = db db return true; }; clientreactionRoleManager = client storage: false client;
Credits
Thanks to Androz2091 for helping me on this project.