Discord Integration Guide for FiveM Servers
Complete guide to integrating Discord with your FiveM server's CAD system, bots, and community management.
Discord is the heart of most FiveM communities. Integrating it with your CAD/MDT system gives players one experience where players can authenticate, receive notifications, and manage their roleplay without juggling multiple accounts. This guide covers everything from basic webhooks to full OAuth integration.
Types of Discord integration
There are several ways to connect Discord with your FiveM server. The best approach depends on your community's needs and technical capabilities.
Setup process overview
Discord integration is configuration you do once, before anyone signs in.
Every step below happens in Discord's developer portal, and Discord documents each one: the OAuth2 guide lists what each scope grants, the webhook reference covers what a message can carry, and the rate limits page explains what happens when a bot posts too often.
How OAuth2 sign-in works
OAuth2 lets users log in to your CAD with their Discord account. Here's how it works:
Role synchronization
The real power of Discord integration is automatic role sync. When an admin promotes someone in Discord, their CAD permissions update instantly. No manual configuration needed.
Webhook notifications
Webhooks push events from your CAD to Discord channels. This keeps your community informed even when they're not actively in-game.
How CDE CAD uses the connection
In CDE CAD each community maps to one Discord server, and the login reads which servers a member belongs to. Membership is the access check: someone who leaves your Discord loses the CAD community with it, and nobody has to remember to remove them. Discord handles the sign-in, so the CAD receives a member's identity and roles, never their Discord password.
Role mapping covers admin, supervisor, dispatch, judicial, fire and EMS, and officer access. You set the mapping once in the admin panel, and from then on a promotion or removal in Discord is the only change anyone makes.
Webhooks are set per department, so police reports can post to the police channel and EMS logs to the EMS channel rather than one shared feed. Paste the channel's webhook URL into the department's settings and use the test button to confirm it posts. Announcements written in the admin panel go to the CAD dashboard and the configured channels at the same time, with a priority and an expiry date so old notices clear themselves.
Best practices
Follow these guidelines to ensure your Discord integration is secure and effective: