From c998b6728d8d55b43b5342a3f4e27340f69949a1 Mon Sep 17 00:00:00 2001 From: Pentacene Date: Tue, 18 May 2021 13:27:57 +0800 Subject: [PATCH] =?UTF-8?q?DeleteMsgsFromGrps=20v1.01=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=86=E5=88=A0=E9=99=A4=E4=BF=A1=E6=81=AF=E6=8A=8A=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E9=82=A3=E6=9D=A1=E4=B9=9F=E5=88=A0=E9=99=A4=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deletemsgsfromgrps.py | 4 ++++ list.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deletemsgsfromgrps.py b/deletemsgsfromgrps.py index 24bb0f4..ddbe216 100644 --- a/deletemsgsfromgrps.py +++ b/deletemsgsfromgrps.py @@ -27,6 +27,8 @@ async def dmfg(context: Message) -> None: if dialog.id > 0: continue async for message in context.client.iter_messages(dialog.id, from_user="me"): + if dialog.id == context.chat_id and message.id == context.id: + continue if count_buffer == count: break await message.delete() @@ -42,6 +44,8 @@ async def dmfg(context: Message) -> None: async for dialog in context.client.iter_dialogs(): if dialog.id > 0: async for message in context.client.iter_messages(dialog.id, from_user="me"): + if dialog.id == context.chat_id and message.id == context.id: + continue if count_buffer == count: break await message.delete() diff --git a/list.json b/list.json index 04fb681..61f3baf 100644 --- a/list.json +++ b/list.json @@ -372,7 +372,7 @@ }, { "name": "deletemsgsfromgrps", - "version": "1.00", + "version": "1.01", "section": "chat", "maintainer": "Pentacene", "size": "4 kb",