Help
Troubleshooting
Most problems happen after the download, in the Developer Portal or in the config. The exact error text usually names the fix.
An invalid token was provided
An invalid token was provided. means the bot is using a token Discord no longer accepts. Resetting a token kills the old one at once, and Discord also kills tokens it finds in public GitHub repositories.
- Open the Developer Portal, Bot, Reset Token, and paste the new token into
.envor thesetline in server.cfg. - No quotes and no spaces around the value in
.env. In server.cfg the value goes in double quotes. - Check that you pasted the token, not the Application ID. The token is much longer and contains dots.
Used disallowed intents
Used disallowed intents means the bot asks for a privileged intent that is switched off for its application. Discord refuses the whole connection, not only that intent.
Open the Developer Portal, Bot, Privileged Gateway Intents. Turn on the ones the README lists, press Save Changes and start the bot again. See Turn on the intents it needs.
Slash commands do not appear
The bot is online, but typing / shows none of its commands. Check in this order:
- The invite scope. The invite link needs both
botandapplications.commands. Generate a new link with both, open it for the same server, then pressCtrl+Rin the Discord app. - Registration. A standalone bot registers its commands with
npm run deploy. Run it again after a change adds or renames a command. A FiveM resource registers on start and logs how many commands it registered. - The server id. Commands are registered for the server whose id is in the config. In another server they do not appear.
Missing required environment variable
The bot stops at once with Error: Missing required environment variable: GUILD_ID or, for a FiveM resource, Missing required convar: discord_guild_id. A setting is empty, misspelled or in the wrong place.
- Standalone: the file must be named
.envexactly, in the project folder, not.env.txtand not.env.example. - FiveM: the
setlines must come before theensureline in server.cfg. - Compare every name with
.env.exampleor the README. The names differ from bot to bot.
The bot lacks permissions
The bot answers with something like I could not finish that request. Check my permissions and try again., or the console shows Missing Permissions. Two causes cover nearly every case:
- A permission is missing on the bot's role or in the channel. Compare with the permissions in the README.
- The role order is wrong. A bot can only give, take or edit roles below its own highest role. In Server Settings, Roles, drag its role above the roles it manages. Server owners and roles above the bot stay out of its reach.
A FiveM resource starts but nothing happens
- No output at all.
dist/server.jsis missing, for example because the folder was nested one level too deep.fxmanifest.luaanddistmust sit directly in the resource folder. - yarn fails on start with
The engine "node" is incompatible with this module. Expected version ">=18". Got "16.9.1". The FXServer artifact is too old to have a newer Node runtime. Update the server artifact; no change to the resource can replace that. Cannot find module 'discord.js'. Theyarnresource is missing or starts after the bot. It installs discord.js into the resource folder on start.
FiveM: GetConvar is not defined or commands answer twice
GetConvar is not defined means a file of the resource was run with Node in a normal terminal. GetConvar exists only inside FXServer. Do not run anything by hand: the resource registers its own commands when it starts.
When every command answers twice, two copies of the bot are logged in, usually after restarting the resource while the old connection was still open. Restart the whole server once.
The application did not respond
The application did not respond under a command means the bot took longer than three seconds to reply, or is not running. Generated commands acknowledge first and reply after, so this usually points at code added by hand, or at a bot that crashed: check its console. Paste what you see into the change box.
The build ended with problems
When the status reads Built, with problems the checks could not fix, the checks panel lists what is left, with file and line. Send one change such as "Fix the errors in the checks panel", or paste the findings. If the request was very large, build the core first and add the rest as changes.
A yellow note Reached max tool iterations (15). Returning current workspace state. means the build ran out of writing steps. It is not an error: what was written was checked. Compare the result with your request and ask for anything missing.
- 1. Checking: compile, scan, boot
- 2. Round 1: all errors cleared by the fixing round
- 3. Reached max tool iterations: the build used all its writing steps
Not enough credits
Not enough credits. This needs 800. A run needs 400 credits available for a build and 800 for a change or question. That amount is held, not charged: a change typically costs about 50-150 and the rest returns when the run ends.
Free accounts get 25 free credits on each day they sign in. For more, top up or choose a plan on the pricing page.
Still stuck
- The Discord bot setup guide covers the Developer Portal step by step, with the errors per target.
- Ask in the bot itself: paste the error into the change box, or ask a setup question.
- Use Report a problem at the bottom right of the bot page, so we see the bot you mean, or ask in the SwisserAI Discord.