Class JDA.ShardInfo

Enclosing interface:

public static class JDA.ShardInfo extends Object
Represents the information used to create this shard.
  • Field Details

    • SINGLE

      public static final JDA.ShardInfo 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).
      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 using JDABuilder.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.
      The total of shards based on the total provided by the developer during JDA initialization.
    • getShardString

      public String getShardString()
      Provides a shortcut method for easily printing shard info.
      Format: "[# / #]"
      Where the first # is shardId and the second # is shardTotal.
      A String representing the information used to build this shard.
    • toString

      public String toString()
      toString in class Object
    • equals

      public boolean equals(Object o)
      equals in class Object