Answer the question
In order to leave comments, you need to log in
Telethon Delete from contacts by phone number, how?
Hello.
There is a list of phone numbers that need to be removed from contacts via Telethon . I
use this code for this:
def delete_contact():
with open('phone.txt', 'rt') as f:
phone_list = f.read().split('\n')
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.contacts.DeleteByPhonesRequest(
phones=phone_list
))
print(result)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question