⚡️ ᴀᴅᴠᴀɴᴄᴇᴅ ᴍᴜ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.
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 ❄️)
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.
Below are detailed tutorials for deploying SmartXMusic on various platforms, including enhanced instructions for Docker, Docker Compose, Heroku, and Localhost/VPS setups.
- Create a Heroku Account: Sign up at heroku.com if you don’t have an account.
- Install Heroku CLI: Download and install the Heroku CLI from heroku.com.
- Log in to Heroku:
heroku login
- Fork the Repository: Fork SmartXMusic to your GitHub account.
- 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.
- Enable Dynos:
- Go to the "Resources" tab in your Heroku app dashboard.
- Enable the
workerdyno to start the bot.
- Monitor Logs:
heroku logs --tail
- 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
This method is ideal for users with access to a Linux-based server or local machine.
- A Linux-based system (Ubuntu recommended).
- Basic knowledge of terminal commands.
- Internet connection for downloading dependencies.
- Update and Upgrade System:
sudo apt-get update && sudo apt-get upgrade -y - Install FFmpeg and Python:
sudo apt-get install python3-pip ffmpeg -y
- Install pip:
sudo pip3 install -U pip
- 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
- Clone the Repository:
git clone https://github.com/abirxdhack/SmartXMusic && cd SmartXMusic
- Install Python Requirements:
pip3 install -U -r requirements.txt
- Set Up Environment Variables:
- Copy the sample environment file:
cp sample.env .env
- Edit the
.envfile:Fill in the mandatory variables (nano .env
API_ID,API_HASH,BOT_TOKEN,SESSION_STRING) and any optional ones. Save and exit (Ctrl+O,Enter,Ctrl+X).
- Copy the sample environment file:
- Install tmux for Persistent Sessions:
sudo apt install tmux && tmux - Run the Bot:
bash start
- Detach from tmux:
- Press
Ctrl+B, thenDto detach and keep the bot running. - To reattach later:
tmux attach
- Press
- FFmpeg Errors: Ensure FFmpeg is installed correctly (
ffmpeg -version). - Python Dependency Issues: Run
pip3 install -U -r requirements.txtagain. - Port Conflicts: Ensure no other service is using the bot’s default port.
- Session String Expired: Generate a new session string and update
.env.
Docker Compose simplifies deployment by managing dependencies in a containerized environment. This is the most reliable method for consistent performance across systems.
- A system with Docker and Docker Compose installed.
- Basic knowledge of Docker commands.
- Install Docker on Ubuntu:
Verify installation:
sudo apt-get update sudo apt-get install -y docker.io sudo systemctl start docker sudo systemctl enable dockerdocker --version
- Install Docker Compose:
Verify installation:
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-composedocker-compose --version
- Add User to Docker Group (to run Docker without sudo):
Log out and log back in for the change to take effect.
sudo usermod -aG docker $USER
- Clone the Repository:
git clone https://github.com/abirxdhack/SmartXMusic && cd SmartXMusic
- Set Up Environment Variables:
- Copy the sample environment file:
cp sample.env .env
- Edit the
.envfile:Add mandatory variables (nano .env
API_ID,API_HASH,BOT_TOKEN,SESSION_STRING) and optional ones. Save and exit.
- Copy the sample environment file:
- Build and Start the Bot:
This command builds the Docker image and starts the bot in a container.
docker compose up --build --remove-orphans
- Run in Detached Mode (optional):
docker compose up -d
- View Logs:
docker compose logs -f
- Stop the Bot:
docker compose down
- Docker Not Running: Ensure Docker is running (
sudo systemctl status docker). - Permission Denied: Run commands with
sudoor add your user to the Docker group. - Image Build Fails: Check for errors in
Dockerfileordocker-compose.yml. Ensure all dependencies are listed inrequirements.txt. - Container Exits Immediately: Verify that all mandatory variables are set in
.env. - Port Conflicts: Modify
docker-compose.ymlto use a different port if needed.
- Isolated Environment: Prevents dependency conflicts.
- Easy Scaling: Adjust resources in
docker-compose.yml. - Portability: Run the same setup on any system with Docker.
- Special thanks to ᴛᴇᴀᴍ ʏᴜᴋᴋɪ for ʏᴜᴋᴋɪ ᴍᴜsɪᴄ ʙᴏᴛ
- Special thanks to ˹ᴛʜᴇ ғᴧʟʟᴇɴ ᴧssᴏᴄɪᴀᴛɪᴏɴ˼ for AnonXMusic 🌐

