Skip to content

Commit

Permalink
Update grouputils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
StarkGang authored Apr 29, 2021
1 parent dcf2c8f commit ef2dcc1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/grouputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,25 +559,25 @@ async def purge(client, message):
offset_id=message.reply_to_message.message_id,
reverse=True,
):
purge_len += 1
message_ids.append(msg.message_id)
if len(message_ids) >= 100:
await client.delete_messages(
chat_id=message.chat.id, message_ids=message_ids, revoke=True
)
message_ids.clear()
if msg.message_id != message.message_id:
purge_len += 1
message_ids.append(msg.message_id)
if len(message_ids) >= 100:
await client.delete_messages(
chat_id=message.chat.id, message_ids=message_ids, revoke=True
)
message_ids.clear()
if message_ids:
await client.delete_messages(
chat_id=message.chat.id, message_ids=message_ids, revoke=True
)
end_time = time.time()
u_time = round(end_time - start_time)
h = await client.send_message(
message.chat.id,
await event.edit(
f"**>> Flash Purge Done!** \n**>> Total Message Purged :** `{purge_len}` \n**>> Time Taken :** `{u_time}`",
)
await asyncio.sleep(3)
await h.delete()
await event.delete()


@friday_on_cmd(
Expand Down

0 comments on commit ef2dcc1

Please sign in to comment.