QueueStoreManager

Type: classarrow-up-right / objectarrow-up-right

Please Note, the Queue is always "cached" on the client side, which means it's still quite fast, however, the speed of "saving and syncing" depends on the StoreManager.

Here is a List of External Stores I'd recommend:

Overview

Parameter
Type
Required
Description

get

βœ“

set

βœ“

delete

βœ“

stringify

βœ“

parse

βœ“

The interface `QueueStoreManager` declares, what methods your custom QueueStore requires!

export interface QueueStoreManager extends Record<string, any>{
  /** @async get a Value (MUST RETURN UNPARSED!) */
  get: (guildId: unknown) => Promise<any>;
  /** @async Set a value inside a guildId (MUST BE UNPARSED) */
  set: (guildId: unknown, value: unknown) => Promise<any>;
  /** @async Delete a Database Value based of it's guildId */
  delete: (guildId: unknown) => Promise<any>;
  /** @async Transform the value(s) inside of the QueueStoreManager (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
  stringify: (value: unknown) => Promise<any>;
  /** @async Parse the saved value back to the Queue (IF YOU DON'T NEED PARSING/STRINGIFY, then just return the value) */
  parse: (value: unknown) => Promise<Partial<StoredQueue>>;
}

Examples:

Example Queue Store Manager:

This is also the Default Queue Store, which you can import from lavalink-client!

Example for Redis:

Last updated