Class WebhookEmbed.EmbedAuthor
- java.lang.Object
-
- club.minnced.discord.webhook.send.WebhookEmbed.EmbedAuthor
-
- All Implemented Interfaces:
org.json.JSONString
- Enclosing class:
- WebhookEmbed
public static class WebhookEmbed.EmbedAuthor extends Object implements org.json.JSONString
POJO for an embed author.
This can contain an icon (avatar), a name, and a url. Often useful for posts from other platforms such as twitter/github.
-
-
Constructor Summary
Constructors Constructor Description EmbedAuthor(@NotNull String name, @Nullable String iconUrl, @Nullable String url)
Creates a new embed author
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable String
getIconUrl()
The iconUrl of this author.@NotNull String
getName()
The name of the author, this is the only visible text of this component.@Nullable String
getUrl()
The url of this author.String
toJSONString()
String
toString()
JSON representation of this author
-
-
-
Constructor Detail
-
EmbedAuthor
public EmbedAuthor(@NotNull @NotNull String name, @Nullable @Nullable String iconUrl, @Nullable @Nullable String url)
Creates a new embed author- Parameters:
name
- The name of the authoriconUrl
- The (nullable) icon url of the authorurl
- The (nullable) hyperlink of the author- See Also:
WebhookEmbedBuilder.setAuthor(club.minnced.discord.webhook.send.WebhookEmbed.EmbedAuthor)
-
-
Method Detail
-
getName
@NotNull public @NotNull String getName()
The name of the author, this is the only visible text of this component.- Returns:
- The name
-
getIconUrl
@Nullable @JSONPropertyName("icon_url") public @Nullable String getIconUrl()
The iconUrl of this author.
This is displayed left to the name, similar to messages in discord.- Returns:
- Possibly-null iconUrl url
-
getUrl
@Nullable public @Nullable String getUrl()
The url of this author.
This can be used to highlight the name as a hyperlink to the platform's profile service.- Returns:
- Possibly-null url
-
toString
public String toString()
JSON representation of this author
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.JSONString
-
-