Skip to content
Server SetupGuides

How to Set Up a Discord Bot for Your FiveM Server

· 6 min read

How to Set Up a Discord Bot for Your FiveM Server

Discord is mission control for almost every FiveM community. Connecting a bot to your server unlocks role-based whitelisting, live logs, player counts and more. Here's the lay of the land.

What a server bot does

  • Whitelist by role — verify a player's Discord role on connect.
  • Logging — pipe in-game events to staff channels.
  • Status — show live player count and server state.
  • Identity — read a player's Discord ID for permissions.

1. Create the bot application

In the Discord Developer Portal, create an application, add a bot user, and copy its token. Treat the token like a password — anyone with it controls your bot.

2. Invite it with the right scopes

Generate an invite URL with the bot scope and the permissions it needs (read roles, send messages). Add it to your server and place it above the roles it must read in the hierarchy.

3. Connect it to FiveM

A bridge resource (or your whitelist script) takes the bot token and your guild/role IDs in its config. With those set and the resource ensured, FiveM can check roles on the player-connecting event.

4. Lock the token down

Never commit the token to a public repo or paste it in screenshots. If it leaks, regenerate it immediately.

A Discord bot is the backbone of a clean whitelist setup — get both in place before you open applications to the public.

Keep reading