Merge pull request #89 from Pentacene/master

新增一键跑路(删群消息+禁言) -paolu
This commit is contained in:
Pentacene 2020-12-23 17:02:04 +08:00 committed by GitHub
commit 5f9db87d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -349,6 +349,16 @@
"supported": true,
"des-short": "小型计算器",
"des": "/cal 6+4。"
},
{
"name": "paolu",
"version": "1.00",
"section": "chat",
"maintainer": "Pentacene",
"size": "1.0 kb",
"supported": true,
"des-short": "一键跑路(删所有消息并禁言)",
"des": "paolu。"
}
]
}

25
paolu.py Normal file
View File

@ -0,0 +1,25 @@
""" 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)))
await context.edit("Finished")
await sleep(10)
await context.delete()