Skip to content

Telegram Group Calls Streaming bot with some useful features, written in Python with Py-Tgcalls. Supporting platforms like YouTube, Spotify, AppleMusic, Soundcloud, JioSaavn and more.

License

Notifications You must be signed in to change notification settings

AshokShau/TgMusicBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 TgMusicBot – Telegram Music Bot Stars

A high-performance Telegram Voice Chat Bot for streaming music from YouTube, Spotify, JioSaavn, and more. Built with Python, Py-Tgcalls, and PyTdBot.

Stars Forks Last Commit Repo Size Python License Issues PRs CI Status

thumbnail

πŸ”₯ Live Bot: @FallenBeatzBot


✨ Key Features

Feature Description
🎧 Multi-Platform Support YouTube, Spotify, Apple Music, SoundCloud, JioSaavn
πŸ“œ Playlist Management Queue system with auto-play
πŸŽ›οΈ Advanced Controls Volume, loop, seek, skip, pause/resume
🌐 Multi-Language English, Hindi, Spanish, Arabic support
⚑ Low Latency Optimized with PyTgCalls
🐳 Docker Ready One-click deployment
πŸ”’ Anti-Ban Cookie & API-based authentication

πŸš€ Quick Deploy

Deploy on Heroku


πŸ“¦ Installation Methods

πŸ“Œ Docker Installation (Recommended) (Click to expand)

🐳 Prerequisites

  1. Install Docker:

πŸš€ Quick Setup

  1. Clone the repository:
    git clone https://github.com/AshokShau/TgMusicBot.git && cd TgMusicBot

πŸ”§ Configuration

  1. Prepare environment file:

    cp sample.env .env
  2. Edit configuration (choose one method):

    • Beginner-friendly (nano):

      nano .env
      • Edit values
      • Save: Ctrl+O β†’ Enter β†’ Ctrl+X
    • Advanced (vim):

      vi .env
      • Press i to edit
      • Save: Esc β†’ :wq β†’ Enter

πŸ—οΈ Build & Run

  1. Build Docker image:

    docker build -t tgmusicbot .
  2. Run container (auto-restarts on crash/reboot):

    docker run -d --name tgmusicbot --env-file .env --restart unless-stopped tgmusicbot

πŸ” Monitoring

  1. Check logs:
    docker logs -f tgmusicbot
    (Exit with Ctrl+C)

βš™οΈ Management Commands

  • Stop container:

    docker stop tgmusicbot
  • Start container:

    docker start tgmusicbot
  • Update the bot:

    docker stop tgmusicbot
    docker rm tgmusicbot
    git pull origin master
    docker build -t tgmusicbot .
    docker run -d --name tgmusicbot --env-file .env --restart unless-stopped tgmusicbot
πŸ“Œ Step-by-Step Installation Guide (Click to Expand)

πŸ› οΈ System Preparation

  1. Update your system (Recommended):

    sudo apt-get update && sudo apt-get upgrade -y
  2. Install essential tools:

    sudo apt-get install git python3-pip ffmpeg tmux -y

⚑ Quick Setup

  1. Install UV package manager:

    pip3 install uv
  2. Clone the repository:

    git clone https://github.com/AshokShau/TgMusicBot.git && cd TgMusicBot

🐍 Python Environment

  1. Create virtual environment:

    uv venv
  2. Activate environment:

    • Linux/Mac: source .venv/bin/activate
    • Windows (PowerShell): .\.venv\Scripts\activate
  3. Install dependencies:

    uv pip install -e .

πŸ” Configuration

  1. Setup environment file:

    cp sample.env .env
  2. Edit configuration (Choose one method):

    • For beginners (nano editor):

      nano .env
      • Edit values
      • Save: Ctrl+O β†’ Enter β†’ Ctrl+X
    • For advanced users (vim):

      vi .env
      • Press i to edit
      • Save: Esc β†’ :wq β†’ Enter

πŸ€– Running the Bot

  1. Start in tmux session (keeps running after logout):

    tmux new -s musicbot
    tgmusic

    Tmux Cheatsheet:

    • Detach: Ctrl+B then D
    • Reattach: tmux attach -t musicbot
    • Kill session: tmux kill-session -t musicbot

πŸ”„ After Updates

To restart the bot:

tmux attach -t musicbot
# Kill with Ctrl+C
tgmusic

βš™οΈ Configuration Guide

πŸ”‘ Required Variables (Click to expand)
Variable Description How to Get
API_ID Telegram App ID my.telegram.org
API_HASH Telegram App Hash my.telegram.org
TOKEN Bot Token @BotFather
STRING1-10 Pyrogram Sessions (Only 1 Required) @StringFatherBot
MONGO_URI MongoDB Connection MongoDB Atlas
OWNER_ID User ID of the bot owner @GuardxRobot and type /id
LOGGER_ID Group ID of the bot logger Add @GuardxRobot to the group and type /id

Optional Variables

Variable Description How to Get
API_URL API URL Start @FallenApiBot
API_KEY API Key Start @FallenApiBot and type /apikey
MIN_MEMBER_COUNT Minimum number of members required to use the bot Default: 50
PROXY Proxy URL for the bot if you want to use it for yt-dlp (Optional) Any online service
COOKIES_URL Cookies URL for the bot Cookie Guide
DEFAULT_SERVICE Default search platform (Options: youtube, spotify, jiosaavn) Default: youtube
SUPPORT_GROUP Telegram Group Link Default: https://t.me/GuardxSupport
SUPPORT_CHANNEL Telegram Channel Link Default: https://t.me/FallenProjects
AUTO_LEAVE Leave all chats for all userbot clients Default: True
START_IMG Start Image URL Default: IMG
DEVS User ID of the bot owner @GuardxRobot and type /id: e.g. 5938660179, 5956803759

πŸͺ Avoiding Bans

Option 1: Premium API

API_URL=https://tgmusic.fallenapi.fun
API_KEY=your-secret-key

πŸ“Œ Get keys: Contact @AshokShau or @FallenApiBot

Option 2: Cookies

Cookie Guide


πŸ€– Bot Commands

Command Description
/play [query] Play music from supported platforms
/skip Skip current track
/pause / /resume Control playback
/volume [1-200] Adjust volume
/queue Show upcoming tracks
/loop Enable/disable loop

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Note: Minor typo fixes will be closed. Focus on meaningful contributions.


πŸ“œ License

AGPL-3.0 Β© AshokShau.
License


πŸ’– Support

Help keep this project alive!
Telegram
Donate


πŸ”— Connect

GitHub
Channel


About

Telegram Group Calls Streaming bot with some useful features, written in Python with Py-Tgcalls. Supporting platforms like YouTube, Spotify, AppleMusic, Soundcloud, JioSaavn and more.

Topics

Resources

License

Stars

Watchers

Forks

Languages