use of io.discloader.discloader.network.json.PruneCountJSON in project DiscLoader by R3alCl0ud.
the class Guild method getPruneCount.
@Override
public CompletableFuture<Integer> getPruneCount(int days) {
CompletableFuture<Integer> future = new CompletableFuture<>();
JSONObject payload = new JSONObject().put("days", days);
CompletableFuture<PruneCountJSON> cf = getLoader().rest.request(Methods.GET, Endpoints.guildPrune(getID()), new RESTOptions(payload), PruneCountJSON.class);
cf.thenAcceptAsync(data -> {
future.complete(Integer.valueOf(data.pruned));
});
cf.exceptionally(ex -> {
future.completeExceptionally(ex);
return null;
});
return future;
}
Aggregations