🤬
  • Fix unused variable, Added validation of the target during the flag -c Added a way to specify nickname during the -u usage.

  • Loading...
  • Giacomo Giallombardo committed 2 years ago
    37fbe534
    1 parent 58f6c255
  • ■ ■ ■ ■ ■
    README.md
    skipped 82 lines
    83 83   
    84 84  - **'--user', '-u' [USER]**
    85 85   
    86  -Looks up a specified user ID. This will only work if your account has "encountered" the user before (for example, after archiving a group).
     86 +Looks up a specified user ID. This will only work if your account has "encountered" the user before (for example, after archiving a group), you can specify User ID or @nickname
    87 87   
    88 88  ```
    89 89  $ telepathy -t 0123456789 -u
     90 + 
     91 +$ telepathy -t @test_user -u
    90 92  ```
    91 93   
    92 94   
    skipped 95 lines
  • ■ ■ ■ ■ ■
    requirements.txt
    1 1  alive-progress==2.4.1
    2  -beautifulsoup4==4.11.1
     2 +beautifulsoup4==4.9.3
    3 3  Click==7.1.2
    4 4  colorama==0.4.3
    5 5  pandas==1.4.2
    skipped 1 lines
    7 7  requests==2.28.1
    8 8  googletrans==4.0.0rc1
    9 9  pprintpp==0.4.0
     10 +cryptg==0.3.1
  • ■ ■ ■ ■ ■ ■
    src/telepathy/telepathy.py
    skipped 30 lines
    31 31   print_shell,
    32 32   createPlaceholdeCls
    33 33  )
    34  -import telepathy.const as const
    35 34   
    36 35  from colorama import Fore, Back, Style
    37  - 
    38 36  from telethon.errors import SessionPasswordNeededError, ChannelPrivateError
    39 37  from telethon.tl.types import (
    40 38   InputPeerEmpty,
    41 39   PeerUser,
     40 + User,
    42 41   PeerChat,
    43 42   PeerChannel,
    44 43   PeerLocated,
    skipped 349 lines
    394 393   break
    395 394   
    396 395   if entity.username:
    397  - name = entity.title
    398 396   group_url = "http://t.me/" + entity.username
    399 397   group_username = entity.username
    400 398   web_req = parse_html_page(group_url)
    skipped 19 lines
    420 418   
    421 419   translated_description = _desc["translated_text"]
    422 420   group_description = ('"' + group_description + '"')
     421 + 
     422 + if(entity.__class__ == User):
     423 + color_print_green(" [!] ", "U can't search user using flag -c, run Telepathy using the flag -u.")
     424 + exit(1)
    423 425   
    424 426   if entity.broadcast is True:
    425 427   chat_type = "Channel"
    skipped 895 lines
    1321 1323   if user_check == True:
    1322 1324   my_user = None
    1323 1325   try:
    1324  - 
    1325  - user = int(t)
    1326  - my_user = await client.get_entity(PeerUser(int(user)))
     1326 + if "@" in t:
     1327 + my_user = await client.get_entity(t)
     1328 + else:
     1329 + user = int(t)
     1330 + my_user = await client.get_entity(PeerUser(int(user)))
    1327 1331   
    1328 1332   user_first_name = my_user.first_name
    1329 1333   user_last_name = my_user.last_name
    skipped 146 lines
  • ■ ■ ■ ■
    src/telepathy/utils.py
    skipped 178 lines
    179 179   
    180 180  def print_shell(type, obj):
    181 181   if type == "user":
    182  - color_print_green(" [+] ", "User details for " + obj.targe)
     182 + color_print_green(" [+] ", "User details for " + obj.target)
    183 183   color_print_green(" ├ Username: ", str(obj.username))
    184 184   color_print_green(" ├ Name: ", str(obj.user_full_name))
    185 185   color_print_green(" ├ Verification: ", str(obj.verified))
    skipped 168 lines
Please wait...
Page is in error, reload to recover