public class IdentifyOptions extends Object
If you register a GatewayObserver
when building a client, you can receive the current
IdentifyOptions
with updated values until that point, and used to resume a session.
Constructor and Description |
---|
IdentifyOptions(int shardIndex,
int shardCount,
StatusUpdate initialStatus)
Create a new identifying policy.
|
Modifier and Type | Method and Description |
---|---|
StatusUpdate |
getInitialStatus()
Retrieve the initial status used to identify bots.
|
Integer |
getResumeSequence()
Retrieve the last gateway sequence observed by the client using this policy.
|
String |
getResumeSessionId()
Retrieve the unique gateway session identifier for the current session.
|
int |
getShardCount()
Retrieve the number of shards used by this policy.
|
int |
getShardIndex()
Retrieve the shard index in this policy.
|
void |
setResumeSequence(Integer resumeSequence)
Set a new value representing the last observed gateway sequence.
|
void |
setResumeSessionId(String resumeSessionId)
Set a new session id for the client using this policy.
|
String |
toString() |
public IdentifyOptions(int shardIndex, int shardCount, @Nullable StatusUpdate initialStatus)
shardIndex
- shard ID the client using this policy will identify withshardCount
- number of shards the client using this policy will identify withinitialStatus
- initial presence status the bot will identify withpublic int getShardIndex()
public int getShardCount()
@Nullable public StatusUpdate getInitialStatus()
@Nullable public Integer getResumeSequence()
getResumeSessionId()
.public void setResumeSequence(@Nullable Integer resumeSequence)
resumeSequence
- the new observed gateway sequence@Nullable public String getResumeSessionId()
getResumeSequence()
.public void setResumeSessionId(@Nullable String resumeSessionId)
resumeSessionId
- the new session id