From c0525a9d5098b5dd6329f7fcdd00a8cc668abc1c Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Mon, 31 Dec 2018 16:15:20 +0200 Subject: [PATCH] More exceptions. --- aiogram/utils/exceptions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aiogram/utils/exceptions.py b/aiogram/utils/exceptions.py index cddd0c74..9e3bb6d2 100644 --- a/aiogram/utils/exceptions.py +++ b/aiogram/utils/exceptions.py @@ -16,6 +16,7 @@ TelegramAPIError ObjectExpectedAsReplyMarkup InlineKeyboardExpected ChatNotFound + ChatIdIsEmpty ChatDescriptionIsNotModified InvalidQueryID InvalidPeerID @@ -40,6 +41,7 @@ TelegramAPIError NotEnoughRightsToPinMessage CantDemoteChatCreator CantRestrictSelf + NotEnoughRightsToRestrict PhotoDimensions UnavailableMembers TypeOfFileMismatch @@ -205,6 +207,10 @@ class ChatNotFound(BadRequest): match = 'chat not found' +class ChatIdIsEmpty(BadRequest): + match = 'chat_id is empty' + + class ChatDescriptionIsNotModified(BadRequest): match = 'chat description is not modified' @@ -284,6 +290,10 @@ class CantRestrictSelf(BadRequest): text = "Admin can't restrict self." +class NotEnoughRightsToRestrict(BadRequest): + match = 'not enough rights to restrict/unrestrict chat member' + + class PhotoDimensions(BadRequest): match = 'PHOTO_INVALID_DIMENSIONS' text = 'Invalid photo dimensions'