Fix format escape and update test.
Ready for first release. Signed-off-by: Etzelia <etzelia@hotmail.com>pull/1/head
parent
21a139cd1e
commit
6e20ef32b7
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
<groupId>xyz.etztech</groupId>
|
<groupId>xyz.etztech</groupId>
|
||||||
<artifactId>javacord</artifactId>
|
<artifactId>javacord</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>0.0.2</version>
|
<version>0.1.0</version>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
|
|
|
@ -6,7 +6,8 @@ public class Javacord {
|
||||||
return input
|
return input
|
||||||
.replaceAll("_", "\\\\\\\\_")
|
.replaceAll("_", "\\\\\\\\_")
|
||||||
.replaceAll("\\*", "\\\\\\\\*")
|
.replaceAll("\\*", "\\\\\\\\*")
|
||||||
.replaceAll("~", "\\\\\\\\~");
|
.replaceAll("~", "\\\\\\\\~")
|
||||||
|
.replaceAll("\\|", "\\\\\\\\|");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String escapeQuote(String input) {
|
public static String escapeQuote(String input) {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import xyz.etztech.Javacord;
|
||||||
import xyz.etztech.embed.Author;
|
import xyz.etztech.embed.Author;
|
||||||
import xyz.etztech.embed.Embed;
|
import xyz.etztech.embed.Embed;
|
||||||
import xyz.etztech.embed.Webhook;
|
import xyz.etztech.embed.Webhook;
|
||||||
|
@ -10,8 +11,9 @@ public class Test {
|
||||||
Embed embed = new Embed()
|
Embed embed = new Embed()
|
||||||
.color(3306460)
|
.color(3306460)
|
||||||
.timestamp(OffsetDateTime.now())
|
.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", ""));
|
.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);
|
Webhook webhook = new Webhook("@here", embed);
|
||||||
System.out.println(webhook);
|
System.out.println(webhook);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue