🐛 fix invalid cq code catched

This commit is contained in:
yanyongyu 2020-12-16 13:34:41 +08:00
parent e4377faa67
commit a63a5fea3c
2 changed files with 5 additions and 1 deletions

View File

@ -213,7 +213,7 @@ class Message(BaseMessage):
for cqcode in re.finditer(
r"\[CQ:(?P<type>[a-zA-Z0-9-_.]+)"
r"(?P<params>"
r"(?:,[a-zA-Z0-9-_.]+=?[^,\]]*)*"
r"(?:,[a-zA-Z0-9-_.]+=[^,\]]+))*"
r"),?\]", msg):
yield "text", unescape(msg[text_begin:cqcode.pos +
cqcode.start()])

View File

@ -4,6 +4,10 @@ sidebar: auto
# 更新日志
## v2.0.0a8
- 修复部分非法 CQ 码被识别导致报错
## v2.0.0a7
- 修复 cqhttp 检查 to me 时出现 IndexError