From f7a4188a534dd1dd7277ff152547c10d0d3e9e2e Mon Sep 17 00:00:00 2001 From: mihalin Date: Sun, 26 Jun 2022 02:51:19 +0300 Subject: [PATCH] chat not found handle --- server/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/custom.py b/server/custom.py index e91017d..db7456d 100644 --- a/server/custom.py +++ b/server/custom.py @@ -129,7 +129,7 @@ async def handle_user_message(message: types.Message, super_chat_id: int, bot): # Пересылаем сообщение в супер-чат try: await send_to_superchat(is_super_group, message, super_chat_id, bot) - except exceptions.Unauthorized: + except (exceptions.Unauthorized, exceptions.ChatNotFound): return SendMessage(chat_id=message.chat.id, text=_("Не удаётся связаться с владельцем бота")) bot.incoming_messages_count = F("incoming_messages_count") + 1