Discord bot offline or not responding? 10 causes and fixes

, developer of Bot-Hosting

A bot that “does not work” is in one of three states: offline because its process stopped, offline while its process still runs, or online but silent. Each state has its own short list of causes, and the bot’s log almost always names the one you have. Start with the flowchart, then jump to the cause.

Diagnostic flowchart: if the bot is offline and the process stopped, the last log lines point to a token, intents, memory, file limit, uncaught crash or plan problem; if it is offline but the process runs, look for rate limits, network timeouts or repeated reconnects; if it is online but ignores you, check slash command registration, the 3-second response rule and the Message Content intent

The errors below come from discord.js 14.28.1 and discord.py 2.7.1, which we ran on 30 November 2026. The fleet figures come from the servers we run for Bot-Hosting.

Read the log first

Every fix below starts with the last 20 lines the bot printed before it stopped or went quiet:

  • On your PC: the terminal where you ran it.
  • With pm2: pm2 logs my-bot --lines 50.
  • With systemd: journalctl -u my-bot -n 50.
  • On Bot-Hosting: the deployment’s Console. For the common failures, the console names the cause above the logs.
A Bot-Hosting deployment console after a failed start: a banner reads Discord refused the bot token, with buttons to ask the assistant or fix it in Studio, above the log line Login failed: An invalid token was provided

If the log is empty, the bot probably never started: check that the entry file and start command are the ones you think.

1. Discord reset your token

Error [TokenInvalid]: An invalid token was provided.
discord.errors.LoginFailure: Improper token has been passed.

The bot is offline and exits at every start. Either the token never reached your code (an empty or misnamed environment variable), or Discord no longer accepts it. Discord invalidates a token when:

  • you or a teammate clicked Reset Token in the Developer Portal;
  • the token was pushed to a public repository, where Discord’s scanning finds it and resets it;
  • the bot used up its 1,000 gateway logins (IDENTIFY calls) in 24 hours. Discord’s documentation says that reaching this limit ends all sessions and resets the token. A bot that crashes right after logging in and restarts every minute or so gets there in a day.

Fix: reset the token in the portal, put the new one in your environment variable or secret, never in a file, and restart. If the bot was restarting in a loop, fix that crash first, or the new token goes the same way. The TokenInvalid guide goes through each case.

2. Missing intents

The bot crashes at login with:

Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted.
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents
that have not been explicitly enabled in the developer portal.

Other libraries show the raw gateway close code, 4014. Your code asks for a privileged intent (Server Members, Presence or Message Content) that is switched off in the portal.

The quieter version: the bot is online, slash commands work, but prefix commands like !help do nothing. Without the Message Content intent, Discord sends empty content, embeds, attachments and components for most messages; only DMs, messages that mention the bot and the bot’s own messages keep their content. discord.py warns you at startup:

WARNING discord.ext.commands.bot Privileged message content intent is missing, commands may not work as expected.

Fix: enable the intent under Bot > Privileged Gateway Intents in the portal and restart, or stop requesting it. In discord.js, that means adding GatewayIntentBits.MessageContent to the client’s intents only if you need it; in discord.py, intents.message_content = True. A verified bot, required from 100 servers, must also be approved for each privileged intent. Details in the disallowed intents guide.

3. Slash commands are not registered or not synced

The bot is online, but its command does not appear when you type /, or an old version appears. Discord only shows commands the bot has registered, and registering is a separate step from logging in:

  • discord.py registers nothing until you call tree.sync().
  • discord.js registers commands only if your code calls application.commands.set() or a deploy script with the REST API.

Guild commands update instantly. Global commands reach users without a fixed delay; Discord rejects and refreshes a stale one when someone uses it. While developing, register in your test server for instant updates:

GUILD = discord.Object(id=123456789012345678)  # your test server's ID


async def setup_hook():
    bot.tree.copy_global_to(guild=GUILD)
    await bot.tree.sync(guild=GUILD)

bot.setup_hook = setup_hook

Two more things to check: the bot was invited with the bot scope, which includes applications.commands, and you are not re-creating commands in a loop. Discord allows 200 command creations per day per server.

4. “The application did not respond”

Discord shows this under a slash command when the bot does not answer within 3 seconds. A reply sent later fails with:

DiscordAPIError[10062]: Unknown interaction
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction

The command does something slow first: a database query, an API call, an image. Fix: acknowledge the interaction immediately, then edit the answer. The user sees “thinking” in the meantime, and you have 15 minutes.

discord.js:

