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

x/lavadeno/testing/queue.ts>Queue

lavadeno is a simple, easy-to-use, and flexible lavalink client built on the Deno Runtime.
Latest
class Queue
import { Queue } from "https://deno.land/x/lavadeno@3.3.0/testing/queue.ts";

Constructors

new
Queue(player: Player)

Properties

private
optional
_loop: "song" | "queue"

The type of loop that is occurring.

optional
current: Song

The currently playing song.

length: number

The current length of the queue.

readonly
loopType: "song" | "queue" | undefined

The current type of loop that is occurring.

readonly
player: Player

The player for this queue.

previous: Song[]

The previously played songs.

started: boolean

Whether this queue has been started or not.

readonly
tracks: Song[]

The tracks that are in this queue.

Methods

private
_next()

Get the next song in the queue.

add(songs: Addable | Array<Addable>, requester?: Snowflake | { id: Snowflake; }): number

Add songs to the queue.

emit<E extends keyof QueueEvents>(event: E, ...args: QueueEvents[E]): Promise<void>
loop(type: "queue" | "song"): Queue

Loop the track or queue.

shuffle(): void

Shuffle all the tracks in the queue.

skip(): Promise<Song | undefined>

Skips the current song and returns the new playing one.

sort(predicate?: (a: Song, b: Song) => number): Array<Song>

Sort the queued songs.

start(): Promise<boolean>

Start the queue.