Discord Player

GuildQueue

No description provided

GuildQueue

new GuildQueue(player, options);
ParameterTypeOptional
playerPlayer
optionsGuildNodeInit<Meta>

Properties

public dispatcher: any

public filters: any

public history: any

public node: any

public onAfterCreateStream: any

public onBeforeCreateStream: any

public options: any

public player: any

public repeatMode: any

public stats: any

public syncedLyricsProvider: any

public tasksQueue: any

public timeouts: any

public tracks: any

public channel: any

The voice channel of this queue

public connection: any

The voice connection of this queue

public currentTrack: any

Indicates current track of this queue

public deleted: any

Indicates if this queue was deleted previously

public durationFormatted: any

Formatted duration of this queue

public estimatedDuration: any

Estimated duration of this queue in ms

public guild: any

The guild this queue belongs to

public hasDebugger: any

public id: any

The id of this queue

public isShuffling: any

Whether shuffle mode is enabled for this queue.

public maxHistorySize: any

Max history size of this queue

public maxSize: any

Max size of this queue

public metadata: any

The metadata of this queue

public ping: any

The voice connection latency of this queue

public size: any

Gets the size of the queue

Methods

public addTrack(track): void

Add track to the queue. This will emit audioTracksAdd when multiple tracks are added, otherwise audioTrackAdd.

ParameterTypeOptionalDescription
trackPlaylist | Track<unknown>Array<Track<unknown>>Track or playlist or array of tracks to add

public clear(): void

Clear this queue

public connect(channelResolvable, options): Promise<GuildQueue<Meta>>

Connect to a voice channel

ParameterTypeOptionalDescription
channelResolvableGuildVoiceChannelResolvableThe voice channel to connect to
optionsVoiceConnectConfigJoin config

public copyTrack(track, index): void

Copy a track in the queue

ParameterTypeOptional
trackTrackResolvable
indexnumber

public createDispatcher(connection, options): void

Create stream dispatcher from the given connection

ParameterTypeOptionalDescription
connectionVoiceConnectionThe connection to use
optionsPick<VoiceConnectConfig['audioPlayer'],'timeout'>N/A

public debug(m): void

Write a debug message to this queue

ParameterTypeOptionalDescription
mstringThe message to write

public delete(): void

Delete this queue

public disableShuffle(): boolean

Disable shuffle mode for this queue.

public emit(event, args): boolean

Emit an event on this queue

ParameterTypeOptionalDescription
eventKThe event to emit
argsParameters<GuildQueueEvents<Meta>[K]>The args for the event

public enableShuffle(dynamic): boolean

Enable shuffle mode for this queue

ParameterTypeOptionalDescription
dynamicbooleanWhether to shuffle the queue dynamically. Defaults to true. Dynamic shuffling will shuffle the queue when the current track ends, without mutating the queue. If set to false, the queue will be shuffled immediately in-place, which cannot be undone.

public getCapacity(): number

Get queue capacity

public getMaxHistorySize(): number

Max history size of this queue

public getMaxSize(): number

Max size of this queue

public getSize(): number

The size of this queue

public insertTrack(track, index): void

Inserts the track to the given index

ParameterTypeOptionalDescription
trackTrack<unknown>The track to insert
indexnumberThe index to insert the track at (defaults to 0)

public isEmpty(): boolean

Check if this queue has no tracks left in it

public isFull(): boolean

Check if this queue is full

public isPlaying(): boolean

Check if this queue currently holds active audio resource

public isTransitioning(): boolean

if this queue is currently under transition mode

public moveTrack(track, index): void

Moves a track in the queue

ParameterTypeOptional
trackTrackResolvable
indexnumber

public play(track, options?): Promise<PlayerNodeInitializationResult<Meta>>

Play a track in this queue

ParameterTypeOptionalDescription
trackTrackLikeThe track to be played
optionsPlayerNodeInitializerOptions<Meta>Player node initialization options

public removeTrack(track): null | Track<unknown>

Remove a track from queue

ParameterTypeOptionalDescription
trackTrackResolvableThe track to remove

public revive(): void

