Answer the question
In order to leave comments, you need to log in
How to check if an account with the telethon library is banned?
this_client = TelegramClient(phone_number, api_id, api_hash)
this_client.connect()
if not this_client.is_user_authorized():
try:
this_client.send_code_request(phone_number)
except telethon.errors.rpc_error_list.PhoneNumberBannedError:
print("Phone number is banned.")
this_client.disconnect()
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