EmbedBuilder
Request-only embed builder. Emits RESTPostAPIEmbed (no video/audio).
Constructor
()Properties
: Partial<RESTPostAPIEmbed> (readonly)Partial embed data (built incrementally via setters).
Methods
(fields: EmbedFieldData[]): thisAdd fields (up to 25 total). Existing fields are preserved.
| Param | Type | Description |
|---|---|---|
| fields | EmbedFieldData[] | Field objects to append |
(data: APIEmbed | RESTPostAPIEmbed): EmbedBuilderCopy request fields only — response video/audio/type/provider are ignored.
| Param | Type | Description |
|---|---|---|
| data | APIEmbed | RESTPostAPIEmbed | API embed from message or webhook |
(options: EmbedAuthorOptions | null): thisSet embed author. Pass null to clear.
| Param | Type | Description |
|---|---|---|
| options | EmbedAuthorOptions | null | Author name, icon URL, and URL, or null |
(color: number | string | [number, number, number] | null): thisSet embed color. Pass null to clear.
| Param | Type | Description |
|---|---|---|
| color | number | string | [number, number, number] | null | Number (24-bit RGB), hex string (`#5865F2`), or RGB tuple, or null |
(description: string | null): thisSet embed description (max 4096 characters). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| description | string | null | Description text or null |
(fields: EmbedFieldData[]): thisReplace all fields (max 25). Pass empty array to clear.
| Param | Type | Description |
|---|---|---|
| fields | EmbedFieldData[] | Field objects (name, value, inline) |
(input: string | EmbedMediaOptions | null): thisSet embed image (large media below description). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| input | string | EmbedMediaOptions | null | URL string or media options, or null |
(input: string | EmbedMediaOptions | null): thisSet embed thumbnail (small media in top-right corner). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| input | string | EmbedMediaOptions | null | URL string or media options, or null |
(timestamp?: Date | number | null): thisSet embed timestamp. Pass null to clear.
| Param | Type | Description |
|---|---|---|
| timestamp? | Date | number | null | Date object, Unix ms, or undefined (defaults to now), or null |
(title: string | null): thisSet embed title (max 256 characters). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| title | string | null | Title text or null |
(url: string | null): thisSet embed URL (title becomes clickable). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| url | string | null | HTTP(S) URL or null |
(index: number, deleteCount: number, fields: EmbedFieldData[]): thisSplice fields (like Array.prototype.splice).
| Param | Type | Description |
|---|---|---|
| index | number | Start index |
| deleteCount | number | Number of fields to remove |
| fields | EmbedFieldData[] | Fields to insert at index |
(): RESTPostAPIEmbedWire payload: request keys only, snake_case nested media/author/footer.