LogoRobo.js

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.

config/plugins/robojs/discordjs.ts
import type { DiscordConfig } from '@robojs/discordjs'

export default {
	clientOptions: {
		intents: ['Guilds', 'GuildMessages', 'MessageContent']
	}
} satisfies DiscordConfig
config/plugins/robojs/discordjs.mjs
export 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

FocusThe intent validation log with configured intents and missing intent warningZoom100%NotesShow terminal output from npx robo dev where the plugin logs configured intents and warns about a missing one. If hard to trigger, show the startup log listing resolved intents.

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 CaseRequired Intents
Slash commands onlyGuilds
Message content readingGuilds, GuildMessages, MessageContent
Member join/leave trackingGuilds, GuildMembers
Reaction rolesGuilds, GuildMessages, GuildMessageReactions
Voice state trackingGuilds, GuildVoiceStates
Presence updatesGuilds, 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

FocusThe three privileged intent toggles with mixed on/off statesZoom100%NotesShow the Privileged Gateway Intents section with Message Content turned ON and the other two OFF. Include the full toggle descriptions below each switch. Show more vertical context than the invite page screenshot.

Intent Reference

For the complete mapping of every Discord gateway event to its required intent, see the @robojs/discordjs Intents & Permissions reference.

Next Steps

On this page