Search in sources :

Example 26 with DataArray

use of net.dv8tion.jda.api.utils.data.DataArray in project JDA by DV8FromTheWorld.

the class EntityBuilder method createPresence.

public void createPresence(MemberImpl member, DataObject presenceJson) {
    if (member == null)
        throw new NullPointerException("Provided member was null!");
    OnlineStatus onlineStatus = OnlineStatus.fromKey(presenceJson.getString("status"));
    if (onlineStatus == OnlineStatus.OFFLINE)
        // don't cache offline member presences!
        return;
    MemberPresenceImpl presence = member.getPresence();
    if (presence == null) {
        CacheView.SimpleCacheView<MemberPresenceImpl> view = member.getGuild().getPresenceView();
        if (view == null)
            return;
        presence = new MemberPresenceImpl();
        try (UnlockHook lock = view.writeLock()) {
            view.getMap().put(member.getIdLong(), presence);
        }
    }
    boolean cacheGame = getJDA().isCacheFlagSet(CacheFlag.ACTIVITY);
    boolean cacheStatus = getJDA().isCacheFlagSet(CacheFlag.CLIENT_STATUS);
    DataArray activityArray = !cacheGame || presenceJson.isNull("activities") ? null : presenceJson.getArray("activities");
    DataObject clientStatusJson = !cacheStatus || presenceJson.isNull("client_status") ? null : presenceJson.getObject("client_status");
    List<Activity> activities = new ArrayList<>();
    boolean parsedActivity = false;
    if (cacheGame && activityArray != null) {
        for (int i = 0; i < activityArray.length(); i++) {
            try {
                activities.add(createActivity(activityArray.getObject(i)));
                parsedActivity = true;
            } catch (Exception ex) {
                String userId = member.getId();
                if (LOG.isDebugEnabled())
                    LOG.warn("Encountered exception trying to parse a presence! UserId: {} JSON: {}", userId, activityArray, ex);
                else
                    LOG.warn("Encountered exception trying to parse a presence! UserId: {} Message: {} Enable debug for details", userId, ex.getMessage());
            }
        }
    }
    if (cacheGame && parsedActivity)
        presence.setActivities(activities);
    presence.setOnlineStatus(onlineStatus);
    if (clientStatusJson != null) {
        for (String key : clientStatusJson.keys()) {
            ClientType type = ClientType.fromKey(key);
            OnlineStatus status = OnlineStatus.fromKey(clientStatusJson.getString(key));
            presence.setOnlineStatus(type, status);
        }
    }
}
Also used : OnlineStatus(net.dv8tion.jda.api.OnlineStatus) DataArray(net.dv8tion.jda.api.utils.data.DataArray) DataObject(net.dv8tion.jda.api.utils.data.DataObject) CacheView(net.dv8tion.jda.api.utils.cache.CacheView) UnlockHook(net.dv8tion.jda.internal.utils.UnlockHook)

Example 27 with DataArray

use of net.dv8tion.jda.api.utils.data.DataArray in project JDA by DV8FromTheWorld.

the class EntityBuilder method createTemplate.

public Template createTemplate(DataObject object) {
    final String code = object.getString("code");
    final String name = object.getString("name");
    final String description = object.getString("description", null);
    final int uses = object.getInt("usage_count");
    final User creator = createUser(object.getObject("creator"));
    final OffsetDateTime createdAt = OffsetDateTime.parse(object.getString("created_at"));
    final OffsetDateTime updatedAt = OffsetDateTime.parse(object.getString("updated_at"));
    final long guildId = object.getLong("source_guild_id");
    final DataObject guildObject = object.getObject("serialized_source_guild");
    final String guildName = guildObject.getString("name");
    final String guildDescription = guildObject.getString("description", null);
    final String guildIconId = guildObject.getString("icon_hash", null);
    final VerificationLevel guildVerificationLevel = VerificationLevel.fromKey(guildObject.getInt("verification_level", -1));
    final NotificationLevel notificationLevel = NotificationLevel.fromKey(guildObject.getInt("default_message_notifications", 0));
    final ExplicitContentLevel explicitContentLevel = ExplicitContentLevel.fromKey(guildObject.getInt("explicit_content_filter", 0));
    final Locale locale = Locale.forLanguageTag(guildObject.getString("preferred_locale", "en"));
    final Timeout afkTimeout = Timeout.fromKey(guildObject.getInt("afk_timeout", 0));
    final DataArray roleArray = guildObject.getArray("roles");
    final DataArray channelsArray = guildObject.getArray("channels");
    final long afkChannelId = guildObject.getLong("afk_channel_id", -1L);
    final long systemChannelId = guildObject.getLong("system_channel_id", -1L);
    final List<TemplateRole> roles = new ArrayList<>();
    for (int i = 0; i < roleArray.length(); i++) {
        DataObject obj = roleArray.getObject(i);
        final long roleId = obj.getLong("id");
        final String roleName = obj.getString("name");
        final int roleColor = obj.getInt("color");
        final boolean hoisted = obj.getBoolean("hoist");
        final boolean mentionable = obj.getBoolean("mentionable");
        final long rawPermissions = obj.getLong("permissions");
        roles.add(new TemplateRole(roleId, roleName, roleColor == 0 ? Role.DEFAULT_COLOR_RAW : roleColor, hoisted, mentionable, rawPermissions));
    }
    final List<TemplateChannel> channels = new ArrayList<>();
    for (int i = 0; i < channelsArray.length(); i++) {
        DataObject obj = channelsArray.getObject(i);
        final long channelId = obj.getLong("id");
        final int type = obj.getInt("type");
        final ChannelType channelType = ChannelType.fromId(type);
        final String channelName = obj.getString("name");
        final String topic = obj.getString("topic", null);
        final int rawPosition = obj.getInt("position");
        final long parentId = obj.getLong("parent_id", -1);
        final boolean nsfw = obj.getBoolean("nsfw");
        final int slowmode = obj.getInt("rate_limit_per_user");
        final int bitrate = obj.getInt("bitrate");
        final int userLimit = obj.getInt("user_limit");
        final List<TemplateChannel.PermissionOverride> permissionOverrides = new ArrayList<>();
        DataArray overrides = obj.getArray("permission_overwrites");
        for (int j = 0; j < overrides.length(); j++) {
            DataObject overrideObj = overrides.getObject(j);
            final long overrideId = overrideObj.getLong("id");
            final long allow = overrideObj.getLong("allow");
            final long deny = overrideObj.getLong("deny");
            permissionOverrides.add(new TemplateChannel.PermissionOverride(overrideId, allow, deny));
        }
        channels.add(new TemplateChannel(channelId, channelType, channelName, topic, rawPosition, parentId, type == 5, permissionOverrides, nsfw, slowmode, bitrate, userLimit));
    }
    TemplateChannel afkChannel = channels.stream().filter(templateChannel -> templateChannel.getIdLong() == afkChannelId).findFirst().orElse(null);
    TemplateChannel systemChannel = channels.stream().filter(templateChannel -> templateChannel.getIdLong() == systemChannelId).findFirst().orElse(null);
    final TemplateGuild guild = new TemplateGuild(guildId, guildName, guildDescription, guildIconId, guildVerificationLevel, notificationLevel, explicitContentLevel, locale, afkTimeout, afkChannel, systemChannel, roles, channels);
    final boolean synced = !object.getBoolean("is_dirty", false);
    return new Template(getJDA(), code, name, description, uses, creator, createdAt, updatedAt, guild, synced);
}
Also used : TemplateChannel(net.dv8tion.jda.api.entities.templates.TemplateChannel) Timeout(net.dv8tion.jda.api.entities.Guild.Timeout) TemplateGuild(net.dv8tion.jda.api.entities.templates.TemplateGuild) VerificationLevel(net.dv8tion.jda.api.entities.Guild.VerificationLevel) DataArray(net.dv8tion.jda.api.utils.data.DataArray) TemplateRole(net.dv8tion.jda.api.entities.templates.TemplateRole) Template(net.dv8tion.jda.api.entities.templates.Template) DataObject(net.dv8tion.jda.api.utils.data.DataObject) ExplicitContentLevel(net.dv8tion.jda.api.entities.Guild.ExplicitContentLevel) OffsetDateTime(java.time.OffsetDateTime) NotificationLevel(net.dv8tion.jda.api.entities.Guild.NotificationLevel)

Example 28 with DataArray

use of net.dv8tion.jda.api.utils.data.DataArray in project JDA by DV8FromTheWorld.

the class EntityBuilder method createGuild.

public GuildImpl createGuild(long guildId, DataObject guildJson, TLongObjectMap<DataObject> members, int memberCount) {
    final GuildImpl guildObj = new GuildImpl(getJDA(), guildId);
    final String name = guildJson.getString("name", "");
    final String iconId = guildJson.getString("icon", null);
    final String splashId = guildJson.getString("splash", null);
    final String description = guildJson.getString("description", null);
    final String vanityCode = guildJson.getString("vanity_url_code", null);
    final String bannerId = guildJson.getString("banner", null);
    final String locale = guildJson.getString("preferred_locale", "en-US");
    final DataArray roleArray = guildJson.getArray("roles");
    final DataArray channelArray = guildJson.getArray("channels");
    final DataArray threadArray = guildJson.getArray("threads");
    final DataArray emotesArray = guildJson.getArray("emojis");
    final DataArray voiceStateArray = guildJson.getArray("voice_states");
    final Optional<DataArray> featuresArray = guildJson.optArray("features");
    final Optional<DataArray> presencesArray = guildJson.optArray("presences");
    final long ownerId = guildJson.getUnsignedLong("owner_id", 0L);
    final long afkChannelId = guildJson.getUnsignedLong("afk_channel_id", 0L);
    final long systemChannelId = guildJson.getUnsignedLong("system_channel_id", 0L);
    final long rulesChannelId = guildJson.getUnsignedLong("rules_channel_id", 0L);
    final long communityUpdatesChannelId = guildJson.getUnsignedLong("public_updates_channel_id", 0L);
    final int boostCount = guildJson.getInt("premium_subscription_count", 0);
    final int boostTier = guildJson.getInt("premium_tier", 0);
    final int maxMembers = guildJson.getInt("max_members", 0);
    final int maxPresences = guildJson.getInt("max_presences", 5000);
    final int mfaLevel = guildJson.getInt("mfa_level", 0);
    final int afkTimeout = guildJson.getInt("afk_timeout", 0);
    final int verificationLevel = guildJson.getInt("verification_level", 0);
    final int notificationLevel = guildJson.getInt("default_message_notifications", 0);
    final int explicitContentLevel = guildJson.getInt("explicit_content_filter", 0);
    final int nsfwLevel = guildJson.getInt("nsfw_level", -1);
    final boolean boostProgressBarEnabled = guildJson.getBoolean("premium_progress_bar_enabled");
    guildObj.setName(name).setIconId(iconId).setSplashId(splashId).setDescription(description).setBannerId(bannerId).setVanityCode(vanityCode).setMaxMembers(maxMembers).setMaxPresences(maxPresences).setOwnerId(ownerId).setAfkTimeout(Guild.Timeout.fromKey(afkTimeout)).setVerificationLevel(VerificationLevel.fromKey(verificationLevel)).setDefaultNotificationLevel(Guild.NotificationLevel.fromKey(notificationLevel)).setExplicitContentLevel(Guild.ExplicitContentLevel.fromKey(explicitContentLevel)).setRequiredMFALevel(Guild.MFALevel.fromKey(mfaLevel)).setLocale(locale).setBoostCount(boostCount).setBoostTier(boostTier).setMemberCount(memberCount).setNSFWLevel(Guild.NSFWLevel.fromKey(nsfwLevel)).setBoostProgressBarEnabled(boostProgressBarEnabled);
    SnowflakeCacheViewImpl<Guild> guildView = getJDA().getGuildsView();
    try (UnlockHook hook = guildView.writeLock()) {
        guildView.getMap().put(guildId, guildObj);
    }
    guildObj.setFeatures(featuresArray.map(it -> StreamSupport.stream(it.spliterator(), false).map(String::valueOf).collect(Collectors.toSet())).orElse(Collections.emptySet()));
    SnowflakeCacheViewImpl<Role> roleView = guildObj.getRolesView();
    try (UnlockHook hook = roleView.writeLock()) {
        TLongObjectMap<Role> map = roleView.getMap();
        for (int i = 0; i < roleArray.length(); i++) {
            DataObject obj = roleArray.getObject(i);
            Role role = createRole(guildObj, obj, guildId);
            map.put(role.getIdLong(), role);
            if (role.getIdLong() == guildObj.getIdLong())
                guildObj.setPublicRole(role);
        }
    }
    for (int i = 0; i < channelArray.length(); i++) {
        DataObject channelJson = channelArray.getObject(i);
        createGuildChannel(guildObj, channelJson);
    }
    TLongObjectMap<DataObject> voiceStates = convertToUserMap((o) -> o.getUnsignedLong("user_id", 0L), voiceStateArray);
    TLongObjectMap<DataObject> presences = presencesArray.map(o1 -> convertToUserMap(o2 -> o2.getObject("user").getUnsignedLong("id"), o1)).orElseGet(TLongObjectHashMap::new);
    try (UnlockHook h1 = guildObj.getMembersView().writeLock();
        UnlockHook h2 = getJDA().getUsersView().writeLock()) {
        // this is done because we can still keep track of members in voice channels
        for (DataObject memberJson : members.valueCollection()) {
            long userId = memberJson.getObject("user").getUnsignedLong("id");
            DataObject voiceState = voiceStates.get(userId);
            DataObject presence = presences.get(userId);
            updateMemberCache(createMember(guildObj, memberJson, voiceState, presence));
        }
    }
    if (guildObj.getOwner() == null)
        LOG.debug("Finished setup for guild with a null owner. GuildId: {} OwnerId: {}", guildId, guildJson.opt("owner_id").orElse(null));
    if (guildObj.getMember(api.getSelfUser()) == null) {
        LOG.error("Guild is missing a SelfMember. GuildId: {}", guildId);
        LOG.debug("Guild is missing a SelfMember. GuildId: {} JSON: \n{}", guildId, guildJson);
        // This is actually a gateway request
        guildObj.retrieveMembersByIds(api.getSelfUser().getIdLong()).onSuccess(m -> {
            if (m.isEmpty())
                LOG.warn("Was unable to recover SelfMember for guild with id {}. This guild might be corrupted!", guildId);
            else
                LOG.debug("Successfully recovered SelfMember for guild with id {}.", guildId);
        });
    }
    for (int i = 0; i < threadArray.length(); i++) {
        DataObject threadJson = threadArray.getObject(i);
        createThreadChannel(guildObj, threadJson, guildObj.getIdLong());
    }
    createGuildEmotePass(guildObj, emotesArray);
    guildJson.optArray("stage_instances").map(arr -> arr.stream(DataArray::getObject)).ifPresent(list -> list.forEach(it -> createStageInstance(guildObj, it)));
    guildObj.setAfkChannel(guildObj.getVoiceChannelById(afkChannelId)).setSystemChannel(guildObj.getTextChannelById(systemChannelId)).setRulesChannel(guildObj.getTextChannelById(rulesChannelId)).setCommunityUpdatesChannel(guildObj.getTextChannelById(communityUpdatesChannelId));
    return guildObj;
}
Also used : MemberCacheViewImpl(net.dv8tion.jda.internal.utils.cache.MemberCacheViewImpl) NotificationLevel(net.dv8tion.jda.api.entities.Guild.NotificationLevel) ExplicitContentLevel(net.dv8tion.jda.api.entities.Guild.ExplicitContentLevel) UnaryOperator(java.util.function.UnaryOperator) UserUpdateAvatarEvent(net.dv8tion.jda.api.events.user.update.UserUpdateAvatarEvent) AuditLogChange(net.dv8tion.jda.api.audit.AuditLogChange) UserUpdateFlagsEvent(net.dv8tion.jda.api.events.user.update.UserUpdateFlagsEvent) TLongHashSet(gnu.trove.set.hash.TLongHashSet) JDAImpl(net.dv8tion.jda.internal.JDAImpl) EventCache(net.dv8tion.jda.internal.handle.EventCache) ActionRow(net.dv8tion.jda.api.interactions.components.ActionRow) VerificationLevel(net.dv8tion.jda.api.entities.Guild.VerificationLevel) DataObject(net.dv8tion.jda.api.utils.data.DataObject) ToLongFunction(java.util.function.ToLongFunction) AudioChannelMixin(net.dv8tion.jda.internal.entities.mixin.channel.middleman.AudioChannelMixin) OnlineStatus(net.dv8tion.jda.api.OnlineStatus) TLongSet(gnu.trove.set.TLongSet) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) OffsetDateTime(java.time.OffsetDateTime) JDALogger(net.dv8tion.jda.internal.utils.JDALogger) ActionType(net.dv8tion.jda.api.audit.ActionType) net.dv8tion.jda.api.entities(net.dv8tion.jda.api.entities) DataArray(net.dv8tion.jda.api.utils.data.DataArray) java.util(java.util) JDA(net.dv8tion.jda.api.JDA) GuildMemberRoleRemoveEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberRoleRemoveEvent) Helpers(net.dv8tion.jda.internal.utils.Helpers) Timeout(net.dv8tion.jda.api.entities.Guild.Timeout) Function(java.util.function.Function) CollectionUtils(org.apache.commons.collections4.CollectionUtils) CaseInsensitiveMap(org.apache.commons.collections4.map.CaseInsensitiveMap) AuditLogEntry(net.dv8tion.jda.api.audit.AuditLogEntry) TemporalAccessor(java.time.temporal.TemporalAccessor) Template(net.dv8tion.jda.api.entities.templates.Template) GuildMemberRoleAddEvent(net.dv8tion.jda.api.events.guild.member.GuildMemberRoleAddEvent) UserUpdateDiscriminatorEvent(net.dv8tion.jda.api.events.user.update.UserUpdateDiscriminatorEvent) CacheView(net.dv8tion.jda.api.utils.cache.CacheView) StreamSupport(java.util.stream.StreamSupport) CacheFlag(net.dv8tion.jda.api.utils.cache.CacheFlag) TemplateChannel(net.dv8tion.jda.api.entities.templates.TemplateChannel) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) TemplateRole(net.dv8tion.jda.api.entities.templates.TemplateRole) Logger(org.slf4j.Logger) UnlockHook(net.dv8tion.jda.internal.utils.UnlockHook) UserUpdateNameEvent(net.dv8tion.jda.api.events.user.update.UserUpdateNameEvent) SnowflakeCacheViewImpl(net.dv8tion.jda.internal.utils.cache.SnowflakeCacheViewImpl) TLongObjectHashMap(gnu.trove.map.hash.TLongObjectHashMap) TemplateGuild(net.dv8tion.jda.api.entities.templates.TemplateGuild) DateTimeFormatter(java.time.format.DateTimeFormatter) TLongObjectMap(gnu.trove.map.TLongObjectMap) net.dv8tion.jda.api.events.guild.member.update(net.dv8tion.jda.api.events.guild.member.update) MessageEmbed(net.dv8tion.jda.api.entities.MessageEmbed) IPermissionContainerMixin(net.dv8tion.jda.internal.entities.mixin.channel.attribute.IPermissionContainerMixin) TLongObjectHashMap(gnu.trove.map.hash.TLongObjectHashMap) TemplateGuild(net.dv8tion.jda.api.entities.templates.TemplateGuild) DataArray(net.dv8tion.jda.api.utils.data.DataArray) TemplateRole(net.dv8tion.jda.api.entities.templates.TemplateRole) DataObject(net.dv8tion.jda.api.utils.data.DataObject) UnlockHook(net.dv8tion.jda.internal.utils.UnlockHook)

Example 29 with DataArray

use of net.dv8tion.jda.api.utils.data.DataArray in project pokeraidbot by magnusmickelsson.

the class InstallEmotesCommand method createEmote.

// Code taken from JDA's GuildController since they have a limitation that bot accounts can't upload emotes.
private void createEmote(String iconName, CommandEvent commandEvent, Icon icon, Role... roles) {
    JSONObject body = new JSONObject();
    body.put("name", iconName);
    body.put("image", icon.getEncoding());
    if (// making sure none of the provided roles are null before mapping them to the snowflake id
    roles.length > 0) {
        body.put("roles", Stream.of(roles).filter(Objects::nonNull).map(ISnowflake::getId).collect(Collectors.toSet()));
    }
    StringWriter writer = new StringWriter();
    body.write(writer);
    DataObject dataObject = DataObject.fromJson(writer.toString());
    GuildImpl guild = (GuildImpl) commandEvent.getGuild();
    JDA jda = commandEvent.getJDA();
    Route.CompiledRoute route = Route.Emotes.CREATE_EMOTE.compile(guild.getId());
    AuditableRestAction<Emote> action = new AuditableRestActionImpl<Emote>(jda, route, dataObject) {

        @Override
        public void handleResponse(Response response, Request<Emote> request) {
            if (response.isOk()) {
                DataObject obj = response.getObject();
                final long id = obj.getLong("id");
                String name = obj.getString("name");
                EmoteImpl emote = new EmoteImpl(id, guild).setName(name);
                // managed is false by default, should always be false for emotes created by client accounts.
                DataArray rolesArr = obj.getArray("roles");
                Set<Role> roleSet = emote.getRoleSet();
                for (int i = 0; i < rolesArr.length(); i++) {
                    roleSet.add(guild.getRoleById(rolesArr.getString(i)));
                }
                // put emote into cache
                guild.createEmote(name, icon, roles);
                request.onSuccess(emote);
            } else {
                request.onFailure(response);
                throw new RuntimeException("Couldn't install emojis. " + "Make sure that pokeraidbot has access to manage emojis.");
            }
        }
    };
    action.queue();
}
Also used : JDA(net.dv8tion.jda.api.JDA) Emote(net.dv8tion.jda.api.entities.Emote) Request(net.dv8tion.jda.api.requests.Request) DataArray(net.dv8tion.jda.api.utils.data.DataArray) Response(net.dv8tion.jda.api.requests.Response) Role(net.dv8tion.jda.api.entities.Role) GuildImpl(net.dv8tion.jda.internal.entities.GuildImpl) EmoteImpl(net.dv8tion.jda.internal.entities.EmoteImpl) DataObject(net.dv8tion.jda.api.utils.data.DataObject) AuditableRestActionImpl(net.dv8tion.jda.internal.requests.restaction.AuditableRestActionImpl) JSONObject(org.json.JSONObject) StringWriter(java.io.StringWriter) Route(net.dv8tion.jda.internal.requests.Route) ISnowflake(net.dv8tion.jda.api.entities.ISnowflake)

