DisTube API Documentation
    Preparing search index...

    Class Queue

    Represents a queue.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _beginTime: number

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

    _listeners?: DisTubeVoiceEvents

    DisTubeVoice listener

    _manualUpdate: boolean

    Whether or not the queue is being updated manually (skip, jump, previous)

    _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 queue is active.

    Note: This remains true when paused. It only becomes false when stopped.

    Use !queue.paused to check if audio is playing. Will be removed in v6.0.

    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 clientMember(): GuildMember | undefined

      The client user as a GuildMember of this queue's guild

      Returns GuildMember | undefined

    • get currentTime(): number

      What time in the song is playing (in seconds).

      Returns number

    • get voiceChannel(): VoiceBasedChannel | null

      The voice channel playing in.

      Returns VoiceBasedChannel | null

    Methods

    • Internal

      Internal implementation of addRelatedSong without task queue protection. Used by methods that already hold the task queue lock.

      Parameters

      • Optionalsong: Song<unknown>

      Returns Promise<Song<unknown>>

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

      Parameters

      • Optionalsong: Song<unknown>

        The song to get related songs from. Defaults to the current playing song.

      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

    • Returns boolean

      true if the queue is paused

      Use queue.paused property instead. Will be removed in v6.0.

    • Returns boolean

      true if the queue is active (not stopped)

      Use !queue.paused to check if audio is playing. Will be removed in v6.0.

    • 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

      • Optionaloptions: JumpOptions

        Skip options

      Returns Promise<Song<unknown>>

      The new Song will be played

    • Play the first song in the queue

      Parameters

      Returns Promise<void>

    • Set the playing time to another position

      Parameters

      • time: number

        Time in seconds

      Returns Promise<Queue>

      The guild queue

    • 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.

      Parameters

      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