Skip to content

peanutbother/clever-roles

Repository files navigation

Clever Roles Discord Bot

About

This discord bot adds / removes guild members role(s) when they join or leave a voice channel. You can configure which channel triggers which role(s).

This allows you to create channels which are only visible while being in a stream voice chat, for extended usage if voice channel chats aren't enough.

Setup

To get started invite the bot and run the setup with /watch to watch a voice channel and select the matching role to manage. You can /unwatch this channel / role later.

To make this bot active you also need to /activate it in order for it to actually watch the channels you set up. You can /deactivate the bot later if you pause it, or kick it if you no longer wish to use it.

Development / Deployment

This bot is running inside docker and assumes certain environment variables to be set to function properly.

  • TZ: defaults to Etc/Utc, a timezone to create proper timestamps in logs and some discord api
  • DATABASE_URL: defaults to sqlite:/data/database.sqlite, a seaorm sqlite compatible file url
  • RUST_LOG: optional - overrided to error,clever_roles=info in production, allows you to set more verbose logging if needed
  • DISCORD_TOKEN: required, your discord api token

To deploy the container either pull bricksoft/clever-roles-dc or build it locally by docker build . and then run it:

docker run -d -v PATH_TO_YOUR_DATA:/data -e DISCORD_TOKEN=YOUR_TOKEN_HERE bricksoft/clever-roles-dc:latest