The author data for this embed. The name field may be up to 256 characters.
The numerically encoded RGB color code for this embed.
The description text for the embed. Up to 2048 characters.
An array of fields to be rendered on this embed.
Field names may be up to 256 characters. Field values may be up to 1024 characters, and support markdown.
The footer for this embed. The text may be up to 2048 characters.
The image data for this embed.
The provider data for this embed.
The thumbnail data for this embed.
The ISO-8601 UTC timestamp for this embed.
The title of the embed.
The type of the embed.
The url of the embed. It renders as a link on the name, if provided.
The video data for this embed.
Adds a field to the embed.
Fields appear under the description. Inline fields may be rendered side-by-side depending on the screen width.
A field object.
Sets the author options for this embed.
You may set an author name, url and icon image url.
Embed author options.
Sets the color for this embed. An integer representation of a hexadecimal color code.
The default color for roles (no color) is 0
.
Note: You can set this to a hex color code using an integer represented in hex format.
Example: 0xFF0000
(or 16711680
) is red.
The integer representation of a color.
Sets the description for this embed.
May contain markdown-formatted text, including links.
The description for this embed. Up to 2048 characters.
Replaces the array of discord.Embed.IEmbedField objects with the one provided.
Note: You can add individual fields easily using discord.Embed.addField.
Array of field objects. Provide an empty array to clear the fields.
Sets the footer for this embed. Rendered at the bottom of an embed.
The footer for this embed. The text property may be up to 2048 characters.
Sets an image for this embed. If set, the image is typically rendered below the description and fields.
You must only set the url
property of the options sent to this function.
Embed image options.
Sets a provider for this embed. Contains a name and url.
Embed provider options.
Sets a thumbnail for this embed. If set, the thumbnail is typically rendered to the right of the description and fields.
You must only set the url
property of the options sent to this function.
Embed thumbnail options.
A localized timestamp to render at the bottom of the embed.
Should be set to a UTC time string in ISO 8601 format (YYYY-MM-DDTHH:mm:ss
)
For example, new Date().toISOString()
returns the current date and time in this format.
The ISO-8601 formatted timestamp string to set the embed timestamp to.
Sets the title of this embed.
A new title for the embed. Must be no more than 256 characters.
Sets the type of this embed. Always rich
for webhook embeds.
The type of this embed.
Adds a link to the specified URL to the title of this embed.
Note: Requires a title to be set.
The url of this embed.
Sets an video for this embed. If set, the video is typically rendered below the description and fields.
You must only set the url
property of the options sent to this function.
Embed thumbnail options.
Generated using TypeDoc
Discord allows us to send Rich Embed objects attached to messages that render as nice info boxes in chat.
Example: Send an embed with some customization in response to an !info command.
const commands = new discord.command.CommandGroup({ defaultPrefix: '!' }); commands.registerCommand( "info", args => ({ user: args.user() }), async ({ message }, { user }) => { // build the rich embed const richEmbed = new discord.Embed(); richEmbed.setTitle(user.getTag()).setColor(0x00ff00); richEmbed.setDescription("User Information Example"); richEmbed.setThumbnail({ url: user.getAvatarUrl() }); richEmbed.addField({ name: "User ID", value: user.id, inline: false }); richEmbed.setTimestamp(new Date().toISOString()); // reply to the command with our embed await message.reply({ content: "", embed: richEmbed }); } );