paolu 修复删除的消息不存在时报错

This commit is contained in:
xtaodada 2021-07-04 12:11:31 +08:00
parent eb3830159b
commit 49a0c0698e
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 6 additions and 2 deletions

View File

@ -362,7 +362,7 @@
},
{
"name": "paolu",
"version": "1.02",
"version": "1.021",
"section": "chat",
"maintainer": "Pentacene",
"size": "1.0 kb",

View File

@ -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,