diff --git a/src/main/java/com/bbn/hadder/utils/BotList.java b/src/main/java/com/bbn/hadder/utils/BotList.java index 3ae0424..fbee5ca 100644 --- a/src/main/java/com/bbn/hadder/utils/BotList.java +++ b/src/main/java/com/bbn/hadder/utils/BotList.java @@ -19,11 +19,16 @@ import java.nio.file.Paths; public class BotList { private static String MythicalBotList = "https://mythicalbots.xyz/api/bot/637002314162372639"; + private static String BotsForDiscord = "https://botsfordiscord.com/api/bot/637002314162372639"; + private static String DiscordBotList = "https://discordbotlist.com/api/bots/637002314162372639/stats"; + private static String DiscordBestBots = "https://discordsbestbots.xyz/api/bots/637002314162372639/stats"; private static JSONObject json = new JSONObject(); public static void post() { json.put("server_count", Hadder.shardManager.getGuilds().size()); + json.put("guilds", Hadder.shardManager.getGuilds().size()); + json.put("users", Hadder.shardManager.getUsers().size()); RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString()); @@ -37,6 +42,7 @@ public class BotList { } // Mythical Bot List + Request mythicalbotlist = new Request.Builder() .url(MythicalBotList) .post(body) @@ -50,6 +56,50 @@ public class BotList { e.printStackTrace(); } + // BotsForDiscord + + Request botsfordiscord = new Request.Builder() + .url(BotsForDiscord) + .post(body) + .addHeader("Authorization", config.getString("BotsForDiscord")) + .build(); + + try { + new OkHttpClient().newCall(botsfordiscord).execute().close(); + System.out.println("Successfully posted count to Bots For Discord!"); + } catch (IOException e) { + e.printStackTrace(); + } + + // Discord Bot List + + Request discordbotlist = new Request.Builder() + .url(DiscordBotList) + .post(body) + .addHeader("Authorization", "Bot " + config.getString("DiscordBotList")) + .build(); + + try { + new OkHttpClient().newCall(discordbotlist).execute().close(); + System.out.println("Successfully posted count for the Discord Bot List"); + } catch (IOException e) { + e.printStackTrace(); + } + + // Discord Best Bots + + Request discordbestbots = new Request.Builder() + .url(DiscordBestBots) + .post(body) + .addHeader("Authorization", config.getString("DiscordBestBots")) + .build(); + + try { + new OkHttpClient().newCall(discordbestbots).execute().close(); + System.out.println("Successfully posted count to Discord Best Bots!"); + } catch (IOException e) { + e.printStackTrace(); + } } }