Skip to content

Releases: lavalibs/lavaqueue

v1.1.0

28 Jul 23:49
Compare
Choose a tag to compare

Additions

  • Queue#next now accepts a count parameter to advance multiple times
  • Queue#unshift has been added to prepend tracks to the queue
  • Queue#tracks now accepts start and end parameters to easily paginate results
  • Queue#trim has been added to trim the queue to between the specified start and stop positions
  • QueueStore#start now accepts a filter parameter of signature (guildID: string) => boolean to control which guilds get started

Fixes

  • Readme now shows correct examples
  • Reference has been updated
  • Return type of Queue#add has been properly designated as Promise<number>

v1.0.0

25 Jul 23:13
Compare
Choose a tag to compare

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;
  }
}