The bot works together with a userbot session to delete messages from Telegram groups or supergroups.
- Skips whitelisted users
- Admin permission checks
- Auto invite & promote userbot
- FloodWait safe handling
- Cleaning spam
- Removing raid messages
- Mass cleanup in groups
-
Add the bot to your group.
-
Make sure the bot is ADMIN and has:
- Delete messages permission
- Invite users permission
- Promote admin permission
-
Use this command in the group: /delall
-
The bot will:
- Invite the userbot automatically
- Promote userbot with delete permission
- Start deleting messages
- Skip whitelisted users
- Show deleted & skipped count
-
After completion:
- if Userbot invited leaves the group automatically
You must set the following variables before running the bot:
BOT_TOKEN
- Telegram bot token from @BotFather
USERBOT_STRING
- Pyrogram session string of your user account
API_ID
- Telegram API ID from my.telegram.org
API_HASH
- Telegram API HASH from my.telegram.org
WHITELIST_USERS
- Telegram user IDs whose messages should NOT be deleted
MSG_ID
specific ID of message you don't want to delete
Set in config.py file
BOT_TOKEN=123456:ABCDEF
USERBOT_STRING=SESSION_STRING_HERE
API_ID=12345678
API_HASH=your_api_hash_here
WHITELIST_USERS= {
12345678,
12345678
}
MSG_ID=0 # msg id you don't want to delete
- Do not abuse this bot to avoid FloodWait
- Telegram does not ban accounts for deletions, but excessive usage may cause temporary limits
- Always test the bot in a small group first
- Keep your session string private and secure
AUTHOR
Developer: Lx 0980