Connect Discord to Your FiveM Server
Setting up Rich Presence and Server Bots
Connecting your server to Discord adds a professional look and enables features like Rich Presence and role checking.
- 1Step 1
Create Discord App
Go to Discord Developer Portal and create a new Application. Copy the Application ID.
- 2Step 2
Setup Rich Presence
Upload your server logo in 'Rich Presence' > 'Art Assets' in the developer portal. Name the image 'large' for example.
-- client.lua: Discord Rich Presence CreateThread(function() while true do SetDiscordAppId(123456789012345678) -- your Application ID SetDiscordRichPresenceAsset('logo') SetRichPresence('Playing on SNG Roleplay') Wait(60000) end end) - 3Step 3
Install Script
Download a script like 'DiscordRichPresence' or use the one built into QBCore/vMenu. Put your Application ID in the config.
- 4Step 4
Server Bots
Use bots like 'Badger_Discord_API' to link Discord roles to in-game permissions (Whitelisting).
Helpful tips
- Status UpdateYou can configure Rich Presence to show current player count and character name.
- SecurityNever share your Bot Token with anyone.
Frequently asked questions
Where do I find the Discord Application ID?
Create an application in the Discord Developer Portal and copy its Application ID from the General Information page. Upload the image you want to show under Rich Presence assets and use its name in SetDiscordRichPresenceAsset.
Where should the Discord bot token go?
Only on the server side: in server.cfg with set (not sets, which makes it public) or in a server-only config file. Never put a bot token in a client script, because every player downloads client files.
Why don't players see Rich Presence?
Rich Presence only shows when the Discord desktop app is running on the same PC and activity status is enabled in Discord settings. It is not visible in the browser version of Discord.
Can I give in-game permissions from Discord roles?
Yes, with a Discord API script that reads the player's roles through your bot. Use it for whitelists, staff ranks or job access, and keep the bot in your server with only the permissions it needs.
Run this guide on a ready server
Need a server for this guide? FiveM server hosting from SNG comes with txAdmin, OneSync and DDoS protection, and the SNG CDN for FiveM delivers your server files to players from inside Saudi Arabia.
Related FiveM guides
Need help setting up your server?
