declare class EmbedBuilder
Represents a embed in a message (image/video preview, rich embed, etc.)
readonlyAPIEmbed data :
addFieldsfields: RestOrArray<APIEmbedField>) : this (
fields: RestOrArray<APIEmbedField>
Appends fields to the embed
Examples:Using an arrayUsing 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 embed's fields
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 in the embed.
Examples:Remove the first fieldRemove the first n fieldsRemove the last field
embed.spliceFields(0, 1);
const n = 4
embed.spliceFields(0, n);
embed.spliceFields(-1, 1);
toJSONAPIEmbed () :
Transforms the embed to a plain object