- Remove users without profile pictures: Often bots or alts used for leaking/spying. Command:
/kicknopfp - Remove recent joiners: Kick anyone who joined in the last X hours (e.g., during a spam add raid). Command:
/kickjoined <hours>(default 3 hours)
Kicks are temporary (users can rejoin), but you can edit the script for permanent bans. Built with Pyrogram for full member access.
- Get Telegram API Credentials:
- Go to https://my.telegram.org → Create an app → Get
API_IDandAPI_HASH. - Create a bot via @BotFather → Get
BOT_TOKEN.
- Go to https://my.telegram.org → Create an app → Get
2.Install Dependencies:
- apt update && full-upgrade -y
- apt install git
- git clone https://github.com/DresOperatingSystems/DresAntiRaidBot
- cd DresAntiRaidBot
- pip install -r requirements.txt
-
Configure .env:
Copy.env.exampleto.envand fill in your values. -
Run the Bot:
python Dresanti.py -
Add to Group:
- Add the bot to your group/channel.
- Make it an admin with "Ban Users" permission.
/kicknopfp: Scan and kick all members without a profile picture (suspected bots/alts)./kickjoined 2: Kick all who joined in the last 2 hours (great for raids/spam adds). Default: 3 hours if no number given.
Only group admins can use these commands.
- Permanent Bans: In
main.py, remove/comment outawait client.unban_chat_member(...)lines. - Delays: Adjust
random.uniform(2, 5)for slower/faster actions (to avoid rate limits). - Run in Background: Use
nohup,screen, or a VPS (e.g., Heroku, Render).
- Rate limits: The bot handles Telegram's FloodWaits automatically and resumes.
- Runs as a bot with full access – use responsibly.
- Use mutliple bots if you keep getting FloodWaits
- tested and works on both termux and linux
Thank you to everyone for making these past 2 years of Dres awesome we love all of you and thought we would just release this quick little side project as a thanks so thanks from the entire Dres team.