Lavalink must be running before you start
bot.py. The bot connects to the Lavalink node during its on_ready event — if the node is unreachable at startup, the bot will fail to initialize audio playback.1
Prerequisites
Make sure the following are installed and available in your
PATH before continuing:- Python 3.12 or later — Older versions of Python (like 3.10 or lower) will cause the bot to crash on startup.
- Docker (with
docker compose) — used to run the Lavalink audio server - Git — to clone the repository
- A Discord Bot Token — create an application and bot user at the Discord Developer Portal, then copy the token from the Bot tab
If you haven’t set up a Discord application before, enable the Message Content Intent under Bot → Privileged Gateway Intents in the Developer Portal. The bot enables this intent in code, and Discord requires you to opt in on the portal side as well.
2
Clone the Repository
Clone the project from GitHub and navigate into the project directory:
3
Create and activate your environment
The recommended workflow is to use Then activate it for your operating system:Your terminal prompt should now show
uv, which manages the Python environment and installs dependencies automatically.If you are not using uv, create a virtual environment manually:- Windows
- macOS
- Linux
(venv) to confirm the environment is active.4
Install uv
Install Verify the install with:
uv, the recommended Python environment manager for this project.5
Install Dependencies
Install the project dependencies with This installs the runtime and development dependencies defined in
uv:pyproject.toml.This project still includes requirements.txt for compatibility, but uv sync is the recommended workflow.6
Create the .env File
The bot reads your Discord bot token from a Replace
.env file in the project root. Create the file now:your_discord_bot_token_here with the actual token you copied from the Discord Developer Portal.Never commit the
.env file to version control. It is already listed in .gitignore for your protection — do not remove it from that list.7
Start the Lavalink Server with Docker
The bot streams audio through Lavalink, which runs as a Docker container. Start it in the background with:This pulls the official You should see a container named
ghcr.io/lavalink-devs/lavalink:4.2.2 image, mounts your local application.yml as its configuration file, and exposes port 2333 so the bot can connect. The unless-stopped restart policy means Lavalink will come back up automatically after a system reboot.Confirm it is running:lavalink_node with status Up.8
Run the Bot
With Lavalink running and your On startup the bot will:
.env file in place, start the bot:- Load
BOT_TOKENfrom.env - Connect to the Lavalink node at
http://127.0.0.1:2333 - Sync all slash commands with Discord
- Log in and display its tag in the terminal
9
Test Playback in Discord
- Open Discord and join a voice channel in a server where your bot has been invited
- In any text channel, type
/playand enter a song name or YouTube URL when prompted - The bot will join your voice channel, post an “Added to Queue” embed, and begin streaming the track
- A Now Playing embed will appear in the channel and the bot’s status will update to reflect the current track
/queue to see the paginated queue browser, /pause and /resume to control playback, and /skip to move to the next song.Related Topics
Environment Variables
Verify the .env values the startup path depends on.
Lavalink Setup
Learn how to run the audio server that the quickstart depends on.
Bot Setup
Create the Discord application and invite link for the bot you are starting.
Playback Commands
Read the detailed command guide once the bot is up and running.