Merge pull request #622 from BigfufuOuO/issue-614

修复接收部分卡片消息错误的bug
classical
SengokuCola 2025-04-01 11:34:03 +08:00 committed by GitHub
commit d9b4536969
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -79,7 +79,10 @@ class MessageRecv(Message):
if message_segment.get("data", "") == "[json]":
# 提取json消息中的展示信息
pattern = r"\[CQ:json,data=(?P<json_data>.+?)\]"
pattern = re.compile(
r"\[CQ:json,data=(?P<json_data>.+?)\]",
re.DOTALL
)
match = re.search(pattern, message_dict.get("raw_message", ""))
raw_json = html.unescape(match.group("json_data"))
try: