From b74a52a6dbcb3da8be01caec32d6b9a10feb6cc4 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Thu, 20 Jan 2022 21:49:59 +0700 Subject: [PATCH] something --- program/userbot_tools.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/program/userbot_tools.py b/program/userbot_tools.py index bf9c114..e8f565c 100644 --- a/program/userbot_tools.py +++ b/program/userbot_tools.py @@ -62,32 +62,34 @@ async def leave_all(client, message): left = 0 failed = 0 - lol = await message.reply("šŸ”„ **userbot** leaving all chats !") + + msg = await message.reply("šŸ”„ Userbot leaving all Group !") async for dialog in user.iter_dialogs(): try: await user.leave_chat(dialog.chat.id) left += 1 - await lol.edit( - f"Userbot leaving all group...\n\nLeft: {left} chats.\nFailed: {failed} chats." + await msg.edit( + f"Userbot leaving all Group...\n\nLeft: {left} chats.\nFailed: {failed} chats." ) except BaseException: failed += 1 - await lol.edit( + await msg.edit( f"Userbot leaving...\n\nLeft: {left} chats.\nFailed: {failed} chats." ) await asyncio.sleep(0.7) + await msg.delete() await client.send_message( message.chat.id, f"āœ… Left from: {left} chats.\nāŒ Failed in: {failed} chats." ) -@Client.on_message(filters.left_chat_member) -async def ubot_leave(c: Client, m: Message): - ass_id = (await user.get_me()).id - bot_id = (await c.get_me()).id - chat_id = m.chat.id - left_member = m.left_chat_member - if left_member.id == bot_id: - await user.leave_chat(chat_id) - elif left_member.id == ass_id: - await c.leave_chat(chat_id) +# @Client.on_message(filters.left_chat_member) +# async def ubot_leave(c: Client, m: Message): +# ass_id = (await user.get_me()).id +# bot_id = (await c.get_me()).id +# chat_id = m.chat.id +# left_member = m.left_chat_member +# if left_member.id == bot_id: +# await user.leave_chat(chat_id) +# elif left_member.id == ass_id: +# await c.leave_chat(chat_id)