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

x/discordeno/util/mod.ts>Collection

Discord API library for Deno
Extremely Popular
Go to Latest
class Collection
extends Map<K, V>
import { Collection } from "https://deno.land/x/discordeno@17.2.0/util/mod.ts";

Constructors

new
Collection(entries?: (readonly (readonly [K, V])[] | null) | Map<K, V>, options?: CollectionOptions<K, V>)

Properties

maxSize: number | undefined
sweeper: CollectionSweeper<K, V> & { intervalId?: number; } | undefined

Methods

changeSweeperFilter(newFilter: (
value: V,
key: K,
bot: Bot,
) => boolean
)
changeSweeperInterval(newInterval: number)
every(callback: (value: V, key: K) => boolean)
filter(callback: (value: V, key: K) => boolean)
find(callback: (value: V, key: K) => boolean)
first(): V | undefined

Retrieve the value of the first element in this collection

forceSet(key: K, value: V)
last(): V | undefined
map<T>(callback: (value: V, key: K) => T)
random(): V | undefined
reduce<T>(callback: (
accumulator: T,
value: V,
key: K,
) => T
, initialValue?: T
): T
set(key: K, value: V)
some(callback: (value: V, key: K) => boolean)
startSweeper(options: CollectionSweeper<K, V>): number
stopSweeper(): void