Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: divkix <divkix@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: Programming Error <error@notavailable.live> Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com>
91 lines
2.6 KiB
Python
91 lines
2.6 KiB
Python
# Ultroid - UserBot
|
|
# Copyright (C) 2021 TeamUltroid
|
|
#
|
|
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
|
# PLease read the GNU Affero General Public License in
|
|
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
|
|
|
"""
|
|
✘ Commands Available -
|
|
|
|
• `{i}tagall`
|
|
Tag Top 100 Members of chat.
|
|
|
|
• `{i}tagadmins`
|
|
Tag Admins of that chat.
|
|
|
|
• `{i}tagowner`
|
|
Tag Owner of that chat
|
|
|
|
• `{i}tagbots`
|
|
Tag Bots of that chat.
|
|
|
|
• `{i}tagrec`
|
|
Tag recently Active Members.
|
|
|
|
• `{i}tagon`
|
|
Tag online Members(work only if privacy off).
|
|
|
|
• `{i}tagoff`
|
|
Tag Offline Members(work only if privacy off).
|
|
"""
|
|
|
|
from telethon.tl.types import ChannelParticipantAdmin as admin
|
|
from telethon.tl.types import ChannelParticipantCreator as owner
|
|
from telethon.tl.types import UserStatusOffline as off
|
|
from telethon.tl.types import UserStatusOnline as onn
|
|
from telethon.tl.types import UserStatusRecently as rec
|
|
from telethon.utils import get_display_name
|
|
|
|
from . import *
|
|
|
|
|
|
@ultroid_cmd(
|
|
pattern="tag(on|off|all|bots|rec|admins|owner)?(.*)",
|
|
groups_only=True,
|
|
)
|
|
async def _(e):
|
|
okk = e.text
|
|
lll = e.pattern_match.group(2)
|
|
users = 0
|
|
o = 0
|
|
nn = 0
|
|
rece = 0
|
|
if lll:
|
|
xx = f"{lll}"
|
|
else:
|
|
xx = ""
|
|
async for bb in e.client.iter_participants(e.chat_id, 99):
|
|
users = users + 1
|
|
x = bb.status
|
|
y = bb.participant
|
|
if isinstance(x, onn):
|
|
o = o + 1
|
|
if "on" in okk:
|
|
xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
|
|
if isinstance(x, off):
|
|
nn = nn + 1
|
|
if "off" in okk:
|
|
if not (bb.bot or bb.deleted):
|
|
xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
|
|
if isinstance(x, rec):
|
|
rece = rece + 1
|
|
if "rec" in okk:
|
|
if not (bb.bot or bb.deleted):
|
|
xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
|
|
if isinstance(y, owner):
|
|
if "admin" or "owner" in okk:
|
|
xx += f"\n꧁[{get_display_name(bb)}](tg://user?id={bb.id})꧂"
|
|
if isinstance(y, admin):
|
|
if "admin" in okk:
|
|
if not bb.deleted:
|
|
xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
|
|
if "all" in okk:
|
|
if not (bb.bot or bb.deleted):
|
|
xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
|
|
if "bot" in okk:
|
|
if bb.bot:
|
|
xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
|
|
await e.client.send_message(e.chat_id, xx)
|
|
await e.delete()
|