mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Merge pull request #14 from 1pyxa1/error_phone_number_banned
Error [400 PHONE_NUMBER_BANNED]
This commit is contained in:
commit
a180a5b47e
@ -43,3 +43,4 @@ VOLUME_LOC_NOT_FOUND The volume location can't be found
|
|||||||
FILE_ID_INVALID The file id is invalid
|
FILE_ID_INVALID The file id is invalid
|
||||||
LOCATION_INVALID The file location is invalid
|
LOCATION_INVALID The file location is invalid
|
||||||
CHAT_ADMIN_REQUIRED The method requires admin privileges
|
CHAT_ADMIN_REQUIRED The method requires admin privileges
|
||||||
|
PHONE_NUMBER_BANNED The phone number is banned
|
||||||
|
|
@ -37,7 +37,7 @@ from pyrogram.api.errors import (
|
|||||||
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
|
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
|
||||||
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
||||||
PasswordHashInvalid, FloodWait, PeerIdInvalid, FilePartMissing,
|
PasswordHashInvalid, FloodWait, PeerIdInvalid, FilePartMissing,
|
||||||
ChatAdminRequired, FirstnameInvalid
|
ChatAdminRequired, FirstnameInvalid, PhoneNumberBanned
|
||||||
)
|
)
|
||||||
from pyrogram.api.types import (
|
from pyrogram.api.types import (
|
||||||
User, Chat, Channel,
|
User, Chat, Channel,
|
||||||
@ -274,7 +274,7 @@ class Client:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
except PhoneNumberInvalid as e:
|
except (PhoneNumberInvalid, PhoneNumberBanned) as e:
|
||||||
if phone_number_invalid_raises:
|
if phone_number_invalid_raises:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user