Skip to main content
You configure this bot in three places: a .env file for secrets, the Lavalink bootstrap in bot.py, and application.yml for the audio server itself. Understanding where each setting lives — and how they must stay in sync — helps you move the bot between machines or tune playback safely. For the full variable reference, see Environment Variables.

Environment Variables

The bot uses python-dotenv to load sensitive values from a .env file in the project root at startup. This keeps secrets out of source code and out of version control.
The .env file is listed in .gitignore and should never be committed to your repository. Anyone with your bot token can control your bot and potentially abuse your Discord application.

Required Variables

How to get your token:
  1. Go to the Discord Developer Portal
  2. Select your application (or create one) and open the Bot tab
  3. Click Reset Token to reveal a fresh token, then copy it immediately
  4. Paste it into your .env file as shown below
Example .env file:
The bot establishes its connection to the Lavalink audio server inside the on_ready event in bot.py. The URI and password are currently hard-coded:
Running Lavalink on a remote server: If your Lavalink node is hosted on a separate machine (for example, a VPS), update the uri to point to that server’s IP or hostname:
Make sure the remote server’s firewall exposes port 2333 and that application.yml on that server uses the same password you set here.
Changing the password in application.yml without updating the matching password argument in bot.py (or vice versa) will cause the bot to fail authentication against the Lavalink node and audio will not work. Always update both values together.
The application.yml file is mounted into the Lavalink Docker container and controls the audio server’s behaviour. It is located in the project root and passed to Docker via the volume definition in docker-compose.yml.

Server Settings

Authentication

This password must match the password argument in bot.py. See the warning above before changing it.

Audio Sources

YouTube Plugin

YouTube support is provided by the youtube-plugin rather than Lavalink’s built-in YouTube source, which gives more reliable access:

Memory Allocation

The Docker container is configured to allocate a maximum of 512 MB of RAM to the Java process:
This is suitable for a small to medium-sized server. If you run many simultaneous streams or notice Lavalink being terminated by the OS, increase this value (e.g., -Xmx1G for 1 GB).

Discord Bot Permissions

When inviting the bot to your server, grant the following permissions. All of these are required for normal operation: Voice Permissions:
  • Connect — allows the bot to join voice channels
  • Speak — allows the bot to transmit audio into a voice channel
Text Permissions:
  • Send Messages — required to post Now Playing embeds and command responses
  • Embed Links — required to render rich embeds with artwork and track details
  • Read Message History — required so the bot can locate and edit its persistent Now Playing message
Gateway Intents: The bot enables the message_content privileged intent in code:
You must also enable Message Content Intent in the Discord Developer Portal under your application’s Bot → Privileged Gateway Intents section, otherwise Discord will silently deny the intent and certain bot behaviours may not function correctly.

Environment Variables

Review the exact .env values the bot reads at startup.

Lavalink Setup

Follow the Docker guide for the audio node that your config points to.

Bot Setup

Register and invite the Discord application that uses these settings.

Quickstart

Move from setup to a working local bot in a few minutes.