Revives this queue

public setMaxHistorySize(size): void

Set max history size for this queue

ParameterTypeOptionalDescription
sizenumberThe size to set

public setMaxSize(size): void

Set max size for this queue

ParameterTypeOptionalDescription
sizenumberThe size to set

public setMetadata(m): void

Set metadata for this queue

ParameterTypeOptionalDescription
mMetaMetadata to set

public setRepeatMode(mode): void

Set repeat mode for this queue

ParameterTypeOptionalDescription
modeQueueRepeatModeThe repeat mode to apply

public setSelfDeaf(mode?, reason?): Promise<GuildMember>

Set self deaf

ParameterTypeOptionalDescription
modebooleanOn/Off state
reasonstringReason

public setSelfMute(mode?, reason?): Promise<GuildMember>

Set self mute

ParameterTypeOptionalDescription
modebooleanOn/Off state
reasonstringReason

public setTransitioning(state): void

Set transition mode for this queue

ParameterTypeOptionalDescription
statebooleanThe state to set

public swapTracks(src, dest): void

Swap two tracks in the queue

ParameterTypeOptionalDescription
srcTrackResolvableThe first track to swap
destTrackResolvableThe second track to swap

public syncedLyrics(lyrics): SyncedLyricsProvider

The sync lyrics provider for this queue.

const lyrics = await player.lyrics.search({ q: 'Alan Walker Faded' });
const syncedLyrics = queue.syncedLyrics(lyrics[0]);
console.log(syncedLyrics.at(10_000));
// subscribe to lyrics change
const unsubscribe = syncedLyrics.onChange((lyrics, timestamp) => {
  console.log(lyrics, timestamp);
});
// unsubscribe from lyrics change
unsubscribe(); // or
syncedLyrics.unsubscribe();
ParameterTypeOptional
lyricsLrcSearchResult | LrcGetResult

public toggleShuffle(dynamic): boolean

Toggle shuffle mode for this queue.

ParameterTypeOptionalDescription
dynamicbooleanWhether to shuffle the queue dynamically. Defaults to true.

On this page

GuildQueuePropertiespublic dispatcher: anypublic filters: anypublic history: anypublic node: anypublic onAfterCreateStream: anypublic onBeforeCreateStream: anypublic options: anypublic player: anypublic repeatMode: anypublic stats: anypublic syncedLyricsProvider: anypublic tasksQueue: anypublic timeouts: anypublic tracks: anypublic channel: anypublic connection: anypublic currentTrack: anypublic deleted: anypublic durationFormatted: anypublic estimatedDuration: anypublic guild: anypublic hasDebugger: anypublic id: anypublic isShuffling: anypublic maxHistorySize: anypublic maxSize: anypublic metadata: anypublic ping: anypublic size: anyMethodspublic addTrack(track): voidpublic clear(): voidpublic connect(channelResolvable, options): Promise<GuildQueue<Meta>>public copyTrack(track, index): voidpublic createDispatcher(connection, options): voidpublic debug(m): voidpublic delete(): voidpublic disableShuffle(): booleanpublic emit(event, args): booleanpublic enableShuffle(dynamic): booleanpublic getCapacity(): numberpublic getMaxHistorySize(): numberpublic getMaxSize(): numberpublic getSize(): numberpublic insertTrack(track, index): voidpublic isEmpty(): booleanpublic isFull(): booleanpublic isPlaying(): booleanpublic isTransitioning(): booleanpublic moveTrack(track, index): voidpublic play(track, options?): Promise<PlayerNodeInitializationResult<Meta>>public removeTrack(track): null | Track<unknown>public revive(): voidpublic setMaxHistorySize(size): voidpublic setMaxSize(size): voidpublic setMetadata(m): voidpublic setRepeatMode(mode): voidpublic setSelfDeaf(mode?, reason?): Promise<GuildMember>public setSelfMute(mode?, reason?): Promise<GuildMember>public setTransitioning(state): voidpublic swapTracks(src, dest): voidpublic syncedLyrics(lyrics): SyncedLyricsProviderpublic toggleShuffle(dynamic): boolean