🚑 Fix db_session and CQ escape

This commit is contained in:
zhbaor 2022-09-29 14:33:48 +08:00
parent 3d21d83bf0
commit b650acb674

View file

@ -25,10 +25,11 @@ def recv_msg():
and data["group_id"] == 346058845 and data["group_id"] == 346058845
): ):
name = data["raw_message"] name = data["raw_message"]
with db_session:
query = select(m for m in Melee if m.name == name) query = select(m for m in Melee if m.name == name)
if query.count() > 0: if query.count() > 0:
return { return {
"reply": f"[CQ]:image,file=http://localhost:7000/pics/{name}.png", "reply": f"[CQ:image,file=http://localhost:7000/pics/{name}.png]",
"at_sender": False, "at_sender": False,
} }
return "OK" return "OK"