Class IdentifyOptions.Builder

java.lang.Object
discord4j.gateway.IdentifyOptions.Builder
Enclosing class:
IdentifyOptions

public static class IdentifyOptions.Builder extends Object
Builder to create IdentifyOptions. Requires specifying the shard information.
  • Constructor Details

    • Builder

      protected Builder(ShardInfo shardInfo)
      Create a builder using the given shard information.
      Parameters:
      shardInfo - the shard index and count to be used when authenticating
  • Method Details

    • initialStatus

      public IdentifyOptions.Builder initialStatus(@Nullable discord4j.discordjson.json.gateway.StatusUpdate initialStatus)
      Set the initial presence status the bot will identify with.
      Parameters:
      initialStatus - a StatusUpdate to be used when authenticating
      Returns:
      this builder
    • intents

      public IdentifyOptions.Builder intents(@Nullable IntentSet intents)
      Set the Gateway intents to use when authenticating.
      Parameters:
      intents - an IntentSet for authenticating, or null if not using this capability
      Returns:
      this builder
    • largeThreshold

      public IdentifyOptions.Builder largeThreshold(int largeThreshold)
      Set the number of members a guild must have to be considered "large". Defaults to 250.
      Parameters:
      largeThreshold - the number of guild members to identify a large guild
      Returns:
      this builder
    • resumeSession

      public IdentifyOptions.Builder resumeSession(@Nullable SessionInfo resumeSession)
      Set information about a Gateway session to be resumed. If not specified, a normal authentication is performed, creating a fresh session to the Gateway.
      Parameters:
      resumeSession - a SessionInfo for resumption, or null if not using this capability
      Returns:
      this builder
    • build

      public IdentifyOptions build()
      Construct the authentication policy.
      Returns:
      a built IdentifyOptions