Skip to content

David15935/Unmusic_Bastard

Repository files navigation

Unmusic_Bastard Telegram Music Bot

Telegram music bot for searching, playing, downloading, lyrics, trending songs, queue, playlists, resume uploads, and inline search.

Latest Commit

  • Commit: 5955e26
  • Message: fix_inline_help_jsruntime
  • Includes:
  • Fixed inline search flow and result payload
  • Added /help with detailed examples
  • Fixed yt-dlp js_runtimes format error

Features

  • MP3 delivery from YouTube search/url
  • /search with paginated buttons (Play/Queue)
  • /download and /play
  • /lyrics (Genius + fallback)
  • /info
  • /trending
  • Queue: /queue, /skip
  • Playlists: create/list/add/show/play/remove/removeitem
  • /resume for failed/partial uploads
  • Inline mode: @your_bot_username <song or artist>

Commands

  • /start
  • /help
  • /play <song|artist|url>
  • /search <song|artist>
  • /download <song|artist|url>
  • /lyrics <song and artist>
  • /info <song|artist|url>
  • /trending
  • /queue
  • /skip
  • /playlist <subcommand>
  • /resume

Project Structure

Unmusic_Bastard/
  bot/
    main.py
    handlers.py
    player.py
    lyrics.py
    trending.py
    queue.py
  downloads/
  covers/
  logs/
  .env
  requirements.txt
  docker-compose.yml

Install

  1. Clone repo:
git clone https://github.com/David15935/Unmusic_Bastard.git
cd Unmusic_Bastard
  1. Create venv and install dependencies:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
  1. Install FFmpeg (Windows):
winget install --id Gyan.FFmpeg -e --source winget --accept-source-agreements --accept-package-agreements
  1. Install Node.js (recommended for yt-dlp JS extraction):
winget install -e --id OpenJS.NodeJS.LTS --source winget --accept-source-agreements --accept-package-agreements
  1. Create .env:
BOT_TOKEN=your_telegram_bot_token
GENIUS_TOKEN=your_genius_api_token

Run

.venv\Scripts\python -m bot.main

Deploy Now (Railway, Recommended)

  1. Push this repo to GitHub (already done).
  2. Go to Railway dashboard and create a new project from GitHub repo David15935/Unmusic_Bastard.
  3. Railway will detect Dockerfile and build automatically.
  4. Add environment variables in Railway service:
  • BOT_TOKEN=your_telegram_bot_token
  • GENIUS_TOKEN=your_genius_api_token
  1. Deploy the service.
  2. Verify logs show Starting Music Bot... and Application started.

Notes:

  • This bot is a background worker (long polling), not a web server.
  • Keep only one active bot instance to avoid Telegram polling conflicts.

How To Use

  1. Open bot chat and run:
/start
/help
  1. Quick examples:
/play burna boy last last
/search adele hello
/download https://www.youtube.com/watch?v=dQw4w9WgXcQ
/lyrics love nwantiti ckay
/info calm down rema
/trending
  1. Inline mode usage:
  • Enable inline mode in BotFather (/setinline)
  • In any chat type:
@your_bot_username asake lonely at the top
  1. If upload breaks on long file:
/resume

Optional: Local Telegram Bot API (for larger upload capability)

  1. Install Docker Desktop.
  2. Configure local-bot-api.env from local-bot-api.env.example.
  3. Start:
docker compose up -d
  1. Add to .env:
LOCAL_BOT_API_URL=http://localhost:8081/bot
LOCAL_BOT_API_FILE_URL=http://localhost:8081/file/bot

Notes

  • Telegram cloud Bot API has upload limits per file.
  • This bot can split large files and send in parts.
  • For very high concurrency, use VPS + webhook + queue workers.

About

A Telegram Music bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors