TuneViaBot is a blazing fast, modern Telegram music bot built with Pyrogram and PyTgCalls. It streams high-quality music into your group voice chats and supports various platforms like YouTube, Spotify, Apple Music, and more.
Below are the required and optional environment variables for deployment.
API_ID= # Required - Get from https://my.telegram.org
API_HASH= # Required - From https://my.telegram.org
BOT_TOKEN= # Required - Get t.me/BotFather
OWNER_ID= # Required - Your Telegram user ID
LOGGER_ID= # Required - Log group/channel ID
STRING_SESSION= # Required - Generate from @SessionBuilderbot
MONGO_DB_URI= # Required - MongoDB connection string
COOKIE_URL= # Required - YT Cookies url
API_KEY= # Optional - External API key for song Download
VIDEO_API_URL= # Optional - External API url for video Download
API_URL= # Optional - External API url for audio DownloadWhere do I get each key?
| Key | Where to Get It | Steps | Notes |
|---|---|---|---|
API_ID & API_HASH |
my.telegram.org → API Development Tools | 1) Log in with Telegram → 2) Open API Development Tools → 3) Create app → 4) Copy values | Keep these private. Needed by both userbot & bot client. |
BOT_TOKEN |
@BotFather | 1) /newbot → 2) Set name & username → 3) Copy the token | Rotate if leaked. Store in .env. |
STRING_SESSION |
@SessionBuilderbot |
1) Start bot →
2) Provide API_ID/API_HASH →
3) Complete login →
4) Copy string
|
Userbot auth for Pyrogram. |
LOGGER_ID |
Telegram Channel/Group you own |
1) Create private channel/group →
2) Add your bot as admin →
3) Get ID via @AnnieXRobot or @MissRose_Bot
|
Use a private space so logs aren’t public. |
MONGO_DB_URI |
MongoDB Atlas |
1) Create free cluster →
2) Add database user & IP allowlist →
3) Copy connection string (mongodb+srv://...)
|
Required for persistence (queues, configs, etc.). |
COOKIE_URL |
Any secure host (e.g., Pastebin, Batbin) |
1) Upload your cookies.txt privately →
2) Set paste visibility to Unlisted →
3) Copy the raw URL
|
Improves YouTube reliability. Never commit raw cookies. |
API_KEY / API_URL or VIDEO_API_URL |
Provider of your choice | generate key → paste here | Optional integrations. |
Details
🎵 Deploy TuneViaBot on VPS
# Step 1: Update & Install Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl python3-pip python3-venv ffmpeg unzip tmux
# Step 2: Install Deno (for yt-dlp) —
curl -fsSL https://deno.land/install.sh | sh
# → When prompted: "Edit shell configs to add deno to the PATH? (y/n)" → Type: y
source ~/.bashrc
# Step 3: Clone & Setup
git clone https://github.com/CertifiedCoders/TuneViaBot
cd TuneViaBot
tmux new -s tune
# Inside tmux:
python3 -m venv venv
source venv/bin/activate
pip install -U pip && pip install -r requirements.txt
bash setup # Fill: API_ID, BOT_TOKEN, COOKIE_URL, etc.
bash start # Run bot
### Useful Commands
tmux detach # Use Ctrl+B, then D
tmux attach-session -t tune # Reattach session
tmux kill-session -t tune # Kill bot session
rm -rf TuneViaBot # Uninstall botDetails
### Step 1: Clone Repo
git clone https://github.com/CertifiedCoders/TuneViaBot
cd TuneViaBot
### Step 2: Create .env File
nano .env
# Paste your environment variables here (API_ID, API_HASH, BOT_TOKEN, MONGO_DB_URI, COOKIE_URL, etc.)
# Save with Ctrl+O, Enter, then Ctrl+X
### Step 3: Build Docker Image
docker build -t tuneviabot .
### Step 4: Run Container
docker run -d \
--name tune \
--env-file .env \
--restart unless-stopped \
tuneviabot
### Step 5: Manage Container
docker logs -f tune # View logs (Ctrl+C to exit)
docker stop tune # Stop container
docker start tune # Start container
docker rm -f tune # Remove container
docker rmi tuneviabot # Remove image| Platform | Deploy Link |
|---|---|
| 🔑 Generate Session | |
| 🌍 Heroku Deploy |
- sᴩᴇᴄɪᴀʟ ᴛʜᴀɴᴋs ᴛᴏ ᴀɴᴏɴʏ ғᴏʀ ᴀɴᴏɴxᴍᴜsɪᴄ
- ᴄʀᴀғᴛᴇᴅ ᴡɪᴛʜ ᴘᴀssɪᴏɴ ʙʏ ᴄᴇʀᴛɪғɪᴇᴅ ᴄᴏᴅᴇʀs


