mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-28 09:36:37 +00:00
xtaodada
fb5a3f5baf
All checks were successful
Github commit to telegram / build (push) Successful in 13s
25 lines
679 B
Python
25 lines
679 B
Python
""" Module to message deletion. """
|
|
|
|
import contextlib
|
|
|
|
from pagermaid.enums import Client, Message
|
|
from pagermaid.listener import listener, _lock
|
|
from pagermaid.modules.prune import self_prune
|
|
from pagermaid.static import read_context
|
|
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(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)
|