Skip to content

DiscordCache

The DiscordCache class provides a caching mechanism for storing and retrieving data associated with Discord objects.

Properties

cache

DiscordCache.cache  :: {
      {… [string]: any …}    }

type

DiscordCache.type  :: string

The type of the DiscordCache. Default is “DiscordCache”.

Methods

setData

DiscordCache : setData (

     cacheType: string
     uuid: string
     data: any
)  -> ()

Sets data in the cache.

getData

DiscordCache : getData (

     cacheType: string
     uuid: string
)  -> any

Gets data from the cache.

getDataOr

DiscordCache : getDataOr (

     cacheType: string
     uuid: string
     callback: function
)  -> any

Gets data from the cache, or calls a callback to generate and cache the data if not found.

Functions

new

DiscordCache . new ()  -> ()

Creates a new DiscordCache instance.