Skip to content

MessageEmbed

MessageEmbed

Represents a message embed.

Kind: global class

new MessageEmbed([data])

Constructs a new MessageEmbed object.

ParamTypeDefaultDescription
[data]ObjectThe data for the message embed.
[data.title]stringThe title of the message embed.
[data.type]string”"rich"“The type of the message embed.
[data.description]stringThe description of the message embed.
[data.url]stringThe URL of the message embed.
[data.timestamp]stringThe timestamp of the message embed.
[data.color]stringThe color of the message embed.
[data.footer]ObjectThe footer of the message embed.
[data.image]ObjectThe image of the message embed.
[data.thumbnail]ObjectThe thumbnail of the message embed.
[data.video]ObjectThe video of the message embed.
[data.provider]ObjectThe provider of the message embed.
[data.author]ObjectThe author of the message embed.
[data.fields]Array.<Object>[]The fields of the message embed.

messageEmbed.setTitle(title) ⇒ MessageEmbed

Sets the title of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
titlestringThe title of the embed.

messageEmbed.setDescription(description) ⇒ MessageEmbed

Sets the description of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
descriptionstringThe description of the embed.

messageEmbed.setURL(url) ⇒ MessageEmbed

Sets the URL of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
urlstringThe URL of the embed.

messageEmbed.setTimestamp(timestamp) ⇒ MessageEmbed

Sets the timestamp of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
timestampDate | number | stringThe timestamp of the embed.

messageEmbed.setColor(color) ⇒ MessageEmbed

Sets the color of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
colorstring | numberThe color of the embed.

messageEmbed.setFooter(footer) ⇒ MessageEmbed

Sets the footer of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
footerstringThe footer of the embed.

messageEmbed.setImage(image) ⇒ MessageEmbed

Sets the image of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
imageobjectThe image of the embed.
image.urlstringThe URL of the image.

messageEmbed.setThumbnail(thumbnail) ⇒ MessageEmbed

Sets the thumbnail of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
thumbnailobjectThe thumbnail of the embed.
thumbnail.urlstringThe URL of the thumbnail.

messageEmbed.setAuthor(author) ⇒ MessageEmbed

Sets the author of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
authorstringThe author of the embed.

messageEmbed.addFields(…fields) ⇒ MessageEmbed

Adds multiple fields to the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
…fieldsobject | Array.<object>The fields to add to the embed.

messageEmbed.addField(name, value, [inline]) ⇒ MessageEmbed

Adds a single field to the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
namestringThe name of the field.
valuestringThe value of the field.
[inline]booleanWhether the field should be displayed inline.

messageEmbed.setFields(…fields) ⇒ MessageEmbed

Sets the fields of the embed.

Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.

ParamTypeDescription
…fieldsobject | Array.<object>The fields to set for the embed.

messageEmbed.toJSON() ⇒ object

Converts the MessageEmbed instance to a plain object.

Kind: instance method of MessageEmbed
Returns: object - The plain object representation of the MessageEmbed instance.

MessageEmbed.transformFields(fields) ⇒ Object

Transforms the input fields object to a new object with specific properties.

Kind: static method of MessageEmbed
Returns: Object - - A new object with transformed fields.

ParamTypeDescription
fieldsObjectThe input object containing fields to be transformed.
fields.namestringThe name of the field.
fields.valueanyThe value of the field.
[fields.inline]boolean | undefinedWhether the field should be displayed inline. If not specified, defaults to undefined.