Sanitize Markdowns

This should hopefully fix the markdown issue, it is the same regex used in my other bot (SBot) which uses a discord bridge and works effectively.
This commit is contained in:
Eva 2022-03-21 00:46:15 +00:00 committed by GitHub
parent 67e84fb498
commit fb6f45a6a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,7 +108,7 @@ public class DiscordBridge {
message = message.substring(0, 2000);
}
return message.replaceAll(colors.pattern(), "").replaceAll(pings.pattern(), "@\u200B");
return message.replaceAll(colors.pattern(), "").replaceAll(pings.pattern(), "@\u200B").replaceAll("([`_~*])", "\\\\$1");
}
public static void transmitMessage(String message) {