Skip to content

AshokShau/TgMusicBot

Repository files navigation

🎵 TGMusic Bot (Go)

Written in Go Docker License Stars

A high-performance, feature-rich Telegram Music Bot written in Go.
Built with gotdbot, ntgcalls, and mongo-driver.

Heroku Deploy


✨ 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

  1. Clone the repository

    git clone https://github.com/AshokShau/TgMusicBot.git
    cd TgMusicBot
  2. Setup ntgcalls & gotdbot Download the required C++ libraries.

    go run setup_ntgcalls.go
    go run github.com/AshokShau/gotdbot/scripts/tools@latest
  3. Configure Environment Copy the sample file and edit it.

    cp sample.env .env
    vi .env
  4. Build and Run

    go build -o app .
    ./app
  5. Run in Background

    • Quick Start: Use screen or tmux.
    • Production: Use systemd. See installation.md for details.

For detailed instructions, see installation.md.

Click to reveal Docker Setup Instructions
  1. Clone and Config

    git clone https://github.com/AshokShau/TgMusicBot.git
    cd TgMusicBot
    cp sample.env .env
    # Edit .env with your credentials
  2. Run with Docker Compose

    docker compose up -d --build
Click to reveal Heroku Setup Instructions
  1. Click the Deploy to Heroku button above.
  2. Fill in the required environment variables (API_ID, API_HASH, STRING1, etc.).
  3. Deploy the app.
  4. Important: Enable the worker dyno and disable the web dyno 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


Made with ❤️ by Ashok Shau

About

Telegram Group Calls Streaming bot with some useful features, written in Go with Gotdbot and NTgcalls. Supporting platforms like Youtube, Spotify, AppleMusic and M3u8 Link

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages