Find your cause
| Symptom | Likely cause | Fix |
|---|---|---|
| Offline when your PC is off or asleep | Bot runs on your PC | Move it to a host |
| Offline after ~15–30 minutes idle on a free platform | Platform sleeps idle apps (Render free web services after 15 min; Heroku Eco web dynos after 30 min) | Use a host without idle sleep |
| Offline at a fixed time every few days | Free plan renewal expired | Renew, or use a plan without renewal |
| Restarts, then dies, no clear error | Out of memory | Check the memory graph; right-size RAM |
| Never comes online; error 4004 or "TokenInvalid" | Wrong or reset token | Fix the token |
| Never comes online; error 4014 "Disallowed intent(s)" | Privileged intent not enabled | Enable it in the Developer Portal |
| Commands fail with 429s, then the bot stalls | Rate limited or temporarily restricted | Rate limits explained |
| Error 4011 "Sharding required" | Bot is in 2,500+ servers | Enable sharding |
Online but not responding is a different symptom
If the bot still appears online, first check whether the command reaches your handler. A missing slash command points to registration or command access; a visible command that fails points to the handler, permissions or response timing. A message-prefix command may need the Message Content intent enabled in both code and the Developer Portal.
Discord requires an initial interaction response within three seconds. Acknowledge or defer before slow API calls, then send the result. Repeated host restarts do not fix a handler that never responds. Follow the online but silent checklist and test a minimal command before changing the deployment.
Offline after idle time on Render
Check whether the project is a Gateway bot on a Free web service. A worker and an HTTP endpoint have different requirements; use the Render Discord bot guide to choose the matching service rather than adding a ping workaround.
The fixes in more detail
- Stop hosting on your PC. Home PCs sleep, update and reboot. A host keeps the process running in a data center.
- Avoid platforms that sleep. Pinging a bot from an uptime monitor to stop it sleeping is a workaround, and some platforms count it as usage or forbid it. A bot host without idle sleep makes it unnecessary.
- Handle command errors. Catch expected failures around the command and log enough context to fix them. A process-level exception handler is not a safe way to continue after every failure. Bots restart automatically after a crash. Repeated crashes pause restarts; check the console before starting again. Paid plans send a crash alert to a Discord channel.
- Watch memory. A bot that slowly grows (caches, unbounded arrays) is killed at the container limit. Limit discord.js caches, and set
-Xmxbelow the container limit for JDA. - Check the token and intents. These errors stop the bot connecting at all; Discord's close codes 4004 and 4014 tell you which.
- Reconnects are normal. Libraries resume the session after short network blips. Discord limits a bot to 1,000 IDENTIFY calls in 24 hours, so a bot stuck in a crash loop can lock itself out. Fix the loop rather than restarting harder.
How discordbothost keeps a bot online
- Every bot gets its own container, and quiet bots are never put to sleep, so you don't need a ping service.
- Bots restart automatically after a crash. Repeated crashes pause restarts; check the console before starting again. Paid plans post a crash alert to your Discord.
- Live memory and CPU graphs show a leak before it kills the bot.
- Paid plans (from $0.99/month) have no renewal, so nothing expires. The free plan renews weekly.
Sources
https://render.com/docs/free; https://devcenter.heroku.com/articles/eco-dyno-hours; https://discord.com/developers/docs/topics/opcodes-and-status-codes; https://discord.com/developers/docs/events/gateway. Checked . Interaction response timing rechecked on against Discord's interaction documentation.
Questions
Why does my Discord bot go offline when I close my computer?
The bot is a program running on your computer; when the PC sleeps, shuts down or loses internet, the gateway connection closes and Discord shows the bot offline. Run it on a host instead.
Why does my bot go offline after a few minutes on a free platform?
Many free app platforms sleep idle apps. Render spins down free web services after 15 minutes without inbound traffic, and Heroku Eco web dynos sleep after 30 minutes. A Discord bot needs a host that does not sleep.
My bot crashes with no error and goes offline. Why?
Often it ran out of memory and was killed. Check the host's memory graph; if it touches the limit, fix the leak or move to a plan with more RAM.
Why is my Discord bot online but not responding?
An online presence only confirms a connection. Check slash-command registration, the server and channel permissions, required intents and the command handler's logs. If an interaction times out, acknowledge it promptly before doing slower work.
Sources
- 1https://render.com/docs/free
- 2https://devcenter.heroku.com/articles/eco-dyno-hours
- 3https://discord.com/developers/docs/topics/opcodes-and-status-codes
- 4https://discord.com/developers/docs/events/gateway
- 5https://docs.discord.com/developers/interactions/receiving-and-responding
- 6https://discordbothost.com/pricing/
Related
Render Discord Bot Hosting: Free Limits and Setup
Can Render host a Discord bot? Choose a worker or HTTP service, understand free sleep limits, set build commands and move your bot safely.
Updated · 4 min readHow to Host a Discord Bot for Free (Step by Step)
Host a Discord bot 24/7 for free: create the bot, upload your discord.js, discord.py or JDA code to a free host, set the token, and keep it renewed.
Updated · 3 min readHow to Keep a Discord Bot Online 24/7
Keep a Discord bot online when your PC is off. Compare idle sleep, crash recovery, memory limits and free-plan renewal before choosing a host.
Updated · 3 min read