epic 发送图片失败降级为发送文字

This commit is contained in:
xtaodada 2022-07-20 17:21:40 +08:00
parent a03b4ea41a
commit a8dee08961
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 5 additions and 2 deletions

View File

@ -96,7 +96,10 @@ async def epic(message: Message):
r = await client.get(game_thumbnail, timeout=10.0)
with open("epic.jpg", "wb") as code:
code.write(r.content)
await message.reply_photo("epic.jpg", caption=msg, quote=False)
try:
await message.reply_photo("epic.jpg", caption=msg, quote=False)
except Exception:
await message.reply(msg, quote=False)
safe_remove("epic.jpg")
else:
await message.reply(msg, quote=False)

View File

@ -372,7 +372,7 @@
},
{
"name": "epic",
"version": "1.0",
"version": "1.001",
"section": "chat",
"maintainer": "xtaodada",
"size": "5.79 kb",