Merge pull request #151 from Pentacene/master

Paolu v1.01
This commit is contained in:
Pentacene 2021-04-16 23:52:41 +08:00 committed by GitHub
commit 2eacfece1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 15 deletions

View File

@ -352,7 +352,7 @@
},
{
"name": "paolu",
"version": "1.00",
"version": "1.01",
"section": "chat",
"maintainer": "Pentacene",
"size": "1.0 kb",

View File

@ -1,25 +1,41 @@
""" 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):
"""一键跑路 删除群内消息并禁言"""
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)
await bot.delete_messages(context.chat_id, list(range(1,context.message.id)))
try:
await context.client.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 context.client.delete_messages(context.chat_id, list(range(1,context.message.id)))
try:
await context.client.edit_permissions(
entity=context.chat_id,
send_messages=False)
except:
pass
await context.edit("Finished")
await sleep(10)
await context.delete()