Search in sources :

Example 6 with ServerImpl

use of org.javacord.core.entity.server.ServerImpl in project Javacord by BtoBastian.

the class GuildMemberUpdateHandler method handle.

@Override
public void handle(JsonNode packet) {
    api.getPossiblyUnreadyServerById(packet.get("guild_id").asLong()).map(server -> (ServerImpl) server).ifPresent(server -> {
        MemberImpl newMember = new MemberImpl(api, server, packet, null);
        Member oldMember = server.getRealMemberById(newMember.getId()).orElse(null);
        api.addMemberToCacheOrReplaceExisting(newMember);
        if (oldMember == null) {
            // Should only happen shortly after startup and is unproblematic
            return;
        }
        if (!newMember.getNickname().equals(oldMember.getNickname())) {
            UserChangeNicknameEvent event = new UserChangeNicknameEventImpl(newMember, oldMember);
            api.getEventDispatcher().dispatchUserChangeNicknameEvent(server, server, newMember.getUser(), event);
        }
        if (!newMember.getServerAvatarHash().equals(oldMember.getServerAvatarHash())) {
            UserChangeServerAvatarEvent event = new UserChangeServerAvatarEventImpl(newMember, oldMember);
            api.getEventDispatcher().dispatchUserChangeServerAvatarEvent(server, server, newMember.getUser(), event);
        }
        if (newMember.isPending() != oldMember.isPending()) {
            UserChangePendingEvent event = new UserChangePendingEventImpl(oldMember, newMember);
            api.getEventDispatcher().dispatchUserChangePendingEvent(server, server, newMember.getUser(), event);
        }
        if (packet.has("roles")) {
            JsonNode jsonRoles = packet.get("roles");
            Collection<Role> newRoles = new HashSet<>();
            Collection<Role> oldRoles = oldMember.getRoles();
            Collection<Role> intersection = new HashSet<>();
            for (JsonNode roleIdJson : jsonRoles) {
                api.getRoleById(roleIdJson.asText()).map(role -> {
                    newRoles.add(role);
                    return role;
                }).filter(oldRoles::contains).ifPresent(intersection::add);
            }
            // Added roles
            Collection<Role> addedRoles = new ArrayList<>(newRoles);
            addedRoles.removeAll(intersection);
            for (Role role : addedRoles) {
                if (role.isEveryoneRole()) {
                    continue;
                }
                UserRoleAddEvent event = new UserRoleAddEventImpl(role, newMember);
                api.getEventDispatcher().dispatchUserRoleAddEvent((DispatchQueueSelector) role.getServer(), role, role.getServer(), newMember.getId(), event);
            }
            // Removed roles
            Collection<Role> removedRoles = new ArrayList<>(oldRoles);
            removedRoles.removeAll(intersection);
            for (Role role : removedRoles) {
                if (role.isEveryoneRole()) {
                    continue;
                }
                UserRoleRemoveEvent event = new UserRoleRemoveEventImpl(role, newMember);
                api.getEventDispatcher().dispatchUserRoleRemoveEvent((DispatchQueueSelector) role.getServer(), role, role.getServer(), newMember.getId(), event);
            }
        }
        if (newMember.getUser().isYourself()) {
            Set<Long> unreadableChannels = server.getTextChannels().stream().filter(((Predicate<ServerTextChannel>) ServerTextChannel::canYouSee).negate()).map(ServerTextChannel::getId).collect(Collectors.toSet());
            api.forEachCachedMessageWhere(msg -> unreadableChannels.contains(msg.getChannel().getId()), msg -> {
                api.removeMessageFromCache(msg.getId());
                ((MessageCacheImpl) msg.getChannel().getMessageCache()).removeMessage(msg);
            });
        }
        // https://github.com/discord/discord-api-docs/pull/1307#issuecomment-581561519
        if (oldMember.getUser() != null) {
            UserImpl oldUser = (UserImpl) oldMember.getUser();
            boolean userChanged = false;
            UserImpl updatedUser = oldUser.replacePartialUserData(packet.get("user"));
            if (packet.get("user").has("username")) {
                String newName = packet.get("user").get("username").asText();
                String oldName = oldUser.getName();
                if (!oldName.equals(newName)) {
                    dispatchUserChangeNameEvent(updatedUser, newName, oldName);
                    userChanged = true;
                }
            }
            if (packet.get("user").has("discriminator")) {
                String newDiscriminator = packet.get("user").get("discriminator").asText();
                String oldDiscriminator = oldUser.getDiscriminator();
                if (!oldDiscriminator.equals(newDiscriminator)) {
                    dispatchUserChangeDiscriminatorEvent(updatedUser, newDiscriminator, oldDiscriminator);
                    userChanged = true;
                }
            }
            if (packet.get("user").has("avatar")) {
                String newAvatarHash = packet.get("user").get("avatar").asText(null);
                String oldAvatarHash = oldUser.getAvatarHash().orElse(null);
                if (!Objects.deepEquals(newAvatarHash, oldAvatarHash)) {
                    dispatchUserChangeAvatarEvent(updatedUser, newAvatarHash, oldAvatarHash);
                    userChanged = true;
                }
            }
            if (userChanged) {
                api.updateUserOfAllMembers(updatedUser);
            }
        }
    });
}
Also used : UserChangeNameEventImpl(org.javacord.core.event.user.UserChangeNameEventImpl) Member(org.javacord.core.entity.user.Member) UserChangeServerAvatarEventImpl(org.javacord.core.event.user.UserChangeServerAvatarEventImpl) UserChangePendingEvent(org.javacord.api.event.user.UserChangePendingEvent) UserRoleRemoveEventImpl(org.javacord.core.event.server.role.UserRoleRemoveEventImpl) UserChangeAvatarEvent(org.javacord.api.event.user.UserChangeAvatarEvent) UserChangeAvatarEventImpl(org.javacord.core.event.user.UserChangeAvatarEventImpl) UserChangeNicknameEvent(org.javacord.api.event.user.UserChangeNicknameEvent) UserChangeServerAvatarEvent(org.javacord.api.event.user.UserChangeServerAvatarEvent) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) MessageCacheImpl(org.javacord.core.util.cache.MessageCacheImpl) UserRoleRemoveEvent(org.javacord.api.event.server.role.UserRoleRemoveEvent) UserChangePendingEventImpl(org.javacord.core.event.user.UserChangePendingEventImpl) ServerTextChannel(org.javacord.api.entity.channel.ServerTextChannel) JsonNode(com.fasterxml.jackson.databind.JsonNode) UserChangeDiscriminatorEventImpl(org.javacord.core.event.user.UserChangeDiscriminatorEventImpl) ServerImpl(org.javacord.core.entity.server.ServerImpl) Predicate(java.util.function.Predicate) UserImpl(org.javacord.core.entity.user.UserImpl) Collection(java.util.Collection) MemberImpl(org.javacord.core.entity.user.MemberImpl) Set(java.util.Set) Collectors(java.util.stream.Collectors) UserRoleAddEvent(org.javacord.api.event.server.role.UserRoleAddEvent) UserChangeNameEvent(org.javacord.api.event.user.UserChangeNameEvent) Objects(java.util.Objects) LoggerUtil(org.javacord.core.util.logging.LoggerUtil) Logger(org.apache.logging.log4j.Logger) User(org.javacord.api.entity.user.User) UserRoleAddEventImpl(org.javacord.core.event.server.role.UserRoleAddEventImpl) Role(org.javacord.api.entity.permission.Role) PacketHandler(org.javacord.core.util.gateway.PacketHandler) DiscordApi(org.javacord.api.DiscordApi) UserChangeNicknameEventImpl(org.javacord.core.event.user.UserChangeNicknameEventImpl) DispatchQueueSelector(org.javacord.core.util.event.DispatchQueueSelector) Collections(java.util.Collections) UserChangeDiscriminatorEvent(org.javacord.api.event.user.UserChangeDiscriminatorEvent) UserChangePendingEvent(org.javacord.api.event.user.UserChangePendingEvent) ArrayList(java.util.ArrayList) JsonNode(com.fasterxml.jackson.databind.JsonNode) UserChangeNicknameEventImpl(org.javacord.core.event.user.UserChangeNicknameEventImpl) UserChangePendingEventImpl(org.javacord.core.event.user.UserChangePendingEventImpl) ServerImpl(org.javacord.core.entity.server.ServerImpl) UserRoleRemoveEvent(org.javacord.api.event.server.role.UserRoleRemoveEvent) UserImpl(org.javacord.core.entity.user.UserImpl) Member(org.javacord.core.entity.user.Member) HashSet(java.util.HashSet) UserRoleAddEventImpl(org.javacord.core.event.server.role.UserRoleAddEventImpl) MemberImpl(org.javacord.core.entity.user.MemberImpl) UserChangeServerAvatarEventImpl(org.javacord.core.event.user.UserChangeServerAvatarEventImpl) Role(org.javacord.api.entity.permission.Role) UserRoleAddEvent(org.javacord.api.event.server.role.UserRoleAddEvent) ServerTextChannel(org.javacord.api.entity.channel.ServerTextChannel) MessageCacheImpl(org.javacord.core.util.cache.MessageCacheImpl) UserChangeServerAvatarEvent(org.javacord.api.event.user.UserChangeServerAvatarEvent) UserChangeNicknameEvent(org.javacord.api.event.user.UserChangeNicknameEvent) UserRoleRemoveEventImpl(org.javacord.core.event.server.role.UserRoleRemoveEventImpl)

