File size: 904 Bytes
2768977
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pyrogram import *
from pyrogram.types import *
from pyrogram.enums import *
from akn.utils.database import db
from akn.langs import transdev

@Client.on_message(filters.command("rmzombies"))
async def arzrmzombies_command(client, message):
    deleted_accounts = []
    async for m in client.get_chat_members(message.chat.id):
        if m.user.is_bot:
           continue
        if m.user.is_deleted:
           deleted_accounts.append(m.user.id)
    if len(deleted_accounts) == 0:
        return await message.reply_text("No deleted accounts found in the group.")
    for user_id in deleted_accounts:
        try:
            await client.ban_chat_member(message.chat.id, user_id)
        except Exception as e:
            return await message.reply_text(f"Failed to kick user {user_id}: {e}")
    await message.reply_text(f"Removed {len(deleted_accounts)} deleted accounts from the group.")