Intents
Configure gateway intents
Gateway intents (filters that tell Discord which events to send your bot) control which events your bot receives from Discord. The plugin infers required intents from your event handlers and warns about missing ones at startup.
For intent validation utilities (validateIntents, checkIntents), the REQUIRED_INTENTS constant, and permission aggregation, see the @robojs/discordjs Intents & Permissions reference.
What Intents Do
Discord uses intents to filter which events are sent to your bot over the gateway connection. Without the right intents enabled, event handlers for those events will not fire. This keeps bandwidth efficient by only sending data your bot actually needs.
Configuring Intents
Set intents in your plugin configuration under clientOptions.intents using PascalCase strings.
import type { DiscordConfig } from '@robojs/discordjs'
export default {
clientOptions: {
intents: ['Guilds', 'GuildMessages', 'MessageContent']
}
} satisfies DiscordConfigexport default {
clientOptions: {
intents: ['Guilds', 'GuildMessages', 'MessageContent']
}
}Terminal output from Robo.js startup showing intent validation: a list of configured intents and a warning about a missing intent required by an event handler
Automatic Inference
The plugin analyzes your registered event handlers at build time and infers which intents are needed. At startup, it logs warnings for any missing intents. You can still override by explicitly setting intents in your configuration.
import { inferIntents, validateIntents, getIntentNames } from '@robojs/discordjs'import { inferIntents, validateIntents, getIntentNames } from '@robojs/discordjs'The inferIntents function returns the set of intents required by your event handlers. The validateIntents function checks your configured intents against the inferred set and reports gaps.
Common Patterns
Most bots need only a few intents. Here are common configurations:
| Use Case | Required Intents |
|---|---|
| Slash commands only | Guilds |
| Message content reading | Guilds, GuildMessages, MessageContent |
| Member join/leave tracking | Guilds, GuildMembers |
| Reaction roles | Guilds, GuildMessages, GuildMessageReactions |
| Voice state tracking | Guilds, GuildVoiceStates |
| Presence updates | Guilds, GuildPresences |
Privileged Intents
Three intents require explicit approval in the Discord Developer Portal before they can be used: GuildPresences, GuildMembers, and MessageContent. Enable these under Applications > Bot > Privileged Gateway Intents.
Bots in 100+ servers must be verified by Discord to use privileged intents.
Discord Developer Portal Bot tab showing the Privileged Gateway Intents section with three toggle switches for Presence, Server Members, and Message Content intents
Intent Reference
For the complete mapping of every Discord gateway event to its required intent, see the @robojs/discordjs Intents & Permissions reference.
