What are Intents?
Intents are a system introduced by Discord to give developers control over which events their bot receives. Each intent corresponds to a set of WebSocket events. TheIntents class in Pycord (located at discord/flags.py:591) provides a bitfield-based system for managing these subscriptions.
Creating Intents
- Default Intents
- All Intents
- Custom Intents
- Using Kwargs
The easiest way to get started is with default intents, which enable most common events except privileged ones:Default intents exclude:
presences(privileged)members(privileged)message_content(privileged)
Common Intents
Guild Intents
on_guild_joinon_guild_removeon_guild_channel_updateon_guild_channel_createon_guild_channel_delete
The
guilds intent is highly recommended for most bots as it provides core functionality.Message Intents
on_messageon_message_editon_message_deleteon_reaction_add/on_reaction_remove
Member Intents (Privileged)
on_member_joinon_member_removeon_member_update- Access to
Guild.memberslist
Privileged Intents
Three intents require special approval from Discord:Members Intent
Members Intent
Required for:
- Member join/leave events
- Member update events
- Full member cache
Guild.membersaccess
- Go to your application’s Bot page
- Scroll to “Privileged Gateway Intents”
- Enable “Server Members Intent”
Presence Intent
Presence Intent
Required for:
on_presence_updateeventsMember.activitiesaccessMember.statusaccess
- Go to your application’s Bot page
- Enable “Presence Intent”
Message Content Intent
Message Content Intent
Required for:
- Reading message content in guilds
Message.contentaccessMessage.embeds,Message.attachments,Message.componentsaccess
- Go to your application’s Bot page
- Enable “Message Content Intent”
Without this intent, message content fields will be empty for messages not mentioning your bot, not sent by your bot, or not in DMs.
Intent Events Reference
Here’s a comprehensive mapping of intents to their corresponding events:| Intent | Events Enabled |
|---|---|
guilds | Guild join/remove, channel updates, role updates |
members | Member join/remove/update, user updates |
moderation | Audit log, bans/unbans |
emojis_and_stickers | Emoji and sticker updates |
integrations | Integration create/update/delete |
webhooks | Webhook updates |
invites | Invite create/delete |
voice_states | Voice state updates (required for voice) |
presences | Presence/status updates |
guild_messages | Guild message events |
dm_messages | DM message events |
guild_reactions | Guild reaction events |
dm_reactions | DM reaction events |
guild_typing | Guild typing indicators |
dm_typing | DM typing indicators |
message_content | Access to message content in guilds |
scheduled_events | Scheduled event CRUD operations |
auto_moderation_configuration | AutoMod rule changes |
auto_moderation_execution | AutoMod action executions |
guild_polls | Poll vote events in guilds |
dm_polls | Poll vote events in DMs |
Complete Example
Here’s a complete bot setup with properly configured intents:Checking Current Intents
You can check which intents are enabled on your client:Common Errors
PrivilegedIntentsRequired
PrivilegedIntentsRequired
Error:
discord.errors.PrivilegedIntentsRequiredCause: Your bot is trying to use a privileged intent that hasn’t been enabled in the Developer Portal.Solution:- Visit the Discord Developer Portal
- Select your application
- Go to the “Bot” section
- Enable the required privileged intent(s)
- If your bot is in 100+ servers, you may need to verify your bot first
Missing Events
Missing Events
Problem: Events like
on_member_join aren’t firingCause: The required intent isn’t enabledSolution: Check which intent is required for your event and enable it:Best Practices
- Enable only what you need - Unnecessary intents waste bandwidth and resources
- Use
Intents.default()as a starting point - It enables common functionality - Document privileged intent usage - Help users understand why they’re needed
- Test without privileged intents - Design features that don’t require them when possible
- Handle missing data gracefully - Not all data is available without certain intents
