mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
More API Exceptions.
This commit is contained in:
parent
77867fe109
commit
c0fcaa6f45
2 changed files with 18 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ TelegramAPIError
|
|||
NotFound
|
||||
MethodNotKnown
|
||||
PhotoAsInputFileRequired
|
||||
ToMuchMessages
|
||||
ConflictError
|
||||
TerminatedByOtherGetUpdates
|
||||
CantGetUpdates
|
||||
|
|
@ -28,6 +29,7 @@ TelegramAPIError
|
|||
BotKicked
|
||||
BotBlocked
|
||||
UserDeactivated
|
||||
CantInitiateConversation
|
||||
NetworkError
|
||||
RetryAfter
|
||||
MigrateToChat
|
||||
|
|
@ -147,6 +149,13 @@ class PhotoAsInputFileRequired(BadRequest, _MatchErrorMixin):
|
|||
match = 'Photo should be uploaded as an InputFile'
|
||||
|
||||
|
||||
class ToMuchMessages(BadRequest, _MatchErrorMixin):
|
||||
"""
|
||||
Will be raised when you try to send media group with more than 10 items.
|
||||
"""
|
||||
match = 'Too much messages to send as an album'
|
||||
|
||||
|
||||
class BadWebhook(BadRequest):
|
||||
pass
|
||||
|
||||
|
|
@ -203,6 +212,10 @@ class UserDeactivated(Unauthorized, _MatchErrorMixin):
|
|||
match = 'user is deactivated'
|
||||
|
||||
|
||||
class CantInitiateConversation(Unauthorized, _MatchErrorMixin):
|
||||
match = 'bot can\'t initiate conversation with a user'
|
||||
|
||||
|
||||
class NetworkError(TelegramAPIError):
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue