Class Cache

The cache manager. Contains cached data, and cacheEventHandler handles dispatched gateway events to keep the cache up to date. Keep in mind that there are many caveats to the gateway, and that real-world cache data may not directly reflect your cache control options. It is recommended that you research intents and the caveats to the gateway, to make sure your bot receives sufficient data for your use case.

See

Discord API Reference

Hierarchy

  • Cache

Constructors

Properties

channels?: ExtendedMap<string, CachedChannel>

Cached channels. A channel's key in the map is its ID.

guilds?: ExtendedMap<string, CachedGuild>

Cached guilds. A guild's key in the map is its ID.

members?: ExtendedMap<string, ExtendedMap<string, CachedMember>>

Cached members. Each key of the parent cache is a guild ID, with its children being a map of members in that guild. A member's key in its map is its user ID.

options: Required<CacheOptions>

Options for the cache manager. Note that any options not specified are set to a default value.

presences?: ExtendedMap<string, ExtendedMap<string, CachedPresence>>

Cached presences. Each key of the parent cache is a guild ID, with its children being a map of presences in that guild. A presence's key in its map is its user's ID.

roles?: ExtendedMap<string, CachedRole>

Cached roles. A role's key in the map is its ID.

system: "Cache" = ...

The system string used for logging.

users?: ExtendedMap<string, CachedUser>

Cached users. A user's key in the map is its ID.

voiceStates?: ExtendedMap<string, ExtendedMap<string, CachedVoiceState>>

Cached voice states. Each key of the parent cache is a guild ID, with its children being a map of voice states in that guild. A voice state's key in its map is its user's ID.

Methods

  • Internal

    Handles data from a gateway event.

    Parameters

    • data: GatewayDispatchPayload

      The gateway data to handle.

    Returns void

Generated using TypeDoc