discord_gleam/discord/intents

Types

See https://discord.com/developers/docs/events/gateway#gateway-intents
NOTE: While we have implemented all intents, we have not implemented all gateway events.

pub type Intents {
  Intents(
    guilds: Bool,
    guild_members: Bool,
    guild_moderation: Bool,
    guild_expressions: Bool,
    guild_integrations: Bool,
    guild_webhooks: Bool,
    guild_invites: Bool,
    guild_voice_states: Bool,
    guild_presences: Bool,
    guild_messages: Bool,
    guild_message_reactions: Bool,
    guild_message_typing: Bool,
    direct_messages: Bool,
    direct_message_reactions: Bool,
    direct_message_typing: Bool,
    message_content: Bool,
    guild_scheduled_events: Bool,
    auto_moderation_configuration: Bool,
    auto_moderation_execution: Bool,
    guild_message_polls: Bool,
    direct_message_polls: Bool,
  )
}

Constructors

  • Intents(
      guilds: Bool,
      guild_members: Bool,
      guild_moderation: Bool,
      guild_expressions: Bool,
      guild_integrations: Bool,
      guild_webhooks: Bool,
      guild_invites: Bool,
      guild_voice_states: Bool,
      guild_presences: Bool,
      guild_messages: Bool,
      guild_message_reactions: Bool,
      guild_message_typing: Bool,
      direct_messages: Bool,
      direct_message_reactions: Bool,
      direct_message_typing: Bool,
      message_content: Bool,
      guild_scheduled_events: Bool,
      auto_moderation_configuration: Bool,
      auto_moderation_execution: Bool,
      guild_message_polls: Bool,
      direct_message_polls: Bool,
    )

Values

pub fn all() -> Intents

Enable all the intents, use this if you want to receive all supported events.

pub fn default() -> Intents

Enable a set of default intents, which are usually used by most bots.
Does not include message_content intent, as its a privileged intent

pub fn default_with_message_intents() -> Intents

Enable a set of default intents, which are usually used by most bots.
But also includes all intents relevant to messages

pub fn intents_to_bitfield(intents: Intents) -> Int

Calculate a bitfield from a set of intents.

pub fn none() -> Intents

Disable all the intents, use this if you want to receive no events other than `interaction_create or ready. \ Useful if you have a bot with slash commands only, that dosen’t need to listen to events.

Search Document