use of org.discordbots.api.client.DiscordBotListAPI in project HangmanDiscordBot by megoRU.
the class BotStartConfig method topGG.
@Scheduled(fixedDelay = 20000L)
private void topGG() {
if (!Config.isIsDev()) {
try {
DiscordBotListAPI TOP_GG_API = new DiscordBotListAPI.Builder().token(Config.getTopGgApiToken()).botId(Config.getBotId()).build();
serverCount = BotStartConfig.jda.getGuilds().size();
TOP_GG_API.setStats(serverCount);
BotStartConfig.jda.getPresence().setActivity(Activity.playing(BotStartConfig.activity + serverCount + " guilds"));
IOUtils.toString(new URL("http://195.2.81.139:3001/api/push/jjyiWxH1QR?msg=OK&ping="), StandardCharsets.UTF_8);
} catch (Exception e) {
Thread.currentThread().interrupt();
e.printStackTrace();
}
}
}
use of org.discordbots.api.client.DiscordBotListAPI in project aiode by robinfriedli.
the class TopGGComponent method getDiscordBotListAPI.
@Bean
public DiscordBotListAPI getDiscordBotListAPI() {
DiscordBotListAPI discordBotListAPI;
if (!Strings.isNullOrEmpty(discordBotId) && !Strings.isNullOrEmpty(topGGToken)) {
discordBotListAPI = new DiscordBotListAPI.Builder().botId(discordBotId).token(topGGToken).build();
} else {
logger.info("top.gg api not set up, missing properties");
discordBotListAPI = null;
}
return discordBotListAPI;
}
Aggregations