Utility scripts for managing Telegram groups using Telethon.
git clone https://github.com/saltyfacu/tg-purgooor.git
cd tg-purgooorpip install -r requirements.txtCreate a .env file in the project root with:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
TELEGRAM_PHONE=+1234567890
TELEGRAM_USERNAME=your_telegram_usernameGet your API_ID and API_HASH from https://my.telegram.org.
Leaves groups that match a name pattern.
python leavooor.py --prefix "Crypto" --match-mode contains --exclude "Crypto News" --dry-runArguments:
- --prefix: The name to match
- --match-mode: startswith (default) or contains
- --exclude: List of group names to skip
- --dry-run: Simulate leaving without taking action
- --case-sensitive: Optional, defaults to false
- --session: (optional) Defaults to TELEGRAM_USERNAME
Kicks inactive members from a specific group who haven’t sent a message in the last N days.
python purgooor.py --group-name "DAO Squad" --days 30 --dry-runArguments:
- --group-name: Exact group name
- --days: Number of days of inactivity to check (default: 60)
- --dry-run: Only simulate without kicking
Lists all groups you’re currently in, with optional exclusions.
python listooor.py --exclude "Secret Group" "Test Chat"Arguments:
- --exclude: List of group names to skip
- --session: (optional) Defaults to TELEGRAM_USERNAME
- The leave_groups.py script includes delay and FloodWaitError handling.
- purge_group.py is designed for manual group maintenance, not spamming.
- Always use --dry-run first to preview actions.
Built with ❤️ using Telethon.