Package discord4j.core.spec
Class EmbedCreateSpec
- java.lang.Object
-
- discord4j.core.spec.EmbedCreateSpec
-
- All Implemented Interfaces:
Spec<discord4j.discordjson.json.EmbedData>
public class EmbedCreateSpec extends Object implements Spec<discord4j.discordjson.json.EmbedData>
A spec used to configure and send an embed.- See Also:
- Embed Layout
-
-
Constructor Summary
Constructors Constructor Description EmbedCreateSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmbedCreateSpec
addField(String name, String value, boolean inline)
Adds a field to the embed.discord4j.discordjson.json.EmbedData
asRequest()
EmbedCreateSpec
setAuthor(String name, String url, String iconUrl)
Sets the author section of the embed.EmbedCreateSpec
setColor(Color color)
Sets the color of the embed.EmbedCreateSpec
setDescription(String description)
Sets the description of the embed.EmbedCreateSpec
setFooter(String text, String iconUrl)
Sets the footer of the embed.EmbedCreateSpec
setImage(String url)
Sets the image of the embed.EmbedCreateSpec
setThumbnail(String url)
Sets the thumbnail of the embed.EmbedCreateSpec
setTimestamp(Instant timestamp)
Sets the timestamp to display in the embed.EmbedCreateSpec
setTitle(String title)
Sets the title of the embed.EmbedCreateSpec
setUrl(String url)
Sets the URL of the embed.
-
-
-
Method Detail
-
setTitle
public EmbedCreateSpec setTitle(String title)
Sets the title of the embed.- Parameters:
title
- The title of the embed.- Returns:
- This spec.
-
setDescription
public EmbedCreateSpec setDescription(String description)
Sets the description of the embed.- Parameters:
description
- The description of the embed.- Returns:
- This spec.
-
setUrl
public EmbedCreateSpec setUrl(String url)
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
public EmbedCreateSpec setTimestamp(Instant timestamp)
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
public EmbedCreateSpec setColor(Color color)
Sets the color of the embed.- Parameters:
color
- AColor
to display on the embed.- Returns:
- This spec.
-
setFooter
public EmbedCreateSpec setFooter(String text, @Nullable String iconUrl)
Sets the footer of the embed.- Parameters:
text
- The footer text.iconUrl
- An icon URL to display in the footer.- Returns:
- This spec.
-
setImage
public EmbedCreateSpec setImage(String url)
Sets the image of the embed.- Parameters:
url
- An image URL.- Returns:
- This spec.
-
setThumbnail
public EmbedCreateSpec setThumbnail(String url)
Sets the thumbnail of the embed.- Parameters:
url
- An image URL.- Returns:
- This spec.
-
setAuthor
public EmbedCreateSpec setAuthor(String name, @Nullable String url, @Nullable String iconUrl)
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
public EmbedCreateSpec addField(String name, String value, boolean inline)
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.
-
-