Package discord4j.core.spec.legacy
Class LegacyEmbedCreateSpec
java.lang.Object
discord4j.core.spec.legacy.LegacyEmbedCreateSpec
- All Implemented Interfaces:
LegacySpec<discord4j.discordjson.json.EmbedData>
public class LegacyEmbedCreateSpec
extends Object
implements LegacySpec<discord4j.discordjson.json.EmbedData>
A spec used to configure and send an embed.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a field to the embed.discord4j.discordjson.json.EmbedData
from
(discord4j.discordjson.json.EmbedData embedData) Populate the spec from an existing embed.Sets the author section of the embed.Sets the color of the embed.setDescription
(String description) Sets the description of the embed.Sets the footer of the embed.Sets the image of the embed.setThumbnail
(String url) Sets the thumbnail of the embed.setTimestamp
(Instant timestamp) Sets the timestamp to display in the embed.Sets the title of the embed.Sets the URL of the embed.
-
Constructor Details
-
LegacyEmbedCreateSpec
public LegacyEmbedCreateSpec()
-
-
Method Details
-
setTitle
Sets the title of the embed.- Parameters:
title
- The title of the embed.- Returns:
- This spec.
-
setDescription
Sets the description of the embed.- Parameters:
description
- The description of the embed.- Returns:
- This spec.
-
setUrl
Sets the URL of the embed.- Parameters:
url
- A URL which can be clicked on through the title of the embed.- Returns:
- This spec.
-
setTimestamp
Sets the timestamp to display in the embed. The timestamp is displayed locally for each user's timezone.- Parameters:
timestamp
- AInstant
to display in the embed footer.- Returns:
- This spec.
-
setColor
Sets the color of the embed.- Parameters:
color
- AColor
to display on the embed.- Returns:
- This spec.
-
setImage
Sets the image of the embed.- Parameters:
url
- An image URL.- Returns:
- This spec.
-
setThumbnail
Sets the thumbnail of the embed.- Parameters:
url
- An image URL.- Returns:
- This spec.
-
setAuthor
Sets the author section of the embed.- Parameters:
name
- The author name to display.url
- A URL which can be clicked on through the author name.iconUrl
- An icon URL displayed as the avatar next to the author name.- Returns:
- This spec.
-
addField
Adds a field to the embed.- Parameters:
name
- The name of the field.value
- The text inside of the field.inline
- Whether to inline the field or not.- Returns:
- This spec.
-
from
Populate the spec from an existing embed. This will override all previously set values including fields!- Parameters:
embedData
- The embed to populate this spec from.- Returns:
- This spec.
-
asRequest
public discord4j.discordjson.json.EmbedData asRequest()- Specified by:
asRequest
in interfaceLegacySpec<discord4j.discordjson.json.EmbedData>
-