A Discord Bot that will assign roles based on the Games that a Member is currently playing.
The Bot needs the MANAGE_ROLES Permission on your Server, and only Members with Roles that are lower in the Hierarchy will be assigned Activity-Roles(tm).
Roles are assigned to a member when a Game is opened, closed or refreshes it's Presence on Discord. Players that we're already playing when the bot looged in won't be assigned a role (yet).
There are a few quirks too be considered:
- Games that are not registered as a Discord Application are ignored by the bot (most of the are dw)
- this prevents members from giving themselves arbritrary roles by manipulating
Settings>Game Activity
- this prevents members from giving themselves arbritrary roles by manipulating
- The Bot will assign any role matching the Name of the Activity
- Make sure no important Admin/Moderator Role has a name matching any game registered with Discord
- If you have a role that should never be tampered with by the bot, make sure that it's above the Bot's Role in the Hierarchy
- Some Games (annoyingly) register both their Launcher AND the actual Game with Discord, resulting in multiple roles being created and assigned to the ones playing it.
- You can instruct the bot to use a specific alias instead of the default name, by editing
config.json
- This way you can prevent Games from showing up twice and use creative Rolenames
- the config file is already preconfigured to rename Rainbow Six Siege and it's annoying duplicate
You will need a token to run the bot.
- Create a Discord Application
- Navigate to the
Bot
Tab on the right side. - Select "add Bot" and confirm.
- And finally: Reveal and copy the token!
- Provide a Discord API access token in
config.json
- Install dependencies
npm install
- Run the bot with
node .
Alternatively, to run as a docker:
- Pull from DockerHub
- Set (docker)Enviroment Variable ACCESS_TOKEN to your token (duh)
- Run Docker Container
Note: When using the Docker Image from DockerHub, you won't easily be able to edit
config.json
. You might have to build the Image yourself