EmbedBuilder
declare class EmbedBuilder
declare class EmbedBuilder
Represents a embed in a message (image/video preview, rich embed, etc.)
constructor(data?)
Constructs a new instance of the
EmbedBuilder
className | Type | Optional | Description |
---|---|---|---|
data | APIEmbed | Yes | None |
Readonly
data
:
APIEmbed
addFields(fields)
:
this
Adds fields to the embed (max 25)
Name | Type | Optional | Description |
---|---|---|---|
fields | RestOrArray<APIEmbedField> | No | The fields to add |
setAuthor(options)
:
this
Sets the author of this embed
Name | Type | Optional | Description |
---|---|---|---|
options | EmbedAuthorOptions | null | No | The options for the author |
setColor(color)
:
this
Sets the color of this embed
Name | Type | Optional | Description |
---|---|---|---|
color | number | RGBTuple | null | No | The color of the embed |
setDescription(description)
:
this
Sets the description of this embed
Name | Type | Optional | Description |
---|---|---|---|
description | string | null | No | The description |
setFields(fields)
:
this
Sets the embed's fields (max 25).
Name | Type | Optional | Description |
---|---|---|---|
fields | RestOrArray<APIEmbedField> | No | The fields to set |
Sets the footer of this embed
Name | Type | Optional | Description |
---|---|---|---|
options | EmbedFooterOptions | null | No | The options for the footer |
setImage(url)
:
this
Sets the image of this embed
Name | Type | Optional | Description |
---|---|---|---|
url | string | null | No | The URL of the image |
setThumbnail(url)
:
this
Sets the thumbnail of this embed
Name | Type | Optional | Description |
---|---|---|---|
url | string | null | No | The URL of the thumbnail |
setTimestamp(timestamp?)
:
this
Sets the timestamp of this embed
Name | Type | Optional | Description |
---|---|---|---|
timestamp | number | Date | null | Yes | The timestamp or date |
setTitle(title)
:
this
Sets the title of this embed
Name | Type | Optional | Description |
---|---|---|---|
title | string | null | No | The title |
setURL(url)
:
this
Sets the URL of this embed
Name | Type | Optional | Description |
---|---|---|---|
url | string | null | No | The URL |
spliceFields(index, deleteCount, fields)
:
this
Removes, replaces, or inserts fields in the embed (max 25)
Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of fields to remove |
fields | APIEmbedField[] | No | The replacing field objects |
toJSON()
:
APIEmbed
Transforms the embed to a plain object