From c439ec88c85afb0b6423a487012d1818b1aa885b Mon Sep 17 00:00:00 2001 From: Andrew <11490628+andrew000@users.noreply.github.com> Date: Thu, 2 Sep 2021 00:42:04 +0300 Subject: [PATCH] Add `NoRightsToSendMessage` exception --- aiogram/utils/exceptions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aiogram/utils/exceptions.py b/aiogram/utils/exceptions.py index e3a1f313..f2ad6111 100644 --- a/aiogram/utils/exceptions.py +++ b/aiogram/utils/exceptions.py @@ -508,6 +508,13 @@ class UserIsAnAdministratorOfTheChat(BadRequest): match = 'User is an administrator of the chat' +class NoRightsToSendMessage(BadRequest): + """ + Raises when bot has no rights to send a message to the group + """ + match = 'Have no rights to send a message' + + class NotFound(TelegramAPIError, _MatchErrorMixin): __group = True