Skip to content

Commit 7d4744b

Browse files
committed
fix: correctly neutralize mentions in Mythic bot events
1 parent cd3f2c9 commit 7d4744b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/main/java/com/innygr/icreateordernetworking/mythic/BotApiBridge.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ static void sendEvent(String eventType, String details) {
9494
});
9595
}
9696

97-
private static String safe(String value, int maxLength) {
97+
static String safe(String value, int maxLength) {
9898
if (value == null) return "unknown";
99-
String clean = value.replace("@everyone", "@\\u200beveryone")
100-
.replace("@here", "@\\u200bhere")
101-
.replace("\\r", " ").strip();
99+
String zeroWidthSpace = Character.toString(0x200B);
100+
String clean = value.replace("@everyone", "@" + zeroWidthSpace + "everyone")
101+
.replace("@here", "@" + zeroWidthSpace + "here")
102+
.replace('\r', ' ').strip();
102103
return clean.length() > maxLength ? clean.substring(0, maxLength) : clean;
103-
}
104-
}
104+
}}

0 commit comments

Comments
 (0)