Universal asynchronous Telegram bot for personal or business use
Beautiful UI with emojis and intuitive navigation, company profile, smart forwarding, and admin commands.
personal-telegram-bot — universal asynchronous Telegram bot for personal or business use with beautiful UI and advanced features.
Features include company profile display, dedicated message writing interface, smart forwarding to administrator, built-in security protection, admin statistics, and support for running on Termux (Android).
1. Create a Bot via BotFather:
/newbot command1234567890:ABCdefGHIjklMNopQRstUVwxyz)2. Get Your Chat ID:
/start commandPrerequisites: Python 3.8+, pip, Git
# Clone repository git clone https://github.com/smartlegionlab/personal-telegram-bot.git cd personal-telegram-bot # Create virtual environment python -m venv venv # Activate environment (Linux) source venv/bin/activate # Install dependencies pip install -r requirements.txt
1. Environment Variables File (.env):
PERSONAL_API_TOKEN="your_bot_token_from_botfather" ADMIN_CHAT_ID="your_numeric_chat_id"
2. Bot Configuration File (.config.json):
{
"name": "Your Company Name",
"description": "Detailed description of your company or personal services.",
"url": "https://your-website.com"
}
# Activate virtual environment (if not already activated) source venv/bin/activate # Start the bot python bot.py
Initial Termux Setup:
# Prevent device from sleeping termux-wake-lock # Update package manager pkg update && pkg upgrade # Install required packages pkg install python python-pip git vim # Install Rust (required for some dependencies) pkg install rust
Bot Installation on Termux:
# Clone the repository git clone https://github.com/smartlegionlab/personal-telegram-bot.git cd personal-telegram-bot # Create configuration files touch .env .config.json # Edit configuration files using vim vim .env # Add your token and chat ID, then save with :wq vim .config.json # Add your company info, then save with :wq # Setup Python environment python -m venv venv source venv/bin/activate pip install -r requirements.txt # Start the bot python bot.py
> Your Telegram bot now runs directly on your Android phone! No server required.
For All Users:
/start — Show welcome message with main menuFor Admin Only:
/stats — View detailed bot statistics (messages processed, unique users, errors)/health — Check bot status and basic statistics/start commandMain Menu:
🌟 Welcome! 🏢 Name: Your Company Name 📝 About us: Your company description... 💬 We're here to help! Send us a message... 👇 Quick actions: [✏️ Write a Message] [🌐 Visit Website] [ℹ️ About]
Message Received by Admin:
📩 New Message Received 👤 User Information: • Name: John Doe • ID: 123456789 • Username: @johndoe 💬 Message Content: Hello, I'm interested in your services! 🔗 Go to chat
Common Issues:
pkg install rust pip install --upgrade pip pip install -r requirements.txt
.env file exists and contains correct values, verify .config.json has valid JSON syntaxADMIN_CHAT_ID is correct, check bot has permission to message the admintermux-wake-lock is active, check internet connection, verify sufficient storage spaceLogs and Debugging: The bot provides detailed logs: INFO — Normal operations, WARNING — Security threats detected, ERROR — Operation failures.
Customizing Messages:
Edit the message templates in bot.py:
_build_welcome_message() — Main menu_build_about_message() — About section_build_write_message_prompt() — Message writing prompt_send_thank_you() — Thank you messageAdding New Features:
The modular architecture makes it easy to extend:
By using this software, you agree to the full disclaimer terms.
Software provided "AS IS" without warranty. You assume all risks.
Full legal disclaimer: See DISCLAIMER.md
License: BSD 3-Clause License