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.

Simple Discord Music Bot is a high-performance, open-source music bot for Discord servers. Built in Python using Nextcord as the Discord API wrapper and Wavelink as the async Lavalink client, it offloads all audio decoding and streaming work to a dedicated Lavalink Java server — delivering crystal-clear sound with low resource overhead on the bot process itself. The project was inspired by a similar discord.py implementation and rewritten from the ground up for Nextcord, and is released under the MIT license.

What the Bot Does

When a user runs /play in a Discord server, the bot searches YouTube or SoundCloud for the requested song, adds it to a per-guild queue, and streams the audio through a Lavalink node into the voice channel. As each track plays, the bot posts a live “Now Playing” rich embed and updates its own Discord presence with the track title, artist, and a live timestamp. When the queue is exhausted the bot cleans up its embed, resets its presence, and disconnects — no manual cleanup needed.

Key Features

  • Lavalink audio backend — audio decoding and streaming are handled by a dedicated Java process, keeping the Python bot lightweight and stable
  • 11 slash commands/play, /skip, /pause, /resume, /stop, /queue, /clearqueue, /shuffle, /nowplaying, /ping, and /help
  • YouTube and SoundCloud search — search by name or paste a direct URL; both video and playlist URLs are supported
  • Playlist support — adding a playlist URL enqueues all tracks at once and reports the playlist name and track count
  • Paginated queue browser — the /queue command opens an interactive, session-locked pagination view so users can browse long queues without flooding the channel
  • Live Now Playing embeds — a persistent embed in the voice channel updates automatically when each new track starts and deletes itself when the queue ends
  • Automated presence sync — the bot’s Discord status reflects the currently playing track, including live start/end timestamps

How the Pieces Fit Together

Discord User  →  Nextcord (bot.py)  →  Wavelink  →  Lavalink Node  →  YouTube / SoundCloud
                      ↑                                    ↓
                  Slash Commands                     Decoded Audio
                      ↑                                    ↓
                Discord Channel  ←─────────────── Voice Channel Stream
A user issues a slash command in Discord. Nextcord receives it in bot.py and calls Wavelink’s async API to search for or queue a track. Wavelink forwards the request to the Lavalink node (a Java process running inside Docker). Lavalink fetches the audio from the source, decodes it, and streams it directly into the Discord voice channel — the Python process never touches raw audio data.

Technology Stack

ComponentRole
NextcordDiscord API wrapper; handles slash commands, embeds, voice protocol, and gateway events
WavelinkAsync Python client for Lavalink; manages nodes, queues, and playback events
LavalinkJava audio server; handles source fetching, decoding, and low-latency streaming
DockerRuns the Lavalink server in an isolated container via docker-compose
python-dotenvLoads the BOT_TOKEN from a .env file, keeping secrets out of source code

Explore the Docs

Quickstart

Get the bot running in minutes — clone, configure, and play your first song.

Configuration

Customize environment variables, Lavalink connection settings, and bot permissions.

Lavalink Setup

Deep-dive into running and tuning the Lavalink Docker node.

Playback Commands

Full reference for every slash command the bot exposes.

Build docs developers (and LLMs) love