MelodyForgeBot is a Telegram music and group-management bot for voice chats. The repository is maintained at https://github.com/themukeshdev/MelodyForgeBot.
It supports playback from YouTube, Spotify, JioSaavn, Apple Music and SoundCloud, and is designed to run reliably on Heroku, Docker and Linux VPS hosts.
- Voice chat playback with queue controls
- Multi-session assistant support
- MongoDB-backed configuration and logging
- Docker, Heroku and VPS deployment support
- Optional cookies and proxy support for streaming services
Before deploying, make sure you have:
- Python 3.10 or newer
- FFmpeg installed
- A MongoDB instance
- Telegram API credentials from my.telegram.org
- A bot token from @BotFather
- At least one Pyrogram session string
Use the button below to deploy this repository directly to Heroku. Our app.json is fully configured to automatically set up the required Python and FFmpeg buildpacks.
Setup steps:
- Click the button above.
- Fill in the required environment variables such as API_ID, API_HASH, TOKEN, STRING1 and MONGO_URI.
- Deploy the app.
- Heroku will automatically use the
requirements.txtandProcfileto start the bot.
If you prefer using the command line:
heroku login
heroku create my-melody-bot
heroku buildpacks:add heroku/python
heroku buildpacks:add https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
git push heroku main
heroku ps:scale worker=1sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-pip python3-venv ffmpeg tmux curlgit clone https://github.com/themukeshdev/MelodyForgeBot.git
cd MelodyForgeBot
cp sample.env .env
nano .envFill in the required values in .env before starting the bot.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install uv
uv syncUse tmux so the process keeps running after logout:
tmux new -s melodyforgebot
source .venv/bin/activate
uv run startTo detach, press Ctrl+B then D.
tmux attach -t melodyforgebot
# stop the bot with Ctrl+C
cd MelodyForgeBot
git pull
source .venv/bin/activate
uv sync
uv run startTo test the bot locally before deploying:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install uv
uv sync
cp sample.env .env
nano .env
uv run startFor Windows PowerShell, use:
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install uv
uv sync
Copy-Item sample.env .env
notepad .env
uv run startdocker build -t melodyforgebot .
docker run -d --name melodyforgebot --env-file .env --restart unless-stopped melodyforgebotThis project exposes the startup entrypoint through the package script. The recommended commands are:
- Heroku: Procfile worker process
- VPS:
uv run start - Alternative:
python -m src
The most important variables are:
- API_ID
- API_HASH
- TOKEN
- STRING1 (required)
- MONGO_URI
- OWNER_ID
- LOGGER_ID
AGPL-3.0