mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-22 03:19:18 +00:00
dme 适配 v1.2.23
This commit is contained in:
parent
0275279f9e
commit
ffc6947430
15
dme/main.py
15
dme/main.py
@ -1,14 +1,21 @@
|
||||
""" Module to message deletion. """
|
||||
from pagermaid import bot
|
||||
from pagermaid.listener import listener
|
||||
from pagermaid.utils import Message, lang
|
||||
|
||||
import contextlib
|
||||
|
||||
from pagermaid import read_context
|
||||
from pagermaid.enums import Client, Message
|
||||
from pagermaid.listener import listener, _lock
|
||||
from pagermaid.modules.prune import self_prune
|
||||
from pagermaid.utils import lang
|
||||
|
||||
|
||||
@listener(is_plugin=False, command="dme",
|
||||
need_admin=True,
|
||||
description=lang('sp_des'),
|
||||
parameters=lang('sp_parameters'))
|
||||
async def dme(message: Message):
|
||||
async def dme(bot: Client, message: Message):
|
||||
""" Deletes specific amount of messages you sent. """
|
||||
async with _lock:
|
||||
with contextlib.suppress(Exception):
|
||||
del read_context[(message.chat.id, message.id)]
|
||||
await self_prune(bot, message)
|
||||
|
Loading…
Reference in New Issue
Block a user