Search in sources :

Example 1 with GroupChannel

use of org.javacord.api.entity.channel.GroupChannel 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);
    }
}
Also used : GroupChannelCreateEventImpl(org.javacord.core.event.channel.group.GroupChannelCreateEventImpl) GroupChannel(org.javacord.api.entity.channel.GroupChannel) GroupChannelCreateEvent(org.javacord.api.event.channel.group.GroupChannelCreateEvent) GroupChannelImpl(org.javacord.core.entity.channel.GroupChannelImpl)

Aggregations

GroupChannel (org.javacord.api.entity.channel.GroupChannel)1 GroupChannelCreateEvent (org.javacord.api.event.channel.group.GroupChannelCreateEvent)1 GroupChannelImpl (org.javacord.core.entity.channel.GroupChannelImpl)1 GroupChannelCreateEventImpl (org.javacord.core.event.channel.group.GroupChannelCreateEventImpl)1