mirror of
https://github.com/bellingcat/telegram-phone-number-checker.git
synced 2026-06-07 19:08:31 +03:00
Fix missing info (#17)
* Use the user object from user deletion instead of user import * Bump version
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user