Updated 4 November 2026
A Discord bot shows as offline when its program isn't running or can't log in: most often the PC it runs on is off or asleep, a free host put it to sleep, the token was reset, or the code crashed. The console output almost always tells you which one; below are the 8 causes we see most, with the error text to look for and the fix.
Works for discord.js (Node.js) and discord.py, nextcord or py-cord (Python). Last checked 28 October 2026.
1. The computer running it is off or asleep
A bot is a program: when your PC sleeps, shuts down or loses Wi-Fi, the bot disappears from the member list within a minute. Fix: run it on a server that is always on. Discord bot hosting at ServerSpark costs €0.69 per month paid per quarter (€0.79 with monthly billing) and restarts the bot automatically after a crash. See Run your Discord bot 24/7.
2. A free host puts it to sleep
General app platforms stop apps without web traffic: on 28 October 2026, Render's free web services spun down after 15 minutes without inbound traffic, and Replit's free published app expired after 30 days. Fix: a host where the bot simply keeps running; compare the options in Replit, Render or Railway for a Discord bot?
3. The token is wrong or was reset
Look for An invalid token was provided (discord.js) or LoginFailure: Improper token has been passed (discord.py). Tokens change when you click Reset Token in the Developer Portal, and Discord can reset a token that was published, for example in a public GitHub repository. Fix: open discord.com/developers → your application → Bot → Reset Token, put the new token in your .env file (DISCORD_TOKEN=...) and restart. Keep .env out of Git.
4. Privileged intents are not switched on
Look for Used disallowed intents (discord.js) or PrivilegedIntentsRequired (discord.py). Your code asks for the Message Content, Server Members or Presence intent, but it isn't enabled. Fix: Developer Portal → Bot → Privileged Gateway Intents, switch on the ones your code uses, save and restart. Bot online but every message.content is empty? Same cause: switch on Message Content.
5. The code crashes on start
A typo, a missing package (Cannot find module in Node.js, ModuleNotFoundError in Python) or the wrong start file stops the bot straight away. Fix: read the first red error line in the console. Add missing packages to package.json or requirements.txt (on ServerSpark they install automatically on start) and check the startup file under Settings: index.js or app.py by default.
6. It runs out of memory
A bot in many servers, with big caches or image work, can use more memory than its plan has; it then stops or restarts over and over. Fix: look at the memory graph in SparkPanel. Near the limit all the time? Move from 512 MB to 1 GB (€1.49 per month paid per quarter, €1.79 monthly billing) or from 1 GB to 2 GB (€2.09 per month paid per quarter, €2.29 monthly billing) in the customer portal; you only pay the difference for the rest of your period.
7. The bot is online but slash commands don't show up
The bot runs, but its commands were never registered, or it was invited without the applications.commands scope. Fix: register your commands (discord.js: a deploy script with the REST API; discord.py: await bot.tree.sync()) and invite the bot again with both the bot and applications.commands scopes. Our Python and JavaScript guides include a working slash command.
8. Rate limits or a Discord outage
A bot that sends too many requests gets HTTP 429 (Too Many Requests) and can be blocked for a while; on shared free hosts, other people's bots on the same IP address can cause this too. And sometimes Discord itself has problems. Fix: check discordstatus.com first, then slow your bot down (no loops that edit or send messages every second).
Keep it online from now on
- Run the bot on hosting, not on your own PC.
- Keep the token in
.envand never commit it. - Let the host restart the bot automatically after a crash (on by default at ServerSpark).
- Look at the console after every update you upload.
Frequently asked questions
Why does my Discord bot go offline when I close my laptop? The bot is a program running on your laptop; when the laptop sleeps or shuts down, the program stops and Discord shows the bot as offline. Run it on bot hosting to keep it online 24/7.
Why does my bot say "Used disallowed intents"? Your code requests a privileged intent (Message Content, Server Members or Presence) that is not switched on. Enable it in the Discord Developer Portal under Bot → Privileged Gateway Intents and restart.
My bot is online but doesn't respond to commands. Why? For message commands, the Message Content intent is usually off. For slash commands, the commands were not registered or the bot was invited without the applications.commands scope.
How do I keep a Discord bot online 24/7 cheaply? Bot hosting at ServerSpark runs a discord.js or discord.py bot 24/7 for €0.69 per month paid per quarter (€0.79 with monthly billing), VAT included, with automatic restarts after a crash.
How much memory does my bot need? Most moderation, utility and fun bots run fine in 512 MB. Choose 1 GB for bots in very many servers, with large caches or image work, and 2 GB for music bots with many voice connections or AI bots with big caches. Lavalink/Java music bots aren't supported on the Node.js/Python plans.