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 IdentifyOptions
build()
Construct the authentication policy.IdentifyOptions.Builder
initialStatus(discord4j.discordjson.json.gateway.StatusUpdate initialStatus)
Set the initial presence status the bot will identify with.IdentifyOptions.Builder
intents(IntentSet intents)
Set the Gateway intents to use when authenticating.IdentifyOptions.Builder
largeThreshold(int largeThreshold)
Set the number of members a guild must have to be considered "large".IdentifyOptions.Builder
resumeSession(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
- aStatusUpdate
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
- anIntentSet
for authenticating, ornull
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
- aSessionInfo
for resumption, ornull
if not using this capability- Returns:
- this builder
-
build
public IdentifyOptions build()
Construct the authentication policy.- Returns:
- a built
IdentifyOptions
-
-