Giter VIP home page Giter VIP logo

role_assigner's Introduction

Role Assigner

Discord bot for assign roles.

Presentation

I made this bot for assignating role on discord server.

Often, when you have a discord server, you want people to self asign roles but with out give them the right to manage roles.

This is exactly what this bot do.

You give him a message where the bot watchs reactions, and when someone add or remove an emote to the message, the bot add of remove the role to the user.

The link between roles and emotes is made with the roles.json file.

Usage

This bot isn't made to run on multiple server. (It can, but the configuration will be the same.)

Configure roles

You have to configure the roles.json file.
To do that, you can rename the roles.json.tpl file to roles.json and complete it.

The roles.json file must contain an object.
Keys are a string which is the emote name.
Values are a string which is the role name.

Example of roles.json file:

{
    "py": "python",
    "rs": "rustacean",
    "go": "gopher",
    "hs": "haskell",
    "kt": "kotlin"
}

Configure environment (and some other things)

You have to put you discord token in a .env file.
The .env.tpl file is here to help you complete it.

Presents variable in the .env file:

  • discord → This is the token of your bot.
  • channels → Channels id where messages are watched (separate by a comma then a space , .
  • messages → Messages id watched by the bot (serarate by a comma then a space , ). When reaction are added to that message, if it correspond to a role (defined in the roles.json file), then the role is added to the user which added the emote.

The order of channels and messages is important !
The message id 1 (index 0) must be in the channel id 1 (with the index 0). In the channels and messages variables.

role_assigner's People

Contributors

albandewilde avatar

Watchers

 avatar  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.