TgMusicBot
A high-performance, open-source Telegram Music Bot written in Go — stream music and video in Telegram voice chats effortlessly
Install / Use
/learn @AshokShau/TgMusicBotREADME
✨ Features
- 🚀 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.
🛠️ Installation & Setup
<details> <summary><b>Click to reveal Local Setup Instructions</b></summary>Prerequisites
- Go 1.25+
- FFmpeg
Steps
-
Clone the repository
git clone https://github.com/AshokShau/TgMusicBot.git cd TgMusicBot -
Setup
ntgcalls&gotdbotDownload the required C++ libraries.go run setup_ntgcalls.gogo run github.com/AshokShau/gotdbot/scripts/tools@latest -
Configure Environment Copy the sample file and edit it.
cp sample.env .env vi .env -
Build and Run
go build -o app . ./app -
Run in Background
- Quick Start: Use
screenortmux. - Production: Use
systemd. See installation.md for details.
- Quick Start: Use
For detailed instructions, see installation.md.
</details> <details> <summary><b>Click to reveal Docker Setup Instructions</b></summary>-
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 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.
⚙️ Configuration
The bot is configured via environment variables. See sample.env for all options.
| 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 | YouTube cookies URL via https://batbin.me | ❌ |
🤖 Commands
<details> <summary><b>Click to view Admin Commands</b></summary>/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.
/start- Check if bot is alive./ping- Check latency./help- Show help menu.
<div align="center">
❤️ Donate
</div>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
<div align="center">
💬 Links
</div>- 📦 Repo: TgMusicBot on GitHub
- 💬 Support: Telegram Group
- 🐍 Old version: TgMusicBot (Python) (Deprecated)
<p align="center"> Made with ❤️ by <a href="https://github.com/ashokshau">Ashok Shau</a> </p>
