Skip to content

TheSmartDevs/SmartUtilBot

Repository files navigation

🚀 SmartUtilBot - The Ultimate Telegram Toolkit

SmartUtilBot Logo

Version Python MongoDB

Stars Forks Watchers

🔧 The all-in-one Telegram toolkit for seamless education, AI, downloads, and more! ⚡



🌟 Click to Expand - Key Features

Premium Features Overview:

🎯 All In One Telegram Bot With 3 Mixed Libraries
Complete toolkit built with Aiogram, Pyrofork & Telethon
🔥 Built With Best & Custom Apis & Functions
Powered by A360API and custom-built functions
🔌 Best Easy Plug And Play
Minimal configuration, maximum functionality
High Performance And Best Optimized
Built for speed and efficiency
🚀 Fully Asyncio & Nonblock I/O Operation Handle
Advanced asynchronous operations
Works Blazy Fast Like Thunder Rest Depends On Host
Lightning-fast performance
🎨 Best Ui Ux Themed
Beautiful and intuitive interface
👑 Best Admin Utilities
Comprehensive administrative tools
🛠️ Superb Customizeable
Highly configurable to your needs
📦 Built With Custom Python Libraries
SmartFaker and SmartBinDb integration

🛠️ Technical Stack & Architecture

Core Technologies

Component Technology Badge Purpose
Language Python 🐍 Python Core Development
Bot Libraries Aiogram Aiogram Modern Bot Framework
Pyrofork Pyrofork Telegram MTProto API
Telethon Telethon Telegram Client Library
Database MongoDB 🗄️ MongoDB NoSQL Database
API Engine A360API A360API Custom API Backend

Custom Architecture Components

🎯 Core Custom Features

📋 SmartButtons      # Custom button builder with dataclass
🛡️ SmartSecurity     # Advanced security layer  
🔰 SmartDefender     # Comprehensive defense system
🛡️ SmartShield       # 3 decorator wrapper protection
👥 SmartUsers        # User database handler

📦 Custom Modules & Wrappers

🗑️ Custom Message Deletion Wrapper    # Efficient message managementNew Task Decorator                 # Asynchronous task handling  
📝 Custom Logger Module               # Comprehensive logging
📊 Custom Progress Bar Module         # Real-time progress tracking
⚠️ Custom Admin Error Notify          # Instant error reporting

🌐 Custom Libraries Integration

📦 PyPI Published Libraries

SmartFaker Version
SmartFaker
pypi.org/project/smartfaker
Advanced fake data generation library
SmartBinDb Version
SmartBinDb
pypi.org/project/smartbindb
Intelligent binary database handling

🔗 Related Project - A360API

Repository: github.com/abirxdhack/A360API

  • 🛠️ Built with Python FastAPI
  • Pyrofork integration
  • 📡 Telethon support
  • 🚀 High-performance API backend for SmartUtilBot

📋 Environment Configuration

🔑 Mandatory Variables

Variable Description Required
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
DEVELOPER_USER_ID Your Telegram User ID ✅ Yes
MONGO_URL MongoDB Connection URL ✅ Yes
DATABASE_URL Database URL ✅ Yes
A360APIBASEURL A360 API Base URL ✅ Yes

⚙️ Optional Variables

🤖 AI & Machine Learning APIs
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
REPLICATE_API_TOKEN=YOUR_REPLICATE_API_TOKEN  
GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY
GROQ_API_KEY=YOUR_GROQ_API_KEY
GROQ_API_URL=https://api.groq.com/openai/v1/chat/completions
MODEL_NAME=gemini-2.0-flash
TEXT_MODEL=deepseek-r1-distill-llama-70b
🔐 Session & Security
SESSION_STRING=YOUR_SESSION_STRING
🛠️ Utility APIs
TRANS_API_KEY=YOUR_TRANS_API_KEY
OCR_API_KEY=YOUR_OCR_API_KEY  
DOMAIN_API_KEY=YOUR_DOMAIN_API_KEY
DOMAIN_API_URL=https://www.whoisxmlapi.com/whoisserver/WhoisService
IPINFO_API_TOKEN=YOUR_IPINFO_API_TOKEN
WEB_SS_KEY=YOUR_WEB_SS_KEY
IMAGE_UPLOAD_KEY=YOUR_IMAGE_UPLOAD_KEY
⚡ Rate Limits & Performance
CC_SCRAPPER_LIMIT=5000
SUDO_CCSCR_LIMIT=10000
MULTI_CCSCR_LIMIT=2000
MAIL_SCR_LIMIT=10000
SUDO_MAILSCR_LIMIT=15000
CC_GEN_LIMIT=2000
MULTI_CCGEN_LIMIT=5000
DOMAIN_CHK_LIMIT=20
PROXY_CHECK_LIMIT=20
📱 Media & Content Configuration
MAX_TXT_SIZE=15728640               # 15MB
MAX_VIDEO_SIZE=2147483648           # 2GB
IMGAI_SIZE_LIMIT=5242880           # 5MB
VIDEO_RESOLUTION=1280x720
YT_COOKIES_PATH=bot/SmartCookies/SmartUtilBot.txt
📢 Channel & System Configuration
UPDATE_CHANNEL_URL=t.me/TheSmartDev
LOG_CHANNEL_ID=-1002735511721
COMMAND_PREFIX=!|.|#|,|/

