Discord Roles Integration
SnailyCADv4 supports Discord based role permisions. Below you'll find out how to get access to it.
How this feature works
- Enable it via the CAD-settings
- Fetch the roles you'd like to set for each permission
- Save
Later
- User's permisions get updated, Discord's roles are also updated
- User authentications via Discord, user's permissions are updated based on their roles.
Create Discord application
If you already have an application created in the Discord portal, you can skip this step.
Note: you can use the same application from Discord Authentication
- head to https://discord.com/developers/applications
- Click the "New Application" button in the top right
- Enter a name in the modal and press "Create"
- Once created, it will redirect you to the application.
- Head to the "OAuth2" section
- Copy the "Client ID" and "Client Secret" (these will be used later)
Creating bot
We'll now have to create the bot in the application.
warning
The bot must have Manage Roles
permissions and the bot's role must also be above all the roles
that you'd want to add to users
- Head to the
Bot
tab - Create a new bot
- Invite this bot to your Discord server
- Copy the bot token and save for #update-env
Update .env
Once everything is correctly setup above, we can continue.
- Open the
.env
file - Add the following lines
note
This must be placed at the bottom of SnailyCAD's .env file
DISCORD_BOT_TOKEN=""
DISCORD_SERVER_ID=""
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
tip
SnailyCAD also supports multiple Discord servers. This can be done by adding a comma ,
between each server ID.
Example: DISCORD_SERVER_ID="123456789123456789,987654321123456789"
- Enter the copied values from earlier in the corresponding name
- Properly update the .env file
- Restart the entire CAD.