在特定情况下消息含有at但没有被 message.x.@.me 捕获
Tsuk1ko opened this issue · comments
神代綺凛 commented
我实际使用时发现,当在消息中at机器人之前含有图片,则该消息将会被message.x
捕获,跳过了message.x.@.me
例如:
# 以下消息可以被 message.x.@.me 捕获(先at再图片,或是at前只有文字没有图片)
[CQ:at,qq=123] [CQ:image,file=123,url=123]
123123[CQ:at,qq=123]
# 以下消息会跳过 message.x.@.me (先图片再at,并且与之间或者之前是否有文字无关)
[CQ:image,file=123,url=123][CQ:at,qq=123]
[CQ:image,file=123,url=123] [CQ:at,qq=123]
[CQ:image,file=123,url=123] aaa [CQ:at,qq=123]
aaa[CQ:image,file=123,url=123][CQ:at,qq=123]
牛牛 commented
確實有這問題呢 🤔
試了一下發現, 原因是RegExp的greedy問題, 造成只有第一個CQ碼會被抽出。
稍後發個patch。
神代綺凛 commented
好的,感谢 😃