Introducing Livops 2.0! Promo codeCEOgives you 8,000 so‘m on your balance.What’s new

PrivilegedIntentsRequired / Used disallowed intents — how to fix it

Your Discord bot asked for a privileged intent — Server Members, Presence or Message Content — that is not switched on for its application. Discord closes the connection with code 4014 and does not let it reconnect. Turn the intent on under Bot → Privileged Gateway Intents in the Developer Portal, or stop asking for it in code, and the bot connects.

By Livops team, the people who build and run LivopsUpdated

The full message, as discord.py raises it for a bot without shards:

discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

discord.js 14 reports the same case more briefly, from its WebSocket layer[7]:

Error: Used disallowed intents

and its error list words it as Privileged intent provided is not enabled or whitelisted.[9], which the discord.js guide shows with a [DisallowedIntents] prefix[6]. This page explains what the error means, lists the causes from the most common, shows the fix in the Developer Portal and in code for both libraries, and ends with what you see on Livops.

What does the error mean?

A bot tells Discord which events it wants by sending intents when it connects. Three intents are privileged: GUILD_PRESENCES, GUILD_MEMBERS and MESSAGE_CONTENT[1]. Before a bot may ask for one, the intent must be enabled in the app’s settings in the Developer Portal; apps in 100 or more servers must also be verified and have the intent approved[1].

When a bot asks for a privileged intent that its application has not enabled, Discord closes the Gateway connection with close code 4014, “Disallowed intent(s)”, which its documentation explains as an intent the app has not enabled or is not approved for. Discord marks 4014 as not to be reconnected after[2]. discord.py turns it into PrivilegedIntentsRequired, whose documentation lists Intents.members, Intents.presences and Intents.message_content as the intents it is about[4][5]. discord.js puts 4014 among the close codes it does not reconnect after, and emits shardDisconnect[8].

So the bot is not crashing at random: it is asking for something it was not given, and it will keep failing in exactly the same way until the portal or the code changes.

Not to be confused with 4013, “Invalid intent(s)”: that one means the intent value itself is wrong, usually a miscalculated bitwise value[2].

Causes, most common first

1. The switch in the Developer Portal is off

The code asks for members, presences or message content, and nobody turned the intent on. Enabling it in the portal is the fix, and it is also the step people miss, because the code alone is not enough — and neither is the portal alone: discord.py’s guide notes that even with intents enabled in the portal, you still have to enable them in code[3].

2. Production uses a different application’s token

You built the bot with a test application whose switches are on, then deployed with the real bot’s token, or the other way round. Intents belong to the application, so each one needs its own switches. This is the usual reason the error appears only after a deploy: the code is the same, the token is not.

3. The code started asking for more

A new feature added an intent. Welcome messages need on_member_join(), which comes with the members intent[4]; prefix commands such as !help that do not mention the bot need message content[3]. Or the code switched to discord.Intents.all(), which turns on everything[4], privileged intents included.

4. The bot is in 100 servers or more

Below 100 servers an unverified bot turns privileged intents on with the switch[6]. From 100 servers up, the app has to be verified and the intent approved in that process[1], and a bot that is already verified and wants a new privileged intent has to go through Discord support[3]. A new intent added to the code of a verified bot fails until that approval comes through.

The fix in the Developer Portal

  1. Open the Developer Portal and choose the application whose token the bot uses[3].
  2. Open the Bot tab and scroll to Privileged Gateway Intents[3].
  3. Turn on the ones your code asks for — presence, server members, message content — and save the changes.
  4. Start the bot again. It does not reconnect by itself after 4014[2].

The fix in code: ask only for what you use

If you cannot or do not want to enable an intent, stop requesting it. In discord.py, Intents.default() turns on everything except presences, members and message content[4], so it never triggers this error; add privileged ones one by one, only where the portal has them on:

import os

import discord
from discord.ext import commands

intents = discord.Intents.default()   # no privileged intents
intents.message_content = True        # only if Message Content is on in the portal

bot = commands.Bot(command_prefix="!", intents=intents)
bot.run(os.environ["DISCORD_TOKEN"])

Message content is only needed for messages that the bot did not send, that are not direct messages, and that do not mention it[4] — slash commands and mention-prefixed commands work without it.

