docs.jda.wiki Open in urlscan Pro
2606:50c0:8003::153  Public Scan

URL: https://docs.jda.wiki/net/dv8tion/jda/api/requests/GatewayIntent.html
Submission: On October 10 via api from US — Scanned from US

Form analysis 0 forms found in the DOM

Text Content

JavaScript is disabled on your browser.
   
Skip navigation links
 * Overview
 * Package
 * Class
 * Tree
 * Deprecated
 * Index
 * Help

 * Summary:
   
   * Nested
   * Enum Constants
   * Field
   * Method

 * Detail:
   
   * Enum Constants
   * Field
   * Method

 * Summary: 
 * Nested | 
 * Enum Constants | 
 * Field | 
 * Method

 * Detail: 
 * Enum Constants | 
 * Field | 
 * Method

SEARCH
Package net.dv8tion.jda.api.requests


ENUM GATEWAYINTENT

java.lang.Object
java.lang.Enum<GatewayIntent>
net.dv8tion.jda.api.requests.GatewayIntent
All Implemented Interfaces: Serializable, Comparable<GatewayIntent>

--------------------------------------------------------------------------------

public enum GatewayIntent extends Enum<GatewayIntent>
Flags which enable or disable specific events from the discord gateway.

The way to use these is very simple. Go through each intent in the following
list and decide whether your bot will need these events or not.

 1.  GUILD_MEMBERS - This is a privileged gateway intent that is used to update
     user information and join/leaves (including kicks). This is required to
     cache all members of a guild (including chunking)
 2.  GUILD_MODERATION - This will only track guild moderation events, such as
     bans, unbans, and audit-logs.
 3.  GUILD_EMOJIS - This will only track custom emoji create/modify/delete. Most
     bots don't need this since they just use the emoji id anyway.
 4.  GUILD_WEBHOOKS - This will only track guild webhook create/update/delete.
     Most bots don't need this since related events don't contain any useful
     information about webhook changes.
 5.  GUILD_INVITES - This will only track invite create/delete. Most bots don't
     make use of invites since they are added through OAuth2 authorization by
     administrators.
 6.  GUILD_VOICE_STATES - Required to properly get information of members in
     voice channels and cache them. You cannot connect to a voice channel
     without this intent.
 7.  GUILD_PRESENCES - This is a privileged gateway intent this is only used to
     track activity and online-status of a user.
 8.  GUILD_MESSAGES - This is used to receive incoming messages in guilds
     (servers), most bots will need this for commands.
 9.  GUILD_MESSAGE_REACTIONS - This is used to track reactions on messages in
     guilds (servers). Can be useful to make a paginated embed or reaction role
     management.
 10. GUILD_MESSAGE_TYPING - This is used to track when a user starts typing in
     guilds (servers). Almost no bot will have a use for this.
 11. DIRECT_MESSAGES - This is used to receive incoming messages in private
     channels (DMs). You can still send private messages without this intent.
 12. DIRECT_MESSAGE_REACTIONS - This is used to track reactions on messages in
     private channels (DMs).
 13. DIRECT_MESSAGE_TYPING - This is used to track when a user starts typing in
     private channels (DMs). Almost no bot will have a use for this.
 14. MESSAGE_CONTENT - This is a privileged gateway intent this is only used to
     enable access to the user content in messages (also including
     embeds/attachments/components).
 15. SCHEDULED_EVENTS - This is used to keep track of scheduled events in
     guilds.
 16. AUTO_MODERATION_CONFIGURATION - This is used to keep track of auto-mod rule
     changes in guilds.
 17. AUTO_MODERATION_EXECUTION - This is used to receive events related to
     auto-mod response actions.

If an intent is not specifically mentioned to be privileged, it is not required
to be on the whitelist to use it (and its related events). To get whitelisted
you either need to contact discord support (for bots in more than 100 guilds) or
enable it in the developer dashboard of your application.

You must use ChunkingFilter.NONE if GUILD_MEMBERS is disabled. To enable
chunking the discord api requires the privileged GUILD_MEMBERS intent.

