A professional Telegram bot for managing multiple user accounts with advanced OTP destroyer protection against unauthorized access attempts.
Developed by:
Support: Contact Support Documentation: π Wiki Repository: GitHub
-
Clone Repository
git clone https://github.com/MeherMankar/TeleGuard.git cd TeleGuard
-
Install Dependencies
pip install -r config/requirements.txt
-
Configure Environment
cp config/.env.example config/.env # Edit config/.env with your credentials
-
Run Bot
python main.py
- Heroku: Use one-click deploy button above or
./deploy/heroku.sh
- Koyeb: Run
./deploy/koyeb.sh
for free tier deployment (Guide) - Docker:
docker-compose up -d
# Telegram API (get from https://my.telegram.org)
API_ID=your_api_id_here
API_HASH=your_api_hash_here
# Bot Token (get from @BotFather)
BOT_TOKEN=your_bot_token_here
# Admin Access
ADMIN_IDS=123456789,987654321
# Database (auto-configured for cloud platforms)
DATABASE_URL=sqlite+aiosqlite:///bot_data.db
# Security & Limits
MAX_ACCOUNTS=10
RATE_LIMIT_ENABLED=true
# Session Backup (production)
SESSION_BACKUP_ENABLED=true
[email protected]:username/sessions-backup.git
GPG_KEY_ID=your_gpg_key_id
FERNET_KEY=your_base64_fernet_key
TELEGRAM_BACKUP_CHANNEL=-1001234567890
Feature | Description | Status |
---|---|---|
π‘οΈ OTP Destroyer | Real-time protection against unauthorized login attempts | β Active |
π€ Account Management | Manage up to 10 Telegram accounts per user | β Active |
π Security Features | 2FA management, session backup, audit logging | β Active |
β‘ Automation Engine | Online maker, scheduled tasks, auto-reply | β Active |
π± Profile Manager | Update names, photos, bios, usernames | β Active |
π 2FA Management | Set, change, remove two-factor authentication | β Active |
π Activity Simulator | Human-like activity to avoid detection | β Active |
π¬ Unified Messaging | Smart message routing, auto-reply, templates | β Active |
π¨ DM Reply Manager | Centralized DM management with topic creation | β Active |
π’ Channel Manager | Join, leave, create, manage channels | β Active |
π₯ Contact Export | Export Telegram contacts to CSV format | β Active |
π€ Bot Message Handling | Direct bot notifications without topics | β Active |
πΎ Expanded Backups | User settings, IDs, and sessions to Telegram | β Active |
βοΈ Cloud Ready | Deploy on Heroku, Koyeb, Docker | β Active |
- Real-time Protection: Automatically invalidates unauthorized login codes
- Telegram API Integration: Uses official
account.invalidateSignInCodes
- Instant Alerts: Notifies users when attacks are blocked
- Zero False Positives: Only triggers on actual login attempts
- Multi-Account Support: Manage up to 10 accounts per user
- Secure Storage: Military-grade Fernet encryption for sessions
- Profile Management: Update names, usernames, bios, and photos
- Session Control: View and terminate active sessions
- 2FA Management: Set, change, and remove two-factor authentication
- Session Backup: Automated GitHub backup with GPG signing
- Audit Logging: Complete activity tracking
- Rate Limiting: Protection against abuse
- Online Maker: Keep accounts online automatically
- Scheduled Tasks: Automated actions and workflows
- Smart Auto-Reply: Keyword-based and time-aware responses
- DM Reply Management: Centralized inbox with forum topics
- Contact Export: Export contacts to CSV with comprehensive data
- Bulk Operations: Mass account management
- Send
/start
to your bot - Use the persistent menu buttons to navigate
- Add accounts via "π± Account Settings"
- Enable OTP protection in "π‘οΈ OTP Manager"
π± Account Settings π‘οΈ OTP Manager
π¬ Messaging π’ Channels
β Help π Support
βοΈ Developer (Admin Only)
- π± Account Settings: Add, remove, manage accounts
- π‘οΈ OTP Manager: Configure OTP destroyer protection
- π¬ Unified Messaging: Smart routing, auto-reply, templates
- π¨ DM Reply: Forum-based centralized DM management
- π’ Channels: Join, leave, create, manage channels
- π₯ Contacts: Export contacts to CSV format
- π Activity Simulator: Human-like activity simulation
- π Sessions: View and terminate active sessions
- π 2FA: Set, change, remove two-factor authentication
- Add Account: Phone number β OTP β 2FA (if enabled)
- Remove Account: Logout and delete all data
- Profile Updates: Names, usernames, bios, photos
- Session Control: View and terminate sessions
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Telegram Bot ββββββ Account Managerββββββ User Clients β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β βββββββββββββββββββ β
ββββββββββββββββ Menu System ββββββββββββββββ
βββββββββββββββββββ
β
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββ
β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Unified Messagingβ β MongoDB DB β β OTP Manager β
β β’ Auto-Reply β β β’ Accounts β β β’ Destroyer β
β β’ Topic Routing β β β’ Settings β β β’ Notifications β
β β’ Bot Filtering β β β’ Mappings β β β’ Prevention β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Full Data Encryption: All user data encrypted at rest with Fernet
- Encrypted Sessions: Session strings double-encrypted for security
- Secure Database: MongoDB with comprehensive field-level encryption
- Secure Logging: No sensitive information in logs
- Password Protection: 2FA passwords hashed with SHA-256
- Triple Encryption: Fernet + GPG + GitHub private repository
- Telegram Backups: Encrypted user settings and session files
- Database Encryption: All sensitive fields encrypted at storage level
- Integrity Verification: GPG signatures for all backups
- Automated Rotation: History compaction every 8 hours
- Access Control: Private repository with SSH key authentication
- INFO: Normal operations and user actions
- WARNING: Rate limits and recoverable issues
- ERROR: Authentication failures and system errors
- Account connectivity status
- Session backup verification
- OTP destroyer statistics
- Automation engine performance
TeleGuard/
βββ teleguard/ # Main package
β βββ core/ # Core functionality
β βββ handlers/ # Event handlers
β βββ utils/ # Utilities
β βββ workers/ # Background workers
βββ config/ # Configuration
βββ deploy/ # Deployment scripts
βββ tests/ # Test suite
βββ main.py # Entry point
# Install dependencies
pip install -r config/requirements.txt
# Run tests
python -m pytest tests/
# Run locally
python main.py
# Heroku
./deploy/heroku.sh
# Koyeb
./deploy/koyeb.sh
# Docker
docker-compose up -d
- Python 3.11+
- Telegram API credentials (API_ID, API_HASH)
- Bot token from @BotFather
- MongoDB (primary database - auto-configured)
- PostgreSQL (legacy support)
- Git + GPG (for session backup)
- Docker (for containerized deployment)
- Use only for legitimate account management
- Comply with Telegram's Terms of Service
- Respect local laws and regulations
- Telegram enforces API rate limits
- Bot includes automatic rate limit handling
- Use different phone numbers if rate limited
- Keep
.env
file secure and private - Use strong passwords for 2FA
- Regularly update dependencies
- Monitor logs for suspicious activity
π Complete troubleshooting guide: Troubleshooting
Issue | Solution | Guide |
---|---|---|
Rate Limiting | Wait for cooldown or use different number | Rate Limits |
2FA Required | Provide 2FA password when prompted | 2FA Issues |
Session Errors | Re-add affected accounts | Session Problems |
Database Connection | Check MongoDB configuration | Database Issues |
Auto-Reply Not Working | Check account and settings enabled | Auto-Reply Guide |
Duplicate Messages | Restart bot to clear handler duplicates | Handler Issues |
/backup_status
- Check backup system status/backup_now
- Trigger session backup to GitHub/backup_settings
- Backup user settings to Telegram (encrypted)/backup_ids
- Backup user IDs to Telegram (unencrypted)/backup_sessions
- Backup session files to Telegram (encrypted)/backup_all
- Trigger all backup types at once/compact_now
- Compact GitHub repository history/migrate_encrypt_data
- Encrypt existing unencrypted datapython manual_backup.py
- Run manual backup script
- π Bug Reports: GitHub Issues
- π¬ Support: Contact Support
- π Documentation: Check code comments and examples
- π Deployment: See
deploy/README.md
MIT License - see LICENSE file for details.
- π Complete Wiki - Full documentation
- β‘ Quick Start - 5-minute setup guide
- π‘οΈ OTP Destroyer - Security feature guide
- π± Account Management - Account management guide
- π¨ DM Reply Feature - Centralized DM management guide
- π§ Configuration - Complete configuration reference
- π Troubleshooting - Problem solving guide
- π Report Issues - Bug reports and feature requests
- π¬ Support Chat - Get help from developers
- π Deploy Guide - Cloud deployment instructions
- π Security - Security guidelines