Search...

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 class
NameTypeOptionalDescription
dataAPIEmbedYesNone
Readonly

data

:

APIEmbed

addFields(fields)

:

this

Adds fields to the embed (max 25)
NameTypeOptionalDescription
fieldsRestOrArray<APIEmbedField>NoThe fields to add

setAuthor(options)

:

this

Sets the author of this embed
NameTypeOptionalDescription
optionsEmbedAuthorOptions | nullNoThe options for the author

setColor(color)

:

this

Sets the color of this embed
NameTypeOptionalDescription
colornumber | RGBTuple | nullNoThe color of the embed

setDescription(description)

:

this

Sets the description of this embed
NameTypeOptionalDescription
descriptionstring | nullNoThe description

setFields(fields)

:

this

Sets the embed's fields (max 25).
NameTypeOptionalDescription
fieldsRestOrArray<APIEmbedField>NoThe fields to set

setFooter(options)

:

this

Sets the footer of this embed
NameTypeOptionalDescription
optionsEmbedFooterOptions | nullNoThe options for the footer

setImage(url)

:

this

Sets the image of this embed
NameTypeOptionalDescription
urlstring | nullNoThe URL of the image

setThumbnail(url)

:

this

Sets the thumbnail of this embed
NameTypeOptionalDescription
urlstring | nullNoThe URL of the thumbnail

setTimestamp(timestamp?)

:

this

Sets the timestamp of this embed
NameTypeOptionalDescription
timestampnumber | Date | nullYesThe timestamp or date

setTitle(title)

:

this

Sets the title of this embed
NameTypeOptionalDescription
titlestring | nullNoThe title

setURL(url)

:

this

Sets the URL of this embed
NameTypeOptionalDescription
urlstring | nullNoThe URL

spliceFields(index, deleteCount, fields)

:

this

Removes, replaces, or inserts fields in the embed (max 25)
NameTypeOptionalDescription
indexnumberNoThe index to start at
deleteCountnumberNoThe number of fields to remove
fieldsAPIEmbedField[]NoThe replacing field objects

toJSON()

:

APIEmbed

Transforms the embed to a plain object