See Also:
 * JDABuilder.disableIntents(GatewayIntent, GatewayIntent...)
 * JDABuilder.enableIntents(GatewayIntent, GatewayIntent...)
 * DefaultShardManagerBuilder.disableIntents(GatewayIntent, GatewayIntent...)
 * DefaultShardManagerBuilder.enableIntents(GatewayIntent, GatewayIntent...)

   


 * ENUM CONSTANT SUMMARY
   
   Enum Constants
   Enum Constant
   Description
   AUTO_MODERATION_CONFIGURATION
   Events related to AutoModRule changes.
   AUTO_MODERATION_EXECUTION
   Events related to AutoModResponse triggers.
   DIRECT_MESSAGE_POLLS
   Events for poll votes in PrivateChannels.
   DIRECT_MESSAGE_REACTIONS
   Message reaction events in private channels.
   DIRECT_MESSAGE_TYPING
   Typing events in private channels.
   DIRECT_MESSAGES
   Message events in private channels.
   GUILD_EMOJIS_AND_STICKERS
   Custom emoji and sticker add/update/delete events.
   GUILD_INVITES
   Invite events.
   GUILD_MEMBERS
   PRIVILEGED INTENT Events which inform us about member update/leave/join of a
   guild.
   GUILD_MESSAGE_POLLS
   Events for poll votes in Guilds.
   GUILD_MESSAGE_REACTIONS
   Message reaction events in guilds.
   GUILD_MESSAGE_TYPING
   Typing start events in guilds.
   GUILD_MESSAGES
   Message events from text channels in guilds.
   GUILD_MODERATION
   Moderation events, such as ban/unban/audit-log.
   GUILD_PRESENCES
   PRIVILEGED INTENT Presence updates.
   GUILD_VOICE_STATES
   Voice state events.
   GUILD_WEBHOOKS
   Webhook events.
   MESSAGE_CONTENT
   PRIVILEGED INTENT Access to message content.
   SCHEDULED_EVENTS
   Scheduled Events events.
   


 * FIELD SUMMARY
   
   Fields
   Modifier and Type
   Field
   Description
   static final int
   ALL_INTENTS
   Bitmask with all intents enabled.
   static final int
   DEFAULT
   All intents with some disabled: GUILD_MEMBERS (because its privileged)
   GUILD_PRESENCES (because its privileged) MESSAGE_CONTENT (because its
   privileged) GUILD_WEBHOOKS because its not useful for most bots
   GUILD_MESSAGE_TYPING because its not useful for most bots
   DIRECT_MESSAGE_TYPING because its not useful for most bots To use these
   intents you have to pass no other intents to createLight(token) or
   createDefault(token).
   


 * METHOD SUMMARY
   
   All MethodsStatic MethodsInstance MethodsConcrete Methods
   Modifier and Type
   Method
   Description
   static EnumSet<GatewayIntent>
   from(Collection<Class<? extends GenericEvent>> events, Collection<CacheFlag
   > flags)
   Parse the required GatewayIntents from the provided Event Types and
   CacheFlags.
   static EnumSet<GatewayIntent>
   fromCacheFlags(Collection<CacheFlag> flags)
   Parse the required GatewayIntents from the provided CacheFlags.
   static EnumSet<GatewayIntent>
   fromCacheFlags(CacheFlag flag, CacheFlag... other)
   Parse the required GatewayIntents from the provided CacheFlags.
   static EnumSet<GatewayIntent>
   fromEvents(Class<? extends GenericEvent>... events)
   Parse the required GatewayIntents from the provided Event Types.
   static EnumSet<GatewayIntent>
   fromEvents(Collection<Class<? extends GenericEvent>> events)
   Parse the required GatewayIntents from the provided Event Types.
   static EnumSet<GatewayIntent>
   getIntents(int raw)
   Converts a bitmask into an EnumSet of enum values.
   int
   getOffset()
   The offset of the intent flag within a bitmask
   This means getRawValue() == 1 << getOffset()
   static int
   getRaw(Collection<GatewayIntent> set)
   Converts the given intents to a bitmask
   static int
   getRaw(GatewayIntent intent, GatewayIntent... set)
   Converts the given intents to a bitmask
   int
   getRawValue()
   The raw bitmask value for this intent
   static GatewayIntent
   valueOf(String name)
   Returns the enum constant of this type with the specified name.
   static GatewayIntent[]
   values()
   Returns an array containing the constants of this enum type, in the order
   they are declared.
   
   
   METHODS INHERITED FROM CLASS JAVA.LANG.ENUM
   
   compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString,
   valueOf
   
   
   METHODS INHERITED FROM CLASS JAVA.LANG.OBJECT
   
   getClass, notify, notifyAll, wait, wait, wait

   


 * ENUM CONSTANT DETAILS
   
   
    * GUILD_MEMBERS
      
      public static final GatewayIntent GUILD_MEMBERS
      PRIVILEGED INTENT Events which inform us about member update/leave/join of
      a guild.
      This is required to chunk all members of a guild. Without this enabled you
      have to use ChunkingFilter.NONE!
      
      This will also update user information such as name/avatar.
   
   
    * GUILD_MODERATION
      
      public static final GatewayIntent GUILD_MODERATION
      Moderation events, such as ban/unban/audit-log.
   
   
    * GUILD_EMOJIS_AND_STICKERS
      
      public static final GatewayIntent GUILD_EMOJIS_AND_STICKERS
      Custom emoji and sticker add/update/delete events.
   
   
    * GUILD_WEBHOOKS
      
      public static final GatewayIntent GUILD_WEBHOOKS
      Webhook events.
   
   
    * GUILD_INVITES
      
      public static final GatewayIntent GUILD_INVITES
      Invite events.
   
   
    * GUILD_VOICE_STATES
      
      public static final GatewayIntent GUILD_VOICE_STATES
      Voice state events. This is used to determine which members are connected
      to a voice channel.
   
   
    * GUILD_PRESENCES
      
      public static final GatewayIntent GUILD_PRESENCES
      PRIVILEGED INTENT Presence updates. This is used to lazy load members and
      update user properties such as name/avatar.
      This is a very heavy intent! Presence updates are 99% of traffic the bot
      will receive. To get user update events you should consider using
      GUILD_MEMBERS instead.
      
      This intent is primarily used to track Member.getOnlineStatus() and
      Member.getActivities().
   
   
    * GUILD_MESSAGES
      
      public static final GatewayIntent GUILD_MESSAGES
      Message events from text channels in guilds.
   
   
    * GUILD_MESSAGE_REACTIONS
      
      public static final GatewayIntent GUILD_MESSAGE_REACTIONS
      Message reaction events in guilds.
   
   
    * GUILD_MESSAGE_TYPING
      
      public static final GatewayIntent GUILD_MESSAGE_TYPING
      Typing start events in guilds.
   
   
    * DIRECT_MESSAGES
      
      public static final GatewayIntent DIRECT_MESSAGES
      Message events in private channels.
   
   
    * DIRECT_MESSAGE_REACTIONS
      
      public static final GatewayIntent DIRECT_MESSAGE_REACTIONS
      Message reaction events in private channels.
   
   
    * DIRECT_MESSAGE_TYPING
      
      public static final GatewayIntent DIRECT_MESSAGE_TYPING
      Typing events in private channels.
   
   
    * MESSAGE_CONTENT
      
      public static final GatewayIntent MESSAGE_CONTENT
      PRIVILEGED INTENT Access to message content.
      
      This specifically affects messages received through the message history of
      a channel, or through Message Events. The content restriction does not
      apply if the message mentions the bot directly (using @username), sent by
      the bot itself, or if the message is a direct message from a
      PrivateChannel. Affected are all user-generated content fields of a
      message, such as:
      
       * Message.getContentRaw(), Message.getContentDisplay(),
         Message.getContentStripped()
       * Message.getEmbeds()
       * Message.getAttachments()
       * Message.getActionRows(), Message.getButtons()
      
      See Also:
       * Message Content Privileged Intent FAQ
   
   
    * SCHEDULED_EVENTS
      
      public static final GatewayIntent SCHEDULED_EVENTS
      Scheduled Events events.
   
   
    * AUTO_MODERATION_CONFIGURATION
      
      public static final GatewayIntent AUTO_MODERATION_CONFIGURATION
      Events related to AutoModRule changes.
   
   
    * AUTO_MODERATION_EXECUTION
      
      public static final GatewayIntent AUTO_MODERATION_EXECUTION
      Events related to AutoModResponse triggers.
   
   
    * GUILD_MESSAGE_POLLS
      
      public static final GatewayIntent GUILD_MESSAGE_POLLS
      Events for poll votes in Guilds.
   
   
    * DIRECT_MESSAGE_POLLS
      
      public static final GatewayIntent DIRECT_MESSAGE_POLLS
      Events for poll votes in PrivateChannels.

   


 * FIELD DETAILS
   
   
    * ALL_INTENTS
      
      public static final int ALL_INTENTS
      Bitmask with all intents enabled.
      
      To use all intents in your own code you should use
      EnumSet.allOf(GatewayIntent.class) instead. This value only represents the
      raw bitmask used in JDA.
      You can use EnumSet.noneOf(GatewayIntent.class) to achieve the opposite.
   
   
    * DEFAULT
      
      public static final int DEFAULT
      All intents with some disabled:
       * GUILD_MEMBERS (because its privileged)
       * GUILD_PRESENCES (because its privileged)
       * MESSAGE_CONTENT (because its privileged)
       * GUILD_WEBHOOKS because its not useful for most bots
       * GUILD_MESSAGE_TYPING because its not useful for most bots
       * DIRECT_MESSAGE_TYPING because its not useful for most bots
      
      To use these intents you have to pass no other intents to
      createLight(token) or createDefault(token). You can further configure
      intents by using enableIntents(intents) and disableIntents(intents).

   


 * METHOD DETAILS
   
   
    * VALUES
      
      public static GatewayIntent[] values()
      Returns an array containing the constants of this enum type, in the order
      they are declared.
      Returns: an array containing the constants of this enum type, in the order
      they are declared
   
   
    * VALUEOF
      
      public static GatewayIntent valueOf(String name)
      Returns the enum constant of this type with the specified name. The string
      must match exactly an identifier used to declare an enum constant in this
      type. (Extraneous whitespace characters are not permitted.)
      Parameters: name - the name of the enum constant to be returned. Returns:
      the enum constant with the specified name Throws: IllegalArgumentException
      - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
   
   
    * GETRAWVALUE
      
      public int getRawValue()
      The raw bitmask value for this intent
      Returns: The raw bitmask value
   
   
    * GETOFFSET
      
      public int getOffset()
      The offset of the intent flag within a bitmask
      This means getRawValue() == 1 << getOffset()
      Returns: The offset
   
   
    * GETINTENTS
      
      @Nonnull public static EnumSet<GatewayIntent> getIntents(int raw)
      Converts a bitmask into an EnumSet of enum values.
      Parameters: raw - The raw bitmask Returns: EnumSet of intents
   
   
    * GETRAW
      
      public static int getRaw(@Nonnull Collection<GatewayIntent> set)
      Converts the given intents to a bitmask
      Parameters: set - The Collection of intents Returns: The bitmask for this
      set of intents Throws: IllegalArgumentException - If null is provided
   
   
    * GETRAW
      
      public static int getRaw(@Nonnull GatewayIntent intent, @Nonnull
      GatewayIntent... set)
      Converts the given intents to a bitmask
      Parameters: intent - The first intent set - The remaining intents Returns:
      The bitmask for this set of intents Throws: IllegalArgumentException - If
      null is provided
   
   
    * FROMCACHEFLAGS
      
      @Nonnull public static EnumSet<GatewayIntent> fromCacheFlags(@Nonnull
      CacheFlag flag, @Nonnull CacheFlag... other)
      Parse the required GatewayIntents from the provided CacheFlags.
      This creates an EnumSet based on CacheFlag.getRequiredIntent().
      Parameters: flag - The first cache flag other - Any additional cache flags
      Returns: EnumSet for the required intents Throws: IllegalArgumentException
      - If provided with null
   
   
    * FROMCACHEFLAGS
      
      @Nonnull public static EnumSet<GatewayIntent> fromCacheFlags(@Nonnull
      Collection<CacheFlag> flags)
      Parse the required GatewayIntents from the provided CacheFlags.
      This creates an EnumSet based on CacheFlag.getRequiredIntent().
      Parameters: flags - The cache flags Returns: EnumSet for the required
      intents Throws: IllegalArgumentException - If provided with null
   
   
    * FROMEVENTS
      
      @Nonnull @SafeVarargs public static EnumSet<GatewayIntent> fromEvents(
      @Nonnull Class<? extends GenericEvent>... events)
      Parse the required GatewayIntents from the provided Event Types.
      Parameters: events - The event types Returns: EnumSet for the required
      intents Throws: IllegalArgumentException - If provided with null
   
   
    * FROMEVENTS
      
      @Nonnull public static EnumSet<GatewayIntent> fromEvents(@Nonnull
      Collection<Class<? extends GenericEvent>> events)
      Parse the required GatewayIntents from the provided Event Types.
      Parameters: events - The event types Returns: EnumSet for the required
      intents Throws: IllegalArgumentException - If provided with null
   
   
    * FROM
      
      @Nonnull public static EnumSet<GatewayIntent> from(@Nonnull Collection<
      Class<? extends GenericEvent>> events, @Nonnull
      Collection<CacheFlag> flags)
      Parse the required GatewayIntents from the provided Event Types and
      CacheFlags.
      Parameters: events - The event types flags - The cache flags Returns:
      EnumSet for the required intents Throws: IllegalArgumentException - If
      provided with null