use of org.javacord.api.entity.channel.ServerStageVoiceChannel in project Javacord by BtoBastian.
the class ChannelCreateHandler method handleServerStageVoiceChannel.
/**
* Handles server stage voice channel creation.
*
* @param channel The channel data.
*/
private void handleServerStageVoiceChannel(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ServerStageVoiceChannel voiceChannel = ((ServerImpl) server).getOrCreateServerStageVoiceChannel(channel);
ServerChannelCreateEvent event = new ServerChannelCreateEventImpl(voiceChannel);
api.getEventDispatcher().dispatchServerChannelCreateEvent((DispatchQueueSelector) server, server, event);
});
}
Aggregations