Class BotList
java.lang.Object
de.chojo.jdautil.botlist.BotList
Class which represents a discord botlist entry.
-
Constructor Summary
ConstructorsConstructorDescriptionBotList(com.fasterxml.jackson.databind.ObjectMapper objectMapper, HttpClient httpClient, long clientId, String name, String baseUrl, StatusCodeHandler statusCodeHandler, AuthHandler authHandler, StatsMapper statsMapper, VoteChecker voteChecker, VoteReceiver<?> voteReceiver, boolean shardStats) -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()static ClientStagelongclientId()Sends an authenticated GET request to a route of the bot list.getUrl(RouteProvider provider) booleanbooleancom.fasterxml.jackson.databind.ObjectMappermapper()name()voidreport(BotListData total, List<BotListData> shards) Report statistics to the botlist.VoteReceiver<?>
-
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 botshards- statistics per shard- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the payload could not be parsed
-
get
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
-
hasVoted
-
clientId
public long clientId() -
mapper
public com.fasterxml.jackson.databind.ObjectMapper mapper() -
name
-
baseUrl
-
builder
-
voteReceiver
-
statsMapper
-
voteChecker
-
isShardStats
public boolean isShardStats()
-