Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.
/ BotBlock4J Public archive

Api wrapper for, a site that removes the hassle from managing multiple Discord List APIs


Notifications You must be signed in to change notification settings


Repository files navigation



API wrapper for BotBlock, a site that removes the hassle from managing multiple Discord bot list APIs.
You can view the full list of Discord bot list APIs that BotBlock, and by extension this wrapper, supports on the BotBlock API docs.


You have three options for implementing the API.


repositories {

dependencies {
 compile group: 'com.nathanwebb', name: 'BotBlock4J', version: 'LATEST-VERSION-HERE'




<dependency org='com.nathanwebb' name='BotBlock4J' rev='LATEST-VERSION-HERE'>
  <artifact name='BotBlock4J' ext='pom' ></artifact>

Alternatively, you could just head over to the Bintray Site and download the jar file yourself.


Note: You can also provide an instance of ShardManager instead of JDA

Creating a BlockAuth instance

We have to create a BlockAuth instance to provide it later for the post requests.

Using the Builder (Recommended)

You can use the BlockAuth.Builder() to create an instance easy.

 * We can use BlockAuth.Builder() to add sites to the HashMap of lists
 * You can use addListAuthToken(String, String) and add as many as you like.
 * Don't forget to call .build(); at the end to build the BlockAuth instance
BlockAuth auth = new BlockAuth.Builder()
    .addListAuthToken("", "MyS3cr3tT0k3n")
    .addListAuthToken("", "My0th3rS3cr3tT0k3n")

Set manually

If you want to set it manually you can just use setListAuthToken(String, String) directly.

BlockAuth auth = new BlockAuth();

// We have to call this method for each list.
auth.setListAuthToken("", "MyS3cr3tT0k3n");
auth.setListAuthToken("", "My0th3rS3cr3tT0k3n")

Posting stats

There are three different types of methods you can use, depending on your preferences.
All methods require you to have the BlockAuth instance set up.

All shown examples use an BlockAuth called auth and a JDA instance called jda or ShardManager called shardManager.

Post every X minutes

You can let BotBlock4J post stats automatically every X minutes.

 * Create an instance of BotBlockAPI.
 * Default update interval is 30 minutes.
BotBlockAPI api = new BotBlockAPI(jda, false, auth);

// Use this method to change the interval. This needs to be called before startSendingGuildCounts()

// Call this to start posting of the guild count.

// Call this to stop sending of the guild count. You can use startSendingGuildCounts() to start it again.


If you want to send the guild count manually you can use one of those methods.

// Posts the guild count of the provided JDA instance
BotBlockRequests.postGuilds(jda, auth);

// Posts the guild count of the provided ShardManager.
BotBlockRequests.postGuilds(shardManager, auth);

Sending without an instance

If you don't want to provide a JDA or ShardManager instance you can use one of those methods here:

int guilds = 100;

// Posts the guild count with the provided Bot id as String.
BotBlockRequests.postGuilds("yourBotId", guilds, auth);

// Posts the guild count with the provided Bot id as Long.
BotBlockRequests.postGuilds(1234567890L, guilds, auth);


The above methods can throw those Exceptions:

  • FailedToSendException
    Thrown when one or more sites returned errors while posting.
  • EmptyResponseException
    When the BotBlockAPI returns an empty JSON body.
  • RateLimitException
    When the Request was ratelimited.
  • IOException
    When the connection drops/was cancelled.


Api wrapper for, a site that removes the hassle from managing multiple Discord List APIs








No packages published