diff --git a/pom.xml b/pom.xml index c223e68..5c2e3f6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ xyz.etztech javacord jar - 0.0.2 + 0.1.0 diff --git a/src/main/java/xyz/etztech/Javacord.java b/src/main/java/xyz/etztech/Javacord.java index cd1de57..77a0bce 100644 --- a/src/main/java/xyz/etztech/Javacord.java +++ b/src/main/java/xyz/etztech/Javacord.java @@ -6,7 +6,8 @@ public class Javacord { return input .replaceAll("_", "\\\\\\\\_") .replaceAll("\\*", "\\\\\\\\*") - .replaceAll("~", "\\\\\\\\~"); + .replaceAll("~", "\\\\\\\\~") + .replaceAll("\\|", "\\\\\\\\|"); } public static String escapeQuote(String input) { diff --git a/src/test/java/Test.java b/src/test/java/Test.java index 9ad6830..acd0921 100644 --- a/src/test/java/Test.java +++ b/src/test/java/Test.java @@ -1,3 +1,4 @@ +import xyz.etztech.Javacord; import xyz.etztech.embed.Author; import xyz.etztech.embed.Embed; import xyz.etztech.embed.Webhook; @@ -10,8 +11,9 @@ public class Test { Embed embed = new Embed() .color(3306460) .timestamp(OffsetDateTime.now()) - .description("Etzelia found some \"diamond\" ore") + .title("Etzelia found some \"diamond\" ore") .author(new Author("Etzelia", "", "https://minotar.net/helm/Etzelia/100.png", "")); + embed.description(Javacord.escapeFormat("*Test* **Test** _Test_ __Test__ ~Test~ ~~Test~~ |Test| ||Test||")); Webhook webhook = new Webhook("@here", embed); System.out.println(webhook); }