client.on(Events.InteractionCreate, async (interaction) => {
  if (!interaction.isChatInputCommand()) return;
  if (interaction.commandName === 'report') {
    await interaction.deferReply();
    const text = await buildReport();
    await interaction.editReply(text);
  }
});

discord.py:

@bot.tree.command(description="Builds a slow report")
async def report(interaction: discord.Interaction):
    await interaction.response.defer(thinking=True)
    text = await build_report()
    await interaction.followup.send(text)

In Python, also look for blocking calls inside commands: time.sleep(), requests.get() or heavy computation freeze the whole event loop, so every command times out, not just the slow one. Use await asyncio.sleep(), an async HTTP client, or await asyncio.to_thread(...). The unknown interaction page of our docs covers the same rule.

5. The bot runs out of memory

The bot works for hours or days, then goes offline and comes back, again and again. Two signatures:

  • The process is killed from outside, often with exit code 137 and no error of its own: it reached the memory limit of its container or server.
  • Node.js stops on its own with FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (exit code 134) when the V8 heap is full.

On Bot-Hosting, the console says “The app was killed for using more memory than it has.” Caches are the usual culprit: every message, member and presence the library keeps grows with the number of servers.

Fix: cap the caches. discord.js v14:

const { Client, GatewayIntentBits, Options } = require('discord.js');

const client = new Client({
  intents: [GatewayIntentBits.Guilds],
  makeCache: Options.cacheWithLimits({
    ...Options.DefaultMakeCacheSettings,
    MessageManager: 50,
    GuildMemberManager: {
      maxSize: 200,
      keepOverLimit: (member) => member.id === member.client.user.id,
    },
  }),
  sweepers: {
    ...Options.DefaultSweeperSettings,
    messages: { interval: 3600, lifetime: 1800 },
  },
});

discord.py:

client = discord.Client(
    intents=intents,
    max_messages=100,
    member_cache_flags=discord.MemberCacheFlags.none(),
    chunk_guilds_at_startup=False,
)

Then look for your own leaks: arrays or maps that only grow, listeners added inside a command. If the bot genuinely needs more, give it more RAM. A music bot with its own Lavalink needs at least 512 MB for Lavalink alone.

6. Too many open files

OSError: [Errno 24] Too many open files

Every socket, file and database connection uses a file descriptor, and processes start with a soft limit, often 1,024. When the bot reaches it, new connections fail. The error often hides behind another one: on our fleet, many crashes that look like DNS failures, such as PostgreSQL’s could not translate host name "..." to address: System error, are this limit, while DNS itself answers fine.

It mostly hits Python, Java and other runtimes: Node.js raises its own soft limit to the hard limit when it starts, which we confirmed in /proc/self/limits under Node.js 22. The cause is usually a leak, such as a new aiohttp.ClientSession per request that is never closed, or one connection per user to a proxy or a database.

Fix: reuse one HTTP session and one connection pool, and close what you open. Check the count with ls /proc/<pid>/fd | wc -l. If the bot really needs more, raise the soft limit at the top of the script; no privilege is needed up to the hard limit:

import resource

soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (min(65536, hard), hard))

On your own server with systemd, LimitNOFILE=65536 in the unit does the same.

7. Rate limited or banned by Cloudflare

The bot cannot log in or stops answering, and the log shows HTTP 429, an HTML page from Cloudflare, or error 1015. discord.py logs:

We are being rate limited. POST https://discord.com/api/v10/... responded with 429. Retrying in 2.00 seconds.

Discord allows a bot 50 requests per second overall, plus per-route limits. Separately, an IP address that makes 10,000 invalid requests (status 401, 403 or 429) within 10 minutes is temporarily restricted by Cloudflare. The usual causes are a restart loop that logs in again and again, a loop that sends or edits messages for every member, or ignoring 429 answers.

Fix: stop the loop first; retrying while restricted keeps you restricted. discord.js retries rate-limited requests for you without saying so, so log them to see which route is hit:

const { RESTEvents } = require('discord.js');

client.rest.on(RESTEvents.RateLimited, (info) => {
  console.warn(`Rate limited on ${info.route}: retry in ${info.timeToReset} ms (global: ${info.global})`);
});

On shared hosting, your outbound IP may be shared with a few other servers, and another bot’s traffic can get it restricted. The server rate limits page explains what to do on Bot-Hosting.

8. A crash nobody catches

The bot starts, then dies on the first error, with a stack trace and nothing else. Since Node.js 15, a rejected promise without a handler ends the process with exit code 1. A missing permission, a deleted message or a timeout in any async handler is enough.

