This is a role manager for my personal Discord servers
- Clone or download the repository.
- Ensure you have Python 3.10+ installed.
- Install the project dependencies with
pdm install. - (Optional) Install development dependencies for testing:
pdm install -d. - Configure
roles.jsonwith the roles you want to manage and their associated emojis. - Copy
.env.exampleto.envand fill in your Discord bot token and other settings. - To run the bot, execute
pdm run(orrun.baton Windows).
Rolm now includes a built-in web dashboard for managing users, roles, birthdays, guilds, and logs through a dark-themed web UI.
- Overview - live stats cards (users, guilds, reaction roles, birthdays) plus the next upcoming birthday
- Users - searchable/filterable user table pulled from the SQLite database
- Roles - view and edit reaction role mappings live (writes directly to
roles.json) - Birthdays - calendar view with month filter and today's birthday highlight
- Guilds - birthday channel and birthday role configuration viewer
- Logs - tail the latest bot logs in real-time
You can start the dashboard alongside the bot in a few ways:
Option 1: Run both at once
pdm run dashboard # dashboard only
# Or use the bundled scripts:
# Windows (interactive): run.bat
# Windows (background): Rolm_Role_Manager.bat
# PowerShell: run.ps1Option 2: Run separately
# Terminal 1
pdm run # starts the bot
# Terminal 2
pdm run dashboard # starts the dashboardDirect launch
python -m dashboard.main # respects DASHBOARD_HOST / DASHBOARD_PORTThe dashboard expects discord.db, roles.json, birthday.json, and rolm.log in the project root.
See .env.example for all available variables. Key dashboard variables:
DASHBOARD_HOST- bind address (default0.0.0.0)DASHBOARD_PORT- bind port (default8080)OAUTH2- set totrueto enable Authentik loginAUTHENTIK_CLIENT_IDAUTHENTIK_CLIENT_SECRETAUTHENTIK_ISSUERAUTHENTIK_REDIRECT_URIAUTHENTIK_USER_INFO_ENDPOINT
The dashboard supports optional OAuth2 / OIDC authentication via Authentik. When enabled, unauthenticated users are redirected to Authentik to log in before accessing the dashboard.
- In Authentik, create a new Provider:
- Type: OAuth2/OpenID Provider
- Client type: Confidential
- Redirect URI:
https://your-dashboard-domain/callback - Scopes:
openid,profile,email
- Create an Application linked to that provider.
- Copy the Client ID, Client Secret, and Issuer URL into your
.env:OAUTH2=true AUTHENTIK_CLIENT_ID=your-client-id AUTHENTIK_CLIENT_SECRET=your-client-secret AUTHENTIK_ISSUER=https://authentik.yourdomain.com/application/o/your-provider/ AUTHENTIK_REDIRECT_URI=https://your-dashboard-domain/callback AUTHENTIK_USER_INFO_ENDPOINT=https://authentik.yourdomain.com/application/o/userinfo/ - Restart the dashboard. Visiting
/will now redirect unauthenticated users to Authentik.
Set OAUTH2=false (or omit the variables) to run the dashboard in open mode for local/trusted networks.
After installing the development dependencies, you can run the test suite with:
pdm testor directly with pytest:
pytest- Missing pdm (Install pdm using
pip install pdm)
Interested in contributing? Feel free to reach out to me on my discord! geoffery10
- Geoffery Powell - Geoffery10
This project is licensed under the GNU General Public License v3.0 – see the LICENSE file for details.
