telegramsjs
    Preparing search index...

    Class ChatManager

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cache: Collection<string, Chat>
    cacheFilter?: (holds: Chat) => boolean
    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
      • Optionaloptions: { extras?: unknown[]; id?: string }

        Additional options.

      Returns Chat

      The cached or newly created entry.

    • Returns a new Iterator object that contains the [key, value] pairs for each element in the collection.

      Returns IterableIterator<[string, Chat]>

      An iterator object that can be used to iterate over the key-value pairs of the Collection.

    • Fetches multiple chats at once.

      Parameters

      • chats: ChatResolvable[]

        Array of chats to fetch.

      • Optionaloptions: Omit<IFetchOptions, "fullInfo"> & { fullInfo?: false }

        Options for fetching.

      Returns Promise<(Chat | null)[]>

      Array of fetched chats (nulls for failed fetches).

    • Fetches multiple chats at once.

      Parameters

      • chats: ChatResolvable[]

        Array of chats to fetch.

      • Optionaloptions: Omit<IFetchOptions, "fullInfo"> & { fullInfo: true }

        Options for fetching.

      Returns Promise<(ChatFullInfo | null)[]>

      Array of fetched chats (nulls for failed fetches).

    • Fetches multiple chats at once.

      Parameters

      Returns Promise<(ChatFullInfo | Chat | null)[]>

      Array of fetched chats (nulls for failed fetches).

    • 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 string | null

      The resolved ID or null if not found.