Fix missing info (#17)

* Use the user object from user deletion instead of user import
* Bump version
This commit is contained in:
Galen Reich
2024-02-13 15:23:52 +00:00
committed by GitHub
parent fe57ce1443
commit b9380e001a
2 changed files with 4 additions and 3 deletions

View File

@@ -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"

View File

@@ -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'),