Two more Bot Lists :)
This commit is contained in:
parent
4d47be3d5a
commit
10658cf8bc
1 changed files with 34 additions and 1 deletions
|
|
@ -19,11 +19,15 @@ import java.nio.file.Paths;
|
||||||
public class BotList {
|
public class BotList {
|
||||||
|
|
||||||
private static String MythicalBotList = "https://mythicalbots.xyz/api/bot/637002314162372639";
|
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();
|
private static JSONObject json = new JSONObject();
|
||||||
|
|
||||||
public static void post() {
|
public static void post() {
|
||||||
json.put("server_count", Hadder.shardManager.getGuilds().size());
|
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());
|
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
||||||
|
|
||||||
|
|
@ -37,7 +41,7 @@ public class BotList {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mythical Bot List
|
// Mythical Bot List
|
||||||
|
|
||||||
Request mythicalbotlist = new Request.Builder()
|
Request mythicalbotlist = new Request.Builder()
|
||||||
.url(MythicalBotList)
|
.url(MythicalBotList)
|
||||||
.post(body)
|
.post(body)
|
||||||
|
|
@ -51,6 +55,35 @@ public class BotList {
|
||||||
e.printStackTrace();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue