Class BotList

java.lang.Object
de.chojo.jdautil.botlist.BotList

public class BotList extends Object
Class which represents a discord botlist entry.
  • Constructor Details

  • Method Details

    • report

      public void report(BotListData total, List<BotListData> shards) throws com.fasterxml.jackson.core.JsonProcessingException
      Report statistics to the botlist. Lists with shard stats get one request per shard, all others the total.
      Parameters:
      total - statistics of the whole bot
      shards - statistics per shard
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the payload could not be parsed
    • get

      public Optional<HttpResponse<String>> get(String route)
      Sends an authenticated GET request to a route of the bot list. A 404 response is returned without being logged, since vote checks answer "no vote" with it.
      Parameters:
      route - route relative to the base url
      Returns:
      the response, or empty when the request failed
    • getUrl

      public URI getUrl(RouteProvider provider)
    • hasVoted

      public boolean hasVoted(User user)
    • clientId

      public long clientId()
    • mapper

      public com.fasterxml.jackson.databind.ObjectMapper mapper()
    • name

      public String name()
    • baseUrl

      public String baseUrl()
    • builder

      public static ClientStage builder(String name)
    • voteReceiver

      public VoteReceiver<?> voteReceiver()
    • statsMapper

      public StatsMapper statsMapper()
    • voteChecker

      public VoteChecker voteChecker()
    • isShardStats

      public boolean isShardStats()