From 547ff569b8d1491aede77a9240532b20dc6d3f75 Mon Sep 17 00:00:00 2001 From: Andrew <11490628+andrew000@users.noreply.github.com> Date: Tue, 21 Sep 2021 14:48:05 +0300 Subject: [PATCH] Add `GroupDeleted` & `NotMemberOfSupergroup` exceptions --- aiogram/utils/exceptions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aiogram/utils/exceptions.py b/aiogram/utils/exceptions.py index 32291dd3..242e2595 100644 --- a/aiogram/utils/exceptions.py +++ b/aiogram/utils/exceptions.py @@ -569,6 +569,14 @@ class CantTalkWithBots(Unauthorized): match = 'bot can\'t send messages to bots' +class GroupDeleted(Unauthorized): + match = 'Forbidden: the group chat was deleted' + + +class NotMemberOfSupergroup(Unauthorized): + match = 'Forbidden: bot is not a member of the supergroup chat' + + class NetworkError(TelegramAPIError): pass