2
0
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:
Dan 2018-02-01 13:46:24 +01:00 committed by GitHub
commit a180a5b47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -43,3 +43,4 @@ 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
PHONE_NUMBER_BANNED The phone number is banned

1 id message
43 FILE_ID_INVALID The file id is invalid
44 LOCATION_INVALID The file location is invalid
45 CHAT_ADMIN_REQUIRED The method requires admin privileges
46 PHONE_NUMBER_BANNED The phone number is banned

View File

@ -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: