Skip to content

Commit

Permalink
Fix missing info (#17)
Browse files Browse the repository at this point in the history
* Use the user object from user deletion instead of user import
* Bump version
  • Loading branch information
GalenReich authored Feb 13, 2024
1 parent fe57ce1 commit b9380e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "telegram-phone-number-checker"
version = "1.0.6"
version = "1.0.7"
description = "Check if phone numbers are connected to Telegram accounts."
authors = ["Bellingcat"]
license = "MIT"
Expand Down
5 changes: 3 additions & 2 deletions telegram_phone_number_checker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ def get_names(client, phone_number):
if number_of_matches == 0:
result.update({"error": f'No response, the phone number is not on Telegram or has blocked contact adding.'})
elif number_of_matches == 1:
user = users[0]
# Attempt to remove the contact from the address book
client(functions.contacts.DeleteContactsRequest(id=[user.get('id')]))
# The response from DeleteContactsRequest contains more information than from ImportContactsRequest
del_user = client(functions.contacts.DeleteContactsRequest(id=[users[0].get('id')]))
user = del_user.to_dict().get('users')[0]
# getting more information about the user
result.update({
"id": user.get('id'),
Expand Down

0 comments on commit b9380e0

Please sign in to comment.