Skip to content

Commit

Permalink
feat: bump to jda 5.beta-14 and enable LRU member cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicMushroom committed Sep 29, 2023
1 parent 279032f commit 9bd44dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ val kotlinX = "1.7.2" // https://mvnrepository.com/artifact/org.jetbrains.kotlin
val kotlin = "1.8.20"
val scrimage = "4.0.34"

val jda = "5.0.0-beta.13"
val jda = "5.0.0-beta.14"
val kordEx = "1.6.3-SNAPSHOT"
val kordKommons = "0.0.9-SNAPSHOT"

Expand Down
6 changes: 5 additions & 1 deletion bot/src/main/kotlin/me/melijn/bot/Melijn.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import me.melijn.kordkommons.database.DriverManager
import me.melijn.kordkommons.logger.logger
import me.melijn.kordkommons.redis.RedisConfig
import me.melijn.kordkommons.utils.ReflectUtil
import net.dv8tion.jda.api.OnlineStatus
import net.dv8tion.jda.api.entities.Activity
import net.dv8tion.jda.api.requests.GatewayIntent
import net.dv8tion.jda.api.utils.MemberCachePolicy
import net.dv8tion.jda.api.utils.cache.CacheFlag
Expand Down Expand Up @@ -70,11 +72,13 @@ object Melijn {
setShardsTotal(PodInfo.shardCount)
setShards(PodInfo.shardList)
enableCache(CacheFlag.VOICE_STATE, CacheFlag.ACTIVITY, CacheFlag.EMOJI)
setMemberCachePolicy(MemberCachePolicy.DEFAULT)
setMemberCachePolicy(MemberCachePolicy.lru(1000).unloadUnless(MemberCachePolicy.VOICE))
injectKTX()
applyLavakord(lShardManager)
}

presence({OnlineStatus.ONLINE}, { shardId -> Activity.customStatus("This is shard $shardId")})

hooks {
beforeKoinSetup {
loadMelijnStartupKoinModules(settings)
Expand Down

0 comments on commit 9bd44dc

Please sign in to comment.