Gateway Intents
Gateway Intents are filters that determine which events and data your bot receives from Discord. Properly configuring intents optimizes performance and ensures your bot has access to the data it needs.
What are Gateway Intents?
Section titled “What are Gateway Intents?”Intents allow you to specify which Discord events your bot should receive. By selecting specific intents, you can:
- Reduce data transfer - Only receive events you need
- Optimize performance - Less data means faster processing
- Comply with Discord - Some data requires explicit permission
Intent Categories
Section titled “Intent Categories”Discord intents fall into three categories:
Standard Intents
Section titled “Standard Intents”Available to all bots without special permission:
- Guild Moderation
- Guild Emojis and Stickers
- Guild Webhooks
- Guild Invites
- Guild Voice States
- Guild Messages
- Guild Message Reactions
- Guild Message Typing
- Direct Messages
- Direct Message Reactions
- Direct Message Typing
- Scheduled Events
Privileged Intents
Section titled “Privileged Intents”Require explicit enabling in the Discord Developer Portal:
- Guild Members - Access to member join/leave events and member lists
- Message Content - Access to message content (required for reading messages!)
- Guild Presences - Access to member presence/status information
Message Poll Intents
Section titled “Message Poll Intents”For handling poll-related events:
- Guild Message Polls
- Direct Message Polls
Enabling Privileged Intents
Section titled “Enabling Privileged Intents”To use privileged intents:
- Go to Discord Developer Portal
- Select your application
- Navigate to the “Bot” section
- Scroll to “Privileged Gateway Intents”
- Enable the intents you need
- Save changes
Using Intents in DiSky
Section titled “Using Intents in DiSky”Default Intents
Section titled “Default Intents”For most bots, use default intents:
define new bot named "MyBot": token: "YOUR_TOKEN" intents: default intentsDefault intents include:
- Guild messages
- Direct messages
- Guild message reactions
- Guild voice states
- And other common intents
Specific Intents
Section titled “Specific Intents”Specify exactly which intents you need:
define new bot named "MyBot": token: "YOUR_TOKEN" intents: guild members, message content, guild messagesAll Intents
Section titled “All Intents”Enable all available intents:
define new bot named "MyBot": token: "YOUR_TOKEN" intents: all intentsCombining Intents
Section titled “Combining Intents”You can combine multiple intents:
define new bot named "MyBot": token: "YOUR_TOKEN" intents: default intents, guild members, message content, guild presencesCommon Intent Combinations
Section titled “Common Intent Combinations”Basic Message Bot
Section titled “Basic Message Bot”intents: guild messages, message contentMember Management Bot
Section titled “Member Management Bot”intents: guild members, guild messages, message contentVoice-Enabled Bot
Section titled “Voice-Enabled Bot”intents: default intents, guild voice statesFull-Featured Bot
Section titled “Full-Featured Bot”intents: all intentsIntent Requirements
Section titled “Intent Requirements”Some DiSky features require specific intents:
| Feature | Required Intent |
|---|---|
| Read message content | Message Content (privileged) |
| Access member list | Guild Members (privileged) |
| Member join/leave events | Guild Members (privileged) |
| Member status/presence | Guild Presences (privileged) |
| Voice state updates | Guild Voice States |
| Emoji/sticker updates | Guild Emojis and Stickers |
| Scheduled events | Scheduled Events |
Best Practices
Section titled “Best Practices”- Start with default intents - Good for most bots
- Add privileged intents as needed - Enable in Developer Portal first
- Don’t use all intents unnecessarily - Only enable what you need
- Plan for growth - Consider verification requirements for 100+ servers
- Test thoroughly - Ensure your bot has all required intents
Troubleshooting
Section titled “Troubleshooting””CloseCode 4014” or “Disallowed intents” Error
Section titled “”CloseCode 4014” or “Disallowed intents” Error”This means you’re using intents in code that aren’t enabled in the Developer Portal.
Solution: Enable the required privileged intents in the Discord Developer Portal.
Bot Can’t Read Messages
Section titled “Bot Can’t Read Messages”You’re missing the Message Content intent.
Solution:
- Enable it in the Developer Portal
- Add it to your bot configuration:
intents: default intents, message content
Member Events Not Firing
Section titled “Member Events Not Firing”You’re missing the Guild Members intent.
Solution:
- Enable it in the Developer Portal
- Add it to your bot configuration:
intents: default intents, guild members
Example Configurations
Section titled “Example Configurations”Minimal Bot (Commands Only)
Section titled “Minimal Bot (Commands Only)”define new bot named "MyBot": token: "YOUR_TOKEN" intents: guild messages policy: none cache flags: noneStandard Bot (Messages + Members)
Section titled “Standard Bot (Messages + Members)”define new bot named "MyBot": token: "YOUR_TOKEN" intents: default intents, guild members, message content policy: all cache flags: default flagsAdvanced Bot (Full Features)
Section titled “Advanced Bot (Full Features)”define new bot named "MyBot": token: "YOUR_TOKEN" intents: all intents policy: all cache flags: allVisual Guide
Section titled “Visual Guide”graph TD A[Discord Intents] --> B[Privileged Intents] A --> C[Standard Intents] A --> D[Message Poll Intents]
B --> E[Guild Members] B --> F[Message Content] B --> G[Guild Presences]
C --> H[Guild Moderation] C --> I[Guild Emojis/Stickers] C --> J[Guild Voice States] C --> K[Guild Messages] C --> L[Scheduled Events]
D --> M[Guild Message Polls] D --> N[Direct Message Polls]Next Steps
Section titled “Next Steps”- Configure Cache Policy & Flags
- Learn about Bot Configuration
- Set up Multiple Bots