randydev's picture
fix update
6dca01c
from pyrogram import *
from pyrogram.types import *
from pyrogram.enums import *
from pyrogram.errors import *
from akn.utils.database import db
from akn.langs import transdev
@Client.on_message(filters.command("echo"))
async def echo_handler(client, message):
text = message.text.split(None, 1)
if len(text) < 2:
return await message.reply("You need to provide some text to echo.")
echo_text = text[1]
if message.reply_to_message:
await message.reply_to_message.reply(echo_text)
else:
await message.reply(echo_text)
@Client.on_message(filters.command("rmzombies"))
async def arzrmzombies_command(client, message):
bot = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
if not bot.can_restrict_members:
return await message.reply_text("I don't have enough permissions to restrict members.")
if not message.chat.type in [ChatType.GROUP, ChatType.SUPERGROUP]:
return await message.reply_text("This command can only be used in groups.")
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 UserAdminInvalid:
pass
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.")