GithubHelp home page GithubHelp logo

fzqbjkgfiuqhzaoiguzhpazihozizgfajoo / discord-rolereact Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haykam821/discord-rolereact

0.0 1.0 0.0 16 KB

Assigns roles to users on Discord based on reactions to a message

License: MIT License

JavaScript 100.00%

discord-rolereact's Introduction

Discord-RoleReact

A bot that automatically assigns roles based on message reactions.

Demo of Bot using Regular Messages

Demo of Bot Using Embeds

Features

  • Customizable messages, reactions, commands, and roles

  • Auto-removes role when user removes a reaction

  • Option to use an embed to have all options in one message

Installation

Clone this repository to your local machine.

Run the npm install command to install discord.js

Open roleReact.js with a text editor and modify the following lines:

const yourID = "158063324699951104"; //Instructions on how to get this: https://redd.it/40zgse
const setupCMD = "!createrolemessage"
const initialMessage = `**React to the messages below to receive the associated role. If you would like to remove the role, simply remove your reaction!**`;
const embedMessage = `
React to the emoji that matches the role you wish to receive.

If you would like to remove the role, simply remove your reaction!
`;
const embedFooter = "Role Reactions"; // Must set this if "embed" is set to true
const roles = ["Hacker", "Artist", "Public Relations", "Intern"];
const reactions = ["๐Ÿ’ป", "๐Ÿ–Œ", "๐Ÿ˜ƒ", "๐Ÿ†•"];
const embed = false; // Set to "true" if you want all roles to be in a single embed
const embedColor = "#dd2423"; // Set the embed color if the "embed" variable is set to true
const botToken = "";
/**
 * You'll have to set this up yourself! Read more below:
 * 
 * https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token
 */

Mandatory:

  • Fill in the yourID variable. You can get "yourID" in any Discord channel by typing \@YOUR NAME. For me, it would be \@Night.

  • Change roles the to ones that are in your server.

  • Replace the reaction emojis with the ones of your choosing. Note: to get the value for the reaction, type \:my_reaction with the backslash and press enter. If done correctly, a smaller emoji should appear. Copy the small emoji into the reactions array. For custom emojis, follow the previous step and copy the string of numbers only (i.e. ignore text and angled brackets). Paste the string of numbers into the reactions array as you would with regular emojis.

  • Set embed to true or false if you wish to use a single embed for all reaction roles. After that, set the text for the embed footer via the embedFooter variable

  • Set up the bot and get a token. The Github Wiki Page explains how to set up bots and get tokens. An image of the permissions the bot needs can be found here. Make sure the bot has a role/the permissions that allows it to modify other user's roles.

Optional:

  • Modify the setupCMD variable to display a custom setup message

  • Modify initialMessage variable to display a custom initial message

  • Modify the embedMessage variable to display a custom message for the embed

  • Modify the embedColor variable to display a custom embed color

After you have installed discord.js and made the modifications above, run the npm start command to start the bot!

Support

I hope you find this bot useful. If you need help or find any bugs, use the appropriate forums in this repository to contact me.

discord-rolereact's People

Contributors

acollierr17 avatar devmaxiss avatar ipadpuppydogdude1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.