use of org.javacord.core.event.server.role.RoleCreateEventImpl in project Javacord by BtoBastian.
the class GuildRoleCreateHandler method handle.
@Override
public void handle(JsonNode packet) {
long serverId = Long.parseLong(packet.get("guild_id").asText());
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
Role role = ((ServerImpl) server).getOrCreateRole(packet.get("role"));
RoleCreateEvent event = new RoleCreateEventImpl(role);
api.getEventDispatcher().dispatchRoleCreateEvent((DispatchQueueSelector) server, server, event);
});
}
Aggregations