use of org.javacord.core.event.server.ServerJoinEventImpl in project Javacord by BtoBastian.
the class GuildCreateHandler method handle.
@Override
public void handle(JsonNode packet) {
if (packet.has("unavailable") && packet.get("unavailable").asBoolean()) {
return;
}
long id = packet.get("id").asLong();
if (api.getUnavailableServers().contains(id)) {
ServerImpl server = new ServerImpl(api, packet);
ServerBecomesAvailableEvent event = new ServerBecomesAvailableEventImpl(server);
api.getEventDispatcher().dispatchServerBecomesAvailableEvent(server, event);
return;
}
ServerImpl server = new ServerImpl(api, packet);
ServerJoinEvent event = new ServerJoinEventImpl(server);
api.getEventDispatcher().dispatchServerJoinEvent(server, event);
}
Aggregations