A Discord bot that runs inside your FiveM server
Not another thing to host. A resource in your server folder, with direct access to the player list, generated from a description of what your server actually needs. You get the TypeScript source and it is checked before you download it.
First build free · QBCore, Qbox, ESX or no framework
Inside the server, not next to it
Most FiveM Discord bots are a separate Node process running somewhere else, talking to your server over HTTP or not talking to it at all. That is a second thing to host, a second thing to restart after a crash, and a player list that is always a few seconds behind.
A bot beside the server
- Second host, second bill, second thing to keep alive
- Reaches your server over HTTP, if at all
- Player data arrives late or not at all
- Restarts independently, so the two drift apart
A bot as a resource
- Runs in the server you already pay for
- Reads the live player list directly
- Starts and stops with the server, always in sync
- Uses your framework's own exports, not a copy of your data
Six rules that only apply here
The FiveM Node runtime is not ordinary Node, and every difference is a way for a resource to start, report success and do nothing. All six are checked before you get the files, which is the part that usually costs an evening.
| Rule | What goes wrong without it |
|---|---|
| fxmanifest.lua present | Without it FiveM does not recognise the directory as a resource at all. |
| node_version '22' | discord.js 14 needs Node 18 or newer. The default runtime is older and the bot never connects. |
| fx_version 'cerulean' | Older manifest versions reject current syntax, and the error points at the wrong line. |
| at least one server_script | The resource loads, reports itself as started, and runs nothing. |
| CommonJS, not ESM | The FiveM runtime cannot load an ES module. The failure message does not say so. |
| no import.meta | ESM only, undefined here, and it crashes the first time that line is reached. |
What servers actually ask for
Each of these is a description, not a configuration screen. Ask for the combination your server needs and you get one bot that does those things.
Whitelist and role sync
Players link their Discord account, the bot matches them to their in game identifier, and anyone without the role gets dropped on connect.
Live player count
Player count in a channel name or a voice channel title, a list of who is on when someone asks, and a status embed that updates itself.
Tickets with transcripts
A button that opens a private channel only the player and your support role can see, a Close button inside, and the transcript sent where you want it.
Applications
Whitelist applications, staff applications, department applications for PD, EMS and DOJ, each with your questions and your review queue.
Ban appeals and reports
Separate flows for appeals, player reports and bug reports, so your staff are not triaging three different things in one channel.
In game logs
Server events pushed to a channel as embeds, in a format your staff can actually read, plus admin commands that act on a player from Discord.
When you should not use this
If what you want is whitelisting and basic moderation and nothing beyond that, there are open source resources that already do exactly that, for free, tested across thousands of servers. Install one of those. You do not need a generator to arrive at a solved problem.
Generating one makes sense when the thing you want is not in the fixed feature list: a ticket flow that follows your rules, an application form with your questions, a log format your staff can read, or anything that has to touch your framework's own data. The alternative there is forking someone else's bot and writing the feature yourself, and that is the evening this replaces.
Other things for your server
Frequently Asked Questions
Yes. The FiveM server has a Node runtime, so a resource can hold a full discord.js bot and start with the server.
The catch is that this runtime differs from plain Node in a few specific ways, mainly the module format and the Node version declared in the manifest. Getting any of them wrong makes the resource fail to start with very little explanation. Those differences are checked automatically here before you download anything.
No. The resource runs in the server you already pay for, starts when it starts and stops when it stops. You still need a bot token from the Discord Developer Portal, which is free.
Yes. Name the framework in your description and the generated code uses that framework’s exports and player identifiers. A server running no framework at all works too, and so does Qbox.
Yes, directly, because it runs inside the server. There is no HTTP round trip and no polling an external status API, so a player count in a channel name or a live list on request is one of the simplest things to ask for.
If you want whitelisting and basic moderation and nothing beyond that, zdiscord is free, open, widely used and already does it. Use it.
Generate one instead when the thing you want is not in it: a ticket flow that matches your rules, an application form with your questions, a log format your staff can read, or anything touching your framework’s own data. The alternative there is forking a fixed bot and writing the feature yourself, which is the work this replaces.
No. Those are configured on someone else’s infrastructure and stop working when the subscription does. This produces a resource in your server folder and TypeScript source you keep, with no ongoing dependency on us.
The first build is free and needs no card. After that a build has been running around 80 credits and a later change around 110, from the same credit balance as the rest of the tools. New accounts start with 250 credits.
Create the application in the Discord Developer Portal and copy the bot token, enable any privileged intents the generated README lists, drop the folder into your resources directory and add it to your server config. Then start the server.
The setup guide at ai.swisser.dev/discord-bot-setup walks all of it, including where the token goes in server.cfg, which is a convar rather than a .env file.
Build it for your server
Describe the commands, the roles and the flows your server needs. The first build is free and the source is yours.