use of org.javacord.core.event.channel.server.invite.ServerChannelInviteCreateEventImpl in project Javacord by BtoBastian.
the class InviteCreateHandler method handle.
@Override
protected void handle(JsonNode packet) {
InviteImpl invite = new InviteImpl(api, packet);
invite.getServer().ifPresent(server -> {
// An error here means a missing channel for the invite, which should have already thrown an error
ServerChannel channel = invite.getChannel().orElseThrow(AssertionError::new);
ServerChannelInviteCreateEvent event = new ServerChannelInviteCreateEventImpl(invite, channel);
api.getEventDispatcher().dispatchServerChannelInviteCreateEvent((DispatchQueueSelector) server, server, event);
});
}
Aggregations