A modern, stable Discord music bot built with disnake and mafic (Lavalink client).
- Automatic Lavalink detection & startup — Bot checks if Lavalink is running; if not, automatically starts it locally (configurable via env vars)
- Node pool management — Full integration with mafic's NodePool for robust music node handling
- Utility commands:
/ping— Latency check/uptime— Bot uptime tracker/nodes— View connected music nodes status/player— Current player status with track info, queue length, volume, and filters
- Cog-based architecture — Modular design for easy command expansion
- Comprehensive logging — Structured logging for debugging and monitoring
- Environment-based configuration — Support for
.envvariables (LAVALINK_HOST, LAVALINK_PORT, LAVALINK_PASSWORD, LAVALINK_AUTO_START, DISCORD_TOKEN)
- Uses AsyncIO for concurrent operations
- YAML-based Lavalink config with Python fallback to env vars
- Auto-reconnection & health checks for Lavalink availability
- Clean separation of bot logic and music node management
- Python 3.11+
- Java (for local Lavalink running)
- Discord bot token
python -m venv .venv
.venv\Scripts\activate
pip install -U disnake mafic pyyaml-
Set environment variables:
$env:DISCORD_TOKEN = "your-token-here" $env:LAVALINK_AUTO_START = "true" $env:LAVALINK_HOST = "127.0.0.1" $env:LAVALINK_PORT = "2333" $env:LAVALINK_PASSWORD = "youshallnotpass"
-
Update
application.ymlwith your Lavalink config (template provided) -
Run:
python main.py
- Audio playback commands (play, pause, skip, queue)
- Search integration (YouTube, Spotify)
- Playlist management
- Equalizer & filter presets
- Web dashboard (optional)