In discord.js the privileged ones are GuildPresences, MessageContent and GuildMembers[6]. List the intents explicitly and leave out the ones you do not use:

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

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent, // privileged: also switch it on in the portal
  ],
});

client.login(process.env.DISCORD_TOKEN);

How to confirm the fix

  1. Write down which privileged intents the code asks for: search for members, presences, message_content and Intents.all in Python, or GuildMembers, GuildPresences, MessageContent in JavaScript.
  2. In the portal, open the application that owns the deployed token and check that exactly those switches are on.
  3. Stop the deployed copy, start the bot locally with the same token, and wait for on_ready (discord.py) or the ready event (discord.js). If it connects, the deployed copy will too.

Do not let a supervisor restart the bot in a tight loop while this error is unfixed. Every start sends an IDENTIFY, a bot may send 1000 of them in 24 hours, and at the limit Discord ends the app’s sessions and resets its token[1] — leaving you with a second problem.

On Livops

What Livops does for this error, and nothing more:

  • The error is in the logs. A Discord bot runs as a worker; the traceback it prints is on the project’s Logs page. Over MCP, get_logs returns up to 5000 lines of the running service’s log.
  • The portal is yours. Livops cannot see or change your Discord application’s settings. Flip the switch there, then restart the service — no rebuild is needed when only the portal changed.
  • The token is yours to change. If production has the wrong application’s token, put the right one under Variables (for example DISCORD_TOKEN), marked as a secret. New values take effect on the next deploy; to apply them now, restart the service. The assistant sees variable names, never their values.
  • A code change is a push. If you removed an intent from the code, git push and the new version is deployed; if the build fails, the running version is left alone.

How a Discord bot is set up on Livops, with the exact livops.json: Discord bot hosting.

Questions

Which Discord intents are privileged?

Three: Server Members (GUILD_MEMBERS), Presence (GUILD_PRESENCES) and Message Content (MESSAGE_CONTENT). In discord.py they are Intents.members, Intents.presences and Intents.message_content; in discord.js, GatewayIntentBits.GuildMembers, GuildPresences and MessageContent.

I enabled the intent in the portal. Why does the error stay?

Most often the token in production belongs to another application, such as a test bot, whose switches are still off. Intents are switched on per application. Check the switches on the application whose token the deployed bot uses, save, and restart the bot.

Do I need the Message Content intent?

Only if the bot reads the text, attachments or embeds of messages that neither mention it nor are sent to it in direct messages, for example prefix commands like !help. Slash commands do not need it.

Will the bot reconnect on its own once I flip the switch?

No. Discord marks close code 4014 as one not to reconnect after, and discord.py and discord.js both stop. Restart the bot after saving the change in the portal.

My bot is in more than 100 servers. Can I still turn the intent on?

Not with a switch alone. Above 100 servers a bot has to be verified, and a privileged intent must be approved in that process. A bot that is already verified asks Discord support.

Does Livops change the intents for me?

No. Intents live in your application's settings in the Discord Developer Portal and in your code. Livops shows the error in the project's logs, and once you have fixed it, you restart the service.

Sources

  1. Discord — Gateway (intents, privileged intents, rate limits) (docs.discord.com). Checked .
  2. Discord — Opcodes and status codes (Gateway close event codes) (docs.discord.com). Checked .
  3. discord.py — A primer to Gateway Intents (discordpy.readthedocs.io). Checked .
  4. discord.py — API reference (Intents, PrivilegedIntentsRequired) (discordpy.readthedocs.io). Checked .
  5. discord.py source — discord/errors.py (raw.githubusercontent.com). Checked .
  6. discord.js guide — Gateway intents (discordjs.guide). Checked .
  7. discord.js source — packages/ws/src/ws/WebSocketShard.ts (@discordjs/ws 1.x) (raw.githubusercontent.com). Checked .
  8. discord.js source — WebSocketManager.js (14.28.1) (raw.githubusercontent.com). Checked .
  9. discord.js source — errors/Messages.js (v14) (raw.githubusercontent.com). Checked .

Put your project online today

Connect GitHub or drop a folder. No card is asked for.

Deploy your Discord bot

Got a question? — @livops_uz