Intents

Intents tell Discord which event categories to send your bot. Fewer intents means less traffic and memory.

Intents tell Discord which event categories to send your bot. Fewer intents means less traffic and memory.

Setting them

import { Client, GatewayIntentBits } from 'athena';
 
new Client(`Bot ${token}`, {
  intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});

Accepted forms: an array of GatewayIntentBits values, an array of name strings (['Guilds', 'GuildMessages']), or a raw bitmask number. The default 3243773 is every non-privileged intent.

Inspect at runtime via client.intents.has(GatewayIntentBits.GuildMessages).

Privileged intents

Three must be enabled on your application's portal page first, and large bots need Discord approval:

  • GuildPresences - presence/status updates. Very high volume. Leave off unless you truly need it.
  • GuildMembers - member add/update/remove and full member lists in GUILD_CREATE.
  • MessageContent - the content, embeds, attachments, and components of messages your bot did not author or get mentioned in.

Requesting one that is not enabled closes the gateway with code 4014, surfaced as an error event.

What each intent unlocks (common ones)

IntentGives you
Guildsguild, channel, thread, role, stage lifecycle events
GuildMembersguildMemberAdd/Update/Remove
GuildModerationbans, guildAuditLogEntryCreate
GuildExpressionsemoji and sticker updates
GuildWebhookswebhooksUpdate
GuildInvitesinviteCreate/Delete
GuildVoiceStatesvoice join/leave/switch
GuildPresencespresenceUpdate
GuildMessagesmessage create/update/delete (content blank without MessageContent)
GuildMessageReactionsreaction add/remove events
DirectMessagesDM message events
MessageContentmessage content fields
AutoModerationConfiguration / AutoModerationExecutionauto-moderation rule and action events

A sensible starting set

intents: [
  GatewayIntentBits.Guilds,
  GatewayIntentBits.GuildMessages,
  GatewayIntentBits.GuildMessageReactions,
  GatewayIntentBits.DirectMessages
]

Add MessageContent only if you read message text outside slash commands. Add GuildMembers only if you need member events; otherwise fetch members on demand.

Performance notes

  • GuildPresences is the single most expensive intent. Skipping it also means Athena never allocates presence state on members (see Caching and memory).
  • Use disableEvents to skip parsing events you do not use even within an enabled intent.
  • Avoid getAllUsers: true unless you genuinely need every member cached.