From 5fc8f623ea22279447db0f94d32406ff3d7ed072 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 27 Jul 2022 18:39:55 +0800 Subject: [PATCH] =?UTF-8?q?jikipedia=20=E5=9B=BE=E7=89=87=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=A4=B1=E8=B4=A5=E6=97=B6=E9=99=8D=E7=BA=A7=E4=B8=BA?= =?UTF-8?q?=E4=BB=85=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikipedia/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jikipedia/main.py b/jikipedia/main.py index 47b0e15..9eb6afc 100644 --- a/jikipedia/main.py +++ b/jikipedia/main.py @@ -115,5 +115,9 @@ async def jikipedia(message: Message): if not image: await message.edit(text, disable_web_page_preview=True) else: - await message.reply_photo(image, quote=False, caption=text) + try: + await message.reply_photo(image, quote=False, caption=text) + await message.safe_delete() + except Exception: + await message.edit(text, disable_web_page_preview=True) await message.safe_delete()