Discolink
    Preparing search index...

    Class Queue<Context>

    Class representing a guild's queue while wrapping it's lavalink player.

    Simple interpretation: join of two arrays, negative for previous, zero for current, positive for next

    Type Parameters

    Index

    Constructors

    Properties

    context: Context = ...

    Context of the queue

    voice: VoiceState
    filters: FilterManager
    player: Player
    "[LastTrackSymbol]": Track<CommonUserData, CommonPluginInfo> | null = null

    Accessors

    • get volume(): number

      Volume of the lavalink player

      Returns number

    • get paused(): boolean

      Whether the lavalink player is paused

      Returns boolean

    • get stopped(): boolean

      Whether the queue has a track but the lavalink player doesn't

      Returns boolean

    • get empty(): boolean

      Whether the queue is truly empty (no previous, current, or next tracks)

      Returns boolean

    • get playing(): boolean

      Whether a track is present and also playing in the lavalink player

      Returns boolean

    • get autoplay(): boolean

      Whether autoplay is enabled

      Returns boolean

    • get finished(): boolean

      Whether the queue has no current or next tracks

      Returns boolean

    • get destroyed(): boolean

      Whether this queue instance is destroyed

      Returns boolean

    • get hasNext(): boolean

      Whether the queue has a next track

      Returns boolean

    • get hasPrevious(): boolean

      Whether the queue has a previous track

      Returns boolean

    • get length(): number

      Number of current and next tracks

      Returns number

    • get totalLength(): number

      Number of previous, current, and next tracks

      Returns number

    • get duration(): number

      Duration of current and next tracks (excluding live tracks)

      Returns number

    • get formattedDuration(): string

      Formatted duration of current and next tracks (excluding live tracks)

      Returns string

    • get currentTime(): number

      Position in milliseconds of the current track

      Returns number

    • get formattedCurrentTime(): string

      Formatted position in milliseconds of the current track

      Returns string

    Methods

    • Sync lavalink player data

      Parameters

      • target: "local" | "remote" = "local"

        Target to update (local for queue, remote for node)

      Returns Promise<void>

    • Remove tracks by type (all if none specified)

      Parameters

      • Optionaltype: "current" | "previous"

        Type of tracks (current for current and next, previous for previous)

      Returns void

      current track is only removed if its stopped

    • Unpause the lavalink player and play the current track if its present but stopped

      Returns Promise<boolean>

    • Jump to a specific position in the current track

      Parameters

      • ms: number

        Position in milliseconds

      Returns Promise<number>

    • Shuffle the next tracks in queue

      Parameters

      • includePrevious: boolean = false

        Whether to include previous tracks

      Returns Queue<Context>

    • Set the lavalink player's volume

      Parameters

      • volume: number

        Numeric value between 0 and 1000

      Returns Promise<number>

    • Set autoplay mode

      Parameters

      • autoplay: boolean = false

        Whether autoplay should be enabled

      Returns boolean

    • Destroy this queue instance

      Parameters

      • Optionalreason: string

        Reason for destroying

      Returns Promise<void>