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()