commit
345c63a2f6
2 changed files with 21 additions and 0 deletions
|
|
@ -113,4 +113,8 @@ public class Config {
|
||||||
public String getDiscordBoatsToken() {
|
public String getDiscordBoatsToken() {
|
||||||
return config.getJSONObject("Tokens").getString("DiscordBoats");
|
return config.getJSONObject("Tokens").getString("DiscordBoats");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getYetAnotherBotListToken() {
|
||||||
|
return config.getJSONObject("Tokens").getString("YetAnotherBotList");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ public class BotList {
|
||||||
private static String DiscordBotList = "https://discordbotlist.com/api/bots/637002314162372639/stats";
|
private static String DiscordBotList = "https://discordbotlist.com/api/bots/637002314162372639/stats";
|
||||||
private static String DiscordBestBots = "https://discordsbestbots.xyz/api/bots/637002314162372639/stats";
|
private static String DiscordBestBots = "https://discordsbestbots.xyz/api/bots/637002314162372639/stats";
|
||||||
private static String DiscordBoats = "https://discord.boats/api/bot/637002314162372639";
|
private static String DiscordBoats = "https://discord.boats/api/bot/637002314162372639";
|
||||||
|
private static String YetAnotherBotList = "https://yabl.xyz/api/bot/637002314162372639/stats";
|
||||||
|
|
||||||
private Config config;
|
private Config config;
|
||||||
|
|
||||||
|
|
@ -34,6 +35,7 @@ public class BotList {
|
||||||
if (Files.notExists(Paths.get("./DEBUG"))) {
|
if (Files.notExists(Paths.get("./DEBUG"))) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("server_count", Hadder.shardManager.getGuilds().size());
|
json.put("server_count", Hadder.shardManager.getGuilds().size());
|
||||||
|
json.put("guildCount", Hadder.shardManager.getGuilds().size());
|
||||||
json.put("guilds", Hadder.shardManager.getGuilds().size());
|
json.put("guilds", Hadder.shardManager.getGuilds().size());
|
||||||
json.put("users", Hadder.shardManager.getUsers().size());
|
json.put("users", Hadder.shardManager.getUsers().size());
|
||||||
|
|
||||||
|
|
@ -113,6 +115,21 @@ public class BotList {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Yet Another Bot List
|
||||||
|
|
||||||
|
Request yetanotherbotlist = new Request.Builder()
|
||||||
|
.url(YetAnotherBotList)
|
||||||
|
.post(body)
|
||||||
|
.addHeader("Authorization", config.getYetAnotherBotListToken())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
new OkHttpClient().newCall(yetanotherbotlist).execute().close();
|
||||||
|
System.out.println("Successfully posted count to Yet Another Bot List!");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue