A horizontally-scaled, natively proxied Discord Music Bot architecture powered purely by Python and yt-dlp.
Multi-Music Discord Bots is an advanced deployment template customized for hosting multiple completely independent Discord Music Bots directly utilizing yt-dlp and FFmpegPCMAudio without requiring bloated JVMs, Lavalink nodes, or Node.js bridges.
By pairing discord.py securely with HTTP Residential Proxies and native Docker Compose orchestration, this architecture perfectly bypasses YouTube datacenter blocking, avoids bot-connection overlaps, and securely protects itself against Google's constant scraper mitigation techniques.
- 🚀 Horizontal Native Scaling: Run an infinite amount of independent bots seamlessly through Docker Compose without complicated Python sub-processing multiplexers. Every bot binds smoothly via
BOT_INDEX. - 📻 Pure Native Python Audio: All audio streaming is piped natively through
discord.FFmpegPCMAudionatively—zero audio loss and zero JVM memory bloat. - 🛡️ Proxied
yt-dlpBypass: Deep native proxy integration routes all metadata scraping natively. No more429 Too Many Requestsor cloud datacenter blocks on YouTube headers since traffic appears heavily residential. - 🔞 Age-Restriction Bypass via Cookies: Employs an internal
cookies.txtbypass configuration natively injected into yt-dlp avoiding PoW problems. - ⚡ Prefix-less Native Audio Setup: You can completely avoid slash commands—have users just type
a play song_name(or whatever configuredBOT_PLAY_LETTERapplies) and instantly enjoy audio. - 🌐 Stale Session Pruning: Specifically hard-coded thread-safe websocket cleanup natively prevents the dreaded Discord Voice
4006gateway corruption error natively.
- Docker & Docker Compose (Mandatory for handling dependencies like
FFmpegout-of-the-box). - Discord Bot Tokens with Message Content and Voice State Intents enabled on the Discord Developer Portal.
- Supported HTTP Residential Proxy (e.g. DataImpulse).
- Optional:
cookies.txt(Drop this in your project root to seamlessly bypass YouTube age restriction pop-ups natively).
git clone https://github.com/S1nju/multi-music-discord-bots.git
cd multi-music-discord-botsCreate a .env file in the root directory and define your API variables securely:
# Proxy Injection Strategy
PROXY_HOST=gw.dataimpulse.com
PROXY_PORT=823
PROXY_USER=proxy_username
PROXY_PASSWORD=proxy_password
# --- BOT CONFIGURATIONS ---
# Bot 1
BOT_TOKEN1=YOUR_SECRET_TOKEN
BOT_CHANNEL_ID1=YOUR_VOICE_CHANNEL_ID
BOT_PLAY_LETTER1=a
BOT_PREFIX1=-
# Add BOT_TOKEN2, BOT_CHANNEL_ID2, etc. natively underneath if orchestrating multiple.To add bots to your multiplex, duplicate the native docker service slice in your docker-compose.yml natively passing the exact BOT_INDEX referencing your .env:
services:
bot1:
build: .
container_name: musicbots_1
restart: always
env_file: .env
environment:
- BOT_INDEX=1
bot2:
build: .
container_name: musicbots_2
restart: always
env_file: .env
environment:
- BOT_INDEX=2Build and launch natively:
docker compose up --build -dYou're done! To view your active bots natively, type
docker compose logs -f bot1.
All commands execute securely relying purely on your dynamically assigned BOT_PLAY_LETTER inside .env. (If your letter is a ...)
| Command | Description |
|---|---|
a play <query/url> |
Play a song directly from HTTP proxy parsing (or just type a <song>!). |
a stop or a leave |
Gracefully forces the bot to disconnect natively and clears websocket status. |
a pause or a s |
Temporarily halts music playback natively via VoiceClient. |
a resume |
Resumes a historically paused track effortlessly. |
status, help |
(Using BOT_PREFIX) Detailed system bot index and diagnostics. |
Unlike bulky Lavalink setups scaling through shared sockets, every musicbot spawns a strictly isolated asyncio.Lock() execution loop securely feeding the search query (yt-dlp) down your Proxy Pipeline seamlessly extracting the raw AV stream.
graph TD
subgraph "Docker Compose"
B1["Service: Bot 1 <br/>BOT_INDEX=1"]
B2["Service: Bot 2 <br/>BOT_INDEX=2"]
end
B1 -->|"FFmpegPCMAudio"| D["Discord Gateway"]
B2 -->|"FFmpegPCMAudio"| D
B1 -.->|"yt-dlp"| P["Residential HTTP Proxy"]
B2 -.->|"yt-dlp"| P
P <-->|"Search Bypass"| Y["YouTube Core Servers"]
This project is licensed under the MIT License - see the LICENSE file for details.