use of me.shadorc.shadbot.listener.ShardListener in project Shadbot by Shadorc.
the class Shadbot method main.
public static void main(String[] args) {
Locale.setDefault(new Locale("en", "US"));
// Initialization
if (!DataManager.init() || !CommandManager.init()) {
System.exit(1);
}
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
DataManager.stop();
}
});
client = new ClientBuilder().withToken(APIKeys.get(APIKey.DISCORD_TOKEN)).withRecommendedShardCount().withPingTimeout(10).setMaxReconnectAttempts(10).setMaxMessageCacheCount(100).setPresence(StatusType.IDLE).build();
LogUtils.infof("Connecting to %s...", StringUtils.pluralOf(client.getShardCount(), "shard"));
client.getDispatcher().registerListeners(Shadbot.getEventThreadPool(), new ReadyListener(), new ShardListener());
client.login();
}
Aggregations