-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtagall.py
32 lines (26 loc) · 864 Bytes
/
tagall.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
import asyncio
from pyrogram import Client, filters, enums
from pyrogram.types import Message
from utils.misc import modules_help, prefix
@Client.on_message(filters.command("tagall", prefix) & filters.me)
async def tagall(client: Client, message: Message):
await message.delete()
chat_id = message.chat.id
string = ""
limit = 1
icm = client.get_chat_members(chat_id)
async for member in icm:
tag = member.user.username
if limit <= 5:
string += f"@{tag}\n" if tag != None else f"{member.user.mention}\n"
limit += 1
else:
await client.send_message(
chat_id, text=string, parse_mode=enums.ParseMode.HTML
)
limit = 1
string = ""
await asyncio.sleep(2)
modules_help["tagall"] = {
"tagall": "Tag all members",
}