A lightweight Telegram auto-cleaner bot with web dashboard that automatically deletes messages in groups and channels after a set time. Keep your chats clutter-free, spam-free, and organized β automatically. Now with web monitoring dashboard for cloud hosting!
πΉ Made by: PIROXTG
πΉ Session Generator: @SessionStringZBot (trusted & secure)
πΉ Support & Help: @piroxhelorobot
πΉ Web App Branch: Web App Support (for cloud hosting)
β οΈ WARNING: This bot uses your personal Telegram account session. Improper handling can lead to account compromise.
NEVER:
- Fork this repository publicly with your credentials
- Commit
config.pywith real values to any repository - Share your session string or bot token with anyone
ALWAYS:
- β Star the original repository first
- Use GitHub's Import repository feature (not fork)
- Make your imported repository PRIVATE
- Use environment variables for deployment
- Keep your credentials secure and private
DISCLAIMER: The author is not responsible for any account compromise due to improper credential handling. Use at your own risk.
β
Auto-delete messages in multiple Telegram groups or channels
β
Per-chat timer control β set different durations for each chat
β
Web dashboard β monitor bot status via web interface (koyeb branch)
β
System monitoring β comprehensive CPU, RAM, disk, and network stats
β
Auto-ping system β keeps cloud deployments alive
β
Lightweight & fast β built with Pyrogram (MTProto API)
β
Userbot + Bot mode β uses a user session for full message control
β
Scheduled cleanup β uses APScheduler for reliable timing
β
Remote management β control via Telegram commands
β
Cloud ready β optimized for Koyeb, Heroku, Railway, and VPS
β
Production-grade β graceful shutdown & comprehensive logging
The koyeb branch includes additional web application features:
| Endpoint | Description | Access |
|---|---|---|
/ |
Main dashboard with bot overview | Public |
/health |
Health check API (JSON) | Public |
/stats |
Detailed system statistics (JSON) | Public |
- Auto-ping: Pings web server every 2 minutes
- Prevents sleeping on free hosting platforms
- Always-on monitoring for 24/7 operation
- Real-time system stats: CPU, RAM, disk usage
- Network monitoring: Data transfer statistics
- Process monitoring: Bot resource usage
- Load averages: System performance metrics
| Command | Description |
|---|---|
/start |
Check if the bot is online |
/ping |
Measure bot response latency |
/status |
View uptime, active jobs, and system stats |
/sysinfo |
Detailed system information (koyeb branch) |
| Command | Description |
|---|---|
/delete |
Force immediate cleanup of old messages |
/update |
Pull latest code from GitHub and restart |
/restart |
Restart the bot service |
/chats |
List all monitored chats and their delete timers |
/stats |
Enhanced statistics dashboard (Owner only, koyeb branch) |
/webapp |
Web dashboard information (koyeb branch) |
- Python 3.8 or higher
- Git installed on your system
- Telegram bot token from @BotFather
- Telegram user session string from @SessionStringZBot
-
Clone the repository
git clone https://github.com/PIROXTG/AutoWiper.git cd AutoWiper -
Install dependencies
pip install -r requirements.txt
-
Configure the bot (Local Development Only)
β οΈ For local testing only - Editconfig.py:# Telegram API Credentials API_ID = 12345678 API_HASH = "your_api_hash_here" BOT_TOKEN = "your_bot_token_here" SESSION = "your_user_session_string_here" # Chat Configuration CHAT_IDS = [-1001234567890, -1009876543210] # Chat IDs to monitor # Delete Timer Configuration (in seconds) ID_DUR = { -1001234567890: 3600, # Delete after 1 hour -1009876543210: 7200, # Delete after 2 hours # Use 0 to disable auto-delete for specific chats }
β οΈ NEVER commit this file with real credentials! -
Run the bot
python main.py
Koyeb offers excellent free hosting perfect for AutoWiper with web app support:
β IMPORTANT: Always star the original repository first!
-
Import as Private Repository:
- Go to GitHub β Import repository
- Clone URL:
https://github.com/PIROXTG/AutoWiper.git - Make it PRIVATE (crucial for security)
- DO NOT FORK - Others can see your environment variables if you fork publicly
-
Switch to Koyeb Branch:
git checkout koyeb
Or during import, specify branch:
koyeb -
Deploy on Koyeb:
- Sign up at Koyeb
- Click "Create App" β "Deploy from Git"
- Select your private imported repository
- Choose branch:
koyeb(important!) - Choose Docker deployment method
- Set Service Type:
Web Service(for web app support) - Port: Set to
8080(default web server port) - Add Environment Variables (see configuration below)
- Click Deploy π
-
Access Web Dashboard:
- After deployment, you'll get a public URL
- Visit the URL to see your bot's web dashboard
- Monitor system stats, uptime, and bot health in real-time
| Platform | Branch | Service Type | Notes |
|---|---|---|---|
| Koyeb | koyeb |
Web Service | β Best choice, free tier, web dashboard |
| Railway | koyeb |
Web Service | Supports web apps, paid after trial |
| Heroku | koyeb |
Web Dyno | Uses web server, includes Procfile |
| VPS/Server | koyeb |
Manual | Full control, SSH access required |
For local testing with web features:
git checkout koyeb
pip install -r requirements.txt # Includes aiohttp, psutil
python main.pyAccess dashboard at: http://localhost:8080
For cloud deployment, set these environment variables:
API_ID=your_api_id
API_HASH=your_api_hash
BOT_TOKEN=your_bot_token
SESSION=your_session_string
CHAT_IDS=[-1001234567890,-1009876543210]PORT=8080 # Web server port (auto-detected on most platforms)
ID_DUR={-1001234567890:3600} # Delete timers in JSON formatpyrotgfork==2.1.35
tgcrypto==1.2.5
APScheduler==3.10.4
pyrotgfork==2.1.35
tgcrypto==1.2.5
APScheduler==3.10.4
aiohttp==3.9.1 # Web server support
psutil==5.9.6 # System monitoring
ID_DUR = {
-1001234567890: 300, # 5 minutes
-1009876543210: 1800, # 30 minutes
-1007654321098: 3600, # 1 hour
-1005432109876: 86400, # 24 hours
-1003210987654: 0, # Disabled (no auto-delete)
}- π Real-time Monitoring: System stats, uptime, active jobs
- π₯οΈ System Health: CPU, RAM, disk usage with visual indicators
- π Performance Metrics: Load averages, network statistics
- π€ Bot Status: Connection status, monitored chats, queue size
- π± Mobile Friendly: Responsive design for all devices
Perfect for monitoring integrations:
# Health check (for uptime monitoring)
GET /health
{
"status": "healthy",
"uptime": "2:30:45",
"active_jobs": 15,
"monitored_chats": 3,
"bot_running": true,
"user_running": true
}
# Detailed statistics
GET /stats
{
"system": {
"cpu_percent": 15.2,
"memory_percent": 45.8,
"disk_percent": 32.1,
"load_avg": [0.8, 0.9, 0.7]
},
"bot_status": {
"bot_connected": true,
"user_connected": true,
"scheduler_running": true
}
}Use the /health endpoint with:
- UptimeRobot: HTTP keyword monitoring
- Pingdom: Uptime monitoring
- StatusCake: Performance monitoring
- Custom scripts: Automated health checks
β οΈ CRITICAL: Never fork this repository publicly - use GitHub's Import feature instead- Always make your repository PRIVATE when importing
- Never commit
config.pywith real credentials to any repository - Use environment variables only for production deployments
- Use HTTPS only for web dashboard access in production
- If credentials are accidentally exposed, immediately:
- Revoke the bot token via @BotFather
- Generate a new session string
- Delete and recreate the compromised repository
- DISCLAIMER: The repository owner is not responsible for compromised accounts due to improper handling of credentials
- The bot requires delete message permissions in target chats
- Pinned messages are preserved and won't be deleted
- Only messages older than the specified duration are removed
- The bot uses a user account session for broader permissions
- Web dashboard is public by default - no sensitive data is displayed
Bot not deleting messages?
- Ensure the user account has admin/delete permissions
- Check if chat IDs are correct (negative numbers for groups/channels)
- Verify the session string is valid
Web dashboard not loading? (Koyeb branch)
- Check if you're using the correct branch (
koyeb) - Verify
PORTenvironment variable is set correctly - Ensure platform supports web services
- Check deployment logs for aiohttp errors
Connection errors?
- Check your internet connection
- Verify API credentials are correct
- Ensure Telegram isn't blocked in your region
Bot stops working on free hosting?
- Make sure you're using the
koyebbranch (has auto-ping) - Verify web service is properly configured
- Check if platform requires keep-alive requests
Deployment fails?
- Ensure you're using the correct branch for your platform
- Check all required environment variables are set
- Verify
requirements.txtmatches your branch
- π Bug Reports: Open an issue
- π¬ Support Chat: @piroxhelorobot
- π Documentation: Check this README and inline comments
- π Web Dashboard Issues: Specify if you're using
koyebbranch
Contributions are welcome! Please:
- Fork the repository
- Choose the appropriate branch (
mainfor core features,koyebfor web features) - Create a feature branch
- Make your changes
- Submit a pull request
Areas for improvement:
- Web dashboard enhancements: Better UI, more metrics
- Mobile optimization: Improved responsive design
- Security features: Authentication, rate limiting
- Performance optimizations: Caching, database integration
- Additional hosting guides: More platform-specific instructions
- Core Features: Message deletion, scheduling, basic monitoring
- Dependencies: Pyrogram, APScheduler
- Deployment: VPS, worker processes
- Enhanced Features: Web dashboard, system monitoring, auto-ping
- Additional Dependencies: aiohttp (web server), psutil (system stats)
- Deployment: Web services, cloud platforms with HTTP support
- Keep-Alive: Built-in ping system for free hosting platforms
- Pyrogram v2.0 - MTProto API framework
- APScheduler - Task scheduling
- aiohttp - Async HTTP server (koyeb branch)
- psutil - System monitoring (koyeb branch)
- Python 3.8+ - Core language
- Memory Usage: ~50-100MB depending on monitored chats
- CPU Usage: Minimal (~1-5% on modern systems)
- Network: Low bandwidth usage, periodic API calls
- Web Server: Lightweight HTTP server, <1MB additional memory
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
π Important: Any modifications, forks, or derivative works must also be released under AGPL-3.0 and publicly share their source code if deployed or made accessible over a network.
- Pyrogram - Excellent MTProto API framework
- @SessionStringZBot - Trusted session string generator
- Koyeb - Excellent free cloud hosting with web support
- aiohttp - Robust async HTTP framework
- Community - Thanks to all users and contributors!
Note: Replace template URLs with your private repository
π AutoWiper - Keeping your Telegram chats clean, one message at a time.
π Now with Web Dashboard Support for Better Monitoring!
β Star this repo β’ π± Main Branch β’ π Koyeb Branch β’ π’ Join Support