Skip to content

Commit

Permalink
🐛 Fix special characters in @ type name field #258
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomujin authored Nov 27, 2024
1 parent ac97cee commit f2f295a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public static String arrayMsgToCode(ArrayMsg arrayMsg) {
} else {
builder.append("[CQ:").append(arrayMsg.getType());
}
arrayMsg.getData().forEach((k, v) -> builder.append(",").append(k).append("=").append(v));
arrayMsg.getData().forEach((k, v) -> builder.append(",").append(k).append("=").append(ShiroUtils.escape(v)));
builder.append("]");
return builder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void atCheckTest() {
@Test
void extractMsgTest() {
// 定义包含特殊格式字符串消息的变量
val msg = "[CQ:at,qq=1122334455]测试消息1";
val msg = "[CQ:at,qq=1122334455,name=@机器人 [可以]]测试消息1";

// 将 msg 字符串转换成 ArrayMsg 数组
val arrayMsg = ShiroUtils.rawToArrayMsg(msg);
Expand Down

0 comments on commit f2f295a

Please sign in to comment.