Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RainCacheOptions

Hierarchy

  • RainCacheOptions

Index

Properties

Optional cacheClasses

cacheClasses?: { channel?: typeof ChannelCache; channelMap?: typeof ChannelMapCache; emoji?: typeof EmojiCache; guild?: typeof GuildCache; member?: typeof MemberCache; permOverwrite?: typeof PermissionOverwriteCache; presence?: typeof PresenceCache; role?: typeof RoleCache; user?: typeof UserCache; voiceState?: typeof VoiceStateCache }

object with classes (not objects) that should be used for each type of data that is cached

RainCache automatically uses default classes when no cache classes are passed, else it will use your classes.

Type declaration

  • Optional channel?: typeof ChannelCache

    cache class to use for channels, defaults to ChannelCache

  • Optional channelMap?: typeof ChannelMapCache

    cache class to use for channel relations, defaults to ChannelMapCache

  • Optional emoji?: typeof EmojiCache

    cache class to use for emojis, defaults to EmojiCache

  • Optional guild?: typeof GuildCache

    cache class to use for guilds, defaults to the GuildCache

  • Optional member?: typeof MemberCache

    cache class to use for channels, defaults to ChannelMapCache

  • Optional permOverwrite?: typeof PermissionOverwriteCache

    cache class to use for permission overwrites, defaults to PermissionOverwriteCache

  • Optional presence?: typeof PresenceCache

    cache class to use for presences, defaults to PresenceCache

  • Optional role?: typeof RoleCache

    cache class to use for roles, defaults to RoleCache

  • Optional user?: typeof UserCache

    cache class to use for users, defaults to UserCache

  • Optional voiceState?: typeof VoiceStateCache

    cache class to use for voice states, defaults to VoiceStateCache

Optional debug

debug?: boolean

Optional disabledEvents

disabledEvents?: {}

If you want to disable events from being processed, you can add them here like this: {'MESSAGE_CREATE':true}, this would disable any MESSAGE_CREATEs from being cached

Type declaration

  • [event: string]: boolean

storage

storage: { channel?: BaseStorageEngine<any>; channelMap?: BaseStorageEngine<any>; default: BaseStorageEngine<any>; emoji?: BaseStorageEngine<any>; guild?: BaseStorageEngine<any>; member?: BaseStorageEngine<any>; permOverwrite?: BaseStorageEngine<any>; presence?: BaseStorageEngine<any>; role?: BaseStorageEngine<any>; user?: BaseStorageEngine<any>; voiceState?: BaseStorageEngine<any> }

Use this option if you do not want to use a different type of storage engine for certain caches

You may also combine options: e.g. a RedisStorageEngine for presence and the rest within mongo, that's no issue.

The cache type specific storage engine takes priority over the default one.

Type declaration

Optional structureDefs

structureDefs?: { channel?: StructureOptions<ChannelData>; emoji?: StructureOptions<EmojiData>; guild?: StructureOptions<GuildData>; member?: StructureOptions<MemberData>; permOverwrite?: StructureOptions<PermissionOverwriteData>; presence?: StructureOptions<PresenceData>; role?: StructureOptions<RoleData>; user?: StructureOptions<UserData>; voiceState?: StructureOptions<VoiceStateData> }

Type declaration

Generated using TypeDoc