API Libraries

Some libraries have been written making use of the BotBlock API to make posting your bot server/guild count a breeze from your preferred language and bot library. These libraries are not all maintained by BotBlock but are known to make use of the BotBlock API and function as expected.

Want your own BotBlock API library listed here? Contact us using the Discord or Contact links in the navbar dropdown.

Python - discordlists.py

discordlists.py is available via pip and provides an easy to use Client class to automatically and manually post your server/guild count to the BotBlock API to forward it on to all BotBlock bot lists. This library also provides a way to get information about a bot from all lists on BotBlock through the GET bot API endpoint.

Example Usage
import discordlists

class DiscordLists:
    def __init__(self, bot):
        self.bot = bot
        self.lists = discordlists.Client(self.bot)  # Create a Client instance
        self.lists.set_auth("bots.ondiscord.xyz", "dsag38_auth_token_fda6gs") # Set authorisation token for a bot list
        self.lists.set_auth("discordbots.group", "qos56a_auth_token_gfd8g6") # Set authorisation token for a bot list
        self.lists.start_loop()  # Posts the server count automatically every 30 minutes

def setup(bot):

JavaScript - blapi

blapi is a library that makes use of the BotBlock API to post directly to BotBlock to forward your bot server/guild count on to all lists but also uses the lists endpoint to manually post to each bot list if you get ratelimited from the BotBlock post count API.

Example Usage
const Discord = require("discord.js");
const blapi = require("blapi");
const apiKeys = {
  "bots.ondiscord.xyz": "dsag38_auth_token_fda6gs", // Add other bot lists as needed
  "discordbots.group": "qos56a_auth_token_gfd8g6"

let bot = new Discord.Client({ autoReconnect: true });
blapi.handle(bot, apiKeys, 60); // If interval is not passed (60), it will default to every 30 minutes

Java - BotBlock4J

BotBlock4J is a JDA library available through JCenter. It offers a simple object oriented interface for posting your guild counts through the BotBlock API automatically. It supports both a standard JDA instance as well as a ShardManager instance if being used.

Example Usage
BlockAuth auth = new BlockAuth();
auth.setListAuthToken("bots.ondiscord.xyz", "dsag38_auth_token_fda6gs"); // Add other lists as needed.
auth.setListAuthToken("discordbots.group", "qos56a_auth_token_gfd8g6");
BotBlockAPI api = new BotBlockAPI(jda, true, auth); // This starts a timer that sends guild counts every 30 minutes.

C# - BotListAPI

BotListAPI is a C# nuget package for the discord.net lib that provides an easy method to manually or automatically post your bot's server count every 10 minutes with information for each bot list through the BotBlock API. It also supports sharded clients and .net framework or .net core.

Example Usage
ListClient = new ListClient(_Client, new ListConfig
    BotsOnDiscord = "dsag38_auth_token_fda6gs", // Add any other lists as needed
    DiscordBotsGroup = "qos56a_auth_token_gfd8g6"