commit
3325d08da3
3 changed files with 27 additions and 0 deletions
|
|
@ -6,3 +6,4 @@ The Hadder Discord bot is a multi-purpose Discord Bot.
|
||||||
[](https://github.com/BigBotNetwork/Hadder)
|
[](https://github.com/BigBotNetwork/Hadder)
|
||||||
|
|
||||||
<a href="https://discordextremelist.xyz/bots/Hadder"><img src="https://discordextremelist.xyz/api/bot/637002314162372639/widget"/></a>
|
<a href="https://discordextremelist.xyz/bots/Hadder"><img src="https://discordextremelist.xyz/api/bot/637002314162372639/widget"/></a>
|
||||||
|
[](https://top.gg/bot/637002314162372639)
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@ public class Config {
|
||||||
.key("DiscordBotList").value(null)
|
.key("DiscordBotList").value(null)
|
||||||
.key("DiscordBestBots").value(null)
|
.key("DiscordBestBots").value(null)
|
||||||
.key("DiscordBoats").value(null)
|
.key("DiscordBoats").value(null)
|
||||||
|
.key("YetAnotherBotList").value(null)
|
||||||
|
.value("DiscordExtremeList").value(null)
|
||||||
|
.value("DiscordBotReviews").value(null)
|
||||||
|
.value("DiscordBots").value(null)
|
||||||
.endObject().endObject().toString();
|
.endObject().endObject().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,4 +133,8 @@ public class Config {
|
||||||
public String getDiscordBotReviewsToken() {
|
public String getDiscordBotReviewsToken() {
|
||||||
return config.getJSONObject("Tokens").getString("DiscordBotReviews");
|
return config.getJSONObject("Tokens").getString("DiscordBotReviews");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDiscordBotsToken() {
|
||||||
|
return config.getJSONObject("Tokens").getString("DiscordBots");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public class BotList {
|
||||||
private static String YetAnotherBotList = "https://yabl.xyz/api/bot/637002314162372639/stats";
|
private static String YetAnotherBotList = "https://yabl.xyz/api/bot/637002314162372639/stats";
|
||||||
private static String DiscordExtremeList = "https://discordextremelist.xyz/api/bot/637002314162372639";
|
private static String DiscordExtremeList = "https://discordextremelist.xyz/api/bot/637002314162372639";
|
||||||
private static String DiscordBotReviews = "https://discordbotreviews.xyz/api/bot/637002314162372639/stats";
|
private static String DiscordBotReviews = "https://discordbotreviews.xyz/api/bot/637002314162372639/stats";
|
||||||
|
private static String DiscordBots = "https://top.gg/api/bots/637002314162372639/stats";
|
||||||
|
|
||||||
private Config config;
|
private Config config;
|
||||||
|
|
||||||
|
|
@ -40,6 +41,8 @@ public class BotList {
|
||||||
json.put("guildCount", 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());
|
||||||
|
json.put("shard_count", Hadder.shardManager.getShards().size());
|
||||||
|
json.put("shards", Hadder.shardManager.getShards());
|
||||||
|
|
||||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
||||||
|
|
||||||
|
|
@ -162,6 +165,21 @@ public class BotList {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Discord Bots
|
||||||
|
|
||||||
|
Request discordbots = new Request.Builder()
|
||||||
|
.url(DiscordBots)
|
||||||
|
.post(body)
|
||||||
|
.addHeader("Authorization", config.getDiscordBotsToken())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
new OkHttpClient().newCall(discordbots).execute().close();
|
||||||
|
System.out.println("Successfully posted count to Discord Bots!");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue