diff --git a/src/main/kotlin/main/utils/database/mongodb/cache/redis/guild/GuildRedisCache.kt b/src/main/kotlin/main/utils/database/mongodb/cache/redis/guild/GuildRedisCache.kt index 79e34be5..09bf13ee 100644 --- a/src/main/kotlin/main/utils/database/mongodb/cache/redis/guild/GuildRedisCache.kt +++ b/src/main/kotlin/main/utils/database/mongodb/cache/redis/guild/GuildRedisCache.kt @@ -67,7 +67,7 @@ class GuildRedisCache private constructor() : DatabaseRedisCache("ROBERTIFY_GUIL val handleRestrictedChannels: (arr: JSONArray) -> JSONArray = { arr -> val newArr = JSONArray() if (!arr.isEmpty && arr[0] is Long) { - rtc.toList().forEach { item: Any -> + arr.toList().forEach { item: Any -> if (item.toString().isDiscordId()) newArr.put(item.toString()) } @@ -138,11 +138,10 @@ class GuildRedisCache private constructor() : DatabaseRedisCache("ROBERTIFY_GUIL ) } } - return obj } - fun correctGuildObj(obj: JSONObject?): JSONObject { + private fun correctGuildObj(obj: JSONObject?): JSONObject { if (!obj!!.has(GuildDB.Field.GUILD_ID.toString())) return obj if (obj.has("_id")) obj.remove("_id") if (obj.has("__v")) obj.remove("__v") diff --git a/src/main/kotlin/main/utils/json/restrictedchannels/RestrictedChannelsConfig.kt b/src/main/kotlin/main/utils/json/restrictedchannels/RestrictedChannelsConfig.kt index 3c72e3d1..59fa020b 100644 --- a/src/main/kotlin/main/utils/json/restrictedchannels/RestrictedChannelsConfig.kt +++ b/src/main/kotlin/main/utils/json/restrictedchannels/RestrictedChannelsConfig.kt @@ -1,11 +1,15 @@ package main.utils.json.restrictedchannels +import dev.minn.jda.ktx.util.SLF4J import main.utils.database.mongodb.databases.GuildDB import main.utils.json.AbstractGuildConfig import main.utils.json.getIndexOfObjectInArray import net.dv8tion.jda.api.entities.Guild class RestrictedChannelsConfig(private val guild: Guild) : AbstractGuildConfig(guild) { + companion object { + private val logger by SLF4J + } suspend fun addChannel(channelID: Long, type: ChannelType?) { val configField: GuildDB.Field = when (type) {