Class

EmbedBuilder

Request-only embed builder. Emits RESTPostAPIEmbed (no video/audio).

Constructor

new EmbedBuilder()

Properties

data: Partial<RESTPostAPIEmbed> (readonly)

Partial embed data (built incrementally via setters).

Methods

addFields(fields: EmbedFieldData[]): this

Add fields (up to 25 total). Existing fields are preserved.

ParamTypeDescription
fieldsEmbedFieldData[]

Field objects to append

Copy request fields only — response video/audio/type/provider are ignored.

ParamTypeDescription
dataAPIEmbed | RESTPostAPIEmbed

API embed from message or webhook

setAuthor(options: EmbedAuthorOptions | null): this

Set embed author. Pass null to clear.

ParamTypeDescription
optionsEmbedAuthorOptions | null

Author name, icon URL, and URL, or null

setColor(color: number | string | [number, number, number] | null): this

Set embed color. Pass null to clear.

ParamTypeDescription
colornumber | string | [number, number, number] | null

Number (24-bit RGB), hex string (`#5865F2`), or RGB tuple, or null

setDescription(description: string | null): this

Set embed description (max 4096 characters). Pass null to clear.

ParamTypeDescription
descriptionstring | null

Description text or null

setFields(fields: EmbedFieldData[]): this

Replace all fields (max 25). Pass empty array to clear.

ParamTypeDescription
fieldsEmbedFieldData[]

Field objects (name, value, inline)

setFooter(options: EmbedFooterOptions | null): this

Set embed footer. Pass null to clear.

ParamTypeDescription
optionsEmbedFooterOptions | null

Footer text and optional icon URL, or null

setImage(input: string | EmbedMediaOptions | null): this

Set embed image (large media below description). Pass null to clear.

ParamTypeDescription
inputstring | EmbedMediaOptions | null

URL string or media options, or null

setThumbnail(input: string | EmbedMediaOptions | null): this

Set embed thumbnail (small media in top-right corner). Pass null to clear.

ParamTypeDescription
inputstring | EmbedMediaOptions | null

URL string or media options, or null

setTimestamp(timestamp?: Date | number | null): this

Set embed timestamp. Pass null to clear.

ParamTypeDescription
timestamp?Date | number | null

Date object, Unix ms, or undefined (defaults to now), or null

setTitle(title: string | null): this

Set embed title (max 256 characters). Pass null to clear.

ParamTypeDescription
titlestring | null

Title text or null

setURL(url: string | null): this

Set embed URL (title becomes clickable). Pass null to clear.

ParamTypeDescription
urlstring | null

HTTP(S) URL or null

spliceFields(index: number, deleteCount: number, fields: EmbedFieldData[]): this

Splice fields (like Array.prototype.splice).

ParamTypeDescription
indexnumber

Start index

deleteCountnumber

Number of fields to remove

fieldsEmbedFieldData[]

Fields to insert at index

Wire payload: request keys only, snake_case nested media/author/footer.