A high-performance, feature-rich Telegram Music Bot written in Go.
Built with gogram, ntgcalls, and mongo-driver.
- 🚀 High Performance: Written in Go for efficiency and speed.
- 📹 Video & Audio: Supports playing both video and audio streams.
- 🔗 Multi-Source: YouTube, Direct Links, M3U8, etc.
- 🎛 Advanced Control: Seek, Pause, Resume, Mute, Volume Control.
- 📋 Playlist Management: Queue system with skip, loop, and shuffle.
- 🌐 Multi-Language: Easy to localize for different regions.
- 🐳 Docker Ready: Easy deployment with Docker.
Click to reveal Local Setup Instructions
- Go 1.25+
- FFmpeg
-
Clone the repository
git clone https://github.com/AshokShau/TgMusicBot.git cd TgMusicBot -
Setup
ntgcallsDownload the required C++ libraries.go run setup_ntgcalls.go
-
Configure Environment Copy the sample file and edit it.
cp sample.env .env vi .env
-
Build and Run
go build -o app . ./app
For detailed instructions, see installation.md.
Click to reveal Docker Setup Instructions
-
Clone and Config
git clone https://github.com/AshokShau/TgMusicBot.git cd TgMusicBot cp sample.env .env # Edit .env with your credentials
-
Run with Docker Compose
docker-compose up -d --build
Click to reveal Heroku Setup Instructions
- Click the Deploy to Heroku button above.
- Fill in the required environment variables (
API_ID,API_HASH,STRING1, etc.). - Deploy the app.
- Important: Enable the
workerdyno and disable thewebdyno in the Resources tab.
The bot is configured via environment variables. See sample.env for all options.
Click to view Environment Variables
| Variable | Description | Required |
|---|---|---|
API_ID |
Telegram API ID | ✅ |
API_HASH |
Telegram API Hash | ✅ |
TOKEN |
Bot Token from @BotFather | ✅ |
STRING1 |
Pyrogram V2 Session String | ✅ |
MONGO_URI |
MongoDB Connection URI | ✅ |
OWNER_ID |
Telegram User ID of the owner | ✅ |
LOGGER_ID |
Group chat ID for logs | ❌ |
SONG_DURATION_LIMIT |
Max song duration in seconds | ❌ |
API_KEY |
Your API key | ❌ |
COOKIES_URL |
Cookies URL for the bot | ❌ |
Click to view Admin Commands
/play <query|url>- Play a song or video./vplay <query|url>- Force video play./skip- Skip the current track./pause- Pause playback./resume- Resume playback./end- Stop playback and clear queue./mute- Mute the assistant./unmute- Unmute the assistant./auth- Authorize a user to use the bot./unauth- Revoke authorization./settings- Configure bot settings.
Click to view User Commands
/start- Check if bot is alive./ping- Check latency./help- Show help menu.
If you find this project useful, consider supporting its development with a donation:
- TON:
UQDkCHTN1CA-j_5imVmliDlkqydJhE7nprQZrvFCakr67GEs - USDT TRC20:
TJWZqPK5haSE8ZdSQeWBPR5uxPSUnS8Hcq - USDT TON:
UQD8rsWDh3VD9pXVNuEbM_rIAKzV07xDhx-gzdDe0tTWGXan - Telegram Wallet: @Ashokshau
- 📦 Repo: TgMusicBot on GitHub
- 💬 Support: Telegram Group
- 🐍 Old version: TgMusicBot (Python)
Made with ❤️ by Ashok Shau