From 693571f2757dcc2af27e89a31017326442b790dc Mon Sep 17 00:00:00 2001 From: Oleg A Date: Sat, 26 May 2018 01:13:04 +0300 Subject: [PATCH] CantRestrictSelf exception Exception CantRestrictSelf happens if admin try to restrict self --- aiogram/utils/exceptions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aiogram/utils/exceptions.py b/aiogram/utils/exceptions.py index d305b9b5..aec980c1 100644 --- a/aiogram/utils/exceptions.py +++ b/aiogram/utils/exceptions.py @@ -26,6 +26,7 @@ TelegramAPIError PhotoAsInputFileRequired InvalidStickersSet ChatAdminRequired + CantRestrictSelf PhotoDimensions UnavailableMembers TypeOfFileMismatch @@ -206,7 +207,12 @@ class ChatAdminRequired(BadRequest): match = 'CHAT_ADMIN_REQUIRED' text = 'Admin permissions is required!' + +class CantRestrictSelf(BadRequest): + match = "can't restrict self" + text = "Admin can't restrict self." + class PhotoDimensions(BadRequest): match = 'PHOTO_INVALID_DIMENSIONS' text = 'Invalid photo dimensions'