Skip to main content

Java Library

The community-maintained Java library for If you experience any issues/bugs please submit an issue on Github.


Replace VERSION with the latest version or commit hash. The latest version can be found under releases.




repositories {
maven { url '' }
dependencies {
compile 'org.discordbots:DBL-Java-Library:VERSION'


First, build a DiscordBotListAPI object.

DiscordBotListAPI api = new DiscordBotListAPI.Builder()

Posting bot stats provides three ways to post your bots stats. #1 Post the server count for the whole bot.

int serverCount = ...; // the total amount of servers across all shards


#2 Post the server count for an individual shard

int shardId = ...; // the id of this shard
int shardCount = ...; // the amount of shards
int serverCount = ...; // the server count of this shard

api.setStats(shardId, shardCount, serverCount);

#3 Post the server counts for every shard within a single request.

List<Integer> shardServerCounts = ...; // a list of all the shards' server counts


Checking votes

You can use this to tell if a user has voted for your bot before.

String userId = ...; // ID of the user you're checking
api.hasVoted(userId).whenComplete((hasVoted, e) -> {
System.out.println("This person has voted!");
System.out.println("This person has not voted!");

Get vote multiplier

Use this to check if there is a vote multiplier applied at the moment.

api.getVotingMultiplier().whenComplete((multiplier, e) -> {
System.out.println("It's the weekend, so votes are worth 2x!");
System.out.println("It's not the weekend :pensive:");