use of org.javacord.core.event.channel.thread.ThreadCreateEventImpl in project Javacord by BtoBastian.
the class ThreadCreateHandler method handleThread.
/**
* Handles the creation of a thread.
*
* @param channel The channel data from which to build the thread.
*/
private void handleThread(final JsonNode channel) {
final long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
final ServerThreadChannel serverThreadChannel = ((ServerImpl) server).getOrCreateServerThreadChannel(channel);
final ThreadCreateEvent event = new ThreadCreateEventImpl(serverThreadChannel);
api.getEventDispatcher().dispatchThreadCreateEvent((DispatchQueueSelector) server, serverThreadChannel, event);
});
}
Aggregations