Coder Social home page Coder Social logo

raphael1700 / discordrolemanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from acocalypso/discordrolemanager

0.0 0.0 0.0 335 KB

Manage Discord Roles the lazzyyy way

License: Apache License 2.0

JavaScript 86.75% Handlebars 13.04% Dockerfile 0.21%

discordrolemanager's Introduction

DiscordRoleManager

Manage Discord Roles the lazzyyy way

Installation

  • Create a new discord Bot -> GUIDE
  • Invite the Bot to your Discord Server
    • Check the boxes for the needed permissions
    • Minimum requirements: manage roles and send messages
    • Manage roles, it will only be able to manage roles that are below his role/permissions
    • Enable PRESENCE INTENT, SERVER MEMBERS INTENT and MESSAGE CONTENT INTENT
    • Use the URL that page generates and go to it, and you will be asked to log into your discord. You will need Admin access in order to get the bot to join that server.
  • Rename config.json.example to config.json
  • Edit config.json and fill out the required infos.
  • Create a Mysql Database
  • If you used DiscordRoleManager before, backup your dataBase.sqlite
  • update to latest master
  • copy your dataBase.sqlite file back. The Bot will migrate all users from sqlite to mysql.

Even if you have this bot only on a single discord server you have to set the guild ID and register the bot.

As a Workaround to use the multiguild feature and not to crash the bot please manually set the guild_id for all users in the db. (This will be fixed later after I figured out how to)

update temporary_roles set guild_id = YOURGUILDID where guild_id is null;

For the first run please register the bot with

(prefix)register

After that please register the Admin and Moderator Role with

(prefix)register adminrole @AdminRole
(prefix)register modrole @ModRole
(prefix)register channel #mainchannelforthebotinformation
#Please remove all comments as this is currently not handled by the bot!

{
  "token": "", // Bot token
  "clientID": "", // bot client id
  "clientSecret": "", //bot client secret
  "ownerID": "", // Your discord id
  "language": "", // en, de, pt, nl
  "cmdPrefix": "?", // choose your command prefix
  "checkIntervall": 60, // check every 60 min for expired or soon to expire users
  "migrateSQLITE": {
    "migrate": true, // do you want to migrate your user from sqlite?
    "path": "" // path to your sqlite file
  },
  "debug": "no", // enable / disable debug infos
  "webinterface": {
    "disabled": "yes", //enable webinterface
    "backendPort": 9000, // interface port
    "username": "admin", // your login username - This can be removed afterwards
    "password": "SuperSecretPW", // your login password - This can be removed afterwards
    "secret": "ThisShouldBeChanged" // session secret
  },
  "mapMain": {
    "enabled": "yes", // enable link to your map
    "url": "https://yourmap.com" // your map link
  },
  "paypal": {
    "enabled": "yes", // enable paypal link
    "url": "https://www.paypal.me/xyz", // your paypal url
    "img": "https://raw.githubusercontent.com/acocalypso/DiscordRoleManager/master/paypal_icon.jpg"
  },
  "mysql_database": {
    "mysql_host": "localhost", // your mysql host
    "mysql_port": 3306, // mysql port
    "mysql_db": "rolemanager", // mysql database for rolemanager
    "mysql_user": "dummy", // mysql username
    "mysql_pass": "dummy" // mysql password
  }
}

Install node dependecies

Install NodeJS version 16.x!

npm install

Now start the bot

node start.js

You may want to use pm2 or systemd to run it as a service

Docker

DiscordRoleManager is now also available as a docker image.

docker-compose pull docker-compose up -d

Usage example

User commands:

(prefix)check @rolename » to check the time left on your subscription
(prefix)map » a link to our web map
(prefix)subscribe or (prefix)paypal » for a link to your PayPal account

Admin / Mod commands:

(prefix)temprole @mention <DAYS> @rolename » to assign a temporary roles
(prefix)temprole add @mention <DAYS> @rolename » to add more time to a temporary role assignment
(prefix)temprole remove @mention @rolename » to remove a temporary role assignment
(prefix)temprole check @mention @rolename » to check the time left on a temporary role assignment

Help commands:

(prefix)help » display help commands
(prefix)help mods >> display mod commands

Grafana 8.x Support

alt text

Contribution:

You can find the local.json file in locale/local.json

if you want to add another langue you just need to add a new entry in the json file like:

  "Ready": {
    "de": "Bereit!",
    "cz": "připraven"
  },

Additional IMPORTANT Infos:

This is a port from https://github.com/Kneckter/DiscordRoleBot

Many thanks to him for his original version.

discordrolemanager's People

Contributors

acocalypso avatar coldshadow80 avatar dependabot[bot] avatar pjorritsma avatar raphael1700 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.