🐛 修复 block bot 后的报错问题 (#55)

This commit is contained in:
Xtao_dada 2021-04-04 09:13:29 +08:00 committed by GitHub
parent 52edcc8a73
commit c9a5f218f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,16 +73,19 @@ async def attach_report(plaintext, file_name, reply_id=None, caption=None):
caption=caption
)
except:
async with bot.conversation('PagerMaid_Modify_bot') as conversation:
await conversation.send_message('/ping')
await conversation.get_response()
await bot.send_read_acknowledge(conversation.chat_id)
await bot.send_file(
1263764543,
file_name,
reply_to=reply_id,
caption=caption
)
try:
async with bot.conversation('PagerMaid_Modify_bot') as conversation:
await conversation.send_message('/ping')
await conversation.get_response()
await bot.send_read_acknowledge(conversation.chat_id)
await bot.send_file(
1263764543,
file_name,
reply_to=reply_id,
caption=caption
)
except:
pass
remove(file_name)
async def obtain_message(context):