Search…
MessageEmbed
embed docs
wintr - not your average multipurpose bot

What is an embed?

An Embed object is another component of Discord messages that can be used to present data with special formatting and structure. An example of a message embed: An embed can contain the following components: Author, including link and avatar.

Embed Properties

type, title, description, url, color, timestamp, fields, thumbnail, image, video, author, provider, footer, files, createdAt, hexColor, length

Methods

addField addFields spliceFields attachFiles setAuthor setColor setDescription setFooter setImage setThumbnail setTimestamp setTitle setURL toJSON normalizeField normalizeFields

Properties +

PARAMETER
TYPE
DESCRIPTION
fields
Fields to normalize
Normalizes field input and resolves strings.
STATIC
Returns: EmbedField
PARAMETER
TYPE
OPTIONAL
DEFAULT
DESCRIPTION
name
True
The name of the field
value
True
The value of the field
inline
boolean
True
false
Set the field to display inline
Normalizes field input and resolves strings.
STATIC
The raw data of this embed
Returns: Object
Transforms the embed to a plain object.

.toJSON()

Returns: MessageEmbed
PARAMETER
TYPE
OPTIONAL
DEFAULT
DESCRIPTION
index
number
True
The index to start at
deleteCount
number
True
The number of fields to remove
fields
True
none
The replacing field objects
Removes, replaces, and inserts fields in the embed (max 25).
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
url
string
The URL
Sets the URL of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
title
The title
Sets the title of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
OPTIONAL
DEFAULT
DESCRIPTION
timestamp
Date number
True
Date.now()
The timestamp or date
Sets the timestamp of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
url
string
The URL of the thumbnail
Sets the thumbnail of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
url
string
The URL of the image
Sets the image of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
OPTIONAL
DEFAULT
DESCRIPTION
text
True
The text of the footer
iconURL
string
True
none
The icon URL of the footer
Sets the footer of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
description
The description
Sets the description of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
color
The color of the embed
Sets the color of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
OPTIONAL
DEFAULT
DESCRIPTION
name
True
The name of the author
iconURL
string
True
none
The icon URL of the author
url
string
True
none
The URL of the author
Sets the author of this embed.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
files
Files to attach
Sets the file to upload alongside the embed. This file can be accessed via attachment://fileName.extension when setting an embed image or author/footer icons. Multiple files can be attached.
Returns: MessageEmbed
PARAMETER
TYPE
DESCRIPTION
fields
The fields to add
Adds fields to the embed (max 25).
Returns: MessageEmbed
PARAMETER
TYPE
OPTIONAL
DEFAULT
DESCRIPTION
name
True
The name of this field
value
True
The value of this field
inline
boolean
True
false
If this field will be displayed inline
Adds a field to the embed (max 25).

Methods

The video of this embed (if there is one)
READ-ONLY

.video

Type: ?string
The URL of this embed

.url

Type: string
  • rich - a rich embed
  • image - an image embed
  • video - a video embed
  • gifv - a gifv embed
  • article - an article embed
  • link - a link embed
The type of this embed, either:

.type

Type: ?string
The title of this embed

.title

Type: ?number
The timestamp of this embed
The thumbnail of this embed (if there is one)
The provider of this embed (if there is one)

.provider

Type: number
The accumulated length for the embed title, description, fields and footer text
READ-ONLY

.length

The image of this embed, if there is one

.image

Type: ?string
The hexadecimal version of the embed color, with a leading hash
READ-ONLY

.hexColor

The footer of this embed

.footer

The files of this embed

.files

The fields of this embed

.fields

Type: ?string
The description of this embed
Type: ?Date
The date displayed on this embed
READ-ONLY
Type: ?number
The color of this embed

.color

The author of this embed (if there is one)

.author

Last modified 5mo ago