Example 7 with ServerImpl

use of org.javacord.core.entity.server.ServerImpl in project Javacord by BtoBastian.

the class GuildStickersUpdateHandler method handle.

@Override
protected void handle(JsonNode packet) {
    long serverId = packet.get("guild_id").asLong();
    api.getPossiblyUnreadyServerById(serverId).map(server -> (ServerImpl) server).ifPresent(server -> {
        HashMap<Long, JsonNode> stickers = new HashMap<>();
        for (JsonNode sticketJson : packet.get("stickers")) {
            stickers.put(sticketJson.get("id").asLong(), sticketJson);
        }
        stickers.forEach((key, value) -> {
            Optional<Sticker> optionalSticker = server.getStickerById(key);
            if (optionalSticker.isPresent()) {
                Sticker sticker = optionalSticker.get();
                String oldName = sticker.getName();
                String newName = value.get("name").asText();
                if (!Objects.deepEquals(oldName, newName)) {
                    StickerChangeNameEvent event = new StickerChangeNameEventImpl(sticker, oldName, newName);
                    ((StickerImpl) sticker).setName(newName);
                    api.getEventDispatcher().dispatchStickerChangeNameEvent(server, server, sticker, event);
                }
                String oldDescription = sticker.getDescription();
                String newDescription = value.get("description").asText();
                if (!Objects.deepEquals(oldDescription, newDescription)) {
                    StickerChangeDescriptionEvent event = new StickerChangeDescriptionEventImpl(sticker, oldDescription, newDescription);
                    ((StickerImpl) sticker).setDescription(newDescription);
                    api.getEventDispatcher().dispatchStickerChangeDescriptionEvent(server, server, sticker, event);
                }
                String oldTags = sticker.getTags();
                String newTags = value.get("tags").asText();
                if (!Objects.deepEquals(oldTags, newTags)) {
                    StickerChangeTagsEvent event = new StickerChangeTagsEventImpl(sticker, oldTags, newTags);
                    ((StickerImpl) sticker).setTags(newTags);
                    api.getEventDispatcher().dispatchStickerChangeTagsEvent(server, server, sticker, event);
                }
            } else {
                Sticker sticker = api.getOrCreateSticker(value);
                server.addSticker(sticker);
                StickerCreateEvent event = new StickerCreateEventImpl(sticker);
                api.getEventDispatcher().dispatchStickerCreateEvent(server, server, event);
            }
        });
        Set<Long> stickerIds = stickers.keySet();
        server.getStickers().stream().filter(sticker -> !stickerIds.contains(sticker.getId())).forEach(sticker -> {
            api.removeSticker(sticker);
            server.removeSticker(sticker);
            StickerDeleteEvent event = new StickerDeleteEventImpl(sticker);
            api.getEventDispatcher().dispatchStickerDeleteEvent(server, server, sticker, event);
        });
    });
}
Also used : ServerImpl(org.javacord.core.entity.server.ServerImpl) StickerChangeNameEventImpl(org.javacord.core.event.server.sticker.StickerChangeNameEventImpl) StickerCreateEvent(org.javacord.api.event.server.sticker.StickerCreateEvent) StickerDeleteEvent(org.javacord.api.event.server.sticker.StickerDeleteEvent) StickerChangeDescriptionEvent(org.javacord.api.event.server.sticker.StickerChangeDescriptionEvent) StickerDeleteEventImpl(org.javacord.core.event.server.sticker.StickerDeleteEventImpl) Set(java.util.Set) HashMap(java.util.HashMap) StickerChangeTagsEventImpl(org.javacord.core.event.server.sticker.StickerChangeTagsEventImpl) StickerCreateEventImpl(org.javacord.core.event.server.sticker.StickerCreateEventImpl) StickerImpl(org.javacord.core.entity.sticker.StickerImpl) Objects(java.util.Objects) Sticker(org.javacord.api.entity.sticker.Sticker) PacketHandler(org.javacord.core.util.gateway.PacketHandler) DiscordApi(org.javacord.api.DiscordApi) StickerChangeNameEvent(org.javacord.api.event.server.sticker.StickerChangeNameEvent) Optional(java.util.Optional) JsonNode(com.fasterxml.jackson.databind.JsonNode) StickerChangeTagsEvent(org.javacord.api.event.server.sticker.StickerChangeTagsEvent) StickerChangeDescriptionEventImpl(org.javacord.core.event.server.sticker.StickerChangeDescriptionEventImpl) StickerDeleteEvent(org.javacord.api.event.server.sticker.StickerDeleteEvent) HashMap(java.util.HashMap) StickerCreateEvent(org.javacord.api.event.server.sticker.StickerCreateEvent) StickerChangeNameEventImpl(org.javacord.core.event.server.sticker.StickerChangeNameEventImpl) JsonNode(com.fasterxml.jackson.databind.JsonNode) StickerChangeDescriptionEvent(org.javacord.api.event.server.sticker.StickerChangeDescriptionEvent) StickerImpl(org.javacord.core.entity.sticker.StickerImpl) Sticker(org.javacord.api.entity.sticker.Sticker) StickerChangeTagsEventImpl(org.javacord.core.event.server.sticker.StickerChangeTagsEventImpl) StickerChangeNameEvent(org.javacord.api.event.server.sticker.StickerChangeNameEvent) ServerImpl(org.javacord.core.entity.server.ServerImpl) StickerChangeDescriptionEventImpl(org.javacord.core.event.server.sticker.StickerChangeDescriptionEventImpl) StickerCreateEventImpl(org.javacord.core.event.server.sticker.StickerCreateEventImpl) StickerDeleteEventImpl(org.javacord.core.event.server.sticker.StickerDeleteEventImpl) StickerChangeTagsEvent(org.javacord.api.event.server.sticker.StickerChangeTagsEvent)

