Skip to main content

Discord Roles Integration

SnailyCADv4 supports Discord based role permisions. Below you'll find out how to get access to it.

How this feature works

  1. Enable it via the CAD-settings
  2. Fetch the roles you'd like to set for each permission
  3. 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

  1. head to https://discord.com/developers/applications
  2. Click the "New Application" button in the top right
  3. Enter a name in the modal and press "Create"
  4. Once created, it will redirect you to the application.
  5. Head to the "OAuth2" section
  6. 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

  1. Head to the Bot tab
  2. Create a new bot
  3. Invite this bot to your Discord server
  4. Copy the bot token and save for #update-env

Update .env

Once everything is correctly setup above, we can continue.

  1. Open the .env file
  2. 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"

  1. Enter the copied values from earlier in the corresponding name
  2. Properly update the .env file
  3. Restart the entire CAD.

Was this page helpful?