diff --git a/nonebot/adapters/cqhttp/message.py b/nonebot/adapters/cqhttp/message.py index 49a9c858..18cbfea9 100644 --- a/nonebot/adapters/cqhttp/message.py +++ b/nonebot/adapters/cqhttp/message.py @@ -213,7 +213,7 @@ class Message(BaseMessage): for cqcode in re.finditer( r"\[CQ:(?P[a-zA-Z0-9-_.]+)" r"(?P" - r"(?:,[a-zA-Z0-9-_.]+=?[^,\]]*)*" + r"(?:,[a-zA-Z0-9-_.]+=[^,\]]+))*" r"),?\]", msg): yield "text", unescape(msg[text_begin:cqcode.pos + cqcode.start()]) diff --git a/pages/changelog.md b/pages/changelog.md index 2a766f70..5b272a12 100644 --- a/pages/changelog.md +++ b/pages/changelog.md @@ -4,6 +4,10 @@ sidebar: auto # 更新日志 +## v2.0.0a8 + +- 修复部分非法 CQ 码被识别导致报错 + ## v2.0.0a7 - 修复 cqhttp 检查 to me 时出现 IndexError