use of org.javacord.core.event.channel.server.invite.ServerChannelInviteDeleteEventImpl in project Javacord by BtoBastian.
the class InviteDeleteHandler method handle.
@Override
protected void handle(JsonNode packet) {
String code = packet.get("code").asText();
Channel channel = api.getChannelById(packet.get("channel_id").asLong()).orElseThrow(AssertionError::new);
channel.asServerChannel().ifPresent(serverChannel -> {
Server server = serverChannel.getServer();
ServerChannelInviteDeleteEvent event = new ServerChannelInviteDeleteEventImpl(code, serverChannel);
api.getEventDispatcher().dispatchServerChannelInviteDeleteEvent((DispatchQueueSelector) server, server, event);
});
}
Aggregations