Enterprise-grade Telegram bot management system for monitoring messages, managing multiple accounts, and performing bulk operations.
Telegram Panel is a comprehensive management system that enables centralized control of multiple Telegram accounts. It provides two ways to use the system:
- Telegram Bot Interface: Use the bot in Telegram for easy access from anywhere
- CLI (Command Line Interface): Use the CLI on your server or local system for direct control
Both methods provide the same capabilities for account management, message monitoring, bulk operations, and individual account actions.
- Multi-account support with dynamic enable/disable
- Session persistence and automatic recovery
- Account status monitoring and reporting
- Automatic detection of revoked sessions
- Keyword-based message filtering
- Automatic forwarding to designated channels
- User ignore list management
- Real-time monitoring across all active accounts
- Reactions: Apply reactions to messages across multiple accounts
- Polls: Vote in polls using multiple accounts
- Join/Leave: Manage group memberships in bulk
- Block: Block users across multiple accounts
- Private Messages: Send messages to users from multiple accounts
- Comments: Post comments on messages using multiple accounts
- Account-specific actions for targeted operations
- Per-account control and monitoring
- Bot statistics and status overview
- Groups per account listing
- Keyword configuration overview
- Account health monitoring
- Python 3.8 or higher
- Telegram API credentials from my.telegram.org
- Bot token from @BotFather
- Telegram user account for admin access
Ensure Python 3.8+ is installed:
python3 --version- Clone the repository:
git clone <repository-url>
cd Telegram-Panel- Create and activate virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Configure environment:
cp env.example .envEdit .env with your credentials:
API_ID=your_api_id
API_HASH=your_api_hash
BOT_TOKEN=your_bot_token
ADMIN_ID=your_user_id
CHANNEL_ID=@your_channelTelegram Panel supports two methods of usage:
Use the bot directly in Telegram for easy access from anywhere. This is the recommended method for most users.
Start the bot:
python main.pyFeatures:
- Interactive menu system in Telegram
- Easy navigation with buttons
- Access from any device with Telegram
- Real-time notifications and feedback
Getting Started:
- Start the bot with
/startcommand in Telegram - Navigate through the interactive menu system
- All features are accessible through the bot interface
Use the CLI on your server or local system for direct control. This method is ideal for:
- Server environments
- Automation and scripting
- Local system management
- When you prefer command-line interface
Two CLI modes available:
Menu-driven interface similar to the Telegram bot:
python interactive_cli.pyOr use the convenience script:
./cli.shFeatures:
- Menu Navigation: Navigate with arrow keys (ββ) and select with Enter
- Visual Interface: Rich terminal UI with colors and formatting
- All Features: Access to all bot features without Telegram
- Easy Navigation: Back buttons and intuitive menu structure
Navigation:
- Use arrow keys (ββ) to navigate menus
- Press Enter to select an option
- Press Esc to cancel/go back
- Press Ctrl+C to exit
Direct command execution for automation:
python cli_main.py --helpSee CLI Documentation for detailed command usage.
Features:
- Direct command execution
- Suitable for scripting and automation
- All operations available via commands
- Perfect for server environments
Example commands:
# List accounts
python cli_main.py list-accounts
# Add account
python cli_main.py add-account +1234567890
# Bulk reaction
python cli_main.py bulk reaction 5 "https://t.me/c/123456/789" π-
Use Telegram Bot if you want:
- Easy access from anywhere
- Mobile-friendly interface
- Interactive menus and buttons
- Real-time notifications
-
Use CLI if you want:
- Direct control on your server/system
- Automation and scripting capabilities
- Command-line workflow
- Server-based operations
Required variables:
API_ID: Telegram API ID from my.telegram.orgAPI_HASH: Telegram API Hash from my.telegram.orgBOT_TOKEN: Bot token from @BotFatherADMIN_ID: Your Telegram user ID (get from @userinfobot)
Optional variables:
CHANNEL_ID: Channel ID or username for message forwardingBOT_SESSION_NAME: Bot session filename (default: bot_session)CLIENTS_JSON_PATH: Path to clients configuration file (default: clients.json)RATE_LIMIT_SLEEP: Rate limit delay in seconds (default: 60)GROUPS_BATCH_SIZE: Batch size for group operations (default: 10)GROUPS_UPDATE_SLEEP: Group update interval in seconds (default: 60)REPORT_CHECK_BOT: Bot username or ID for report status checking
The config.json file stores:
TARGET_GROUPS: List of target groups for monitoringKEYWORDS: List of keywords for message filteringIGNORE_USERS: List of user IDs to ignoreclients: Dictionary of client configurations
- Start the bot:
python main.py - Open Telegram and find your bot
- Send
/startcommand - Navigate through the interactive menu system
Main Menu Options:
- Account Management: Add, list, and manage Telegram accounts
- Individual: Perform operations on a single account
- Bulk: Execute operations across multiple accounts
- Monitor Mode: Configure keyword monitoring and forwarding
- Report Status: View statistics and account status
Interactive CLI:
python interactive_cli.py
# or
./cli.shCommand-line CLI:
python cli_main.py [COMMAND] [OPTIONS]See CLI Documentation and Interactive CLI Guide for detailed usage.
- Select "Account Management" from main menu
- Choose "Add Account" to add a new Telegram account
- Enter phone number when prompted
- Enter verification code received via Telegram
- Enter 2FA password if enabled
- Account will be saved and activated automatically
- Select "Bulk" from main menu
- Choose operation type (reaction, poll, join, etc.)
- Select number of accounts to use
- Follow prompts to complete operation
- Select "Monitor Mode" from main menu
- Add keywords to monitor
- Configure target groups
- Set up ignore list if needed
- Messages containing keywords will be forwarded to configured channel
Telegram-Panel/
βββ main.py # Application entry point
βββ requirements.txt # Python dependencies
βββ env.example # Environment variables template
βββ config.json # Runtime configuration
βββ clients.json # Client session data
βββ src/ # Source code
β βββ Config.py # Configuration management
β βββ Telbot.py # Main bot orchestrator
β βββ Client.py # Session and account management
β βββ Handlers.py # Event handlers
β βββ Keyboards.py # UI keyboard layouts
β βββ Monitor.py # Message monitoring
β βββ actions.py # Bulk and individual operations
β βββ Validation.py # Input validation
β βββ Logger.py # Logging configuration
β βββ utils.py # Utility functions
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ logs/ # Log files
Run the test suite:
pytest tests/Run with coverage report:
pytest tests/ --cov=src --cov-report=html- Never commit
.envor.sessionfiles to version control - Use strong 2FA passwords for Telegram accounts
- Keep session files secure and backed up
- Regularly update dependencies for security patches
- Limit access to admin user ID only
- Use secure channels for credential transmission
The system includes comprehensive error handling:
- Automatic retry for transient errors
- Flood wait detection and handling
- Session revocation detection and cleanup
- Rate limiting to prevent API abuse
- Graceful degradation on failures
Logs are written to logs/bot.log with the following levels:
INFO: General operational informationWARNING: Non-critical issuesERROR: Error conditionsCRITICAL: Critical failures
- Verify all required environment variables are set
- Check that
.envfile exists and is properly formatted - Ensure bot token is valid and bot is started via @BotFather
- Verify phone number format is correct
- Check that verification code is entered promptly
- Ensure 2FA password is correct if enabled
- Sessions are automatically detected and removed
- Re-add account through Account Management menu
- Check for Telegram security notifications
- System automatically handles FloodWait errors
- Operations include delays to prevent rate limiting
- Reduce concurrent operations if issues persist
- Modular design with separation of concerns
- Async/await for concurrent operations
- Comprehensive error handling
- Type hints for better code clarity
See CONTRIBUTING.md for contribution guidelines.
See LICENSE file for details.
Additional documentation available in the docs/ directory:
For issues and questions:
- Check existing documentation
- Review error logs in
logs/bot.log - Consult test suite for usage examples
- Open an issue on the repository