This bot watches your discord server users and assigns roles based on their presence. For example, if a user is playing Valorant and their presence displays this, the bot can assign a configured role, based on the game name.
Start with the !help
command to the bot, once he is joined to a server and deployed.
This repository holds the code needed to deploy the application.
- Create a Discord Application in Discord Developers Portal
- Create a Bot for the application
- Enable Server Members & Presence Intents
- Note down the bot client ID from the Bot page.
- Join the bot to your server: https://discord.com/oauth2/authorize?client_id=123&scope=bot&permissions=268462144 where 123 is the Client ID provided from the Discord Developers Portal.
- Note down Bot Token, needed for
token
parameter during launch. - Enable both "Presence Intent" and "Server Members Intent" under the bot's settings in the Discord Developers Portal.
The bot can be started using Docker Compose.
ownerId=123 token=123 docker-compose up -d
to run the deployment as a service. Replace Owner ID with your Discord User ID, and Token with your Discord Bot TOken retrieved from the earlier section.
If you'd like to run the environment on an ARM architecture, you can do that with the alternative config: ownerId=123 token=123 docker-compose -f docker-compose-arm.yml up -d
This section defines the environment variables required by the autorole
container. They are set by default in the docker-compose deployment.
token
: The discord bot token for this bot.testToken
: optional Set this if you intend to strap the bot to Discord using an alternative (test) tokenpgUser
: Postgres Username for DB connectionpgPassword
: Postgres Password for DB connectionpgHost
: Postgres Hostname for DB connectiontopggToken
: optional the top GG API token used to report # of discord servers where this bot is installed.sentryDSN
: optional failed INSERTS get reported to Sentry, if configured.ownerId
: The User ID of the bot owner for Discord, used for designating the bot owner.
Local development example: token=123 testToken=${token} pgUser=postgres pgPassword=postgres pgHost=127.0.0.1 ownerId=123 node index.js
- @dfcowell for (docker init conatiners)[docker/compose#6855]
- @alex4108 for refactoring half the bot to run in docker