GuildQueue
new GuildQueue(player, options)
Parameter | Type | Optional | Description |
---|---|---|---|
player | Player | ❌ | - |
options | GuildNodeInit<Meta> | ❌ | - |
Properties
private #deleted: boolean
private #initializing: boolean
private #initializingPromises: Array<(value: boolean | PromiseLike<boolean>) => void>
private #transitioning: boolean
private __current: null | Track
public dispatcher: null | StreamDispatcher
public filters: GuildQueueAudioFilters<Meta>
public history: GuildQueueHistory<Meta>
public node: GuildQueuePlayerNode<Meta>
public onAfterCreateStream: OnAfterCreateStreamHandler
public onBeforeCreateStream: OnBeforeCreateStreamHandler
public options: GuildNodeInit<Meta>
public player: Player
public repeatMode: QueueRepeatMode
public stats: GuildQueueStatistics<Meta>
public timeouts: Collection<string, Timeout>
public tracks: Queue<Track>
public channel: null | VoiceBasedChannel
The voice channel of this queue
public connection: null | VoiceConnection
The voice connection of this queue
public currentTrack: null | Track
Indicates current track of this queue
public deleted: boolean
Indicates if this queue was deleted previously
public durationFormatted: string
Formatted duration of this queue
public estimatedDuration: number
Estimated duration of this queue in ms
public guild: Guild
The guild this queue belongs to
public id: string
The id of this queue
public initializing: boolean
Indicates if this queue is currently initializing
public metadata: undefined | null | Meta
The metadata of this queue
public ping: number
The voice connection latency of this queue
public size: number
Gets the size of the queue
public voiceReceiver: null | VoiceReceiverNode
The voice receiver for this queue
Methods
private #attachListeners(dispatcher): void
Parameter | Type | Optional | Description |
---|---|---|---|
dispatcher | StreamDispatcher | ❌ | - |
private #emitEnd(): void
private #handleAutoplay(track): Promise<void>
Parameter | Type | Optional | Description |
---|---|---|---|
track | Track | ❌ | - |
private #performFinish(resource?): undefined | Promise<void>
Parameter | Type | Optional | Description |
---|---|---|---|
resource | AudioResource<Track> | ✅ | - |
private #performStart(resource?): void
Parameter | Type | Optional | Description |
---|---|---|---|
resource | AudioResource<Track> | ✅ | - |
private #removeListeners(dispatcher): void
Parameter | Type | Optional | Description |
---|---|---|---|
dispatcher | StreamDispatcher | ❌ | - |
private #resolveInitializerAwaiters(): void
public addTrack(track): void
Add track to the queue. This will emit
Parameter | Type | Optional | Description |
---|---|---|---|
track | Track | Playlist | Array<Track> | ❌ | Track or playlist or array of tracks to add |
public awaitInitialization(): Promise<boolean>
Wait for this queue to initialize
public clear(): void
Clear this queue
public connect(channelResolvable, options): Promise<GuildQueue<Meta>>
Connect to a voice channel
Parameter | Type | Optional | Description |
---|---|---|---|
channelResolvable | GuildVoiceChannelResolvable | ❌ | The voice channel to connect to |
options | VoiceConnectConfig | ❌ | Join config |
public debug(m): void
Write a debug message to this queue
Parameter | Type | Optional | Description |
---|---|---|---|
m | string | ❌ | The message to write |
public delete(): void
Delete this queue
public getSize(): number
The size of this queue
public insertTrack(track, index): void
Inserts the track to the given index
Parameter | Type | Optional | Description |
---|---|---|---|
track | Track | ❌ | The track to insert |
index | number | ❌ | The index to insert the track at (defaults to 0) |
public isEmpty(): boolean
Check if this queue has no tracks left in it
public isPlaying(): boolean
Check if this queue currently holds active audio resource
public isTransitioning(): boolean
if this queue is currently under transition mode
public removeTrack(track): null | Track
Remove a track from queue
Parameter | Type | Optional | Description |
---|---|---|---|
track | TrackResolvable | ❌ | The track to remove |
public revive(): void
Revives this queue
public setMetadata(m): void
Set metadata for this queue
Parameter | Type | Optional | Description |
---|---|---|---|
m | undefined | null | Meta | ❌ | Metadata to set |
public setRepeatMode(mode): void
Set repeat mode for this queue
Parameter | Type | Optional | Description |
---|---|---|---|
mode | QueueRepeatMode | ❌ | The repeat mode to apply |
public setSelfDeaf(mode?, reason?): Promise<GuildMember>
Set self deaf
Parameter | Type | Optional | Description |
---|---|---|---|
mode | boolean | ✅ | On/Off state |
reason | string | ✅ | Reason |
public setSelfMute(mode?, reason?): Promise<GuildMember>
Set self mute
Parameter | Type | Optional | Description |
---|---|---|---|
mode | boolean | ✅ | On/Off state |
reason | string | ✅ | Reason |
public setTransitioning(state): void
Set transition mode for this queue
Parameter | Type | Optional | Description |
---|---|---|---|
state | boolean | ❌ | The state to set |