public class EmbedBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TEXT_MAX_LENGTH |
static int |
TITLE_MAX_LENGTH |
static int |
URL_MAX_LENGTH |
static java.util.regex.Pattern |
URL_PATTERN |
static int |
VALUE_MAX_LENGTH |
static java.lang.String |
ZERO_WIDTH_SPACE |
Constructor and Description |
---|
EmbedBuilder()
Creates an EmbedBuilder to be used to creates an embed to send
|
EmbedBuilder(MessageEmbed embed)
Creates an EmbedBuilder using fields in an existing embed
|
Modifier and Type | Method and Description |
---|---|
EmbedBuilder |
addBlankField(boolean inline)
Adds a blank (empty) Field to the embed.
|
EmbedBuilder |
addField(MessageEmbed.Field field)
Adds a Field to the embed
|
EmbedBuilder |
addField(java.lang.String name,
java.lang.String value,
boolean inline)
Adds a Field to the embed.
|
MessageEmbed |
build()
Returns a
MessageEmbed
that has been checked as being valid for sending. |
boolean |
isEmpty()
Checks if the given embed is empty.
|
EmbedBuilder |
setAuthor(java.lang.String name,
java.lang.String url,
java.lang.String iconUrl)
Sets the Author of the embed.
|
EmbedBuilder |
setColor(java.awt.Color color)
Sets the Color of the embed.
|
EmbedBuilder |
setDescription(java.lang.String description)
Sets the Description of the embed.
|
EmbedBuilder |
setFooter(java.lang.String text,
java.lang.String iconUrl)
Sets the Footer of the embed.
|
EmbedBuilder |
setImage(java.lang.String url)
Sets the Image of the embed.
|
EmbedBuilder |
setProvider(java.lang.String name,
java.lang.String url)
Sets the Provider of the embed.
|
EmbedBuilder |
setThumbnail(java.lang.String url)
Sets the Thumbnail of the embed.
|
EmbedBuilder |
setTimestamp(java.time.temporal.TemporalAccessor temporal)
Sets the Timestamp of the embed.
|
EmbedBuilder |
setTitle(java.lang.String title)
Sets the Title of the embed
|
EmbedBuilder |
setUrl(java.lang.String url)
Sets the URL of the embed
|
EmbedBuilder |
setVideo(java.lang.String url)
Sets the Video of the embed.
|
public static final int TITLE_MAX_LENGTH
public static final int VALUE_MAX_LENGTH
public static final int TEXT_MAX_LENGTH
public static final int URL_MAX_LENGTH
public static final java.lang.String ZERO_WIDTH_SPACE
public static final java.util.regex.Pattern URL_PATTERN
public EmbedBuilder()
public EmbedBuilder(MessageEmbed embed)
embed
- the existing embedpublic MessageEmbed build()
MessageEmbed
that has been checked as being valid for sending.public boolean isEmpty()
public EmbedBuilder setUrl(java.lang.String url)
url
- the url of the embedpublic EmbedBuilder setTitle(java.lang.String title)
title
- the title of the embedpublic EmbedBuilder setDescription(java.lang.String description)
description
- the description of the embedpublic EmbedBuilder setTimestamp(java.time.temporal.TemporalAccessor temporal)
temporal
- the temporal accessor of the timestamppublic EmbedBuilder setColor(java.awt.Color color)
color
- the color of the embedpublic EmbedBuilder setThumbnail(java.lang.String url)
url
- the url of the thumbnail of the embedpublic EmbedBuilder setVideo(java.lang.String url)
url
- the url of the video of the embedpublic EmbedBuilder setImage(java.lang.String url)
url
- the url of the image of the embedpublic EmbedBuilder setProvider(java.lang.String name, java.lang.String url)
name
- the name of the provider of the embedurl
- the url of the provider of the embedpublic EmbedBuilder setAuthor(java.lang.String name, java.lang.String url, java.lang.String iconUrl)
name
- the name of the author of the embed. If this is not set, the
author will not appear in the embedurl
- the url of the author of the embediconUrl
- the url of the icon for the authorpublic EmbedBuilder setFooter(java.lang.String text, java.lang.String iconUrl)
text
- the text of the footer of the embed. If this is not set, the
footer will not appear in the embediconUrl
- the url of the icon for the footerpublic EmbedBuilder addField(MessageEmbed.Field field)
field
- the field object to addpublic EmbedBuilder addField(java.lang.String name, java.lang.String value, boolean inline)
name
- the name of the footer of the embed.value
- the contents of the fieldinline
- whether or not this field should display inlinepublic EmbedBuilder addBlankField(boolean inline)
inline
- whether or not this field should display inline