GuildQueue class represents a music queue for a specific guild. It manages tracks, playback, voice connections, and audio processing.
Getting a Queue
Properties
The unique identifier of this queue (Snowflake)
The guild this queue belongs to
The player instance
The track queue
The queue history manager
The voice connection
The voice channel
The audio stream dispatcher
Audio filters manager
The player node (playback control)
Custom metadata attached to this queue
Current repeat mode (OFF, TRACK, QUEUE, AUTOPLAY)
Whether audio is currently playing
Whether the queue is empty
The currently playing track
Number of tracks in the queue
Playback Control Methods
play()
Start playing a track:The track to play, or null to play next in queue
Play options (seek, immediate, filtersUpdate, encoderArgs)
pause()
Pause playback:True if paused successfully
resume()
Resume playback:True if resumed successfully
skip()
Skip the current track:True if skipped successfully
stop()
Stop playback and clear queue:seek()
Seek to a position:Position in milliseconds
True if seek was successful
Track Management Methods
addTrack()
Add a track to the queue:Track or array of tracks to add
insertTrack()
Insert a track at a specific position:Track or array of tracks to insert
Position to insert at
removeTrack()
Remove a track:Track, track ID, or index
The removed track
clear()
Clear all tracks from queue:shuffle()
Shuffle the queue:The shuffled tracks
Queue State Methods
setRepeatMode()
Set repeat mode:The repeat mode: OFF (0), TRACK (1), QUEUE (2), AUTOPLAY (3)
setVolume()
Set playback volume:Volume level (0-200)
True if volume was set
enableDynamicShuffle()
Enable dynamic shuffle mode:disableDynamicShuffle()
Disable dynamic shuffle mode:Voice Connection Methods
connect()
Connect to a voice channel:The voice channel to connect to
The queue instance
disconnect()
Disconnect from voice channel:delete()
Delete this queue:Utility Methods
getTimestamp()
Get current playback timestamp:Object with current and total time info
createProgressBar()
Create a progress bar:Progress bar customization options
The formatted progress bar
isEmpty()
Check if queue is empty:True if queue has no tracks