Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
Β·
aa9e39d
1
Parent(s):
46befb7
Update info.py
Browse files- Powers/plugins/info.py +32 -29
Powers/plugins/info.py
CHANGED
|
@@ -17,34 +17,37 @@ gban_db = GBan()
|
|
| 17 |
|
| 18 |
|
| 19 |
async def count(c: Gojo, chat):
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
for
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
async def user_info(c: Gojo, user, already=False):
|
| 50 |
if not already:
|
|
@@ -168,7 +171,7 @@ async def chat_info(c: Gojo, chat, already=False):
|
|
| 168 |
<b>π€¨ Fake</b>: {is_fake}
|
| 169 |
<b>π§ Restricted</b>: {is_restricted}
|
| 170 |
<b>π€ Reasons</b>: {reasons}
|
| 171 |
-
<b>π¨πΏβπ» Description
|
| 172 |
<b>πͺ Total members</b>: {members}
|
| 173 |
<b>π Link to the chat</b>: <a href={invite_link}>Click Hereπͺ</a>
|
| 174 |
<b>π« Can Save Content</b>: {can_save}
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
async def count(c: Gojo, chat):
|
| 20 |
+
try:
|
| 21 |
+
administrator = []
|
| 22 |
+
async for admin in c.get_chat_members(
|
| 23 |
+
chat_id=chat, filter=enums.ChatMembersFilter.ADMINISTRATORS
|
| 24 |
+
):
|
| 25 |
+
administrator.append(admin)
|
| 26 |
+
total_admin = administrator
|
| 27 |
+
bot = []
|
| 28 |
+
async for tbot in c.get_chat_members(
|
| 29 |
+
chat_id=chat, filter=enums.ChatMembersFilter.BOTS
|
| 30 |
+
):
|
| 31 |
+
bot.append(tbot)
|
| 32 |
+
|
| 33 |
+
total_bot = bot
|
| 34 |
+
bot_admin = 0
|
| 35 |
+
ban = []
|
| 36 |
+
async for banned in c.get_chat_members(chat, filter=enums.ChatMembersFilter.BANNED):
|
| 37 |
+
ban.append(banned)
|
| 38 |
+
|
| 39 |
+
total_banned = ban
|
| 40 |
+
for x in total_admin:
|
| 41 |
+
for y in total_bot:
|
| 42 |
+
if x == y:
|
| 43 |
+
bot_admin += 1
|
| 44 |
+
total_admin = len(total_admin)
|
| 45 |
+
total_bot = len(total_bot)
|
| 46 |
+
total_banned = len(total_banned)
|
| 47 |
+
return total_bot, total_admin, bot_admin, total_banned
|
| 48 |
+
except Exception as e:
|
| 49 |
+
total_bot = total_admin = bot_admin = total_banned = "Can't fetch due to some error."
|
| 50 |
+
return total_bot, total_admin, bot_admin, total_banned
|
| 51 |
|
| 52 |
async def user_info(c: Gojo, user, already=False):
|
| 53 |
if not already:
|
|
|
|
| 171 |
<b>π€¨ Fake</b>: {is_fake}
|
| 172 |
<b>π§ Restricted</b>: {is_restricted}
|
| 173 |
<b>π€ Reasons</b>: {reasons}
|
| 174 |
+
<b>π¨πΏβπ» Description</b>: <code>{description}</code>
|
| 175 |
<b>πͺ Total members</b>: {members}
|
| 176 |
<b>π Link to the chat</b>: <a href={invite_link}>Click Hereπͺ</a>
|
| 177 |
<b>π« Can Save Content</b>: {can_save}
|