MemberCacheImpl

Discord's Member do not have a unique ID, so we need to use a combination of the user id

Constructors

Link copied to clipboard
constructor(allowedCache: Set<CacheIds>, yde: YDEImpl)

Functions

Link copied to clipboard
abstract fun clear()

Clears the cache

open override fun clear(cacheId: CacheIds)

Clears the cache of a certain cache Id.

Link copied to clipboard
open override fun contains(guildId: String, userId: String): Boolean
open override fun contains(key: String, cacheId: CacheIds): Boolean

Check's if this properties exists in the cache and value exists

open override fun contains(key: String): Boolean

Check's if this properties exists in the cache

Link copied to clipboard
open operator override fun get(guildId: String, userId: String): Member?
open operator override fun get(key: String, cacheId: CacheIds): Any?

Gets an item from the cache

Link copied to clipboard
open override fun getOrPut(value: Member): Member
open override fun getOrPut(key: String, value: Any, cacheId: CacheIds): Any

Gets an item from the cache but adds it if it doesn't exist

Link copied to clipboard
open override fun remove(guildId: String, userId: String)
open override fun remove(key: String, cacheId: CacheIds): Any?

Removes an item from the cache

Link copied to clipboard
open operator override fun set(guildId: String, userId: String, value: Member)
open operator override fun set(key: String, value: Any, cacheId: CacheIds)

Adds a new item to the cache

Link copied to clipboard
open override fun triggerCacheClear(duration: Duration, repeat: Boolean)

Triggers a thread to clear the entire cache after a certain amount of time

Link copied to clipboard
open override fun triggerCacheTypeClear(cacheId: CacheIds, duration: Duration, repeat: Boolean)

Triggers a thread to clear a certain cache type after a certain amount of time

Link copied to clipboard
open override fun triggerCacheTypesClear(cacheIds: List<CacheIds>, duration: Duration, repeat: Boolean)

Triggers a thread to clear a list of cache types after a certain amount of time

Link copied to clipboard
open override fun updateVoiceState(member: Member, voiceState: VoiceState, add: Boolean)

updates the member's voice state

Link copied to clipboard
open override fun values(): List<Member>

Gets a list of members in the cache

open override fun values(cacheId: CacheIds): List<Any>

Gets a list of objects in the cache

Properties

Link copied to clipboard
open override val size: Int

The size of the cache