Change builder and test time

Signed-off-by: Etzelia <etzelia@hotmail.com>
pull/1/head
Etzelia 2020-07-30 16:40:45 -05:00
parent d1ad28c5df
commit 21a139cd1e
No known key found for this signature in database
GPG Key ID: 3CAEB74806C4ADE5
3 changed files with 17 additions and 16 deletions

View File

@ -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.1</version> <version>0.0.2</version>
<developers> <developers>
<developer> <developer>

View File

@ -23,20 +23,18 @@ public class Embed {
private Author author; private Author author;
private List<Field> fields; private List<Field> fields;
public static Embed builder() { public Embed() {
Embed embed = new Embed(); this.content = "";
embed.content = ""; this.title = "";
embed.title = ""; this.description = "";
embed.description = ""; this.url = "";
embed.url = ""; this.color = 0;
embed.color = 0; this.timestamp = null;
embed.timestamp = null; this.footer = null;
embed.footer = null; this.thumbnail = null;
embed.thumbnail = null; this.image = null;
embed.image = null; this.author = null;
embed.author = null; this.fields = new ArrayList<>();
embed.fields = new ArrayList<>();
return embed;
} }
public Embed content(String content) { public Embed content(String content) {

View File

@ -2,11 +2,14 @@ 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;
import java.time.OffsetDateTime;
public class Test { public class Test {
public static void main(String[] args) { public static void main(String[] args) {
Embed embed = Embed.builder() Embed embed = new Embed()
.color(3306460) .color(3306460)
.timestamp(OffsetDateTime.now())
.description("Etzelia found some \"diamond\" ore") .description("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", ""));
Webhook webhook = new Webhook("@here", embed); Webhook webhook = new Webhook("@here", embed);