Skip to main content
Module

x/lavalink/mod.ts>Queue

An easy-to-use Lavalink client for Deno.
Latest
class Queue
extends Array<Track | UnresolvedTrack>
Re-export
import { Queue } from "https://deno.land/x/lavalink@v1.0.0/mod.ts";

The player's queue, the current property is the currently playing track, think of the rest as the up-coming tracks.

Properties

optional
current: Track | UnresolvedTrack | null

The current track

readonly
duration: number

The total duration of the queue.

previous: Track | UnresolvedTrack | null

The previous track

readonly
size: number

The size of tracks in the queue.

readonly
totalSize: number

The total size of tracks in the queue including the current track.

Methods

add(track: (Track | UnresolvedTrack) | (Track | UnresolvedTrack)[], offset?: number): void

Adds a track to the queue.

clear(): void

Clears the queue.

remove(position?: number): Track[]

Removes a track from the queue. Defaults to the first track, returning the removed track, EXCLUDING THE current TRACK.

remove(start: number, end: number): (Track | UnresolvedTrack)[]

Removes an amount of tracks using a exclusive start and end exclusive index, returning the removed tracks, EXCLUDING THE current TRACK.

shuffle(): void

Shuffles the queue.