Skip to content
Β 
Β 

Latest commit

Β 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

[⚑] π‡π€π‚πŠπ„π‘ 𝐗 πŒπ”π’πˆπ‚ [⚑]

𝐀 ππŽπ–π„π‘π…π”π‹ π‡π€π‚πŠπ„π‘ 𝐗 πŒπ”π’πˆπ‚ ππŽπ“

⭐️ Thanks to everyone for using π‡π€π‚πŠπ„π‘ 𝐗 πŒπ”π’πˆπ‚!


πŸ“‹ Table of Contents


πŸ›  Requirements

Before deploying, make sure you have:

  1. API_ID & API_HASH β€” Obtain from my.telegram.org.
  2. BOT_TOKEN β€” Obtain from @BotFather.
  3. MONGO_DB_URI β€” MongoDB database connection string from MongoDB Atlas.
  4. STRING_SESSION β€” Pyrogram v2 String Session (generate using string generator bot or script).
  5. OWNER_ID β€” Your Telegram User ID (get from @MissRose_bot using /id).
  6. LOGGER_ID β€” Telegram Group/Channel ID (with -100...) where bot logs events.

🟣 Deploy on Render (Free)

You can easily deploy Hacker-X-Music to Render in 1-Click:

β”€γ€Œ πƒπ„ππ‹πŽπ˜ 𝐎𝐍 𝐑𝐄𝐍𝐃𝐄𝐑 」─

Deploy to Render

Steps to Deploy on Render:

  1. Click the Deploy to Render button above (or open dashboard.render.com).
  2. Sign in or create a Render account.
  3. Fill in your environment variables (API_ID, API_HASH, BOT_TOKEN, OWNER_ID, MONGO_DB_URI, LOGGER_ID, STRING_SESSION).
  4. Click Apply / Create Web Service.
  5. Render will automatically build the Docker container and start your bot!

Tip

Keep Render 24/7 Alive (No Sleep Mode): Render free web services go to sleep after 15 minutes of inactivity. To keep your bot running 24/7:

  1. Copy your Render web service URL (e.g., https://hacker-x-music.onrender.com).
  2. Open UptimeRobot.com (Free).
  3. Add a new HTTP(s) monitor pointing to your Render URL with a 5-minute interval.

πŸš€ Deploy on VPS (Recommended)

Method 1: Manual Setup using screen (Recommended)

Step 1: Connect to your VPS and Update Packages

Open your terminal (PuTTY / SSH) and run:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies (Python, Pip, FFmpeg, Git, Screen)

sudo apt install git python3 python3-pip ffmpeg screen -y

Step 3: Clone the Repository

git clone https://github.com/bindplant123/Hacker-X-Music.git
cd Hacker-X-Music

Step 4: Install Python Requirements

pip3 install -U pip
pip3 install -U -r requirements.txt

Step 5: Configure Environment Variables

Create and edit your .env file:

cp sample.env .env
nano .env

Fill in your details:

API_ID=1234567
API_HASH=your_api_hash_here
BOT_TOKEN=your_bot_token_here
LOGGER_ID=-1001234567890
MONGO_DB_URI=your_mongodb_connection_string
OWNER_ID=your_telegram_id
STRING_SESSION=your_pyrogram_string_session

Tip: Save and exit nano by pressing CTRL + O, then Enter, then CTRL + X.

Step 6: Start Bot in Background (24/7 Online)

Create a new screen session:

screen -S musicbot

Start the bot inside the screen:

python3 -m AnonXMusic
  • To Detach screen (keep running in background): Press CTRL + A then D.
  • To Reattach screen (check live logs): Run screen -r musicbot.
  • To Stop the bot: Inside screen, press CTRL + C.

Method 2: Quick Setup using setup Script

  1. Update and install git:
    sudo apt update && sudo apt install git screen -y
  2. Clone & run installer:
    git clone https://github.com/bindplant123/Hacker-X-Music.git
    cd Hacker-X-Music
    bash setup
  3. Enter your API_ID, API_HASH, BOT_TOKEN, OWNER_ID, MONGO_DB_URI, LOGGER_ID, and STRING_SESSION when prompted.
  4. Run the bot:
    screen -S musicbot
    bash start
    (Press CTRL + A then D to detach)

Method 3: Systemd Service (Auto-Restart & Boot)

To ensure your bot restarts automatically if VPS reboots or if it crashes:

  1. Create a systemd service file:
    sudo nano /etc/systemd/system/musicbot.service
  2. Paste the following configuration:
    [Unit]
    Description=Hacker-X-Music Telegram Bot
    After=network.target
    
    [Service]
    Type=simple
    User=root
    WorkingDirectory=/root/Hacker-X-Music
    ExecStart=/usr/bin/python3 -m AnonXMusic
    Restart=always
    RestartSec=5
    
    [Install]
    WantedBy=multi-user.target
  3. Reload daemon and start service:
    sudo systemctl daemon-reload
    sudo systemctl enable musicbot
    sudo systemctl start musicbot
  4. Service Management Commands:
    • Check status / logs: sudo systemctl status musicbot
    • Restart bot: sudo systemctl restart musicbot
    • Stop bot: sudo systemctl stop musicbot
    • View live logs: journalctl -u musicbot -f

Method 4: Deploy with Docker

  1. Install Docker:
    sudo apt update && sudo apt install docker.io -y
  2. Clone repository and configure .env:
    git clone https://github.com/bindplant123/Hacker-X-Music.git
    cd Hacker-X-Music
    cp sample.env .env
    nano .env
  3. Build and Run Docker Container:
    docker build -t hacker-x-music .
    docker run -d --name musicbot --restart always --env-file .env hacker-x-music
  4. Manage Docker Container:
    • View logs: docker logs -f musicbot
    • Restart: docker restart musicbot
    • Stop: docker stop musicbot

βš™οΈ Environment Variables Setup

Variable Description Mandatory
API_ID Telegram API ID from my.telegram.org Yes
API_HASH Telegram API HASH from my.telegram.org Yes
BOT_TOKEN Bot token from @BotFather Yes
OWNER_ID Telegram user ID of bot owner Yes
MONGO_DB_URI MongoDB database URI string Yes
LOGGER_ID Log channel/group ID (starts with -100) Yes
STRING_SESSION Pyrogram v2 string session for assistant account Yes
COOKIES_DIR Directory containing cookies*.txt pool (Default: .) No
YOUTUBE_API_KEY Google Cloud YouTube Data API v3 key (Faster search) No

☁️ Deploy on Heroku

β”€γ€Œ πƒπ„ππ‹πŽπ˜ 𝐎𝐍 π‡π„π‘πŽπŠπ” 」─

Click to Deploy to Heroku

Deploy


πŸ’¬ Support

Join Support & Updates Channel

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages