diff --git a/compiler/error/source/400_BAD_REQUEST.tsv b/compiler/error/source/400_BAD_REQUEST.tsv index 810c503b..0b92aba5 100644 --- a/compiler/error/source/400_BAD_REQUEST.tsv +++ b/compiler/error/source/400_BAD_REQUEST.tsv @@ -42,4 +42,5 @@ CDN_METHOD_INVALID The method can't be used on CDN DCs VOLUME_LOC_NOT_FOUND The volume location can't be found FILE_ID_INVALID The file id is invalid LOCATION_INVALID The file location is invalid -CHAT_ADMIN_REQUIRED The method requires admin privileges \ No newline at end of file +CHAT_ADMIN_REQUIRED The method requires admin privileges +PHONE_NUMBER_BANNED The phone number is banned diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 5fd75cc0..b6180a9c 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -37,7 +37,7 @@ from pyrogram.api.errors import ( PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty, PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded, PasswordHashInvalid, FloodWait, PeerIdInvalid, FilePartMissing, - ChatAdminRequired, FirstnameInvalid + ChatAdminRequired, FirstnameInvalid, PhoneNumberBanned ) from pyrogram.api.types import ( User, Chat, Channel, @@ -274,7 +274,7 @@ class Client: ) ) break - except PhoneNumberInvalid as e: + except (PhoneNumberInvalid, PhoneNumberBanned) as e: if phone_number_invalid_raises: raise else: