public class MessageEmbed
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
MessageEmbed.AuthorInfo |
Class that represents the author of content, possibly including an icon
that Discord proxies.
|
static class |
MessageEmbed.Field |
Represents a field in an embed.
|
static class |
MessageEmbed.Footer |
Class that represents a footer at the bottom of an embed
|
static class |
MessageEmbed.ImageInfo |
Represents the information provided to embed an image.
|
static class |
MessageEmbed.Provider |
Multipurpose class that represents a provider of content,
whether directly through creation or indirectly through hosting.
|
static class |
MessageEmbed.Thumbnail |
Represents the information Discord provided about a thumbnail image that should be
displayed with an embed message.
|
static class |
MessageEmbed.VideoInfo |
Represents the information provided to embed a video.
|
Modifier and Type | Field | Description |
---|---|---|
static int |
EMBED_MAX_LENGTH_BOT |
The maximum amount of total visible characters an embed can have
This limit depends on the current AccountType and applies to BOT |
static int |
EMBED_MAX_LENGTH_CLIENT |
The maximum amount of total visible characters an embed can have
This limit depends on the current AccountType and applies to CLIENT |
static int |
TEXT_MAX_LENGTH |
The maximum length the description and footer of an embed can have
|
static int |
TITLE_MAX_LENGTH |
The maximum length an embed title can have
|
static int |
URL_MAX_LENGTH |
The maximum length any URL can have inside an embed
|
static int |
VALUE_MAX_LENGTH |
The maximum length an embed field value can have
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object obj) |
|
MessageEmbed.AuthorInfo |
getAuthor() |
The information on the creator of the embedded content.
|
java.awt.Color |
getColor() |
The color of the stripe on the side of the embed.
|
int |
getColorRaw() |
The raw RGB color value for this embed
Defaults to Role.DEFAULT_COLOR_RAW if no color is set |
java.lang.String |
getDescription() |
The description of the embedded resource.
|
java.util.List<MessageEmbed.Field> |
getFields() |
The fields in a message embed.
|
MessageEmbed.Footer |
getFooter() |
The footer (bottom) of the embedded content.
|
MessageEmbed.ImageInfo |
getImage() |
The information about the image in the message embed
|
int |
getLength() |
The total amount of characters that is displayed when this embed is displayed by the Discord client.
|
MessageEmbed.Provider |
getSiteProvider() |
The information on site from which the embed was generated from.
|
MessageEmbed.Thumbnail |
getThumbnail() |
The information about the
Thumbnail image to be displayed with the embed. |
java.time.OffsetDateTime |
getTimestamp() |
The timestamp of the embed.
|
java.lang.String |
getTitle() |
The title of the embed.
|
EmbedType |
getType() |
The
EmbedType of this embed. |
java.lang.String |
getUrl() |
The that was originally placed into chat that spawned this embed.
|
MessageEmbed.VideoInfo |
getVideoInfo() |
The information about the video which should be displayed as an embed.
|
boolean |
isEmpty() |
Whether this embed is empty.
|
boolean |
isSendable(AccountType type) |
Whether this MessageEmbed can be used in a message.
|
org.json.JSONObject |
toJSONObject() |
Creates a new
JSONObject
used for sending. |
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 int EMBED_MAX_LENGTH_BOT
AccountType
and applies to BOTpublic static final int EMBED_MAX_LENGTH_CLIENT
AccountType
and applies to CLIENTpublic java.lang.String getUrl()
public java.lang.String getTitle()
EmbedType
= IMAGE
,
this method will return null.public java.lang.String getDescription()
public EmbedType getType()
EmbedType
of this embed.EmbedType
of this embed.public MessageEmbed.Thumbnail getThumbnail()
Thumbnail
image to be displayed with the embed.
Thumbnail
was not part of this embed, this returns null.Thumbnail
instance
containing general information on the displayable thumbnail.public MessageEmbed.Provider getSiteProvider()
Provider
containing site information.public MessageEmbed.AuthorInfo getAuthor()
AuthorInfo
containing author information.public MessageEmbed.VideoInfo getVideoInfo()
EmbedType
!= VIDEO
this will always return null.VideoInfo
containing the information about the video which should be embedded.public MessageEmbed.Footer getFooter()
Footer
containing the embed footer content.public MessageEmbed.ImageInfo getImage()
ImageInfo
containing image information.public java.util.List<MessageEmbed.Field> getFields()
Field
objects
containing field information.public java.awt.Color getColor()
public int getColorRaw()
Role.DEFAULT_COLOR_RAW
if no color is setpublic java.time.OffsetDateTime getTimestamp()
public boolean isEmpty()
public int getLength()
An Embed can only have, at max, displayable text characters for AccountType.BOT
accounts or displayable text characters for AccountType.CLIENT
accounts.
Both of these values are defined by EMBED_MAX_LENGTH_BOT
and
EMBED_MAX_LENGTH_CLIENT
respectively.
public boolean isSendable(AccountType type)
Bot
- and Client Accounts
Total Character Limits
type
- The AccountType
to inspectjava.lang.IllegalArgumentException
- If the provided AccountType is null
or not supported by this operationgetLength()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public org.json.JSONObject toJSONObject()
JSONObject
used for sending.