Class ChatManager

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

cache: Collection<string, Chat>
cacheSize: number

Accessors

Methods

  • Adds or updates an entry in the cache.

    Parameters

    • data: Chat

      The data to be added or updated in the cache.

    • Optionalcache: boolean
    • Optional__namedParameters: {
          extras?: unknown[];
          id?: string;
      }
      • Optionalextras?: unknown[]
      • Optionalid?: string

    Returns Chat

    The cached or newly created entry.

  • Fetches a chat object from the API.

    Parameters

    • chat: string | Chat

      The chat instance or ID.

    • Optionaloptions: {
          cache?: boolean;
          force?: boolean;
      }

      Additional options.

      • Optionalcache?: boolean
      • Optionalforce?: boolean

    Returns Promise<Chat>

    The fetched chat object.

  • Removes an entry from the cache.

    Parameters

    • id: string

      The ID of the entry to remove.

    Returns boolean

    Whether the entry was successfully removed.

  • Resolves the ID of an entry from the cache.

    Parameters

    • idOrInstance: any

      The ID or instance to resolve.

    Returns null | string

    The resolved ID or null if not found.