-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkickall.py
30 lines (26 loc) · 1.04 KB
/
kickall.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
from .. import loader, utils
def register(cb):
cb(KickAllMod())
class KickAllMod(loader.Module):
"""Ломает чаты."""
strings = {'name': 'KickAll'}
async def kickallcmd(self, message):
"""Что блять не понятного? Используй .kickall <s>, чтобы кикнуть всех с чата."""
args = utils.get_args_raw(message)
silent = False
if 's' in args:
silent = True
await message.delete()
else: await message.edit('✝️Молитесь за чат😌')
users = await message.client.get_participants(message.chat_id)
count = 0
for user in users:
try:
if user.id != message.peer_id.user_id:
await message.client.kick_participant(message.chat_id, user.id)
count += 1
except: pass
if silent == True:
chat = await message.client.get_entity(message.to_id)
await message.client.send_message('me', f'<b>В чате "{chat.title}" снесено {count} грешников.</b>')
else: await message.edit(f'<b>Кикнуто {count} пользователей.</b>')