Spaces:
Paused
Paused
iamgojoof6eyes
commited on
Commit
Β·
fa04dc3
1
Parent(s):
cd3ee79
Looks good
Browse files- Powers/plugins/info.py +8 -3
- Powers/plugins/report.py +2 -1
Powers/plugins/info.py
CHANGED
|
@@ -15,7 +15,7 @@ from Powers.utils.chat_type import c_type
|
|
| 15 |
|
| 16 |
gban_db=GBan()
|
| 17 |
|
| 18 |
-
async def
|
| 19 |
administrator = []
|
| 20 |
async for admin in c.get_chat_members(chat_id=chat, filter = enums.ChatMembersFilter.ADMINISTRATORS):
|
| 21 |
total_admin = administrator.append(admin)
|
|
@@ -23,13 +23,17 @@ async def admin_bot_count(c: Gojo, chat):
|
|
| 23 |
async for tbot in c.get_chat_members(chat_id=chat, filter= enums.ChatMembersFilter.BOTS):
|
| 24 |
total_bot = bot.append(tbot)
|
| 25 |
bot_admin = 0
|
|
|
|
|
|
|
|
|
|
| 26 |
for x in total_admin:
|
| 27 |
for y in total_bot:
|
| 28 |
if x == y:
|
| 29 |
bot_admin += 1
|
| 30 |
total_admin = len(total_admin)
|
| 31 |
total_bot = len(total_bot)
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
async def user_info(c: Gojo, user, already=False):
|
| 35 |
if not already:
|
|
@@ -126,7 +130,7 @@ async def chat_info(c: Gojo, chat, already=False):
|
|
| 126 |
online_mem = c.get_chat_online_count(chat)
|
| 127 |
chat_id = chat.id
|
| 128 |
username = chat.username
|
| 129 |
-
total_bot, total_admin, total_bot_admin = await
|
| 130 |
title = chat.title
|
| 131 |
type_ = c_type(c, chat_id=chat)
|
| 132 |
is_scam = chat.is_scam
|
|
@@ -156,6 +160,7 @@ async def chat_info(c: Gojo, chat, already=False):
|
|
| 156 |
<b>π Username</b>: {("@" + username) if username else "NA"}
|
| 157 |
<b>βοΈ Administrators</b>: {total_admin}
|
| 158 |
<b>π€ Bots</b>: {total_bot}
|
|
|
|
| 159 |
<b>βοΈ Admin π€ Bots</b>: {total_bot_admin}
|
| 160 |
<b>π¨βπ» Currently online</b>: {online_mem}
|
| 161 |
<b>π§ Scam</b>: {is_scam}
|
|
|
|
| 15 |
|
| 16 |
gban_db=GBan()
|
| 17 |
|
| 18 |
+
async def count(c: Gojo, chat):
|
| 19 |
administrator = []
|
| 20 |
async for admin in c.get_chat_members(chat_id=chat, filter = enums.ChatMembersFilter.ADMINISTRATORS):
|
| 21 |
total_admin = administrator.append(admin)
|
|
|
|
| 23 |
async for tbot in c.get_chat_members(chat_id=chat, filter= enums.ChatMembersFilter.BOTS):
|
| 24 |
total_bot = bot.append(tbot)
|
| 25 |
bot_admin = 0
|
| 26 |
+
ban = []
|
| 27 |
+
async for banned in c.get_chat_members(chat, filter=enums.ChatMembersFilter.BANNED):
|
| 28 |
+
total_banned = ban.append(banned)
|
| 29 |
for x in total_admin:
|
| 30 |
for y in total_bot:
|
| 31 |
if x == y:
|
| 32 |
bot_admin += 1
|
| 33 |
total_admin = len(total_admin)
|
| 34 |
total_bot = len(total_bot)
|
| 35 |
+
total_banned = len(total_banned)
|
| 36 |
+
return total_bot, total_admin, bot_admin, total_banned
|
| 37 |
|
| 38 |
async def user_info(c: Gojo, user, already=False):
|
| 39 |
if not already:
|
|
|
|
| 130 |
online_mem = c.get_chat_online_count(chat)
|
| 131 |
chat_id = chat.id
|
| 132 |
username = chat.username
|
| 133 |
+
total_bot, total_admin, total_bot_admin, total_banned = await count(c,chat)
|
| 134 |
title = chat.title
|
| 135 |
type_ = c_type(c, chat_id=chat)
|
| 136 |
is_scam = chat.is_scam
|
|
|
|
| 160 |
<b>π Username</b>: {("@" + username) if username else "NA"}
|
| 161 |
<b>βοΈ Administrators</b>: {total_admin}
|
| 162 |
<b>π€ Bots</b>: {total_bot}
|
| 163 |
+
<b>π« Banned</b>: {total_banned}
|
| 164 |
<b>βοΈ Admin π€ Bots</b>: {total_bot_admin}
|
| 165 |
<b>π¨βπ» Currently online</b>: {online_mem}
|
| 166 |
<b>π§ Scam</b>: {is_scam}
|
Powers/plugins/report.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from traceback import format_exc
|
| 2 |
|
| 3 |
from pyrogram import filters
|
|
|
|
| 4 |
from pyrogram.errors import RPCError
|
| 5 |
from pyrogram.types import CallbackQuery, Message
|
| 6 |
|
|
@@ -79,7 +80,7 @@ async def report_watcher(c: Gojo, m: Message):
|
|
| 79 |
reported_msg_id = m.reply_to_message.message_id
|
| 80 |
reported_user = m.reply_to_message.from_user
|
| 81 |
chat_name = m.chat.title or m.chat.username
|
| 82 |
-
admin_list = await c.get_chat_members(m.chat.id, filter=
|
| 83 |
|
| 84 |
if reported_user.id == me.id:
|
| 85 |
await m.reply_text("Nice try.")
|
|
|
|
| 1 |
from traceback import format_exc
|
| 2 |
|
| 3 |
from pyrogram import filters
|
| 4 |
+
from pyrogram.enums import ChatMembersFilter as cmf
|
| 5 |
from pyrogram.errors import RPCError
|
| 6 |
from pyrogram.types import CallbackQuery, Message
|
| 7 |
|
|
|
|
| 80 |
reported_msg_id = m.reply_to_message.message_id
|
| 81 |
reported_user = m.reply_to_message.from_user
|
| 82 |
chat_name = m.chat.title or m.chat.username
|
| 83 |
+
admin_list = await c.get_chat_members(m.chat.id, filter=cmf.ADMINISTRATORS)
|
| 84 |
|
| 85 |
if reported_user.id == me.id:
|
| 86 |
await m.reply_text("Nice try.")
|