Package net.dv8tion.jda.api
Class JDA.ShardInfo
java.lang.Object
net.dv8tion.jda.api.JDA.ShardInfo
- Enclosing interface:
JDA
Represents the information used to create this shard.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JDA.ShardInfo
Default sharding config with one shard -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Represents the id of the shard of the current instance.Provides a shortcut method for easily printing shard info.int
The total amount of shards based on the value provided during JDA instance creation usingJDABuilder.useSharding(int, int)
.toString()
-
Field Details
-
SINGLE
Default sharding config with one shard
-
-
Constructor Details
-
ShardInfo
public ShardInfo(int shardId, int shardTotal)
-
-
Method Details
-
getShardId
public int getShardId()Represents the id of the shard of the current instance.
This value will be between 0 and (getShardTotal()
- 1).- Returns:
- The id of the currently logged in shard.
-
getShardTotal
public int getShardTotal()The total amount of shards based on the value provided during JDA instance creation usingJDABuilder.useSharding(int, int)
.
This does not query Discord to determine the total number of shards.
This does not represent the amount of logged in shards.
It strictly represents the integer value provided to discord representing the total amount of shards that the developer indicated that it was going to use when initially starting JDA.- Returns:
- The total of shards based on the total provided by the developer during JDA initialization.
-
getShardString
Provides a shortcut method for easily printing shard info.
Format: "[# / #]"
Where the first # is shardId and the second # is shardTotal.- Returns:
- A String representing the information used to build this shard.
-
toString
-
equals
-