commit
14a6fc91b5
1 changed files with 50 additions and 0 deletions
|
|
@ -19,11 +19,16 @@ 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 String DiscordBestBots = "https://discordsbestbots.xyz/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,6 +42,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)
|
||||||
|
|
@ -50,6 +56,50 @@ 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue