use of de.kaktushose.levelbot.bot.Levelbot in project Levelbot by Kaktushose.
the class Bootstrapper method main.
public static void main(String[] args) throws LoginException, InterruptedException {
long startTime = System.currentTimeMillis();
log.info("Starting bot...");
Thread.setDefaultUncaughtExceptionHandler((t, e) -> log.error("An unexpected error has occurred!", e));
SpringApplication.run(Bootstrapper.class, args);
levelbot = new Levelbot(Levelbot.GuildType.PRODUCTION);
levelbot.start().indexMembers();
startTime = System.currentTimeMillis() - startTime;
log.info("Successfully started bot! Took {} seconds", TimeUnit.MILLISECONDS.toSeconds(startTime));
}
use of de.kaktushose.levelbot.bot.Levelbot in project Levelbot by Kaktushose.
the class Statistics method getYoutubeStatistics.
private ChannelStatistics getYoutubeStatistics() throws IOException {
HttpRequestInitializer httpRequestInitializer = request -> {
};
YouTube youTube = new YouTube.Builder(new NetHttpTransport(), new JacksonFactory(), httpRequestInitializer).setApplicationName("Levelbot").build();
YouTube.Channels.List search = youTube.channels().list("statistics");
search.setForUsername("nordrheintvplay");
search.setKey(youtubeApiKey);
ChannelListResponse response = search.execute();
return response.getItems().get(0).getStatistics();
}
Aggregations