mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Merge pull request #14 from 1pyxa1/error_phone_number_banned
Error [400 PHONE_NUMBER_BANNED]
This commit is contained in:
commit
a180a5b47e
@ -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
|
||||
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,
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user