use of org.javacord.api.event.channel.group.GroupChannelCreateEvent in project Javacord by BtoBastian.
the class ChannelCreateHandler method handleGroupChannel.
/**
* Handles a group channel creation.
*
* @param channel The channel data.
*/
private void handleGroupChannel(JsonNode channel) {
long channelId = channel.get("id").asLong();
if (!api.getGroupChannelById(channelId).isPresent()) {
GroupChannel groupChannel = new GroupChannelImpl(api, channel);
GroupChannelCreateEvent event = new GroupChannelCreateEventImpl(groupChannel);
api.getEventDispatcher().dispatchGroupChannelCreateEvent(api, groupChannel.getMembers(), event);
}
}
Aggregations