Class WebhookEmbed
- java.lang.Object
-
- club.minnced.discord.webhook.send.WebhookEmbed
-
- All Implemented Interfaces:
org.json.JSONString
- Direct Known Subclasses:
ReadonlyEmbed
public class WebhookEmbed extends Object implements org.json.JSONString
Reduced version of anReadonlyEmbed
used for sending. A webhook can send up to 10 embeds in a single message.- See Also:
WebhookEmbedBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebhookEmbed.EmbedAuthor
POJO for an embed author.static class
WebhookEmbed.EmbedField
POJO for an embed field.static class
WebhookEmbed.EmbedFooter
POJO for an embed footer.static class
WebhookEmbed.EmbedTitle
POJO for an embed title.
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_FIELDS
Max amount of fields an embed can hold (25)
-
Constructor Summary
Constructors Constructor Description WebhookEmbed(@Nullable OffsetDateTime timestamp, @Nullable Integer color, @Nullable String description, @Nullable String thumbnailUrl, @Nullable String imageUrl, @Nullable WebhookEmbed.EmbedFooter footer, @Nullable WebhookEmbed.EmbedTitle title, @Nullable WebhookEmbed.EmbedAuthor author, @NotNull List<WebhookEmbed.EmbedField> fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable WebhookEmbed.EmbedAuthor
getAuthor()
The embed author.@Nullable Integer
getColor()
The rgb color of this embed.@Nullable String
getDescription()
The description of this embed@NotNull List<WebhookEmbed.EmbedField>
getFields()
List of fields for this embed.@Nullable WebhookEmbed.EmbedFooter
getFooter()
The footer of the embed.@Nullable String
getImageUrl()
The image url@Nullable String
getThumbnailUrl()
The thumbnail url@Nullable OffsetDateTime
getTimestamp()
The timestamp for the embed.@Nullable WebhookEmbed.EmbedTitle
getTitle()
The title of the embed, this is displayed above the description and below the author.@NotNull WebhookEmbed
reduced()
Returns this embed instance, as its already reduced.String
toJSONString()
String
toString()
JSON representation of this embed
-
-
-
Field Detail
-
MAX_FIELDS
public static final int MAX_FIELDS
Max amount of fields an embed can hold (25)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WebhookEmbed
public WebhookEmbed(@Nullable @Nullable OffsetDateTime timestamp, @Nullable @Nullable Integer color, @Nullable @Nullable String description, @Nullable @Nullable String thumbnailUrl, @Nullable @Nullable String imageUrl, @Nullable @Nullable WebhookEmbed.EmbedFooter footer, @Nullable @Nullable WebhookEmbed.EmbedTitle title, @Nullable @Nullable WebhookEmbed.EmbedAuthor author, @NotNull @NotNull List<WebhookEmbed.EmbedField> fields)
-
-
Method Detail
-
getThumbnailUrl
@Nullable @JSONPropertyIgnore public @Nullable String getThumbnailUrl()
The thumbnail url- Returns:
- Possibly-null url
-
getImageUrl
@Nullable @JSONPropertyIgnore public @Nullable String getImageUrl()
The image url- Returns:
- Possibly-null url
-
getTimestamp
@Nullable public @Nullable OffsetDateTime getTimestamp()
The timestamp for the embed.
The discord client displays this in the correct timezone and locale of the viewing users.- Returns:
- Possibly-null
OffsetDateTime
of the timestamp
-
getTitle
@Nullable @JSONPropertyIgnore public @Nullable WebhookEmbed.EmbedTitle getTitle()
The title of the embed, this is displayed above the description and below the author.- Returns:
- Possibly-null
WebhookEmbed.EmbedTitle
-
getColor
@Nullable public @Nullable Integer getColor()
The rgb color of this embed.
This is the colored line on the left-hand side of the embed.- Returns:
- Possibly-null boxed integer of the color
-
getDescription
@Nullable public @Nullable String getDescription()
The description of this embed- Returns:
- Possibly-null description
-
getFooter
@Nullable public @Nullable WebhookEmbed.EmbedFooter getFooter()
The footer of the embed.
This is displayed at the very bottom of the embed, left to the timestamp.- Returns:
- Possibly-null
WebhookEmbed.EmbedFooter
-
getAuthor
@Nullable public @Nullable WebhookEmbed.EmbedAuthor getAuthor()
The embed author.
This is displayed at the very top of the embed, even above thegetTitle()
.- Returns:
- Possibly-null
WebhookEmbed.EmbedAuthor
-
getFields
@NotNull public @NotNull List<WebhookEmbed.EmbedField> getFields()
List of fields for this embed.
And embed can have up to 25.- Returns:
- List of fields for this embed
-
reduced
@NotNull public @NotNull WebhookEmbed reduced()
Returns this embed instance, as its already reduced.- Returns:
- The current instance
-
toString
public String toString()
JSON representation of this embed
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.JSONString
-
-