Fix: catch errors where they happen, and log the rest instead of dying:

client.on(Events.Error, (err) => console.error('Client error:', err));
process.on('unhandledRejection', (err) => console.error('Unhandled rejection:', err));

Logging is not fixing: read what gets logged and handle it in the command. discord.py behaves differently: an exception in an event is logged as Ignoring exception in on_message and the bot keeps running, so the symptom is a command that silently does nothing. Search the log for that line.

Make sure something restarts the bot after a real crash, with a delay that grows if it keeps crashing: Bot-Hosting restarts crashed processes, and on a VPS, pm2’s exp_backoff_restart_delay or systemd’s Restart=on-failure with RestartSec do it. A loop of instant restarts burns through the 1,000 daily logins of cause 1. The identify errors page shows more logging patterns.

9. The free plan expired or the host stopped the bot

Nothing in the log explains it, because the bot did not fail: its host stopped it. Free plans everywhere have a condition. On Bot-Hosting, the Free plan is renewed by hand every 4 days; miss it and the deployment is suspended, then deleted if you do not renew within 3 more days. FPS.ms asks for a renewal every 24 hours, Wispbyte for a login every 14 days, and some cloud tiers stop when a monthly credit runs out, as on Railway’s Free plan.

Fix: check your host’s dashboard and email for a renewal notice or a suspension, renew, and set yourself a reminder. A host can also suspend a bot that breaks its rules, and self-bots break Discord’s terms everywhere. The free hosting comparison lists each provider’s conditions, and the renewal guide shows where to renew on Bot-Hosting.

10. Network timeouts to Discord

ConnectTimeoutError: Connect Timeout Error (attempted address: discord.com:443, timeout: 10000ms)

Code UND_ERR_CONNECT_TIMEOUT. discord.js uses undici for HTTP, which gives up when the connection and TLS handshake to Discord take more than 10 seconds. The bot can stay offline, or log in and fail some commands.

On our fleet, two patterns explained most of these errors:

  • A daily window. Between 05:00 and 08:00 UTC, every one of our locations sees more connection timeouts to Discord than the rest of the day, so moving the bot to another server does not make them go away.
  • The path MTU. On the IPv6 path our servers used to reach Discord, about 17% of TLS handshakes were lost. Recent runtimes send a much larger first TLS packet, because their default key exchange includes the post-quantum X25519MLKEM768: we measured 1,603 bytes from Node.js 22, against 356 bytes with classic curves only. That packet did not fit the path MTU and was silently dropped. Setting the IPv6 route MTU to 1280 fixed it across the fleet.

If you run your own server behind a VPN, a tunnel or an IPv6 route, this script tells you whether the handshake size is the problem. It times a handshake with the default key exchange, then with classic curves:

// tls-check.mjs: run with `node tls-check.mjs`
import tls from 'node:tls';

function handshake(label, options = {}) {
  return new Promise((resolve) => {
    const start = Date.now();
    const socket = tls.connect({ host: 'discord.com', port: 443, servername: 'discord.com', ...options }, () => {
      console.log(`${label}: ${Date.now() - start} ms, group ${socket.getEphemeralKeyInfo()?.name ?? 'unknown'}`);
      socket.end();
      resolve();
    });
    socket.setTimeout(10000, () => {
      console.log(`${label}: no handshake after 10 s`);
      socket.destroy();
      resolve();
    });
    socket.on('error', (err) => {
      console.log(`${label}: ${err.code ?? err.message}`);
      resolve();
    });
  });
}

await handshake('default');
await handshake('classic', { ecdhCurve: 'X25519:P-256' });

On a healthy network both lines print a few dozen milliseconds. Node.js 24 names the default group X25519MLKEM768; Node.js 22 prints unknown for it. If the default handshake hangs and the classic one works, lower the MTU on the interface or route that carries the traffic, or clamp the TCP MSS on your firewall. Do not switch off post-quantum key exchange in the bot to hide it. Otherwise, check DNS, the firewall’s outbound rules, and the connection timed out page.

Keep it from happening again

  • Keep the token in an environment variable and rotate it if it ever leaks.
  • Request only the intents you use.
  • Defer any command that can take more than a second.
  • Cap caches and watch memory over a few days, not a few minutes.
  • Log errors, and restart with a growing delay, never in a tight loop.
  • Know your host’s renewal or credit rules.

If you are choosing where to run the bot, the guide to hosting a Discord bot 24/7 compares the options and shows a crash-safe setup on Bot-Hosting and on a VPS.

Sources

Checked on 30 November 2026: