🐛 fix reply get fail broken down

This commit is contained in:
yanyongyu 2021-03-31 20:09:00 +08:00
parent 03ac119313
commit 68ba1c1af2

View File

@ -52,8 +52,12 @@ async def _check_reply(bot: "Bot", event: "Event"):
except ValueError: except ValueError:
return return
msg_seg = event.message[index] msg_seg = event.message[index]
event.reply = Reply.parse_obj(await try:
bot.get_msg(message_id=msg_seg.data["id"])) event.reply = Reply.parse_obj(await
bot.get_msg(message_id=msg_seg.data["id"]
))
except Exception as e:
log("WARNING", f"Error when getting message reply info: {repr(e)}", e)
# ensure string comparation # ensure string comparation
if str(event.reply.sender.user_id) == str(event.self_id): if str(event.reply.sender.user_id) == str(event.self_id):
event.to_me = True event.to_me = True