A Discord Bot that will assign roles based on the Games that a Member is currently playing.
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).
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).
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/default.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
BotTab on the right side. - Select "add Bot" and confirm.
- And finally: Reveal and copy the token!
- Provide a Discord API access token in
.config/default.json - Install dependencies
npm install - Run the bot with
npm start
Alternatively, run using docker compose:
- Edit
.config/default.json - Run
ACCESS_TOKEN="..." docker compose upin Bash or$env:ACCESS_TOKEN=".." docker compose upin Powershell
If you want to run this thing with docker, independantly from compose,
that the Volume /home/node/.config is bound to a .config folder, containing your configuration.
Otherwise, the Docker Container will run using the default configuration.