MessageEmbed
Represents a message embed.
Kind: global class
- MessageEmbed
- new MessageEmbed([data])
- instance
- .setTitle(title) ⇒
MessageEmbed - .setDescription(description) ⇒
MessageEmbed - .setURL(url) ⇒
MessageEmbed - .setTimestamp(timestamp) ⇒
MessageEmbed - .setColor(color) ⇒
MessageEmbed - .setFooter(footer) ⇒
MessageEmbed - .setImage(image) ⇒
MessageEmbed - .setThumbnail(thumbnail) ⇒
MessageEmbed - .setAuthor(author) ⇒
MessageEmbed - .addFields(…fields) ⇒
MessageEmbed - .addField(name, value, [inline]) ⇒
MessageEmbed - .setFields(…fields) ⇒
MessageEmbed - .toJSON() ⇒
object
- .setTitle(title) ⇒
- static
- .transformFields(fields) ⇒
Object
- .transformFields(fields) ⇒
new MessageEmbed([data])
Section titled “new MessageEmbed([data])”Constructs a new MessageEmbed object.
| Param | Type | Default | Description |
|---|---|---|---|
| [data] | Object | The data for the message embed. | |
| [data.title] | string | The title of the message embed. | |
| [data.type] | string | ”"rich"“ | The type of the message embed. |
| [data.description] | string | The description of the message embed. | |
| [data.url] | string | The URL of the message embed. | |
| [data.timestamp] | string | The timestamp of the message embed. | |
| [data.color] | string | The color of the message embed. | |
| [data.footer] | Object | The footer of the message embed. | |
| [data.image] | Object | The image of the message embed. | |
| [data.thumbnail] | Object | The thumbnail of the message embed. | |
| [data.video] | Object | The video of the message embed. | |
| [data.provider] | Object | The provider of the message embed. | |
| [data.author] | Object | The author of the message embed. | |
| [data.fields] | Array.<Object> | [] | The fields of the message embed. |
messageEmbed.setTitle(title) ⇒ MessageEmbed
Section titled “messageEmbed.setTitle(title) ⇒ MessageEmbed”Sets the title of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| title | string | The title of the embed. |
messageEmbed.setDescription(description) ⇒ MessageEmbed
Section titled “messageEmbed.setDescription(description) ⇒ MessageEmbed”Sets the description of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| description | string | The description of the embed. |
messageEmbed.setURL(url) ⇒ MessageEmbed
Section titled “messageEmbed.setURL(url) ⇒ MessageEmbed”Sets the URL of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| url | string | The URL of the embed. |
messageEmbed.setTimestamp(timestamp) ⇒ MessageEmbed
Section titled “messageEmbed.setTimestamp(timestamp) ⇒ MessageEmbed”Sets the timestamp of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| timestamp | Date | number | string | The timestamp of the embed. |
messageEmbed.setColor(color) ⇒ MessageEmbed
Section titled “messageEmbed.setColor(color) ⇒ MessageEmbed”Sets the color of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| color | string | number | The color of the embed. |
messageEmbed.setFooter(footer) ⇒ MessageEmbed
Section titled “messageEmbed.setFooter(footer) ⇒ MessageEmbed”Sets the footer of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| footer | string | The footer of the embed. |
messageEmbed.setImage(image) ⇒ MessageEmbed
Section titled “messageEmbed.setImage(image) ⇒ MessageEmbed”Sets the image of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| image | object | The image of the embed. |
| image.url | string | The URL of the image. |
messageEmbed.setThumbnail(thumbnail) ⇒ MessageEmbed
Section titled “messageEmbed.setThumbnail(thumbnail) ⇒ MessageEmbed”Sets the thumbnail of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| thumbnail | object | The thumbnail of the embed. |
| thumbnail.url | string | The URL of the thumbnail. |
messageEmbed.setAuthor(author) ⇒ MessageEmbed
Section titled “messageEmbed.setAuthor(author) ⇒ MessageEmbed”Sets the author of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| author | string | The author of the embed. |
messageEmbed.addFields(…fields) ⇒ MessageEmbed
Section titled “messageEmbed.addFields(…fields) ⇒ MessageEmbed”Adds multiple fields to the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| …fields | object | Array.<object> | The fields to add to the embed. |
messageEmbed.addField(name, value, [inline]) ⇒ MessageEmbed
Section titled “messageEmbed.addField(name, value, [inline]) ⇒ MessageEmbed”Adds a single field to the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| name | string | The name of the field. |
| value | string | The value of the field. |
| [inline] | boolean | Whether the field should be displayed inline. |
messageEmbed.setFields(…fields) ⇒ MessageEmbed
Section titled “messageEmbed.setFields(…fields) ⇒ MessageEmbed”Sets the fields of the embed.
Kind: instance method of MessageEmbed
Returns: MessageEmbed - The MessageEmbed instance.
| Param | Type | Description |
|---|---|---|
| …fields | object | Array.<object> | The fields to set for the embed. |
messageEmbed.toJSON() ⇒ object
Section titled “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
Section titled “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.
| Param | Type | Description |
|---|---|---|
| fields | Object | The input object containing fields to be transformed. |
| fields.name | string | The name of the field. |
| fields.value | any | The value of the field. |
| [fields.inline] | boolean | undefined | Whether the field should be displayed inline. If not specified, defaults to undefined. |