PagerMaid_Plugins/paolu.py
2021-04-16 23:44:46 +08:00

35 lines
1.2 KiB
Python

""" PagerMaid Plugins Paolu """
from asyncio import sleep
from pagermaid import bot
from pagermaid.listener import listener
@listener(is_plugin=True, outgoing=True, command="paolu",
description="⚠一键跑路 删除群内消息并禁言⚠")
async def paolu(context):
"""一键跑路 删除群内消息并禁言"""
try:
await bot.edit_permissions(
entity=context.chat_id,
send_messages=False,
send_media=False,
send_stickers=False,
send_gifs=False,
send_games=False,
send_inline=False,
send_polls=False,
invite_users=False,
change_info=False,
pin_messages=False)
except:
pass
await bot.delete_messages(context.chat_id, list(range(1,context.message.id)))
try:
await bot.edit_permissions(
entity=context.chat_id,
send_messages=False)
except:
pass
await context.edit("Finished")
await sleep(10)
await context.delete()