Queue
Constructorโ
- Queue : options
Table of contentsโ
| Properties | Methods |
|---|---|
| current | add() |
| guildId | clear() |
| manager | duration() |
| previous | remove() |
| roundRobinShuffle() | |
| shuffle() | |
| size() | |
| totalsize() | |
| userBlockShuffle() |
Propertiesโ
currentโ
The current track
Returns:
Track|UnresolvedTrack| null
guildIdโ
The guild ID property.
managerโ
The Manager instance.
Returns:
Manager
previousโ
The previous track
Returns:
Track|UnresolvedTrack| null
Methodsโ
add()โ
Adds a track to the queue.
Returns: void
Parameter Type Description track( Track|UnresolvedTrack) | (Track|UnresolvedTrack)[]The track or tracks to add. Can be a single Trackor an array ofTracks.offsetnumber The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
clear()โ
Clears the queue.
This will remove all tracks from the queue and emit a state update event.Returns: void
duration()โ
The total duration of the queue in milliseconds.
This includes the duration of the currently playing track.Returns: number
remove()โ
Removes track(s) from the queue.
Returns: (
Track|UnresolvedTrack)[]
Parameter Type Description startOrPositionnumber If a single number is provided, it will be treated as the position of the track to remove.
If two numbers are provided, they will be used as the start and end of a range of tracks to remove.endnumber Optional, end of the range of tracks to remove.
roundRobinShuffle()โ
Shuffles the queue to play tracks requested by each user one by one.
Returns: void
shuffle()โ
Shuffles the queue.
This will randomize the order of the tracks in the queue and emit a state update event.Returns: void
size()โ
The size of tracks in the queue.
This does not include the currently playing track.Returns: number
totalSize()โ
The total size of tracks in the queue including the current track.
This includes the current track if it is not null.Returns: number
Parameter Type Description bandsBand[]The equalizer bands to apply. Each band includes a band number and a gain value. If no bands are provided, the equalizer is reset.
userBlockShuffle()โ
Shuffles the queue to play tracks requested by each user one block at a time.
Returns: void