Discord patchnotes
The UPDATE section can automatically display patchnotes / announcements posted in a Discord channel: you write your updates in Discord, they appear in the loading screen. No file editing required.
TIP
Patchnotes are cached: they show instantly on load, then refresh automatically in the background each time the server starts.
Configuration — config/discord.lua
return {
BotToken = "", -- Your Discord bot token (keep it secret!)
ChannelID = "", -- ID of the channel to read
MessageLimit = 10, -- Number of messages to display (1-20)
Debug = true, -- Verbose server logs (set false in prod)
}| Field | Description |
|---|---|
BotToken | Your Discord bot token. Never share it. |
ChannelID | ID of the Discord channel to read (e.g. #patchnotes) |
MessageLimit | Number of messages fetched (1 to 20) |
Debug | Detailed logs in the FXServer console (request, response, counts, cache write) |
Step-by-step setup
1. Create a Discord application & bot
- Go to the Discord Developer Portal.
- New Application → name it → confirm.
- Bot tab → Add Bot → Yes, do it!.
- Under the bot name, Reset Token then copy it → paste into
BotToken.
WARNING
Never share your token publicly. Anyone who has it can control your bot.
2. Invite the bot to your Discord server
- OAuth2 tab → URL Generator.
- Scopes: check bot.
- Bot Permissions, at minimum:
- ✔ Read Messages / View Channels
- ✔ Read Message History
- Copy the generated URL, open it, select your server, Authorize.
3. Get the channel ID
- Discord → Settings → Advanced → Developer Mode (enable it).
- Right-click the target channel (e.g.
#patch-notes) → Copy Channel ID. - Paste it into
ChannelID.
4. Discord message format
Messages posted in the channel follow this structure:
Line 1 → Patchnote title
--- → Separator (optional, ignored)
Remaining → Description / detailsExample message to post:
v1.3.0 - Major Update
---
- Added 10 new vehicles
- Fixed server crash on job start
- New faction: Special Forces
- Performance improvementsNOTE
If a message has no text (empty content) but contains an embed, the script automatically pulls the embed's title + description.
5. Restart the server
Once BotToken, ChannelID and MessageLimit are set, restart the FiveM server. Messages are fetched and displayed automatically.
Manual fallback (without Discord)
If you don't want to use Discord, leave BotToken/ChannelID empty and fill the updates directly in config/config.js:
update: {
title: "UPDATE",
elements: [
{
title: "v1.2.0",
description: "- Added new vehicles\n- Fixed bugs\n- Improved performance",
date: "11/01/2026",
author: "Admin",
},
{
title: "v1.1.0",
description: "- New jobs added\n- Economy rebalance",
date: "05/01/2026",
},
],
},| Field | Description |
|---|---|
title | Version number or name |
description | Details (\n for a line break) |
date | (optional) Update date |
author | (optional) Author |
These elements only show if Discord returns no message.
Security & escrow
IMPORTANT
config/discord.lua contains your token: it is listed in escrow_ignore of fxmanifest.lua, so it stays editable even on an escrow resource. Never commit your real token to a public repository.
Troubleshooting
Enable Debug = true and check the FXServer console:
| Console message | Meaning |
|---|---|
ChannelID ou BotToken manquant | One of the two fields is empty in discord.lua |
Discord error: 401 | Invalid token |
Discord error: 403 | The bot can't access the channel (permissions / invite) |
Discord error: 404 | Wrong ChannelID |
Messages bruts reçus: 0 | The channel is empty, or the bot can't see the history |
Cache écrit dans data/discord_cache.js (OK) | Everything works ✅ |