Package discord4j.gateway
Class IdentifyOptions.Builder
- java.lang.Object
-
- discord4j.gateway.IdentifyOptions.Builder
-
- Enclosing class:
- IdentifyOptions
public static class IdentifyOptions.Builder extends Object
Builder to createIdentifyOptions. Requires specifying the shard information.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdentifyOptionsbuild()Construct the authentication policy.IdentifyOptions.BuilderinitialStatus(discord4j.discordjson.json.gateway.StatusUpdate initialStatus)Set the initial presence status the bot will identify with.IdentifyOptions.Builderintents(IntentSet intents)Set the Gateway intents to use when authenticating.IdentifyOptions.BuilderlargeThreshold(int largeThreshold)Set the number of members a guild must have to be considered "large".IdentifyOptions.BuilderresumeSession(SessionInfo resumeSession)Set information about a Gateway session to be resumed.
-
-
-
Constructor Detail
-
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 Detail
-
initialStatus
public IdentifyOptions.Builder initialStatus(@Nullable discord4j.discordjson.json.gateway.StatusUpdate initialStatus)
Set the initial presence status the bot will identify with.- Parameters:
initialStatus- aStatusUpdateto 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- anIntentSetfor authenticating, ornullif 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- aSessionInfofor resumption, ornullif not using this capability- Returns:
- this builder
-
build
public IdentifyOptions build()
Construct the authentication policy.- Returns:
- a built
IdentifyOptions
-
-