Example 8 with ServerImpl

use of org.javacord.core.entity.server.ServerImpl in project Javacord by BtoBastian.

the class GuildRoleCreateHandler method handle.

@Override
public void handle(JsonNode packet) {
    long serverId = Long.parseLong(packet.get("guild_id").asText());
    api.getPossiblyUnreadyServerById(serverId).ifPresent(server -> {
        Role role = ((ServerImpl) server).getOrCreateRole(packet.get("role"));
        RoleCreateEvent event = new RoleCreateEventImpl(role);
        api.getEventDispatcher().dispatchRoleCreateEvent((DispatchQueueSelector) server, server, event);
    });
}
Also used : Role(org.javacord.api.entity.permission.Role) ServerImpl(org.javacord.core.entity.server.ServerImpl) RoleCreateEvent(org.javacord.api.event.server.role.RoleCreateEvent) RoleCreateEventImpl(org.javacord.core.event.server.role.RoleCreateEventImpl)

Example 9 with ServerImpl

use of org.javacord.core.entity.server.ServerImpl 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);
    });
}
Also used : ServerImpl(org.javacord.core.entity.server.ServerImpl) ServerChannelCreateEvent(org.javacord.api.event.channel.server.ServerChannelCreateEvent) ServerVoiceChannel(org.javacord.api.entity.channel.ServerVoiceChannel) ServerChannelCreateEventImpl(org.javacord.core.event.channel.server.ServerChannelCreateEventImpl)

