Build
Standalone or FiveM resource
Both targets produce a discord.js bot in TypeScript. The difference is where it runs, and that changes how it starts, how it is configured and what it can see.
The two targets side by side
Both Discord Bot Generator targets write discord.js 14.27.0 bots in TypeScript and run the same four checks. They differ in where the bot lives:
Runs on
Standalone:Your PC, a VPS or a bot hostFiveM resource:Inside your FiveM serverStarts with
Standalone:npm startFiveM resource:ensurein server.cfgSettings live in
Standalone:.envFiveM resource:setlines in server.cfgCommands registered by
Standalone:npm run deployFiveM resource:The resource itself, on every startBuild step
Standalone:npm run buildafter npm installFiveM resource:None, dist/ is in the zipSees game data
Standalone:NoFiveM resource:Yes: players, identifiers, connectionsOnline while
Standalone:Its process runsFiveM resource:Your server runs
Choose FiveM resource when the bot has to know or change something in the game. Choose Standalone for a community bot that has nothing to do with a game server, or when the bot must stay online while the game server restarts.
What a FiveM resource can do
A FiveM resource runs in the same process as your server scripts. It calls the server directly, with no extra connection and no extra hosting. Typical uses, all from the FiveM templates:
- A voice channel named with the live player count, like
Ingame: 24/64. /playerswith names, server ids and pings.- A whitelist: players without a Discord role are refused on connect, with a message.
/kick,/banand/msgfrom Discord, acting on the running server.
Players are matched to Discord through their discord: identifier. It exists only when the player runs the Discord app on the same PC, so tell players to keep Discord open when they join.
- 1. Files: every file of the project
- 2. Download: the same zip as in the checks panel
Why a FiveM resource looks different
The Node runtime inside FXServer has its own rules. The Project rules check enforces them, and they explain the files you see:
node_version '22'FXServer uses Node 16 by default, and discord.js 14 needs Node 18 or newer.CommonJS, no top-level await
The FiveM JavaScript runtime loads require(), not ES modules.dependency 'yarn'The yarn resource installs discord.js into the resource folder when the server starts.dist/server.jsThe compiled entry point. It ships in the zip, so you never run a build on the server.Settings from convars
The token and ids are read withGetConvarfromsetlines in server.cfg.Clean shutdown
The bot logs out when the resource stops, so a restart does not leave two sessions.
ESX, QBCore and other frameworks
By default a FiveM bot uses plain FiveM natives, which work on every server. When the bot should read jobs, money or items, name your framework and the resources in the request: "We run QBCore with ox_inventory; /giveitem should add the item through ox_inventory."
Need Lua instead?
A Discord bot is JavaScript in both targets. For in-game features in Lua, such as a menu or a job, use the AI Script Generator and let the bot talk to it through events or exports.