WebhookEmbed
A box in a Discord message with a title, text, a coloured edge, fields and pictures.
Final classRLPlugins API
public final class WebhookEmbedAdd it to a WebhookMessage. Every method returns the embed, so calls can be chained.
Text longer than Discord allows is cut off. Pictures are http or https image URLs; anything else is left out.
Members
Constructors
- newWebhookEmbed()
Creates a WebhookEmbed.
Methods
- WebhookEmbedauthor(String)
A small line above the title, at most 256 characters.
- WebhookEmbedcolor(Color)
The colour of the edge.
- WebhookEmbedcolor(int)
The colour of the edge as 0xRRGGBB.
- WebhookEmbeddescription(String)
The text under the title, at most 4096 characters.
- WebhookEmbedfield(String, String)
Adds a field on its own row: a bold name (at most 256 characters) and a value (at most 1024).
- WebhookEmbedfield(String, String, boolean)
Adds a field.
- WebhookEmbedfooter(String)
A small line at the bottom, at most 2048 characters.
- WebhookEmbedimage(String)
A large picture under the text.
- WebhookEmbedthumbnail(String)
A small picture in the top right corner, for example an item icon.
- WebhookEmbedtimestamp(long)
Shows this time at the bottom, in each reader's own time zone.
- WebhookEmbedtitle(String)
The bold first line, at most 256 characters.
- WebhookEmbedurl(String)
Makes the title a link to this http or https URL.
WebhookEmbed()
public WebhookEmbed()Creates a WebhookEmbed.
color(Color)
public WebhookEmbed color(Color color)The colour of the edge.
Parameters
color- Color.
color(int)
public WebhookEmbed color(int rgb)The colour of the edge as 0xRRGGBB.
Parameters
rgb- Rgb.
description(String)
public WebhookEmbed description(String description)The text under the title, at most 4096 characters.
Discord markdown works.
Parameters
description- Description.
field(String, String)
public WebhookEmbed field(String name, String value)Adds a field on its own row: a bold name (at most 256 characters) and a value (at most 1024).
Parameters
name- Name.
value- Value.
field(String, String, boolean)
public WebhookEmbed field(String name, String value, boolean inline)Adds a field.
Inline fields sit side by side, up to three on a row. An embed holds at most 25 fields.
Parameters
name- Name.
value- Value.
inline- Inline.
image(String)
public WebhookEmbed image(String imageUrl)A large picture under the text.
Parameters
imageUrl- Image url.
thumbnail(String)
public WebhookEmbed thumbnail(String imageUrl)A small picture in the top right corner, for example an item icon.
Parameters
imageUrl- Image url.
timestamp(long)
public WebhookEmbed timestamp(long epochMillis)Shows this time at the bottom, in each reader's own time zone.
The time is in milliseconds: pass System.currentTimeMillis() for now.
Parameters
epochMillis- Epoch millis.
title(String)
public WebhookEmbed title(String title)The bold first line, at most 256 characters.
Parameters
title- Title.
url(String)
public WebhookEmbed url(String url)Makes the title a link to this http or https URL.
Parameters
url- Url.
Also allowed
Every class has these, as in plain Java.
equals, toString