use of org.javacord.core.event.channel.server.text.WebhooksUpdateEventImpl in project Javacord by BtoBastian.
the class WebhooksUpdateHandler method handle.
@Override
public void handle(JsonNode packet) {
long channelId = packet.get("channel_id").asLong();
Optional<ServerTextChannel> optionalChannel = api.getServerTextChannelById(channelId);
if (optionalChannel.isPresent()) {
ServerTextChannel channel = optionalChannel.get();
WebhooksUpdateEvent event = new WebhooksUpdateEventImpl(channel);
api.getEventDispatcher().dispatchWebhooksUpdateEvent((DispatchQueueSelector) channel.getServer(), channel.getServer(), channel, event);
} else {
LoggerUtil.logMissingChannel(logger, channelId);
}
}
Aggregations