Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/harmony/src/managers/base.ts>BaseManager

An easy to use Discord API Library for Deno.
Latest
class BaseManager
extends Base
import { BaseManager } from "https://deno.land/x/harmony@v2.9.1/src/managers/base.ts";

Managers handle caching data. And also some REST Methods as required.

You should not be making Managers yourself.

Constructors

new
BaseManager(
client: Client,
cacheName: string,
DataType: TDataType<T, T2>,
)

Properties

cacheName: string

Caches Name or Key used to differentiate caches

DataType: TDataType<T, T2>

Which data type does this cache have

Methods

_delete(key: string): Promise<boolean>

Deletes a key from Cache

_get(key: string): Promise<T | undefined>

Gets raw value from a cache (payload)

array(): Promise<T2[]>

Gets an Array of values from Cache

collection(): Promise<Collection<string, T2>>

Gets a Collection of values from Cache

delete(key: string, ...args: unknown[]): Promise<any>
fetch(...args: unknown[]): Promise<T2 | undefined>
flush(): Promise<void>

Deletes everything from Cache

get(key: string): Promise<T2 | undefined>

Gets a value from Cache

keys(): Promise<string[]>

Gets all keys in the cache (mostly snowflakes)

resolve(key: string): Promise<T2 | undefined>

Try to get value from cache, if not found then fetch

set(key: string, value: T): Promise<void>

Sets a value to Cache

size(): Promise<number>

Gets number of values stored in Cache

[Symbol.asyncIterator](): AsyncIterableIterator<T2>