mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 11:26:47 +00:00
paolu 修复删除的消息不存在时报错
This commit is contained in:
parent
eb3830159b
commit
49a0c0698e
@ -362,7 +362,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "paolu",
|
"name": "paolu",
|
||||||
"version": "1.02",
|
"version": "1.021",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "Pentacene",
|
"maintainer": "Pentacene",
|
||||||
"size": "1.0 kb",
|
"size": "1.0 kb",
|
||||||
|
4
paolu.py
4
paolu.py
@ -8,6 +8,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
|
from telethon.errors.common import MultiError
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
from pagermaid.utils import alias_command
|
from pagermaid.utils import alias_command
|
||||||
|
|
||||||
@ -31,7 +32,10 @@ async def paolu(context):
|
|||||||
pin_messages=False)
|
pin_messages=False)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
await context.client.delete_messages(context.chat_id, list(range(1, context.message.id)))
|
await context.client.delete_messages(context.chat_id, list(range(1, context.message.id)))
|
||||||
|
except MultiError:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
await context.client.edit_permissions(
|
await context.client.edit_permissions(
|
||||||
entity=context.chat_id,
|
entity=context.chat_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user