forked from Minecraft/javacord
29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
import xyz.etztech.Javacord;
|
|
import xyz.etztech.embed.Author;
|
|
import xyz.etztech.embed.Embed;
|
|
import xyz.etztech.Webhook;
|
|
import xyz.etztech.embed.Field;
|
|
|
|
import java.time.OffsetDateTime;
|
|
|
|
public class Test {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
Embed embed = new Embed()
|
|
.color(3306460)
|
|
.timestamp(OffsetDateTime.now())
|
|
.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||"));
|
|
embed.addField(new Field("Title", "Description"));
|
|
embed.addField(new Field("Title2", "Description2"));
|
|
Webhook webhook = new Webhook("@here", embed);
|
|
System.out.println(webhook);
|
|
|
|
String url = System.getenv("JAVACORD_WEBHOOK");
|
|
if (!"".equals(url)) {
|
|
Javacord.sendWebhook(url, webhook);
|
|
}
|
|
}
|
|
}
|