Skip to main content

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.

The playback commands are the core of the Simple Discord Music Bot. They let you search for and queue songs, control playback state, and disconnect the bot from a voice channel when you’re done. All responses are ephemeral — only the user who ran the command sees them — so your channel stays clean. Each command connects to the bot’s Wavelink player, which manages the underlying Lavalink audio node.

/play

Searches for a song or playlist by name or URL and adds it to the queue. If nothing is currently playing, playback starts immediately.
The /play command is the primary way to get music going. It accepts either a plain search term (e.g. lofi hip hop) or a direct URL. The bot defers its response first so Discord doesn’t time out during the search, then joins your voice channel (or moves to it if already connected elsewhere) before queuing the result.
song
string
required
The song name or URL to search for and play. Accepts free-text queries or direct links to supported sources (YouTube, SoundCloud, etc.).
Behavior
  • Defers the interaction response immediately to prevent timeouts during search.
  • Verifies the invoking user is in a voice channel; aborts with an error otherwise.
  • Joins the user’s voice channel if the bot is not already connected, or moves to it if connected elsewhere.
  • Calls wavelink.Playable.search(song) to resolve tracks.
  • Stores the requester’s display name and avatar URL in track.extras for attribution in embeds.
  • If the result is a wavelink.Playlist, all tracks are added to the queue and a confirmation embed shows the playlist name and total track count.
  • If the result is a single track, it is added to the queue and the embed shows the title, author, and formatted duration.
  • The confirmation embed uses an orange color, displays the track artwork as a full-width image (embed.set_image), and includes a footer crediting the requester.
  • The confirmation message is ephemeral and auto-deletes after 10 seconds.
  • If the bot is not already playing when the track is added, playback begins immediately via vc.play(vc.queue.get()).
Error responses
SituationResponse
User is not in a voice channel"You must be in a voice channel." (ephemeral, deletes after 5 s)
Search returns no results"No results found." (ephemeral, deletes after 5 s)

/skip

Skips the currently playing or paused song and advances to the next track in the queue.
/skip calls vc.skip() on the Wavelink player. It works whether the current track is actively playing or has been paused — both states are checked. After the skip the on_wavelink_track_end event fires automatically to advance the queue. Behavior
  • Checks that vc.playing or vc.paused is True.
  • Calls vc.skip() to end the current track.
  • Sends "Skipped the current song." ephemerally on success.
Error responses
SituationResponse
Nothing is playing or paused"Not playing anything to skip."
The /skip success confirmation is sent as a non-ephemeral message when nothing is playing. For consistency, consider always running this command when a track is active.

/pause

Pauses the currently playing track without clearing the queue or disconnecting the bot.
/pause calls vc.pause(True) on the Wavelink player. The track position is preserved; use /resume to continue from the same point. Behavior
  • Verifies the bot is connected to a voice channel (vc is not None).
  • Verifies that vc.playing is True.
  • Calls vc.pause(True) to pause the audio stream.
  • Sends "Playback paused!" ephemerally on success.
Error responses
SituationResponse
Bot is not in a voice channel"I'm not in a voice channel." (ephemeral)
Nothing is currently playing"Nothing is currently playing." (ephemeral)

/resume

Resumes a paused track from the exact position it was paused at.
/resume calls vc.pause(False), which Wavelink uses as the toggle to un-pause the player. It only works when the player is actively paused; if playback is already running, the command returns an error instead of silently succeeding. Behavior
  • Verifies the bot is connected to a voice channel (vc is not None).
  • Verifies that vc.paused is True.
  • Calls vc.pause(False) to resume the audio stream.
  • Sends "Playback resumed!" ephemerally on success.
Error responses
SituationResponse
Bot is not in a voice channel"I'm not in a voice channel." (ephemeral)
Player is not currently paused"I'm not paused right now." (ephemeral)

/stop

This command clears the entire queue, deletes the Now Playing embed, and disconnects the bot from the voice channel. It cannot be undone.
/stop is a full teardown command. It clears queued tracks, removes the persistent Now Playing message from the channel, resets the bot’s Discord presence, and disconnects from the voice channel. Behavior
  • Verifies the bot is connected to a voice channel; aborts with an error otherwise.
  • Calls vc.queue.clear() to remove all upcoming tracks.
  • Looks up the guild’s active Now Playing message in the ACTIVE_PLAYERS dictionary. If one exists, it is deleted from the channel and the dictionary entry is set to None.
  • Calls vc.disconnect() to leave the voice channel.
  • Resets the bot’s Discord presence to None via bot.change_presence(activity=None).
  • Sends "Stopped playback and disconnected" ephemerally on success.
Error responses
SituationResponse
Bot is not connected to a voice channel"I'm not connected to any voice channel." (ephemeral)
If you only want to clear upcoming tracks without disconnecting the bot, use /clearqueue instead.

Build docs developers (and LLMs) love