Discord intents are a subscription system through which your bot declares, up front, which kinds of events it wants to receive from the Discord gateway. When the bot first connects it says "I care about these events," and Discord sends only those. If you don't enable the right intents, your bot either won't work at all or some events (such as a new member joining or message content) will never arrive. In this article I explain what intents are, why privileged intents are different, and how to set them up correctly both in the Developer Portal and in your code.
What is an intent and why does it exist?
A Discord bot receives real-time events over a persistent WebSocket connection called the gateway: a message was sent, a member joined, a channel was updated, a reaction was added, and dozens of others. On large servers this traffic can be enormous. Intents let the bot select the groups of events it actually cares about, reducing both Discord's load and the amount of data your bot has to process.
Each intent maps to a bundle of related events. For example, the Guilds intent covers server, channel and role events, while the GuildMessages intent covers message create/delete events. If you don't enable an intent, the events in that group never reach your bot and the related event listeners simply stay silent.
Standard intents vs. privileged intents
Intents fall into two categories. Most intents are standard and you only need to request them in code; no extra approval is needed. However, three intents are flagged as privileged because they grant access to sensitive data:
- Server Members Intent (
GuildMembers): member join/leave events and the full member list. - Presence Intent (
GuildPresences): presence information such as a user's online/offline status and the game they're playing. - Message Content Intent (
MessageContent): the actual text content, attachments and embeds of messages.
These three must be both enabled with a toggle in the Developer Portal and requested in code. If you request a privileged intent in code but haven't enabled it in the portal, the bot shuts down with a Used disallowed intents error when it tries to connect.
Enabling privileged intents in the Developer Portal
To enable privileged intents, follow these steps:
- Go to the Discord Developer Portal and select your application.
- Open the Bot tab in the left menu.
- Find the toggles under Privileged Gateway Intents: Presence Intent, Server Members Intent and Message Content Intent.
- Turn on the intents your bot needs and save with Save Changes.
An important constraint: if your bot is in more than 100 servers, you must verify the bot and get separate approval for each privileged intent before you can use them. Bots under 100 servers can use them without approval. So don't enable privileged intents you don't truly need, as it makes scaling harder later on.
Defining intents in discord.js
In discord.js v14, intents are passed through the GatewayIntentBits enum when you create the Client. Add only the intents you need:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent, // privileged
GatewayIntentBits.GuildMembers // privileged
]
});
client.on('messageCreate', (message) => {
if (message.author.bot) return;
if (message.content === '!ping') {
message.reply('Pong!');
}
});
client.login(process.env.DISCORD_TOKEN);
A classic pitfall to watch for: if you don't enable the MessageContent intent, the message.content field comes back empty for most messages. Your bot looks like it isn't responding to commands, but the real problem is that it never sees the message text. Messages that mention the bot and DMs are exceptions to this rule, but for prefix-based commands this intent is essential.
Defining intents in discord.py
On the Python side the logic is the same; you configure a discord.Intents object and pass it to Client or commands.Bot:
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True # privileged
intents.members = True # privileged
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'Logged in as: {bot.user}')
bot.run('TOKEN')
If you need to, you can enable everything with discord.Intents.all(), but that's a bad habit: the moment you request a privileged intent that isn't enabled in the portal the bot crashes, and you generate needless data traffic. Follow the principle of least privilege and enable only the intents you actually use.
Don't confuse intents with permissions
A common confusion is to treat intents as the same thing as server permissions. They are different layers:
- Intents determine which events the bot receives from the gateway; they are defined application-wide.
- Permissions determine what the bot can do in a server; they are granted at the role and channel level (send messages, manage channels, kick members, and so on).
For example, even with the GuildMembers intent enabled, the bot can't kick a member without the "Kick Members" permission. Conversely, even if you give the bot every permission, it will never see the relevant events if the right intent isn't enabled. A healthy bot setup means requesting the necessary intents in code and building the invite link (OAuth2 URL) with only the permission scope you actually need.
Frequently Asked Questions
My bot doesn't respond to commands and message content is empty. Why?
Most likely the Message Content Intent is disabled. Enable it both in the Bot tab of the Developer Portal and add the MessageContent / message_content intent in code. Without it, prefix-based commands won't work; slash commands, however, keep working without the content intent.
I'm getting a "Used disallowed intents" error.
This error means a privileged intent you requested in code isn't enabled in the Developer Portal. Enable the intent named in the error in the portal and save, or remove it from your code if you don't actually use it.
Which intents should I enable?
Only the ones your bot's functionality requires. Nearly every bot needs the Guilds intent. Add MessageContent for prefix commands, GuildMembers for welcome/goodbye systems, and GuildPresences for presence tracking. Keeping unneeded privileged intents off is better for both security and the 100+ server verification process.
Want to set your bot up properly with the right intents and permissions? If you need help with Discord bot architecture, intent configuration and deployment, get in touch with me.