Learning objectives
After reading this article you will be able to:
- Recognize the intents error and Gateway close code 4014
- Enable privileged intents in the portal and in code
- Know when Discord requires review of privileged intents
On this page
- What does the intents error look like?
- What are intents, and which ones are privileged?
- How do you enable the intents in the Discord portal?
- How do you request the intents in code?
- Why does the error persist after enabling them?
- What changes as a bot grows?
- How do you avoid the problem?
- How to do this on Square Cloud
- FAQs
You start your bot (see how to make your first bot), the login fails, and the terminal complains about "disallowed intents". The token is fine, and the code ran locally right up to the moment it tried to connect. The problem is not the token. It is a setting that lives in two places, the Discord portal and your code, and both have to agree.
What does the intents error look like?#
The Discord Gateway closes the connection with code 4014 ("Disallowed intent(s)"). The documentation describes it this way: you tried to specify an intent that you have not enabled or are not approved for. Your library turns that into an exception.
Since discord.js 14.10, client.login() rejects with this error (earlier releases showed Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted. instead):
Error: Used disallowed intentsIn discord.py 2.x the exception is PrivilegedIntentsRequired:
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.There is also close code 4013 ("Invalid intent(s)"), which means the intent value itself is invalid, usually from a wrong bitmask calculation. Discord marks both codes as non-reconnectable, so retrying without changing anything just repeats the failure.
What are intents, and which ones are privileged?#
Intents tell the Gateway which groups of events your bot wants to receive. If you do not request an intent, its events never arrive. This saves bandwidth and memory, and protects user data.
Three intents are privileged, meaning they stay off until you enable them:
| Intent | discord.js name | discord.py attribute | What it unlocks |
|---|---|---|---|
| Server Members | GuildMembers |
members |
Member join, leave and update events, plus member listing |
| Presence | GuildPresences |
presences |
PRESENCE_UPDATE events (online status, activity) |
| Message Content | MessageContent |
message_content |
Text, embeds, attachments and components of messages |
Without Message Content, the content fields arrive empty. There are exceptions: messages your bot sends, messages in DMs with the bot, messages that mention the bot, and the target message of a message context menu command.
How do you enable the intents in the Discord portal?#
- Open the Discord Developer Portal and select your application.
- Go to the Bot tab in the sidebar.
- Scroll to Privileged Gateway Intents.
- Turn on the intents your code uses (Presence, Server Members, Message Content).
- Save your changes.
For apps with fewer than 10,000 users, that is all. Enable only what you actually use: every extra intent brings more events to process.
How do you request the intents in code?#
Enabling them in the portal is not enough. Your code must also declare the intent when connecting, and the discord.py documentation is explicit about this.
discord.js v14:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent, // privileged
// GatewayIntentBits.GuildMembers, // privileged, only if you use it
],
});
client.on('messageCreate', (message) => {
if (message.content === '!ping') message.reply('pong');
});
client.login(process.env.DISCORD_TOKEN);discord.py 2.x:
import os
import discord
intents = discord.Intents.default()
intents.message_content = True # privileged
intents.members = False # privileged, set True only if you use it
client = discord.Client(intents=intents)
@client.event
async def on_message(message):
if message.content == "!ping":
await message.channel.send("pong")
client.run(os.environ["DISCORD_TOKEN"])Intents.default() does not turn on any privileged intent, which is why message_content is set explicitly.
Why does the error persist after enabling them?#
Work through these from most to least common:
- Enabled in the portal, forgot in code (or the reverse). Both sides must match. Check the intents list where you create the client.
- You did not restart the bot. The Gateway reads intents at
IDENTIFYtime. After changing the portal or the code, restart to open a new connection. - Wrong application. The token belongs to a different portal application whose toggles are off. Confirm that the token you use comes from the application you configured.
- Bot past the review threshold. Above 10,000 users, the bot loses access to the privileged intent unless its review is approved (see the next section).
- Invalid intent value (code 4013), common when building the bitmask by hand. Use the library constants instead of raw numbers.
If the bot connects but stays silent, the cause may be something else: see Bot online but not responding to commands.
What changes as a bot grows?#
Apps with fewer than 10,000 users can enable privileged intents directly in the portal. Once an app passes 10,000 unique users who can see it, Discord notifies the owner and requires a review (with a stated reason for each intent) to keep access. Approved apps must reapply every year. According to the documentation, the app keeps working and joining servers while the review is pending.
App verification is a separate process, required for apps in 100 or more servers. The user-based review rules took effect on June 10, 2026 and replaced the old 100-server rule for privileged intents, so check the official page before you plan.
If your bot only reads commands, moving to slash commands removes the dependency on Message Content before the review becomes a problem, because interactions do not rely on message content.
How do you avoid the problem?#
- Request only the intents your bot uses. Start with
Guildsand add more as needed. - Prefer slash commands over prefix commands, and avoid Presence unless it is essential.
- Keep the intents list in one place in your code so it cannot diverge between files.
- Test the connection after any portal change, before shipping to production.
How to do this on Square Cloud#
The intents error happens between your code and the Discord portal, so the fix is the same on any host: enable the intents in the Bot tab, declare them in code, and restart.
On Square Cloud the bot runs in an isolated container and you control the deploy. The token lives in an application environment variable (set in the dashboard, API or CLI), and a change takes effect on the next restart, with no rebuild. After adjusting intents in the portal, restart the application and watch the real-time logs to confirm the login went through.
The platform supports discord.js, discord.py, JDA, Discord.Net and other Gateway libraries. The details are in Discord bot hosting.
Bot hosting
Keep your bot online 24/7 with automatic restarts
FAQs
What are the Discord privileged intents?
There are three: Server Members (GUILD_MEMBERS), Presence (GUILD_PRESENCES) and Message Content (MESSAGE_CONTENT). All are off by default and must be enabled in the portal and requested in code.
Do I need the Message Content intent for slash commands?
No. Slash commands arrive as interactions and do not depend on message content. You only need the intent to read the text of regular messages, such as prefix commands.
I enabled it in the portal and the error persists. What is missing?
You also have to request the intent in code, with GatewayIntentBits.MessageContent in discord.js or intents.message_content = True in discord.py. Then restart the bot so it opens a new Gateway connection.
What changes as a bot grows?
Under 10,000 users, flipping the toggle in the portal is enough. Above that, Discord requires a review to keep access to privileged intents. Bots in 100 or more servers also need verification.
More in Bots
See all 33 articles- How much does it cost to host a Discord bot?The cost of hosting a Discord bot depends on RAM, uptime, database and outside services. Learn how to estimate your own bill and where the money goes.
- Running a bot on your phone or PC vs hosting itA bot on your PC or phone (Termux) goes offline when the device shuts down, sleeps or loses its network. Compare the three options and when each one fits.
- How to host a Discord bot 24/7To keep a Discord bot online 24/7, run its process on an always-on machine with automatic restarts. Compare your PC, a VPS with pm2 or systemd, and bot hosting.
- Why your Discord bot keeps going offline (and how to fix it)A Discord bot goes offline when the process dies, the token is invalid, an intent is disabled or memory runs out. Learn to diagnose each cause and fix it.