From d386a47ac7d060d9e2a2f645a562956555594b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Tue, 11 Apr 2023 09:44:39 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20`TypeError`=20exception=20?= =?UTF-8?q?caused=20by=20`message`=20is=20None?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system/errorhandler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/system/errorhandler.py b/plugins/system/errorhandler.py index bc4bb18..d08c711 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -83,11 +83,13 @@ class ErrorHandler(Plugin): try: if update.callback_query: await update.callback_query.answer(content, show_alert=True) - else: + return + if message: reply_text = await message.reply_text(content, reply_markup=buttons, allow_sending_without_reply=True) if filters.ChatType.GROUPS.filter(reply_text): self.add_delete_message_job(reply_text, context=context) self.add_delete_message_job(message, context=context) + return except TelegramError as exc: logger.error(self.SEND_MSG_ERROR_NOTICE, update.update_id, exc.message) except Exception as exc: