mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-01 01:25:07 +08:00
🐛 fix reply get fail broken down
This commit is contained in:
parent
03ac119313
commit
68ba1c1af2
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user