export declare class EmbedBuilder
A builder that creates API-compatible JSON data for embeds.
readonlyAPIEmbed data :
The API data associated with this embed.
addFieldsfields: 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' },
);
setAuthoroptions: EmbedAuthorOptions | null) : this (
options: EmbedAuthorOptions | null
Sets the author of this embed.
setColorcolor: RGBTuple | number | null) : this (
color: RGBTuple | number | null
Sets the color of this embed.
setFieldsfields: RestOrArray<APIEmbedField>) : this (
fields: RestOrArray<APIEmbedField>
Sets the fields for this embed.
setFooteroptions: EmbedFooterOptions | null) : this (
options: EmbedFooterOptions | null
Sets the footer of this embed.
setTimestamptimestamp?: Date | number | null) : this (
timestamp?: Date | number | null
Sets the timestamp 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);
toJSONAPIEmbed () :
Serializes this builder to API-compatible JSON data.