Class ReadonlyEmbed
- java.lang.Object
-
- club.minnced.discord.webhook.send.WebhookEmbed
-
- club.minnced.discord.webhook.receive.ReadonlyEmbed
-
- All Implemented Interfaces:
org.json.JSONString
public class ReadonlyEmbed extends WebhookEmbed
Extension ofWebhookEmbed
with additional meta-data on receivable embeds.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReadonlyEmbed.EmbedImage
POJO containing meta-data about an embed image componentstatic class
ReadonlyEmbed.EmbedProvider
POJO containing meta-data for an embed providerstatic class
ReadonlyEmbed.EmbedVideo
POJO containing meta-data about an embed video-
Nested classes/interfaces inherited from class club.minnced.discord.webhook.send.WebhookEmbed
WebhookEmbed.EmbedAuthor, WebhookEmbed.EmbedField, WebhookEmbed.EmbedFooter, WebhookEmbed.EmbedTitle
-
-
Field Summary
-
Fields inherited from class club.minnced.discord.webhook.send.WebhookEmbed
MAX_FIELDS
-
-
Constructor Summary
Constructors Constructor Description ReadonlyEmbed(@Nullable OffsetDateTime timestamp, @Nullable Integer color, @Nullable String description, @Nullable ReadonlyEmbed.EmbedImage thumbnail, @Nullable ReadonlyEmbed.EmbedImage image, @Nullable WebhookEmbed.EmbedFooter footer, @Nullable WebhookEmbed.EmbedTitle title, @Nullable WebhookEmbed.EmbedAuthor author, @NotNull List<WebhookEmbed.EmbedField> fields, @Nullable ReadonlyEmbed.EmbedProvider provider, @Nullable ReadonlyEmbed.EmbedVideo video)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable ReadonlyEmbed.EmbedImage
getImage()
The image of this embed.@Nullable ReadonlyEmbed.EmbedProvider
getProvider()
TheReadonlyEmbed.EmbedProvider
Used for services that are automatically embedded by discord when posting a link, this includes services like youtube or twitter.@Nullable ReadonlyEmbed.EmbedImage
getThumbnail()
The thumbnail of this embed.@Nullable ReadonlyEmbed.EmbedVideo
getVideo()
The video of this embed.@NotNull WebhookEmbed
reduced()
Reduces this embed to a simplerWebhookEmbed
instance that can be used for sending, this is done implicitly when trying to send an instance of a readonly-embed.String
toJSONString()
String
toString()
JSON representation of this embed.-
Methods inherited from class club.minnced.discord.webhook.send.WebhookEmbed
getAuthor, getColor, getDescription, getFields, getFooter, getImageUrl, getThumbnailUrl, getTimestamp, getTitle
-
-
-
-
Constructor Detail
-
ReadonlyEmbed
public ReadonlyEmbed(@Nullable @Nullable OffsetDateTime timestamp, @Nullable @Nullable Integer color, @Nullable @Nullable String description, @Nullable @Nullable ReadonlyEmbed.EmbedImage thumbnail, @Nullable @Nullable ReadonlyEmbed.EmbedImage image, @Nullable @Nullable WebhookEmbed.EmbedFooter footer, @Nullable @Nullable WebhookEmbed.EmbedTitle title, @Nullable @Nullable WebhookEmbed.EmbedAuthor author, @NotNull @NotNull List<WebhookEmbed.EmbedField> fields, @Nullable @Nullable ReadonlyEmbed.EmbedProvider provider, @Nullable @Nullable ReadonlyEmbed.EmbedVideo video)
-
-
Method Detail
-
getProvider
@Nullable public @Nullable ReadonlyEmbed.EmbedProvider getProvider()
TheReadonlyEmbed.EmbedProvider
Used for services that are automatically embedded by discord when posting a link, this includes services like youtube or twitter.- Returns:
- Possibly-null embed provider
-
getThumbnail
@Nullable public @Nullable ReadonlyEmbed.EmbedImage getThumbnail()
The thumbnail of this embed.- Returns:
- Possibly-null
ReadonlyEmbed.EmbedImage
for the thumbnail
-
getImage
@Nullable public @Nullable ReadonlyEmbed.EmbedImage getImage()
The image of this embed.- Returns:
- Possibly-null
ReadonlyEmbed.EmbedImage
for the image
-
getVideo
@Nullable public @Nullable ReadonlyEmbed.EmbedVideo getVideo()
The video of this embed.
This is a whitelisted feature only available for services like youtube and is only populated for link embeds.- Returns:
- Possibly-null
ReadonlyEmbed.EmbedVideo
-
reduced
@NotNull public @NotNull WebhookEmbed reduced()
Reduces this embed to a simplerWebhookEmbed
instance that can be used for sending, this is done implicitly when trying to send an instance of a readonly-embed.- Overrides:
reduced
in classWebhookEmbed
- Returns:
- The reduced embed instance
-
toString
public String toString()
JSON representation of this embed.
Note that received embeds look different compared to sent ones.- Overrides:
toString
in classWebhookEmbed
- Returns:
- The JSON representation
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.JSONString
- Overrides:
toJSONString
in classWebhookEmbed
-
-