Spaces:
Paused
Paused
iamgojoof6eyes
commited on
Commit
Β·
d9f4368
1
Parent(s):
a69162f
Looks fine
Browse files- Powers/plugins/info.py +59 -58
Powers/plugins/info.py
CHANGED
|
@@ -14,30 +14,6 @@ from Powers.utils.chat_type import c_type
|
|
| 14 |
|
| 15 |
gban_db=GBan()
|
| 16 |
|
| 17 |
-
escape = "\n"
|
| 18 |
-
empty = " "
|
| 19 |
-
|
| 20 |
-
bold = lambda x: f"**{x}:** "
|
| 21 |
-
bold_ul = lambda x: f"**--{x}:**-- "
|
| 22 |
-
|
| 23 |
-
single_func = lambda x: f"`{x}`{escape}"
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
def change(
|
| 27 |
-
title: str,
|
| 28 |
-
body: dict,
|
| 29 |
-
indent: int = 2,
|
| 30 |
-
underline: bool = False,
|
| 31 |
-
) -> str:
|
| 32 |
-
text = (bold_ul(title) + escape) if underline else bold(title) + escape
|
| 33 |
-
|
| 34 |
-
for key, value in body.items():
|
| 35 |
-
text += (
|
| 36 |
-
indent * empty
|
| 37 |
-
+ bold(key)
|
| 38 |
-
+ ((value[0] + escape) if isinstance(value, list) else single_func(value))
|
| 39 |
-
)
|
| 40 |
-
return text
|
| 41 |
|
| 42 |
|
| 43 |
async def user_info(c: Gojo, user, already=False):
|
|
@@ -52,6 +28,7 @@ async def user_info(c: Gojo, user, already=False):
|
|
| 52 |
|
| 53 |
if not user.first_name:
|
| 54 |
return ["Deleted account", None]
|
|
|
|
| 55 |
gbanned, reason_gban = gban_db.get_gban(user)
|
| 56 |
if gbanned:
|
| 57 |
gban=True
|
|
@@ -63,8 +40,11 @@ async def user_info(c: Gojo, user, already=False):
|
|
| 63 |
user_id = user.id
|
| 64 |
username = user.username
|
| 65 |
first_name = user.first_name
|
|
|
|
| 66 |
mention = user.mention(f"{first_name}")
|
| 67 |
dc_id = user.dc_id
|
|
|
|
|
|
|
| 68 |
photo_id = user.photo.big_file_id if user.photo else None
|
| 69 |
is_support = user_id in SUPPORT_STAFF
|
| 70 |
if user_id in SUPPORT_STAFF:
|
|
@@ -78,7 +58,6 @@ async def user_info(c: Gojo, user, already=False):
|
|
| 78 |
omp = "Hmmm.......Who is that again?"
|
| 79 |
is_bot = user.is_bot
|
| 80 |
is_fake = user.is_fake
|
| 81 |
-
|
| 82 |
status = user.status
|
| 83 |
|
| 84 |
|
|
@@ -101,22 +80,29 @@ async def user_info(c: Gojo, user, already=False):
|
|
| 101 |
else:
|
| 102 |
last_date = "User is currently online"
|
| 103 |
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
async def chat_info(c: Gojo, chat, already=False):
|
|
@@ -131,26 +117,41 @@ async def chat_info(c: Gojo, chat, already=False):
|
|
| 131 |
description = chat.description
|
| 132 |
members = chat.members_count
|
| 133 |
is_restricted = chat.is_restricted
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
dc_id = chat.dc_id
|
| 136 |
photo_id = chat.photo.big_file_id if chat.photo else None
|
| 137 |
can_save = chat.has_protected_content
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
|
| 156 |
@Gojo.on_message(command(["info","whois"]))
|
|
|
|
| 14 |
|
| 15 |
gban_db=GBan()
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
async def user_info(c: Gojo, user, already=False):
|
|
|
|
| 28 |
|
| 29 |
if not user.first_name:
|
| 30 |
return ["Deleted account", None]
|
| 31 |
+
|
| 32 |
gbanned, reason_gban = gban_db.get_gban(user)
|
| 33 |
if gbanned:
|
| 34 |
gban=True
|
|
|
|
| 40 |
user_id = user.id
|
| 41 |
username = user.username
|
| 42 |
first_name = user.first_name
|
| 43 |
+
last_name = user.last_name
|
| 44 |
mention = user.mention(f"{first_name}")
|
| 45 |
dc_id = user.dc_id
|
| 46 |
+
is_verified = user.is_verified
|
| 47 |
+
is_restricted = user.is_restricted
|
| 48 |
photo_id = user.photo.big_file_id if user.photo else None
|
| 49 |
is_support = user_id in SUPPORT_STAFF
|
| 50 |
if user_id in SUPPORT_STAFF:
|
|
|
|
| 58 |
omp = "Hmmm.......Who is that again?"
|
| 59 |
is_bot = user.is_bot
|
| 60 |
is_fake = user.is_fake
|
|
|
|
| 61 |
status = user.status
|
| 62 |
|
| 63 |
|
|
|
|
| 80 |
else:
|
| 81 |
last_date = "User is currently online"
|
| 82 |
|
| 83 |
+
caption = f"""
|
| 84 |
+
<b><i><u>β‘ Extracted User info From Telegram β‘</b></i></u>
|
| 85 |
+
|
| 86 |
+
<b>ποΈ User ID</b>: <code>{user_id}</code>
|
| 87 |
+
<b>π Link To Profile</b>: <a href='tg://user?id={user_id}'>Click Hereπͺ</a>
|
| 88 |
+
<b>π£οΈ Mention</b>: {mention}
|
| 89 |
+
<b>π£οΈ First Name</b>: <code>{first_name}</code>
|
| 90 |
+
<b>π£οΈ Second Name</b>: <code>{last_name}</code>
|
| 91 |
+
<b>π Username</b>: {("@" + username) if username else "NA"}
|
| 92 |
+
<b>π₯Έ Support</b>: {is_support}
|
| 93 |
+
<b>π€ Support user type</b>: <code>{omp}</code>
|
| 94 |
+
<b>π£ Gbanned</b>: {gban}
|
| 95 |
+
<b>π€ Gban reason</b>: <code>{reason}</code>
|
| 96 |
+
<b>π DC ID</b>: {dc_id}
|
| 97 |
+
<b>π§ RESTRICTED</b>: {is_restricted}
|
| 98 |
+
<b>β
VERIFIED</b>: {is_verified}
|
| 99 |
+
<b>π§ FAKE</b> : {is_fake}
|
| 100 |
+
<b>π€ BOT</b>: {is_bot}
|
| 101 |
+
<b>π Last seen</b>: <code>{last_date}</code>
|
| 102 |
+
|
| 103 |
+
"""
|
| 104 |
+
|
| 105 |
+
return caption, photo_id
|
| 106 |
|
| 107 |
|
| 108 |
async def chat_info(c: Gojo, chat, already=False):
|
|
|
|
| 117 |
description = chat.description
|
| 118 |
members = chat.members_count
|
| 119 |
is_restricted = chat.is_restricted
|
| 120 |
+
if is_restricted:
|
| 121 |
+
reasons = chat.restrictions
|
| 122 |
+
else:
|
| 123 |
+
reasons = "Chat is not restricted..."
|
| 124 |
+
invite_link = chat.invite_link
|
| 125 |
dc_id = chat.dc_id
|
| 126 |
photo_id = chat.photo.big_file_id if chat.photo else None
|
| 127 |
can_save = chat.has_protected_content
|
| 128 |
+
sticker_set = chat.sticker_set_name
|
| 129 |
+
linked_chat = chat.linked_chat
|
| 130 |
+
reactions = chat.available_reactions
|
| 131 |
+
|
| 132 |
+
caption = f"""
|
| 133 |
+
π° <b>CHAT INFO</b> π°
|
| 134 |
+
|
| 135 |
+
<b>π ID</b>: <code>{chat_id}</code>
|
| 136 |
+
<b>π Chat Title</b>: {title}
|
| 137 |
+
<b>β¨ Chat Type</b>: {type_}
|
| 138 |
+
<b>π DataCentre ID</b>: {dc_id}
|
| 139 |
+
<b> Username</b>: {("@" + username) if username else "NA"}
|
| 140 |
+
<b>π§ Scam</b>: {is_scam}
|
| 141 |
+
<b>π€¨ Fake</b>: {is_fake}
|
| 142 |
+
<b> Restricted</b>: {is_restricted}
|
| 143 |
+
<b> Reasons</b>: {reasons}
|
| 144 |
+
<b>π¨πΏβπ» Description: <code>{description}</code>
|
| 145 |
+
<b>πͺ Total members</b>: {members}
|
| 146 |
+
<b>π Link to the chat</b>: <a href={invite_link}>Click Hereπͺ</a>
|
| 147 |
+
<b>π« Can Save Content</b>: {can_save}
|
| 148 |
+
<b>π Sticker set</b>: {sticker_set}
|
| 149 |
+
<b> Linked Chat</b>: {linked_chat if linked_chat else "Not Linked"}
|
| 150 |
+
<b> Reactions</b>: {reactions}
|
| 151 |
+
|
| 152 |
+
"""
|
| 153 |
+
|
| 154 |
+
return caption, photo_id
|
| 155 |
|
| 156 |
|
| 157 |
@Gojo.on_message(command(["info","whois"]))
|