Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit df46022747a61e53fdfdadb564a5bc1d591af735
Author: K-E-N-W-A-Y <[email protected]>
Date:   Thu Mar 19 19:47:08 2020 +0530

    whois reply msg changed to new msg

commit 3108b71e6f726f13a16d304dc9b47da835041053
Author: K-E-N-W-A-Y <[email protected]>
Date:   Thu Mar 19 19:08:47 2020 +0530

    add missing emoji

commit 1f38e2b8f00caf71a0ab1e77e0e4e71e96623685
Author: K-E-N-W-A-Y <[email protected]>
Date:   Thu Mar 19 18:58:23 2020 +0530

    added emoji to whois output

commit d79fa8c3d4c6b943495be682bc914f34dc6a2e9e
Author: K-E-N-W-A-Y <[email protected]>
Date:   Thu Mar 19 17:24:26 2020 +0530

    fix spelling + add phone option

commit 09959f7eb7ac3dd1063d4d8f54164e318fb88fa6
Author: K-E-N-W-A-Y <[email protected]>
Date:   Thu Mar 19 17:07:09 2020 +0530

    changed output formating

commit 5ee894567d2249d103645d3e80b2e354db2fc9f5
Author: K-E-N-W-A-Y <[email protected]>
Date:   Thu Mar 19 16:55:51 2020 +0530

    removed uselsess line
  • Loading branch information
K-E-N-W-A-Y committed Mar 19, 2020
1 parent dbd8f81 commit e23e0eb
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions userge/plugins/whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

@userge.on_cmd("whois", about="to get user details")
async def who_is(_, message):

await message.edit("`Collecting Whois Info.. Hang on!`")

if " " in message.text:
_, user_id = message.text.split(" ")

try:
user_id = (user_id)
from_user = await userge.get_users(user_id)
from_chat = await userge.get_chat(user_id)

Expand All @@ -27,27 +29,28 @@ async def who_is(_, message):
if from_user or from_chat is not None:
message_out_str = ""

message_out_str += f"<strong>USER INFO:</strong>\n\n"
message_out_str += f"<strong>First Name:</strong> <code>{from_user.first_name}</code>\n"
message_out_str += f"<strong>Last Name:</strong> <code>{from_user.last_name}</code>\n"
message_out_str += f"<strong>Username:</strong> @{from_user.username}\n"
message_out_str += f"<strong>Data Centre ID:</strong> <code>{from_user.dc_id}</code>\n"
message_out_str += f"<strong>Is Bot:</strong> <code>{from_user.is_bot}</code>\n"
message_out_str += f"<strong>Is Restricted:</strong> <code>{from_user.is_scam}</code>\n"
message_out_str += f"<strong>Is Verified by Telegram:</strong> <code>{from_user.is_verified}</code>\n"
message_out_str += f"<strong>User ID:</strong> <code>{from_user.id}</code>\n\n"
message_out_str += f"<strong>Bio:</strong> <code>{from_chat.description}</code>\n\n"
message_out_str += f"<strong>Last Seen:</strong> <code>{from_user.status}</code>\n"
message_out_str += f"<strong>Permanent Link To Profile:</strong> <a href='tg://user?id={from_user.id}'>{from_user.first_name}</a>"
message_out_str += f"<b>USER INFO:</b>\n\n"
message_out_str += f"<b>πŸ—£ First Name:</b> <code>{from_user.first_name}</code>\n"
message_out_str += f"<b>πŸ—£ Last Name:</b> <code>{from_user.last_name}</code>\n"
message_out_str += f"<b>πŸ‘€ Username:</b> @{from_user.username}\n"
message_out_str += f"<b>🏒 DC ID:</b> <code>{from_user.dc_id}</code>\n"
message_out_str += f"<b>πŸ€– Is Bot:</b> <code>{from_user.is_bot}</code>\n"
message_out_str += f"<b>🚫 Is Restricted:</b> <code>{from_user.is_scam}</code>\n"
message_out_str += f"<b>βœ… Is Verified by Telegram:</b> <code>{from_user.is_verified}</code>\n"
message_out_str += f"<b>πŸ•΅οΈβ€β™‚οΈ User ID:</b> <code>{from_user.id}</code>\n"
message_out_str += f"<b>πŸ“ž Phone NO:</b> <code>{from_user.phone_number}</code>\n\n"
message_out_str += f"<b>πŸ“ Bio:</b> <code>{from_chat.description}</code>\n\n"
message_out_str += f"<b>πŸ‘ Last Seen:</b> <code>{from_user.status}</code>\n"
message_out_str += f"<b>πŸ”— Permanent Link To Profile:</b> <a href='tg://user?id={from_user.id}'>{from_user.first_name}</a>"

if from_user.photo:
local_user_photo = await userge.download_media(
message=from_user.photo.big_file_id
)

await message.reply_photo(
await userge.send_photo(
chat_id=message.chat.id,
photo=local_user_photo,
quote=True,
caption=message_out_str,
parse_mode="html",
# ttl_seconds=,
Expand All @@ -58,5 +61,5 @@ async def who_is(_, message):
await message.delete()

else:
message_out_str = "<b>No DP Found</b>\n\n" + message_out_str
message_out_str = "<b>πŸ“· NO DP Found πŸ“·</b>\n\n" + message_out_str
await message.edit(message_out_str, parse_mode="html")

0 comments on commit e23e0eb

Please sign in to comment.