-
Notifications
You must be signed in to change notification settings - Fork 33
/
paolu.py
48 lines (45 loc) · 1.46 KB
/
paolu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
""" PagerMaid Plugins Paolu """
# ______ _
# | ___ \ | |
# | |_/ /__ _ __ | |_ __ _ ___ ___ _ __ ___
# | __/ _ \ '_ \| __/ _` |/ __/ _ \ '_ \ / _ \
# | | | __/ | | | || (_| | (_| __/ | | | __/
# \_| \___|_| |_|\__\__,_|\___\___|_| |_|\___|
#
from asyncio import sleep
from telethon.errors.common import MultiError
from pagermaid import version
from pagermaid.listener import listener
from pagermaid.utils import alias_command
@listener(is_plugin=True, outgoing=True, command=alias_command("paolu"),
description="⚠一键跑路 删除群内消息并禁言⚠")
async def paolu(context):
"""一键跑路 删除群内消息并禁言"""
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
try:
await context.client.delete_messages(context.chat_id, list(range(1, context.message.id)))
except MultiError:
pass
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()