/reactroles

React Roles is a simple discord bot for allowing self-managing user roles in discord.

Primary LanguageGoMIT LicenseMIT

React Roles

React Roles is a simple discord bot for allowing self-managing user roles in discord.

Role message with roles

Usage

To add a role to yourself as a user you simply click one of the reactions on the message, and to remove yourself from that role you click again to remove your reaction on the message.

If a user has the roles (as configured below) that gives the permission to use role management commands:

Conventions

  • < > : a required parameter
  • : an optional parameter

Add Command

Adds a new role to the discord, configured as specified.

  • !role add <role name> <emoji> [colour]

Usage examples:

  • !role add valorant :gun: #d34454
  • !role add valorant :gun:

Remove Command

Removes a role and it's reacions from the discord.

  • !role remove <role name>

Usage example:

  • !role remove valorant

Update Command

Modifies any one part of a role. Where role fields are name, emoji and color, and role field values are valid values of those fields as per the add role command.

  • !role update <role name> <role field> <role field value>

Usage examples:

  • !role update valorant name coolgungame
  • !role update valorant emoji 😎
  • !role update valorant color #CADEAA

Help Command

Replies to the user the help text accompanying the command.

  • !role help <action>

Usage example:

  • !role help add

As of v2.6.0 (3ee3b59)

If unsuccessful, the bot will reply with an error message and usage.

Setup

Before deploying your own, you will need to make a discord bot, and add it to your server.

Docker

You can check out the image versions over on Docker Hub

  1. Clone the repo to your machine
  2. Duplicate ./example.env and rename it to .env
  3. Fill out the env variables
  4. In a terminal in the repo root, run docker-compose up -d

Kubernetes

  1. Clone the repo to your machine
  2. Duplicate ./cmd/reactroles/kube/deployment.yaml and rename it to deployment.prod.yaml
  3. Fill out the data variables in the config map
  4. In a terminal in the repo root, run kubectl apply -f ./cmd/reactroles/kube/deployment.prod.yaml