Skip to content

0xCardi/discord-invite-role-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimalist Discord Invite Role Bot

This is a very minimal discord bot that allows you to associate invites with specific roles so that when that invite is used, the role is automatically added.

Install

git clone https://github.com/okwme/discord-invite-role-bot
cd discord-invite-role-bot
npm i

Configuration

There's a file called .env.example. Copy it to .env and add your discord Bot Token and Guild ID. To learn how to do this follow these instructions.

cp .env.example .env

You may want to delete the contents of invites.json which is used to store the invite codes. It is currently filled with invite codes for the Cosmos Network discord.

echo "{}" > invites.json

Running

This is a single file node.js app so it can be run like:

node index.js

You may want to use pm2 to run it on a server so it records logs and will restart if it crashes:

pm2 start discord-invite-role-bot
pm2 save

Use

Make sure the bot is:

  • added to your server
  • has admin permissions
  • in the list of roles the bot shows up above any roles it will be managing

To list all links

~list

To add a new role use:

~add https://discord.gg/abcdegh @role-name

To remove a role:

// NOT IMPLEMENTED
~remove https://discord.gg/abcdefgh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.2%
  • Shell 0.8%