IBL4J
Java Wrapper used for interacting with the Infinity Bots List API.
Installation
- Replace
VERSION
by the latest release (opens in a new tab)
Maven
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.Zone-Infinity.IBL4J</groupId>
<artifactId>ibl4j</artifactId>
<version>VERSION</version>
</dependency>
<dependency>
<groupId>com.github.Zone-Infinity.IBL4J</groupId>
<artifactId>ibl-library</artifactId>
<version>VERSION</version>
</dependency>
Gradle
maven { url 'https://jitpack.io' }
implementation 'com.github.Zone-Infinity:IBL4J:VERSION'
Post Method
// jda is your JDA instance
IBLDiscordClient iblDiscordClient = new JDAClient(jda);
IBL ibl = new IBLBuilder(iblDiscordClient, "IBL_TOKEN");
// Post only server count
ibl.postServerCount(response -> {
System.out.println(response.getMessage());
});
// Post server count and shard count
ibl.postStats(response -> {
System.out.println(response.getMessage());
});
Auto Posting
// Post every 5 minutes
ibl.autoPostStats(Executors.newSingleThreadExecutor(), response -> {
System.out.println(response.getMessage());
});
// Post every `delay` in `timeunit`
ibl.autoPostStats(Executors.newSingleThreadExecutor(), 5, TimeUnit.MINUTES, response -> {
System.out.println(response.getMessage());
});
Get method
Get your bot data
// bot is me.infinity.ibl.data.entities.IBLBot instance.
ibl.getStats(bot -> {
// Votes
System.out.println(bot.getAnalytics().getVotes());
// Short Description
System.out.println(bot.getShortDescription());
});
Get any Bots data
IBL.getBotStats("BOT_ID", bot -> {
if(!bot.exists()) System.out.println("Bot doesn't exist on the list");
// Prefix
System.out.println(bot.getPrefix());
// Github Link
System.out.println(bot.getLinks().getGithub());
});
Get any Users data
IBL.getUserInfo("USER_ID", user -> {
if(!user.exists()) System.out.println("User doesn't exist on the list");
// Is a staff or not
System.out.println(user.isStaff());
// User's Github
System.out.println(user.getLinks().getGithub());
});