use of org.javacord.api.event.channel.server.ServerChannelCreateEvent in project Javacord by BtoBastian.
the class ChannelCreateHandler method handleServerVoiceChannel.
/**
* Handles server voice channel creation.
*
* @param channel The channel data.
*/
private void handleServerVoiceChannel(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ServerVoiceChannel voiceChannel = ((ServerImpl) server).getOrCreateServerVoiceChannel(channel);
ServerChannelCreateEvent event = new ServerChannelCreateEventImpl(voiceChannel);
api.getEventDispatcher().dispatchServerChannelCreateEvent((DispatchQueueSelector) server, server, event);
});
}
use of org.javacord.api.event.channel.server.ServerChannelCreateEvent in project Javacord by BtoBastian.
the class ChannelCreateHandler method handleChannelCategory.
/**
* Handles channel category creation.
*
* @param channel The channel data.
*/
private void handleChannelCategory(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ChannelCategory channelCategory = ((ServerImpl) server).getOrCreateChannelCategory(channel);
ServerChannelCreateEvent event = new ServerChannelCreateEventImpl(channelCategory);
api.getEventDispatcher().dispatchServerChannelCreateEvent((DispatchQueueSelector) server, server, event);
});
}
use of org.javacord.api.event.channel.server.ServerChannelCreateEvent in project Javacord by BtoBastian.
the class ChannelCreateHandler method handleServerTextChannel.
/**
* Handles server text channel creation.
*
* @param channel The channel data.
*/
private void handleServerTextChannel(JsonNode channel) {
long serverId = channel.get("guild_id").asLong();
api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
ServerTextChannel textChannel = ((ServerImpl) server).getOrCreateServerTextChannel(channel);
ServerChannelCreateEvent event = new ServerChannelCreateEventImpl(textChannel);
api.getEventDispatcher().dispatchServerChannelCreateEvent((DispatchQueueSelector) server, server, event);
});
}
use of org.javacord.api.event.channel.server.ServerChannelCreateEvent 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