The queue commands give you visibility and control over the tracks lined up after the current song. You can browse the full queue in a paginated, interactive embed, randomize the playback order with a single command, or wipe upcoming tracks while leaving the current song untouched. All three commands are accessible by any server member while the bot is active.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DJERLO/Simple-Discord-Music-Bot-Using-Nextcord/llms.txt
Use this file to discover all available pages before exploring further.
/queue
Displays the current music queue in a paginated embed. Only the user who ran the command can navigate between pages.
/queue converts the live Wavelink queue into a list of track tuples and hands them to a QueueView instance, which renders a Discord embed with pagination buttons. The message is sent ephemerally so only the invoker sees it, and the view holds a reference to the message so it can disable buttons automatically when it times out.
Behavior
- Checks that the bot is connected to a voice channel (
vcis notNone) and thatvc.queueis not empty; sends an error and returns early otherwise. - Iterates the Wavelink queue and builds a list of tuples in the form
(track.uri, track.title, track.artwork, track.length / 1000). - Creates a
QueueViewwith the songs list, the invoking user, and the guild ID as a string. - Sends the first-page embed and the view as an ephemeral message.
- Stores the message reference in
view.messageso the timeout handler can later disable the buttons.
| Situation | Response |
|---|---|
| Bot is not connected or queue is empty | "The queue is currently empty." (ephemeral) |
QueueView UI
TheQueueView class (defined in views.py) is a nextcord.ui.View subclass that handles all pagination logic. It renders an embed on demand and updates it in place when the user clicks a button, so no new messages are created during navigation.
Embed format
- Title:
🎶 Music Queue (Page X/Y)— page numbers are 1-indexed. - Description: one line per track in the current page slice, formatted as
**N.** Title (M:SS). - Footer:
Total Songs: Nwhere N is the full queue length. - Color: green (
nextcord.Color.green()).
| Button | Label | Style | Disabled when |
|---|---|---|---|
| Previous page | ⬅️ Prev | Primary (blue) | Already on page 1 |
| Next page | Next ➡️ | Primary (blue) | Already on the last page |
update_button_states().
Session lock
The interaction_check method compares interaction.user.id to self.interaction_user.id. If a different user clicks a button, they receive "Only the user who requested the queue menu can look through pages." ephemerally and the page does not change.
Timeout
The view has a 60-second timeout. When it expires, on_timeout disables all buttons and edits the original message to show the grayed-out view, so users can still see the last page but can no longer navigate.
QueueView shows 10 tracks per page by default (per_page=10). The total page count is calculated as:
songs[page * per_page : (page + 1) * per_page].
The duration displayed in the queue embed is derived from
track.length / 1000 (converting Wavelink’s milliseconds to seconds), then formatted inline as M:SS within get_embed() without calling the shared format_time helper./shuffle
Randomly reorders all tracks in the queue. The currently playing song is not affected.
/shuffle delegates directly to the Wavelink built-in vc.queue.shuffle(). It is a one-shot operation — there is no way to undo a shuffle, but you can shuffle again to get a new random order.
Behavior
- Checks that the bot is connected and that
vc.queueis not empty. - Calls
vc.queue.shuffle()to randomize the order of all queued (upcoming) tracks. - Sends
"The music queue has been shuffled."ephemerally on success.
| Situation | Response |
|---|---|
| Queue is empty or bot is not connected | "The queue is currently empty, nothing to shuffle." (ephemeral) |
/clearqueue
Removes all upcoming tracks from the queue without stopping the currently playing song.
/clearqueue calls vc.queue.clear() on the Wavelink player. Unlike /stop, it does not disconnect the bot or interrupt the current track — only the queued songs waiting their turn are removed.
Behavior
- Retrieves the guild’s voice client (
vc). - If
vcis notNone, callsvc.queue.clear()to remove all queued tracks. - Sends
"The music queue has been cleared."ephemerally regardless of whethervcexists, so the response is always delivered.
/clearqueue gracefully handles the case where the bot is not in a voice channel — it skips the queue.clear() call but still sends the confirmation message.