From ce026dfa71273708852ad2863433331d455bd545 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Wed, 1 Jan 2020 16:05:59 +0200 Subject: [PATCH] Add exception MethodIsNotAvailable --- aiogram/utils/exceptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aiogram/utils/exceptions.py b/aiogram/utils/exceptions.py index f77fe257..bec48d97 100644 --- a/aiogram/utils/exceptions.py +++ b/aiogram/utils/exceptions.py @@ -65,6 +65,7 @@ - UnsupportedUrlProtocol - CantParseEntities - ResultIdDuplicate + - MethodIsNotAvailable - ConflictError - TerminatedByOtherGetUpdates - CantGetUpdates @@ -461,6 +462,10 @@ class BotDomainInvalid(BadRequest): text = 'Invalid bot domain' +class MethodIsNotAvailable(BadRequest): + match = "Method is available only for supergroups" + + class NotFound(TelegramAPIError, _MatchErrorMixin): __group = True