A Discord bot goes offline for one of a handful of predictable reasons: a reset token, a disabled privileged intent, an expired vote window on a hosted bot, or the bot being removed from the server it depends on. Discord's gateway tells you which one with a close code; codes 4004 and 4013/4014 are the two you'll see most often, and each has a specific, mechanical fix rather than a "just restart it and hope" one.

A user's bot token runs on a Noxyr node and comes online as their own branded bot. Your token Noxyr node MyBot Online

Start here: the most likely cause first

In order of how often each one actually happens:

  1. Token was reset. Someone pressed Reset Token in the Developer Portal, on purpose or by accident, and the old token the bot was using is now dead.
  2. A privileged intent got turned off. Server Members Intent or Message Content Intent was switched off after the bot was already set up.
  3. A vote or subscription window lapsed. On a hosted bot like Noxyr's Custom Bot, running time is tied to a Top.gg vote, and the window plus its grace period ran out.
  4. The bot was removed from the server, or a bot it depends on was. Custom Bot specifically depends on Noxyr's own presence; kicking Noxyr stops the custom bot in that server.
  5. A genuine outage. Discord itself is having a bad day. Rare, but check discordstatus.com before assuming it's your setup.

What the gateway close codes actually mean

CodeMeaningTypical cause
4004Authentication failedThe token is wrong or was reset in the Developer Portal
4013Invalid intent(s)The bot's code requested an intent that doesn't exist, or a combination Discord rejects
4014Disallowed intent(s)The bot requested a privileged intent (Server Members or Message Content) that isn't switched on for the application

In practice, 4013 and 4014 show up for the same underlying reason on most bots: a privileged intent the code needs is switched off in the portal. Discord.js and similar libraries sometimes report this as a "disallowed intents" error in logs rather than the raw numeric code, but it's the same problem. Our privileged gateway intents guide covers what each intent controls and what breaks without it in more depth.

Fixing each one on Noxyr Custom Bot

Gateway 4004, or "Discord rejected this token"

The token the bot last logged in with no longer exists. This happens when the token is reset in the Developer Portal, whether that was deliberate (rotating it for security) or a mistake (pressing Reset Token while just looking around the Bot tab).

  1. Open the Discord Developer Portal, select the application, and go to the Bot tab.
  2. Press Reset Token again, this generates a new one; copy it immediately, since Discord only shows it once.
  3. Open the Custom Bot page on the Noxyr dashboard and paste the new token in.
  4. Switch the bot back on. Noxyr's nodes turn a token-invalid bot off automatically so it doesn't sit in a dead reconnect loop; pasting a working token and flipping it on is what restarts it.

Gateway 4013/4014, or "Discord refused the connection"

A privileged intent that was on during setup got switched off later, usually while someone was clicking around the Bot tab for an unrelated reason.

  1. In the Developer Portal, go to Bot → Privileged Gateway Intents.
  2. Turn Server Members Intent and Message Content Intent back on. Both are required; Noxyr's feature set (welcome messages, member counts, AI chat, auto-responders, ticket transcripts) needs both.
  3. Save, then switch the bot back on from the Custom Bot page on the dashboard. Because Discord only applies intent changes on the next login, simply re-enabling the toggle isn't enough by itself; the bot has to reconnect.

Vote window and grace period lapsed

Custom Bot runs on a Top.gg vote. One vote unlocks it for 12 hours; after that a 74-hour grace period keeps the bot running while the dashboard page locks. If both run out, the bot goes offline, though nothing about your setup is deleted.

  1. Vote for Noxyr on Top.gg.
  2. Return to the Custom Bot page; it unlocks immediately after the vote registers.
  3. The bot restarts on its own, using the same token and settings it had before.

A reminder DM goes out 24 hours after your last vote (12 hours into the grace period) specifically to avoid this. If the bot's status shows "suspended," the page itself will say whether it's the vote, the grace period, or the next issue below.

Noxyr was removed from the server

Custom Bot runs on Noxyr's settings and database for that server, so it depends on Noxyr still being a member. If Noxyr is kicked, the custom bot stops serving that server within about a minute, and it DMs whoever removed Noxyr (and the bot owner, if that's someone else) with an invite link.

  1. Re-invite Noxyr using the link from the DM, or from the Noxyr homepage.
  2. The custom bot picks back up on its own once Noxyr is back in the server; no need to touch the token or intents.

While it's stopped for this specific reason, the vote window is paused rather than spent, so re-inviting Noxyr promptly doesn't cost you time off the clock.

If none of the above fixes it

Check the status message on the Custom Bot page first; Noxyr's nodes write a plain-language reason (bad token, bad intents, suspended, or a generic retrying message for anything else) rather than a bare error code. If the status message doesn't match any of the cases above, or the bot stays offline after a fix that should have worked, the Support Center is the fastest way to get eyes on the specific server. Full setup and troubleshooting steps also live in the Custom Bot docs.

Common questions

Why did my bot go offline right after I did nothing? "Nothing" usually means someone else with portal or server access changed something, a token reset, an intent toggle, a kick. Check the Custom Bot page's status message first; it names the cause.

Is my data lost if the bot goes offline? No. Tokens, settings, tickets, products, invoices and transcripts are all kept regardless of why the bot stopped. Fixing the cause brings everything back exactly as it was.

Can I avoid the vote-related offline case entirely? Vote roughly every three and a half days (before the 12-hour window plus 74-hour grace period run out) and the bot never goes down for that reason.

Do I need to re-enable intents every time I restart the bot? No. Intents are a setting on the Discord application itself, not something that resets. Once both are on and saved, they stay on until someone turns them off.

Ready to get it back online? Fix the cause above, then start the bot from the Custom Bot page, or add Noxyr free if you're setting one up for the first time.