Example 30 with DataArray

use of net.dv8tion.jda.api.utils.data.DataArray in project JDA by DV8FromTheWorld.

the class ChannelOrderActionImpl method finalizeData.

@Override
protected RequestBody finalizeData() {
    final Member self = guild.getSelfMember();
    if (!self.hasPermission(Permission.MANAGE_CHANNEL))
        throw new InsufficientPermissionException(guild, Permission.MANAGE_CHANNEL);
    DataArray array = DataArray.empty();
    for (int i = 0; i < orderList.size(); i++) {
        GuildChannel chan = orderList.get(i);
        array.add(DataObject.empty().put("id", chan.getId()).put("position", i));
    }
    return getRequestBody(array);
}
Also used : GuildChannel(net.dv8tion.jda.api.entities.GuildChannel) InsufficientPermissionException(net.dv8tion.jda.api.exceptions.InsufficientPermissionException) Member(net.dv8tion.jda.api.entities.Member) DataArray(net.dv8tion.jda.api.utils.data.DataArray)

Aggregations

DataArray (net.dv8tion.jda.api.utils.data.DataArray)67 DataObject (net.dv8tion.jda.api.utils.data.DataObject)40 Nonnull (javax.annotation.Nonnull)21 EntityBuilder (net.dv8tion.jda.internal.entities.EntityBuilder)14 InsufficientPermissionException (net.dv8tion.jda.api.exceptions.InsufficientPermissionException)10 JDAImpl (net.dv8tion.jda.internal.JDAImpl)9 TLongObjectHashMap (gnu.trove.map.hash.TLongObjectHashMap)8 ArrayList (java.util.ArrayList)8 Route (net.dv8tion.jda.internal.requests.Route)8 RestActionImpl (net.dv8tion.jda.internal.requests.RestActionImpl)7 Collectors (java.util.stream.Collectors)6 CheckReturnValue (javax.annotation.CheckReturnValue)6 TemplateRole (net.dv8tion.jda.api.entities.templates.TemplateRole)5 ParsingException (net.dv8tion.jda.api.exceptions.ParsingException)5 GuildImpl (net.dv8tion.jda.internal.entities.GuildImpl)5 Bean (at.xirado.bean.Bean)4 java.util (java.util)4 OnlineStatus (net.dv8tion.jda.api.OnlineStatus)4 Template (net.dv8tion.jda.api.entities.templates.Template)4 CacheView (net.dv8tion.jda.api.utils.cache.CacheView)4