Represents a queue.

Hierarchy (view full)

Constructors

Properties

#filters: FilterManager
_emptyTimeout?: Timeout
_listeners?: DisTubeVoiceEvents
_next: boolean
_prev: boolean
_taskQueue: TaskQueue
autoplay: boolean
beginTime: number
distube: DisTube
id: string
paused: boolean
playing: boolean
previousSongs: Song<unknown>[]
repeatMode: RepeatMode
songs: Song<unknown>[]
stopped: boolean
textChannel?: GuildTextBasedChannel

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

    Throws

  • Emit error event

    Parameters

    • error: Error

      error

    • Optional channel: GuildTextBasedChannel

      Text channel where the error is encountered.

    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

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

    Parameters

    • Optional mode: 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