Class IdentifyOptions


  • public class IdentifyOptions
    extends Object
    An object that contains parameters used for authenticating a bot to Discord gateway.
    • Constructor Detail

      • IdentifyOptions

        protected IdentifyOptions​(IdentifyOptions.Builder builder)
        Create a new Gateway authentication policy.
        Parameters:
        builder - a builder used to configure this object
    • Method Detail

      • create

        public static IdentifyOptions create​(int shardIndex,
                                             int shardCount)
        Create a default IdentifyOptions using the given shard index and count.
        Parameters:
        shardIndex - the shard index for authentication
        shardCount - the shard count for authentication
        Returns:
        a default authentication policy
      • create

        public static IdentifyOptions create​(ShardInfo shardInfo)
        Create a default IdentifyOptions using the given shard information.
        Parameters:
        shardInfo - the shard index and count to be used when authenticating
        Returns:
        a default authentication policy
      • builder

        public static IdentifyOptions.Builder builder​(int shardIndex,
                                                      int shardCount)
        Create a builder to create an IdentifyOptions using the given shard information.
        Parameters:
        shardIndex - the shard index for authentication
        shardCount - the shard count for authentication
        Returns:
        a IdentifyOptions.Builder
      • getShardInfo

        public ShardInfo getShardInfo()
        Retrieve the ShardInfo to be used when authenticating, specifying shard index and count.
        Returns:
        the shard information used by this object
      • getInitialStatus

        public Optional<discord4j.discordjson.json.gateway.StatusUpdate> getInitialStatus()
        Retrieve the initial status used to identify bots.
        Returns:
        the presence used to identify bots
      • getIntents

        public Optional<IntentSet> getIntents()
        Retrieve the intents which should be subscribed from the gateway when identifying.
        Returns:
        Possible.absent() when no intents are set or the raw intent value which should be subscribed
      • getLargeThreshold

        public int getLargeThreshold()
        Retrieve the number of members used to determine if a guild is "large". Gateway will not send offline member information for a large guild member list.
        Returns:
        the value used to determine if a guild is considered large
      • getResumeSession

        public Optional<SessionInfo> getResumeSession()
        Retrieve the SessionInfo that should be used to resume a Gateway session.
        Returns:
        the session details for resumption