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 anReadonlyEmbedused 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 classWebhookEmbed.EmbedAuthorPOJO for an embed author.static classWebhookEmbed.EmbedFieldPOJO for an embed field.static classWebhookEmbed.EmbedFooterPOJO for an embed footer.static classWebhookEmbed.EmbedTitlePOJO for an embed title.
-
Field Summary
Fields Modifier and Type Field Description static intMAX_FIELDSMax 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.EmbedAuthorgetAuthor()The embed author.@Nullable IntegergetColor()The rgb color of this embed.@Nullable StringgetDescription()The description of this embed@NotNull List<WebhookEmbed.EmbedField>getFields()List of fields for this embed.@Nullable WebhookEmbed.EmbedFootergetFooter()The footer of the embed.@Nullable StringgetImageUrl()The image url@Nullable StringgetThumbnailUrl()The thumbnail url@Nullable OffsetDateTimegetTimestamp()The timestamp for the embed.@Nullable WebhookEmbed.EmbedTitlegetTitle()The title of the embed, this is displayed above the description and below the author.@NotNull WebhookEmbedreduced()Returns this embed instance, as its already reduced.StringtoJSONString()StringtoString()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
OffsetDateTimeof 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:
toJSONStringin interfaceorg.json.JSONString
-
-