How to Set Up a FiveM Discord Whitelist (2026 Guide)
Running a FiveM server is hard work. You spend hours configuring scripts and cars, so the last thing you want is random trolls ruining the fun. You need to control who gets in.
The best way to do this is a Discord Whitelist. This links your game server to your Discord server. If a player isn't in your Discord or doesn't have the right role, they can't join the game. It is that simple.
In this guide, I will show you exactly how to set this up using the two best methods for 2026.
The Discord Developer Portal
Before you download any scripts, you have to set up your Discord Bot. This is where most people get stuck, so follow these steps carefully.
-
Create the App
Go to the Discord Developer Portal. Click New Application and name it something like "Server Gatekeeper". Then click the Bot tab on the left and click "Add Bot".
-
Turn on the Intents
This is the most important part. Scroll down to the "Privileged Gateway Intents" section. You must turn on Server Members Intent. If you don't do this, the bot can't see who is in your server and the whitelist will fail.
-
Get Your Keys
You need three things. Copy your Bot Token (from the Bot tab), your Client ID (from the OAuth2 tab), and your Guild ID (Right click your server icon in Discord and click "Copy ID"). Save these in a notepad for later.
Make the Wait Worth It
A secure whitelist is vital, but it also adds a barrier to entry. Once players are approved, don't lose them to a boring loading screen. Our Night Raid Template offers a professional, animated introduction to your world.
Get the TemplateMethod 1: The "Badger" Stack (Best for RP Servers)
If you run a Roleplay server, you probably need different permissions for different people. For example, you might want Police to have access to a special menu, or Donors to have access to special cars. The best way to do this is by combining two scripts: Badger_Discord_API and DiscordAcePerms.
-
Badger_Discord_API
This script does the heavy lifting. It talks to Discord and remembers the data so your server doesn't get rate-limited. Download it here.
-
DiscordAcePerms
This script links your Discord roles to FiveM permissions. Download it here.
How to Install It
Download both folders and put them in your resources folder. You must rename the folders to exactly Badger_Discord_API and DiscordAcePerms. Remove any extra text like "-master" or the scripts will not work.
Next, open your server.cfg file and add these lines. The order matters:
# Start the API first
ensure Badger_Discord_API
# Give AcePerms permission to change server settings
add_ace resource.DiscordAcePerms command.add_principal allow
add_ace resource.DiscordAcePerms command.remove_principal allow
# Start the Permission script
ensure DiscordAcePerms
Finally, go into the DiscordAcePerms folder and open config.lua. You will see a list where you can paste your Role IDs.
roleList = {
-- {DiscordRoleID, "AceGroup"}
{123456789012345678, "group.admin"},
{987654321098765432, "group.member"},
}
Method 2: txAdmin (Easiest Method)
If you don't want to mess with code files, you can use txAdmin. This is the web panel that comes with FiveM. It has a built-in whitelist that is very easy to use.
-
Open Settings
Go to your txAdmin page in your browser (usually localhost:40120). Click Settings and then Discord Bot.
-
Enter Keys
Paste the Token, Client ID, and Guild ID that you saved earlier.
-
Turn on Whitelist
Go to the Player Manager tab. Switch the mode to "Discord Server Roles". Then just type in the Role IDs of the people you want to let in.
Why Is It Not Working?
If you set everything up but players are still getting kicked, check these three common problems.
"Identifier Not Found"
This happens when FiveM can't talk to the Discord app on the player's PC. To fix this, tell your players to:
- Close FiveM completely.
- Open Discord and make sure it is not minimized.
- Re-open FiveM. They might see a popup in Discord asking to "Authorize". They must click yes.
"Roles == False"
If the console says roles are false or missing, you probably forgot the Gateway Intents in the Developer Portal. Go back to the first step of this guide and make sure those switches are turned on.
Which Method Should You Use?
If you just want to stop random people from joining, use txAdmin. It is faster and easier. If you want a complex RP server where Police and Admins have different powers automatically, use the Badger Stack.
For those who want a bot that handles chat and moderation too, you can also look at zdiscord, but it takes a bit more work to set up.