Skip to content

Latest commit

Β 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoWiper 🧹

License: AGPL v3 Pyrogram Made with Python Deploy on Koyeb Web App Support

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)

🚨 IMPORTANT SECURITY NOTICE

⚠️ 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.py with 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.

✨ Key Features

βœ… 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


🌐 Web App Features (Koyeb Branch)

The koyeb branch includes additional web application features:

πŸ“Š Web Dashboard Endpoints

Endpoint Description Access
/ Main dashboard with bot overview Public
/health Health check API (JSON) Public
/stats Detailed system statistics (JSON) Public

πŸ”„ Auto-Keep-Alive System

  • Auto-ping: Pings web server every 2 minutes
  • Prevents sleeping on free hosting platforms
  • Always-on monitoring for 24/7 operation

πŸ“ˆ Enhanced Monitoring

  • Real-time system stats: CPU, RAM, disk usage
  • Network monitoring: Data transfer statistics
  • Process monitoring: Bot resource usage
  • Load averages: System performance metrics

πŸ“‹ Commands Reference

Bot Commands (Private Chat)

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)

Userbot Commands (In Monitored Chats)

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)

πŸš€ Quick Start

Prerequisites

Local Installation (Main Branch)

  1. Clone the repository

    git clone https://github.com/PIROXTG/AutoWiper.git
    cd AutoWiper
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure the bot (Local Development Only)

    ⚠️ For local testing only - Edit config.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!

  4. Run the bot

    python main.py

☁️ Cloud Deployment

Deploy on Koyeb (Recommended βœ…)

Koyeb offers excellent free hosting perfect for AutoWiper with web app support:

⭐ IMPORTANT: Always star the original repository first!

  1. 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
  2. Switch to Koyeb Branch:

    git checkout koyeb

    Or during import, specify branch: koyeb

  3. 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 πŸš€
  4. 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

⚠️ Security Warning: Never store credentials in public repositories. If you accidentally push sensitive data, immediately rotate all tokens and session strings.

Alternative Cloud Platforms

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

Local Development with Web App

For local testing with web features:

git checkout koyeb
pip install -r requirements.txt  # Includes aiohttp, psutil
python main.py

Access dashboard at: http://localhost:8080


βš™οΈ Configuration Guide

Environment Variables (Production)

For cloud deployment, set these environment variables:

Required Variables

API_ID=your_api_id
API_HASH=your_api_hash
BOT_TOKEN=your_bot_token
SESSION=your_session_string
CHAT_IDS=[-1001234567890,-1009876543210]

Optional Variables (Koyeb Branch)

PORT=8080                    # Web server port (auto-detected on most platforms)
ID_DUR={-1001234567890:3600} # Delete timers in JSON format

Dependencies by Branch

Main Branch (requirements.txt)

pyrotgfork==2.1.35
tgcrypto==1.2.5
APScheduler==3.10.4

Koyeb Branch (requirements.txt)

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

Timer Configuration Examples

ID_DUR = {
    -1001234567890: 300,      # 5 minutes
    -1009876543210: 1800,     # 30 minutes
    -1007654321098: 3600,     # 1 hour
    -1005432109876: 86400,    # 24 hours
    -1003210987654: 0,        # Disabled (no auto-delete)
}

🌐 Web Dashboard Guide (Koyeb Branch)

Dashboard Features

  • πŸ“Š 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

API Endpoints

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
  }
}

Monitoring Integration

Use the /health endpoint with:

  • UptimeRobot: HTTP keyword monitoring
  • Pingdom: Uptime monitoring
  • StatusCake: Performance monitoring
  • Custom scripts: Automated health checks

πŸ” Security & Best Practices

Security Guidelines

  • ⚠️ CRITICAL: Never fork this repository publicly - use GitHub's Import feature instead
  • Always make your repository PRIVATE when importing
  • Never commit config.py with 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:
    1. Revoke the bot token via @BotFather
    2. Generate a new session string
    3. Delete and recreate the compromised repository
  • DISCLAIMER: The repository owner is not responsible for compromised accounts due to improper handling of credentials

Important Notes

  • 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

πŸ› οΈ Troubleshooting

Common Issues

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 PORT environment 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 koyeb branch (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.txt matches your branch

🀝 Support & Contributing

Get Help

  • πŸ› Bug Reports: Open an issue
  • πŸ’¬ Support Chat: @piroxhelorobot
  • πŸ“– Documentation: Check this README and inline comments
  • 🌐 Web Dashboard Issues: Specify if you're using koyeb branch

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Choose the appropriate branch (main for core features, koyeb for web features)
  3. Create a feature branch
  4. Make your changes
  5. 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

πŸ“š Technical Details

Architecture Comparison

Main Branch

  • Core Features: Message deletion, scheduling, basic monitoring
  • Dependencies: Pyrogram, APScheduler
  • Deployment: VPS, worker processes

Koyeb Branch

  • 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

Built With

Performance Notes

  • 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

πŸ“„ License

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.


πŸ™ Acknowledgments

  • 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!

🎯 Quick Deploy Buttons

Koyeb (Web App Support)

Deploy to Koyeb

Railway (Web App Support)

Deploy on Railway

Heroku (Web App Support)

Deploy to Heroku

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

About

AutoWiper - Lightweight Telegram auto-cleaner that deletes messages in groups/channels after set time periods. Keep chats clutter-free with customizable timers per chat, remote management via commands, and cloud deployment support. Built with Python/Pyrogram for reliable automated cleanup.

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages