Creates a new instance of ExtraEmbed.
The color of the embed.
Optional
options: ExtraEmbedOptionsThe additional options for the embed.
Readonly
dataThe API data associated with this embed.
Appends fields to the embed.
Rest
...fields: RestOrArray<APIEmbedField>The fields to add
This method accepts either an array of fields or a variable number of field parameters. The maximum amount of fields that can be added is 25.
Using an array:
const fields: APIEmbedField[] = ...;
const embed = new EmbedBuilder()
.addFields(fields);
Using rest parameters (variadic):
const embed = new EmbedBuilder()
.addFields(
{ name: 'Field 1', value: 'Value 1' },
{ name: 'Field 2', value: 'Value 2' },
);
Sets the description of the embed.
The description text.
Whether to wrap the description in a code block.
The language of the code block. Defaults to 'typescript'.
The updated ExtraEmbed instance.
Sets the fields for this embed.
Rest
...fields: RestOrArray<APIEmbedField>The fields to set
This method is an alias for EmbedBuilder.spliceFields. More specifically, it splices the entire array of fields, replacing them with the provided fields.
You can set a maximum of 25 fields.
Removes, replaces, or inserts fields for this embed.
The index to start at
The number of fields to remove
Rest
...fields: APIEmbedField[]The replacing field objects
This method behaves similarly to Array.prototype.splice(). The maximum amount of fields that can be added is 25.
It's useful for modifying and adjusting order of the already-existing fields of an embed.
Remove the first field:
embed.spliceFields(0, 1);
Remove the first n fields:
const n = 4;
embed.spliceFields(0, n);
Remove the last field:
embed.spliceFields(-1, 1);
Static
fromGenerated using TypeDoc
Represents an extended version of EmbedBuilder with additional features.