Skip to content

v1.0.0

Compare
Choose a tag to compare
@appellation appellation released this 25 Jul 23:13

Initial stable release. Supports Lavalink v3. Any undocumented types can be found in the reference for the main Lavalink wrapper.

API description

Queue

  • readonly store: QueueStore
  • readonly guildID: string
  • readonly keys: { list: string, np: string } - the Redis keys to use for the playlist and now playing info
  • readonly player: Player
  • start(): Promise<boolean> - start the queue
  • add(...tracks: string[]): Promise<any> - add tracks to the queue
  • remove(track: string): PromiseLike<number> - remove a track from the queue
  • next(): Promise<boolean> - skip to the next song
  • stop(): Promise<void> - stop playback and clear the queue
  • clear(): Promise<any> - clear the queued songs
  • current(): Promise<NP | null> - retrieve the current song: returns an object with properties track and position
  • tracks(): Promise<string[]> - retrieves queued tracks
interface NP {
  position?: number;
  track: string;
}

QueueStore extends Map<string, Queue>

  • readonly client: Client
  • redis: Redis - the ioredis instance this queue store is using
  • start(): Promise<void> - start all currently playing queues
  • get(key: string): Queue - gets the specified queue, or creates one if none is found

QueueClient extends Client

  • constructor(opts: Options)
  • readonly queues: QueueStore
interface Options extends ClientOptions {
  hosts?: {
    ws?: ws?: string | { url: string, options: WebSocket.ClientOptions };
    rest?: string;
    redis?: Redis.Redis | Redis.RedisOptions;
  }
}