Two more Bot Lists :)

This commit is contained in:
GregTCLTK 2019-11-03 11:57:29 +01:00
parent 4d47be3d5a
commit 10658cf8bc
No known key found for this signature in database
GPG key ID: 6C090B9A5D4B3734

View file

@ -19,11 +19,15 @@ 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 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,7 +41,7 @@ public class BotList {
}
// Mythical Bot List
Request mythicalbotlist = new Request.Builder()
.url(MythicalBotList)
.post(body)
@ -51,6 +55,35 @@ 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();
}
}
}