Skip to content

Commit

Permalink
FIX: Purgeall
Browse files Browse the repository at this point in the history
  • Loading branch information
ufoptg authored Apr 7, 2024
1 parent b7ec3ff commit d1ecef1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plugins/admintools.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,13 @@ async def _(e):

msg = await e.get_reply_message()
name = msg.sender
try:
await e.client.delete_messages(e.chat_id, from_user=msg.sender_id)
await e.eor(get_string("purgeall_2").format(name.first_name), time=5)
except Exception as er:
return await e.eor(str(er), time=5)

async for message in e.client.iter_messages(e.chat_id, from_user=msg.sender.id):
try:
await e.client.delete_messages(e.chat_id, [message.id])
except Exception as er:
await e.eor(str(er), time=5)
return
await e.eor(get_string("purgeall_2").format(name.first_name), time=5)

@ultroid_cmd(pattern="pinned", manager=True, groups_only=True)
async def djshsh(event):
Expand Down

0 comments on commit d1ecef1

Please sign in to comment.