ADD Exceptions: (#512)

* CantRestrictChatOwner
* UserIsAnAdministratorOfTheChat
This commit is contained in:
Andrew 2021-03-14 18:14:40 +02:00 committed by GitHub
parent 5254329c2b
commit 9bb3a5dccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -494,6 +494,20 @@ class MethodIsNotAvailable(BadRequest):
match = "Method is available only for supergroups"
class CantRestrictChatOwner(BadRequest):
"""
Raises when bot restricts the chat owner
"""
match = 'Can\'t remove chat owner'
class UserIsAnAdministratorOfTheChat(BadRequest):
"""
Raises when bot restricts the chat admin
"""
match = 'User is an administrator of the chat'
class NotFound(TelegramAPIError, _MatchErrorMixin):
__group = True