Skip to content

Welcome to SmartXMusic, a redefined Telegram Music Bot that provides advanced tools for managing group music sessions

Notifications You must be signed in to change notification settings

abirxdhack/SmartXMusic

Repository files navigation

──「 💫 ᴀʙɪʀ ダ sᴍᴀʀᴛ✘ᴍᴜsɪᴄ 💫 」──

Stars License Python


📼   𓆩 ˹sᴍᴀʀᴛ✘ᴍᴜsɪᴄ ✘ ғᴇᴀᴛᴜʀᴇs˼ 𓆪   📼

⚡️ ᴀᴅᴠᴀɴᴄᴇᴅ ᴍᴜsɪᴄ ʙᴏᴛ ғᴏʀ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘs ᴜʟᴛɪᴍᴀᴛᴇ ᴇxᴘᴇʀɪᴇɴᴄᴇ 💌

Lag-Free Music Streaming: High-quality audio with minimal latency.
Advanced Neon Welcome Messages: Customizable, vibrant group welcomes.
Lightweight but Powerful Performance: Optimized for efficiency and speed.
Real-Time Performance Optimization: Dynamic resource management for uninterrupted streaming.
No Promotional Content or Unwanted Shits: Clean, ad-free experience.
Easy-to-Use Interface for Beginners: Intuitive commands for all users.


─「 📖 ɪɴᴛʀᴏᴅᴜᴄᴛɪᴏɴ 」─

Welcome to SmartXMusic, a redefined Telegram Music Bot that provides advanced tools for managing group music sessions. This bot is a Fork of the popular AnonXMusic, enhanced with additional features and bug fixes for a seamless user experience.

With SmartXMusic, you can enjoy:
💥 Improved Stability: Say goodbye to crashes and loop errors!
⭐️ Enhanced Features: Optimized performance and real-time updates.
🌐 User-Friendly Interface: Simple, intuitive, and lightweight.

Whether you're hosting music sessions or managing a Telegram group, SmartXMusic is your ultimate companion for uninterrupted and advanced music streaming.


─「 🔧 ᴠᴀʀɪᴀʙʟᴇs 」─

Mandatory Variables:

To deploy and run the bot, you must set the following environment variables:

  • API_ID: Telegram API ID (get it from my.telegram.org).
  • API_HASH: Telegram API Hash (get it from my.telegram.org).
  • BOT_TOKEN: Bot token from BotFather.
  • SESSION_STRING: Pyrogram session string for the bot.
    (Use only one session string and one user client for simplicity and reliability ❄️)

Recommended Variables:

These optional variables enhance the bot's functionality:

  • LOG_GROUP_ID: Group ID for logging events.
  • MONGO_DB_URI: MongoDB connection string for database support.
  • OWNER_ID: Telegram User ID of the bot owner for admin privileges.
  • HEROKU_APP_NAME: Set this if deploying on Heroku.
  • HEROKU_API_KEY: Heroku API key for managing dynos.

For a complete list of variables and their descriptions, refer to the sample.env file.


─「 DEPLOYMENT OPTIONS 」─

Below are detailed tutorials for deploying SmartXMusic on various platforms, including enhanced instructions for Docker, Docker Compose, Heroku, and Localhost/VPS setups.

Deploy on Heroku

Heroku Deployment Steps:

  1. Create a Heroku Account: Sign up at heroku.com if you don’t have an account.
  2. Install Heroku CLI: Download and install the Heroku CLI from heroku.com.
  3. Log in to Heroku:
    heroku login
  4. Fork the Repository: Fork SmartXMusic to your GitHub account.
  5. Deploy via Heroku Dashboard:
    • Click the "Deploy to Heroku" button above.
    • Enter your app name and fill in the mandatory variables (API_ID, API_HASH, BOT_TOKEN, SESSION_STRING).
    • Optionally, add recommended variables like LOG_GROUP_ID, MONGO_DB_URI, etc.
  6. Enable Dynos:
    • Go to the "Resources" tab in your Heroku app dashboard.
    • Enable the worker dyno to start the bot.
  7. Monitor Logs:
    heroku logs --tail

Troubleshooting Heroku:

  • Dyno Crashes: Ensure all mandatory variables are correctly set.
  • Quota Limits: Heroku free tier has limited hours; consider upgrading to a paid plan for continuous uptime.
  • Session String Issues: Generate a new session string using Our Safe Bot @ItsSmartToolBot And /pyro Command And Then Follow Steps

Deploy on Localhost/VPS

This method is ideal for users with access to a Linux-based server or local machine.

Prerequisites:

  • A Linux-based system (Ubuntu recommended).
  • Basic knowledge of terminal commands.
  • Internet connection for downloading dependencies.

Step-by-Step Setup:

  1. Update and Upgrade System:
    sudo apt-get update && sudo apt-get upgrade -y
  2. Install FFmpeg and Python:
    sudo apt-get install python3-pip ffmpeg -y
  3. Install pip:
    sudo pip3 install -U pip
  4. Install Node.js:
    curl -fssL https://deb.nodesource.com/setup_19.x | sudo -E bash - && sudo apt-get install nodejs -y && npm i -g npm
  5. Clone the Repository:
    git clone https://github.com/abirxdhack/SmartXMusic && cd SmartXMusic
  6. Install Python Requirements:
    pip3 install -U -r requirements.txt
  7. Set Up Environment Variables:
    • Copy the sample environment file:
      cp sample.env .env
    • Edit the .env file:
      nano .env
      Fill in the mandatory variables (API_ID, API_HASH, BOT_TOKEN, SESSION_STRING) and any optional ones. Save and exit (Ctrl+O, Enter, Ctrl+X).
  8. Install tmux for Persistent Sessions:
    sudo apt install tmux && tmux
  9. Run the Bot:
    bash start
  10. Detach from tmux:
    • Press Ctrl+B, then D to detach and keep the bot running.
    • To reattach later:
      tmux attach

Troubleshooting Localhost/VPS:

  • FFmpeg Errors: Ensure FFmpeg is installed correctly (ffmpeg -version).
  • Python Dependency Issues: Run pip3 install -U -r requirements.txt again.
  • Port Conflicts: Ensure no other service is using the bot’s default port.
  • Session String Expired: Generate a new session string and update .env.

Deploy with Docker Compose

Docker Compose simplifies deployment by managing dependencies in a containerized environment. This is the most reliable method for consistent performance across systems.

Prerequisites:

  • A system with Docker and Docker Compose installed.
  • Basic knowledge of Docker commands.

Install Docker and Docker Compose:

  1. Install Docker on Ubuntu:
    sudo apt-get update
    sudo apt-get install -y docker.io
    sudo systemctl start docker
    sudo systemctl enable docker
    Verify installation:
    docker --version
  2. Install Docker Compose:
    sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    Verify installation:
    docker-compose --version
  3. Add User to Docker Group (to run Docker without sudo):
    sudo usermod -aG docker $USER
    Log out and log back in for the change to take effect.

Docker Compose Deployment Steps:

  1. Clone the Repository:
    git clone https://github.com/abirxdhack/SmartXMusic && cd SmartXMusic
  2. Set Up Environment Variables:
    • Copy the sample environment file:
      cp sample.env .env
    • Edit the .env file:
      nano .env
      Add mandatory variables (API_ID, API_HASH, BOT_TOKEN, SESSION_STRING) and optional ones. Save and exit.
  3. Build and Start the Bot:
    docker compose up --build --remove-orphans
    This command builds the Docker image and starts the bot in a container.
  4. Run in Detached Mode (optional):
    docker compose up -d
  5. View Logs:
    docker compose logs -f
  6. Stop the Bot:
    docker compose down

Troubleshooting Docker Compose:

  • Docker Not Running: Ensure Docker is running (sudo systemctl status docker).
  • Permission Denied: Run commands with sudo or add your user to the Docker group.
  • Image Build Fails: Check for errors in Dockerfile or docker-compose.yml. Ensure all dependencies are listed in requirements.txt.
  • Container Exits Immediately: Verify that all mandatory variables are set in .env.
  • Port Conflicts: Modify docker-compose.yml to use a different port if needed.

Advantages of Docker Compose:

  • Isolated Environment: Prevents dependency conflicts.
  • Easy Scaling: Adjust resources in docker-compose.yml.
  • Portability: Run the same setup on any system with Docker.

─「 SUPPORT 」─


Special Thanks

About

Welcome to SmartXMusic, a redefined Telegram Music Bot that provides advanced tools for managing group music sessions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages