Discord Webhooks Integration
Learn how to setup Discord Webhooks in SnailyCADv4.
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.
- 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
warning
The bot must have Manage Webhooks
permissions
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.