From a5870c74b5b24c0d28ffb5247a8a008c27e7a979 Mon Sep 17 00:00:00 2001 From: jowi-tech <72805812+jowi-tech@users.noreply.github.com> Date: Sun, 31 Jan 2021 16:39:49 +0100 Subject: [PATCH] Update Telegram_phone_validation.py --- Telegram_phone_validation.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Telegram_phone_validation.py b/Telegram_phone_validation.py index d617312..89124b3 100644 --- a/Telegram_phone_validation.py +++ b/Telegram_phone_validation.py @@ -13,8 +13,6 @@ def get_names(phone_number): try: contact = InputPhoneContact(client_id = 0, phone = phone_number, first_name="__test__", last_name="__last_test__") contacts = client(functions.contacts.ImportContactsRequest([contact])) - #first_name = contacts.to_dict()['users'][0]['first_name'] - #last_name = contacts.to_dict()['users'][0]['last_name'] username = contacts.to_dict()['users'][0]['username'] del_usr = client(functions.contacts.DeleteContactsRequest(id=[username])) if not username: @@ -22,7 +20,6 @@ def get_names(phone_number): else: return username except IndexError as e: - #err = "ERROR - maybe the user does not exist or something else went wrong." return f'ERROR: there was no response for the phone number: {phone_number}' except: raise @@ -38,10 +35,6 @@ def user_validator(): for phone in phones: api_res = get_names(phone) result[phone] = api_res - #if type(api_res) == tuple: - # result[phone] = { 'first name' : api_res[0], 'last name' : api_res[1] } - #else: - # result[phone] = api_res except: raise