π΅ TGMusic Bot (Go)
A high-performance, feature-rich Telegram Music Bot written in Go.
Built with gotdbot, ntgcalls, and mongo-driver.
β¨ 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
Click to reveal Local Setup Instructions
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.
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.
βοΈ Configuration
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 |
YouTube cookies URL via https://batbin.me | β |
π€ Commands
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.
β€οΈ Donate
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
π¬ Links
- π¦ Repo: TgMusicBot on GitHub
- π¬ Support: Telegram Group
- π Old version: TgMusicBot (Python)
Made with β€οΈ by Ashok Shau