jikipedia 图片发送失败时降级为仅文本

This commit is contained in:
xtaodada 2022-07-27 18:39:55 +08:00
parent a7e3a190ac
commit 5fc8f623ea
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -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()