🚀 Deployment Methods

🖥️ VPS Deployment

Quick Setup

# 📂 Clone Repository
git clone https://github.com/TheSmartDevs/SmartUtilBot
cd SmartUtilBot

# 📦 Install Dependencies  
pip3 install -r requirements.txt

# 🎬 Install FFmpeg (Required for media processing)
sudo apt update
sudo apt install ffmpeg
# ⚠️ Note: FFmpeg cannot be installed via pip

# 🚀 Run the Bot
python3 -m bot

Background Deployment with Screen

# 📺 Install Screen
apt install screen

# 🖥️ Create Screen Session
screen -S SmartUtilBot

# 🚀 Run in Background
python3 -m bot

# 🔄 Detach: Ctrl+A then D
# 🔌 Reattach: screen -r SmartUtilBot

🐳 Docker Deployment

# 🚀 Deploy with Docker Compose
docker compose up --build --remove-orphans

# ⏹️ Stop the Bot
docker compose down

🌐 Heroku Deployment

Deploy to Heroku

Click the deploy button above for one-click Heroku deployment


🔧 Session String Generation

🌟 Handling Scrapper Utils Errors with SESSION_STRING 💫

⚠️ Important: Avoid common user client errors by generating a fresh SESSION_STRING using @ISmartToolBot 🌐

Quick Steps to Generate SESSION_STRING

Step Action Details
1️⃣ Visit Bot 🚀 Go to @ISmartToolBot
2️⃣ Start Generation 💬 Send /pyro to start pyrofork session generation
3️⃣ API ID 🆔 Enter your API ID from my.telegram.org
4️⃣ API Hash 🔐 Enter your API HASH
5️⃣ Phone Number 📞 Input your phone number in international format (e.g., +880...) 🇧🇩
6️⃣ OTP Code ✅ Send the OTP you receive (e.g., AB2 BC4 CD5 EF6 GH6) — the bot auto-extracts it as 24566
7️⃣ Get Session 💾 Check Saved Messages for your SESSION_STRING
8️⃣ Configure 🛠️ Add it to your .env or config.py

❄️ Important Notice: Avoid Frequent Restarts ⚠️

Frequent restarts using user accounts can trigger Telegram's security system 👀

💥 You Might Face:

• 🚫 Forced logout of your account
• ❌ 406 AUTH_KEY_DUPLICATED error
⚠️ Temporary bans or session invalidation

⭐️ To Stay Safe:

• Minimize restarts
• Always use a fresh session if errors appear
• Prefer bot accounts for heavy tasks

Pro Tips

  • 🔄 Fresh sessions fix 90% of scraper issues
  • 🔐 Never share your SESSION_STRING publicly
  • 📁 Use .env for secure config management

🍪 YouTube Download Configuration

Handling YouTube Download Errors with Cookies 🍪

To avoid errors related to YouTube sign-in requirements or bot protection, using a cookie file is highly recommended.

Steps to Export and Use Cookies 👀

Step Action Description
1️⃣ Create Chrome Profile 🖥️ Create a new Chrome profile to manage cookies securely
2️⃣ Install Extension 🔧 Use Cookie Editor extension
3️⃣ Export from YouTube 📺 Login to YouTube → Export cookies in Netscape format 📄
4️⃣ Save Cookie File 📂 Save as SmartUtilBot.txt in SmartUtilBot/cookies/SmartUtilBot.txt

Managing Cookies 💡

🔄 Cookie Expiry

• YouTube cookies may expire or become invalid
• If download issues occur, export fresh cookies 🔄
• Don't play videos on mobile/PC with cookie account
• Don't sign out from Gmail/browser used for export
• Don't restart bot frequently to prevent COOKIE EXPIRY

🛡️ Cookie Depletion

• Avoid frequent bot restarts ⚠️
• Prevent excessive YouTube requests
• Monitor bot activity 👀
• Keep cookies valid longer

🚀 This setup ensures reliable access to YouTube content without encountering sign-in or bot protection errors.


🔔 Ethical Notice

⚖️ Ethics Reminder: Simply modifying a few lines of code does not constitute original authorship. When forking a project, always fork responsibly and give proper credit to the original creators.


👥 Project Contributors

🧑‍💻 Main Author



🌟 Abir Arafat Chawdhury
The Main Author & Base Developer of SmartToolBot




🌟 Star History

Star History Chart

💖 Support the Project

Star the repository 🍴 Fork and contribute
📢 Share with community 💬 Join our Telegram Channel

Footer

📜 License: MIT License
🔗 Repository: github.com/TheSmartDevs/SmartUtilBot

Made with ❤️ by Abir Arafat Chawdhury

Footer Text

About

Smart Util is the most complete bot designed to assist you with a wide array of tools. By @abirxdhack & @TheSmartDevs.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages