New BotList #117

Merged
greg6775 merged 5 commits from greg-dev into master 2019-12-01 09:55:56 +01:00
2 changed files with 20 additions and 1 deletions
Showing only changes of commit d414539814 - Show all commits

View file

@ -137,4 +137,8 @@ public class Config {
public String getDiscordBotsToken() {
return config.getJSONObject("Tokens").getString("DiscordBots");
}
public String getBotListSpaceToken() {
return config.getJSONObject("Tokens").getString("BotListSpace");
}
}

View file

@ -27,6 +27,7 @@ public class BotList {
private static String DiscordExtremeList = "https://discordextremelist.xyz/api/bot/637002314162372639";
private static String DiscordBotReviews = "https://discordbotreviews.xyz/api/bot/637002314162372639/stats";
private static String DiscordBots = "https://top.gg/api/bots/637002314162372639/stats";
private static String BotListSpace = "https://api.botlist.space/v1/bots/:637002314162372639";
private Config config;
@ -179,7 +180,21 @@ public class BotList {
} catch (IOException e) {
e.printStackTrace();
}
}
}
// BotListSpace
Request botlistspace = new Request.Builder()
.url(BotListSpace)
.post(body)
.addHeader("Authorization", config.getBotListSpaceToken())
.build();
try {
new OkHttpClient().newCall(botlistspace).execute().close();
System.out.println("Successfully posted count to BotList.Space!");
} catch (IOException e) {
e.printStackTrace();
}
}
}
}