Skip to content

Intents

Intents is the bitflag set you pass to Client::new. It tells the gateway which event categories to deliver. Intents::default() is a public preset; use Intents::new() when you want a strictly minimal subscription built only from the flags you name.

Constructors

  • Intents::new() — empty set.
  • Intents::default() — the standard public preset. It includes non-privileged public categories and excludes GUILD_MESSAGES, FORUMS, and ENTER_AIO.
  • Intents::all() — every standard flag represented by the framework except ENTER_AIO. It includes privileged flags, so use it only when those permissions are approved; call with_enter_aio() separately if you need AIO entry events.

Toggling flags

Intent flags are exposed as pub const u32 values on the Intents type, plus a chainable with_* method per flag:

rust
use botrs::Intents;

let intents = Intents::new()
    .with_public_guild_messages()
    .with_direct_message()
    .with_guilds();

You can also OR raw constants together via Intents::with_intent(Intents::GUILDS) if you prefer.

Flag reference

FlagBuilderEvents the gateway will deliver
GUILDSwith_guildsguild_create / guild_update / guild_delete
GUILD_MEMBERSwith_guild_membersguild_member_add / _update / _remove
GUILD_MESSAGES (priv.)with_guild_messagesAll channel messages (message_create and friends)
GUILD_MESSAGE_REACTIONSwith_guild_message_reactionsReaction add / remove
DIRECT_MESSAGEwith_direct_messageDM direct_message_create
PUBLIC_GUILD_MESSAGESwith_public_guild_messagesAt-mention messages (message_create) — non-priv.
PUBLIC_MESSAGESwith_public_messagesGroup / C2C messages
INTERACTIONwith_interactionButton / interaction events
MESSAGE_AUDITwith_message_auditMessage audit pass / reject
FORUMS (priv.)with_forumsForum thread / post / reply / publish-audit
AUDIO_ACTIONwith_audio_actionAudio start / finish / on-mic / off-mic
OPEN_FORUM_EVENTwith_open_forum_eventOpen-forum thread / post / reply
ENTER_AIOwith_enter_aioSingle-chat (AIO) entry events
AUDIO_OR_LIVE_CHANNEL_MEMBERwith_audio_or_live_channel_memberVoice / live channel join / leave

The privileged intents (GUILD_MESSAGES, FORUMS) require approval in the QQ Guild developer portal; without it the gateway will reject the identify.

Inspecting at runtime

contains(flag) checks a single flag, and the named accessors (intents.guilds(), intents.public_guild_messages(), etc.) return bool.

Released under the MIT License.