From 49a0c0698e78789684bcf5a9f03ca7abd5b8ae89 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 4 Jul 2021 12:11:31 +0800 Subject: [PATCH] =?UTF-8?q?paolu=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 2 +- paolu.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/list.json b/list.json index 1095b40..07e6314 100644 --- a/list.json +++ b/list.json @@ -362,7 +362,7 @@ }, { "name": "paolu", - "version": "1.02", + "version": "1.021", "section": "chat", "maintainer": "Pentacene", "size": "1.0 kb", diff --git a/paolu.py b/paolu.py index 2508ad2..3b0500a 100644 --- a/paolu.py +++ b/paolu.py @@ -8,6 +8,7 @@ # from asyncio import sleep +from telethon.errors.common import MultiError from pagermaid.listener import listener from pagermaid.utils import alias_command @@ -31,7 +32,10 @@ async def paolu(context): pin_messages=False) except: pass - await context.client.delete_messages(context.chat_id, list(range(1, context.message.id))) + try: + await context.client.delete_messages(context.chat_id, list(range(1, context.message.id))) + except MultiError: + pass try: await context.client.edit_permissions( entity=context.chat_id,