export declare class EmbedBuilderA builder that creates API-compatible JSON data for embeds.
readonlydata : APIEmbed
The API data associated with this embed.
addFields(...fields: RestOrArray<APIEmbedField>) : this
...fields: RestOrArray<APIEmbedField>
Appends fields to the embed.
Examples:Using an array:Using rest parameters (variadic):
const fields: APIEmbedField[] = ...;
const embed = new EmbedBuilder()
.addFields(fields);const embed = new EmbedBuilder()
.addFields(
{ name: 'Field 1', value: 'Value 1' },
{ name: 'Field 2', value: 'Value 2' },
); setAuthor(options: EmbedAuthorOptions | null) : this
options: EmbedAuthorOptions | null
Sets the author of this embed.
setFields(...fields: RestOrArray<APIEmbedField>) : this
...fields: RestOrArray<APIEmbedField>
Sets the fields for this embed.
setFooter(options: EmbedFooterOptions | null) : this
options: EmbedFooterOptions | null
Sets the footer of this embed.
Removes, replaces, or inserts fields for this embed.
Examples:Remove the first field:Remove the first n fields:Remove the last field:
embed.spliceFields(0, 1);const n = 4;
embed.spliceFields(0, n);embed.spliceFields(-1, 1);toJSON() : APIEmbed
Serializes this builder to API-compatible JSON data.