Represents a queue.

Hierarchy (view full)

Constructors

Properties

_beginTime: number

What time in the song to begin (in seconds).

_listeners?: DisTubeVoiceEvents

DisTubeVoice listener

_next: boolean

Whether or not the last song was skipped to next song.

_prev: boolean

Whether or not the last song was skipped to previous song.

_taskQueue: TaskQueue

Task queuing system

autoplay: boolean

Whether or not the autoplay mode is enabled. Default value: false

distube: DisTube
ffmpegArgs: FFmpegArgs

FFmpeg arguments for the current queue. Default value is defined with DisTubeOptions.ffmpeg.args. af output argument will be replaced with Queue#filters manager

id: string

Queue id (Guild id)

paused: boolean

Whether or not the stream is currently paused.

playing: boolean

Whether or not the stream is currently playing.

previousSongs: Song<unknown>[]

List of the previous songs.

repeatMode: RepeatMode

Type of repeat mode (0 is disabled, 1 is repeating a song, 2 is repeating all the queue). Default value: 0 (disabled)

songs: Song<unknown>[]

List of songs in the queue (The first one is the playing song)

stopped: boolean

Whether stream is currently stopped.

textChannel?: GuildTextBasedChannel

The text channel of the Queue. (Default: where the first command is called).

Voice connection of this queue.

Accessors

  • get client(): Client<boolean>
  • Discord.js client

    Returns Client<boolean>

  • get clientMember(): undefined | GuildMember
  • The client user as a GuildMember of this queue's guild

    Returns undefined | GuildMember

  • get currentTime(): number
  • What time in the song is playing (in seconds).

    Returns number

  • get voiceChannel(): null | VoiceBasedChannel
  • The voice channel playing in.

    Returns null | VoiceBasedChannel

Methods

  • Add a related song of the playing song to the queue

    Returns Promise<Song<unknown>>

    The added song

  • Parameters

    • song: Song<unknown> | Song<unknown>[]

      Song to add

    • position: number = 0

      Position to add, <= 0 to add to the end of the queue

    Returns Queue

    The guild queue

  • Emit error event

    Parameters

    • error: Error

      error

    • queue: Queue

      The queue encountered the error

    • Optionalsong: Song<unknown>

      The playing song when encountered the error

    Returns void

  • Jump to the song position in the queue. The next one is 1, 2,... The previous one is -1, -2,... if num is invalid number

    Parameters

    • position: number

      The song position to play

    Returns Promise<Song<unknown>>

    The new Song will be played

  • Play the first song in the queue

    Parameters

    Returns Promise<void>

  • Set the repeat mode of the guild queue. Toggle mode (Disabled -> Song -> Queue -> Disabled ->...) if mode is undefined

    Parameters

    • Optionalmode: RepeatMode

      The repeat modes (toggle if undefined)

    Returns RepeatMode

    The new repeat mode

  • Set the guild stream's volume

    Parameters

    • percent: number

      The percentage of volume you want to set

    Returns Queue

    The guild queue

  • Skip the playing song if there is a next song in the queue. If Queue#autoplay is true and there is no up next song, DisTube will add and play a related song.

    Returns Promise<Song<unknown>>

    The song will skip to

  • Stop the guild stream and delete the queue

    Returns Promise<void>

  • Toggle autoplay mode

    Returns boolean

    Autoplay mode state

MMNEPVFCICPMFPCPTTAAATR