Package discord4j.gateway
Class IdentifyOptions
java.lang.Object
discord4j.gateway.IdentifyOptions
An object that contains parameters used for authenticating a bot to Discord gateway.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIdentifyOptions(IdentifyOptions.Builder builder) Create a new Gateway authentication policy. -
Method Summary
Modifier and TypeMethodDescriptionstatic IdentifyOptions.Builderbuilder(int shardIndex, int shardCount) Create a builder to create anIdentifyOptionsusing the given shard information.static IdentifyOptions.BuilderCreate a builder to create anIdentifyOptionsusing the given shard information.static IdentifyOptionscreate(int shardIndex, int shardCount) Create a defaultIdentifyOptionsusing the given shard index and count.static IdentifyOptionsCreate a defaultIdentifyOptionsusing the given shard information.Optional<discord4j.discordjson.json.gateway.StatusUpdate>Retrieve the initial status used to identify bots.Retrieve the intents which should be subscribed from the gateway when identifying.intRetrieve the number of members used to determine if a guild is "large".Retrieve theSessionInfothat should be used to resume a Gateway session.Retrieve theShardInfoto be used when authenticating, specifying shard index and count.mutate()Derive aIdentifyOptions.Builderfrom this object, reusing all properties.Derive aIdentifyOptions.Builderfrom this object, targeting a differentShardInfobut reusing all other properties.toString()
-
Constructor Details
-
IdentifyOptions
Create a new Gateway authentication policy.- Parameters:
builder- a builder used to configure this object
-
-
Method Details
-
create
Create a defaultIdentifyOptionsusing the given shard index and count.- Parameters:
shardIndex- the shard index for authenticationshardCount- the shard count for authentication- Returns:
- a default authentication policy
-
create
Create a defaultIdentifyOptionsusing the given shard information.- Parameters:
shardInfo- the shard index and count to be used when authenticating- Returns:
- a default authentication policy
-
builder
Create a builder to create anIdentifyOptionsusing the given shard information.- Parameters:
shardIndex- the shard index for authenticationshardCount- the shard count for authentication- Returns:
- a
IdentifyOptions.Builder
-
builder
Create a builder to create anIdentifyOptionsusing the given shard information.- Parameters:
shardInfo- the shard index and count to be used when authenticating- Returns:
- a
IdentifyOptions.Builder
-
mutate
Derive aIdentifyOptions.Builderfrom this object, reusing all properties.- Returns:
- a
IdentifyOptions.Builderfor further configuration
-
mutate
Derive aIdentifyOptions.Builderfrom this object, targeting a differentShardInfobut reusing all other properties.- Parameters:
shardInfo- the shard information for authentication to be used in the builder- Returns:
- a
IdentifyOptions.Builderfor further configuration
-
getShardInfo
Retrieve theShardInfoto be used when authenticating, specifying shard index and count.- Returns:
- the shard information used by this object
-
getInitialStatus
Retrieve the initial status used to identify bots.- Returns:
- the presence used to identify bots
-
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
Retrieve theSessionInfothat should be used to resume a Gateway session.- Returns:
- the session details for resumption
-
toString
-