Example 10 with ServerImpl

use of org.javacord.core.entity.server.ServerImpl in project Javacord by BtoBastian.

the class ChannelUpdateHandler method handleRegularServerChannel.

private void handleRegularServerChannel(JsonNode jsonChannel) {
    long channelId = jsonChannel.get("id").asLong();
    Optional<RegularServerChannel> optionalChannel = api.getRegularServerChannelById(channelId);
    if (!optionalChannel.isPresent()) {
        LoggerUtil.logMissingChannel(logger, channelId);
        return;
    }
    RegularServerChannelImpl channel = (RegularServerChannelImpl) optionalChannel.get();
    ServerImpl server = (ServerImpl) channel.getServer();
    final AtomicBoolean areYouAffected = new AtomicBoolean(false);
    ChannelCategory oldCategory = channel.asCategorizable().flatMap(Categorizable::getCategory).orElse(null);
    ChannelCategory newCategory = jsonChannel.hasNonNull("parent_id") ? channel.getServer().getChannelCategoryById(jsonChannel.get("parent_id").asLong(-1)).orElse(null) : null;
    final RegularServerChannelImpl regularServerChannel = (RegularServerChannelImpl) channel;
    final int oldRawPosition = regularServerChannel.getRawPosition();
    final int newRawPosition = jsonChannel.get("position").asInt();
    if (oldRawPosition != newRawPosition || !Objects.deepEquals(oldCategory, newCategory)) {
        final int oldPosition = regularServerChannel.getPosition();
        if (regularServerChannel instanceof ServerTextChannelImpl) {
            ((ServerTextChannelImpl) regularServerChannel).setParentId(newCategory == null ? -1 : newCategory.getId());
        } else if (regularServerChannel instanceof ServerVoiceChannelImpl) {
            ((ServerVoiceChannelImpl) regularServerChannel).setParentId(newCategory == null ? -1 : newCategory.getId());
        }
        regularServerChannel.setRawPosition(newRawPosition);
        final int newPosition = regularServerChannel.getPosition();
        final ServerChannelChangePositionEvent event = new ServerChannelChangePositionEventImpl(regularServerChannel, newPosition, oldPosition, newRawPosition, oldRawPosition, newCategory, oldCategory);
        if (server.isReady()) {
            api.getEventDispatcher().dispatchServerChannelChangePositionEvent((DispatchQueueSelector) regularServerChannel.getServer(), regularServerChannel.getServer(), regularServerChannel, event);
        }
    }
    Collection<Long> rolesWithOverwrittenPermissions = new HashSet<>();
    Collection<Long> usersWithOverwrittenPermissions = new HashSet<>();
    if (jsonChannel.has("permission_overwrites") && !jsonChannel.get("permission_overwrites").isNull()) {
        for (JsonNode permissionOverwriteJson : jsonChannel.get("permission_overwrites")) {
            Permissions oldOverwrittenPermissions;
            ConcurrentHashMap<Long, Permissions> overwrittenPermissions;
            long entityId = permissionOverwriteJson.get("id").asLong();
            Optional<DiscordEntity> entity;
            switch(permissionOverwriteJson.get("type").asInt()) {
                case 0:
                    Role role = server.getRoleById(entityId).orElseThrow(() -> new IllegalStateException("Received channel update event with unknown role!"));
                    entity = Optional.of(role);
                    oldOverwrittenPermissions = regularServerChannel.getOverwrittenPermissions(role);
                    overwrittenPermissions = regularServerChannel.getInternalOverwrittenRolePermissions();
                    rolesWithOverwrittenPermissions.add(entityId);
                    break;
                case 1:
                    oldOverwrittenPermissions = regularServerChannel.getOverwrittenUserPermissions().getOrDefault(entityId, PermissionsImpl.EMPTY_PERMISSIONS);
                    entity = api.getCachedUserById(entityId).map(DiscordEntity.class::cast);
                    overwrittenPermissions = regularServerChannel.getInternalOverwrittenUserPermissions();
                    usersWithOverwrittenPermissions.add(entityId);
                    break;
                default:
                    throw new IllegalStateException("Permission overwrite object with unknown type: " + permissionOverwriteJson);
            }
            long allow = permissionOverwriteJson.get("allow").asLong(0);
            long deny = permissionOverwriteJson.get("deny").asLong(0);
            Permissions newOverwrittenPermissions = new PermissionsImpl(allow, deny);
            if (!newOverwrittenPermissions.equals(oldOverwrittenPermissions)) {
                overwrittenPermissions.put(entityId, newOverwrittenPermissions);
                if (server.isReady()) {
                    dispatchServerChannelChangeOverwrittenPermissionsEvent(channel, newOverwrittenPermissions, oldOverwrittenPermissions, entityId, entity.orElse(null));
                    areYouAffected.compareAndSet(false, entityId == api.getYourself().getId());
                    entity.filter(e -> e instanceof Role).map(Role.class::cast).ifPresent(role -> areYouAffected.compareAndSet(false, role.getUsers().stream().anyMatch(User::isYourself)));
                }
            }
        }
    }
    ConcurrentHashMap<Long, Permissions> overwrittenRolePermissions;
    ConcurrentHashMap<Long, Permissions> overwrittenUserPermissions;
    overwrittenRolePermissions = regularServerChannel.getInternalOverwrittenRolePermissions();
    overwrittenUserPermissions = regularServerChannel.getInternalOverwrittenUserPermissions();
    Iterator<Map.Entry<Long, Permissions>> userIt = overwrittenUserPermissions.entrySet().iterator();
    while (userIt.hasNext()) {
        Map.Entry<Long, Permissions> entry = userIt.next();
        if (usersWithOverwrittenPermissions.contains(entry.getKey())) {
            continue;
        }
        Permissions oldPermissions = entry.getValue();
        userIt.remove();
        if (server.isReady()) {
            dispatchServerChannelChangeOverwrittenPermissionsEvent(channel, PermissionsImpl.EMPTY_PERMISSIONS, oldPermissions, entry.getKey(), api.getCachedUserById(entry.getKey()).orElse(null));
            areYouAffected.compareAndSet(false, entry.getKey() == api.getYourself().getId());
        }
    }
    Iterator<Map.Entry<Long, Permissions>> roleIt = overwrittenRolePermissions.entrySet().iterator();
    while (roleIt.hasNext()) {
        Map.Entry<Long, Permissions> entry = roleIt.next();
        if (rolesWithOverwrittenPermissions.contains(entry.getKey())) {
            continue;
        }
        api.getRoleById(entry.getKey()).ifPresent(role -> {
            Permissions oldPermissions = entry.getValue();
            roleIt.remove();
            if (server.isReady()) {
                dispatchServerChannelChangeOverwrittenPermissionsEvent(channel, PermissionsImpl.EMPTY_PERMISSIONS, oldPermissions, role.getId(), role);
                areYouAffected.compareAndSet(false, role.getUsers().stream().anyMatch(User::isYourself));
            }
        });
    }
    if (areYouAffected.get() && !channel.canYouSee()) {
        api.forEachCachedMessageWhere(msg -> msg.getChannel().getId() == channelId, msg -> {
            api.removeMessageFromCache(msg.getId());
            ((MessageCacheImpl) ((TextChannel) channel).getMessageCache()).removeMessage(msg);
        });
    }
}
Also used : User(org.javacord.api.entity.user.User) RegularServerChannel(org.javacord.api.entity.channel.RegularServerChannel) RegularServerChannelImpl(org.javacord.core.entity.channel.RegularServerChannelImpl) JsonNode(com.fasterxml.jackson.databind.JsonNode) ServerChannelChangePositionEvent(org.javacord.api.event.channel.server.ServerChannelChangePositionEvent) ServerImpl(org.javacord.core.entity.server.ServerImpl) PermissionsImpl(org.javacord.core.entity.permission.PermissionsImpl) Permissions(org.javacord.api.entity.permission.Permissions) ServerTextChannelImpl(org.javacord.core.entity.channel.ServerTextChannelImpl) HashSet(java.util.HashSet) ServerVoiceChannelImpl(org.javacord.core.entity.channel.ServerVoiceChannelImpl) Role(org.javacord.api.entity.permission.Role) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) MessageCacheImpl(org.javacord.core.util.cache.MessageCacheImpl) ServerChannelChangePositionEventImpl(org.javacord.core.event.channel.server.ServerChannelChangePositionEventImpl) ChannelCategory(org.javacord.api.entity.channel.ChannelCategory) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) DiscordEntity(org.javacord.api.entity.DiscordEntity)

Aggregations

ServerImpl (org.javacord.core.entity.server.ServerImpl)25 JsonNode (com.fasterxml.jackson.databind.JsonNode)14 DiscordApi (org.javacord.api.DiscordApi)9 PacketHandler (org.javacord.core.util.gateway.PacketHandler)9 MemberImpl (org.javacord.core.entity.user.MemberImpl)8 UserImpl (org.javacord.core.entity.user.UserImpl)7 User (org.javacord.api.entity.user.User)6 ArrayList (java.util.ArrayList)5 Objects (java.util.Objects)4 Role (org.javacord.api.entity.permission.Role)4 ServerChannelCreateEvent (org.javacord.api.event.channel.server.ServerChannelCreateEvent)4 ServerChannelCreateEventImpl (org.javacord.core.event.channel.server.ServerChannelCreateEventImpl)4 Collection (java.util.Collection)3 Set (java.util.Set)3 ServerTextChannel (org.javacord.api.entity.channel.ServerTextChannel)3 TextChannel (org.javacord.api.entity.channel.TextChannel)3 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Optional (java.util.Optional)2