Skip to content

Embed

Represents a message embed.

Example

1
const embed = new Embed();
2
embed.setTitle('Seyfert');
3
embed.setDescription('Better than discord.js');
4
embed.setColor('Green');
5
const embedJSON = embed.json();

Constructors

new Embed(data)

1
new Embed(data: Partial<APIEmbed>): Embed

Creates a new instance of Embed.

Parameters

ParameterTypeDescription
dataPartial<APIEmbed>The initial data for the embed.

Returns

Embed

Example

1
const embed = new Embed({ title: 'Hello', description: 'This is an example embed' });

Source

seyfert/src/builders/Embed.ts:20

Properties

PropertyModifierTypeDescription
datapublicPartial<APIEmbed>The initial data for the embed.

Methods

addFields()

1
addFields(...fields: RestOrArray<APIEmbedField>): this

Adds one or more fields to the embed.

Parameters

ParameterTypeDescription
fieldsRestOrArray<APIEmbedField>The fields to add to the embed.

Returns

this

The updated Embed instance.

Example

1
embed.addFields({ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' });

Source

seyfert/src/builders/Embed.ts:68


setAuthor()

1
setAuthor(author: Object): this

Sets the author of the embed.

Parameters

ParameterTypeDescription
authorObjectThe author information.
author.iconUrlundefined | string-
author.namestring-
author.proxyIconUrlundefined | string-
author.urlundefined | string-

Returns

this

The updated Embed instance.

Example

1
embed.setAuthor({ name: 'John Doe', iconURL: 'https://example.com/avatar.png' });

Source

seyfert/src/builders/Embed.ts:31


setColor()

1
setColor(color: ColorResolvable): this

Sets the color of the embed.

Parameters

ParameterTypeDescription
colorColorResolvableThe color of the embed.

Returns

this

The updated Embed instance.

Example

1
embed.setColor('#FF0000');
2
embed.setColor('Blurple');

Source

seyfert/src/builders/Embed.ts:44


setDescription()

1
setDescription(desc: string): this

Sets the description of the embed.

Parameters

ParameterTypeDescription
descstringThe description of the embed.

Returns

this

The updated Embed instance.

Example

1
embed.setDescription('This is the description of the embed');

Source

seyfert/src/builders/Embed.ts:56


setFields()

1
setFields(fields: APIEmbedField[]): this

Sets the fields of the embed.

Parameters

ParameterTypeDescription
fieldsAPIEmbedField[]The fields of the embed.

Returns

this

The updated Embed instance.

Example

1
embed.setFields([{ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' }]);

Source

seyfert/src/builders/Embed.ts:80


setFooter()

1
setFooter(footer: Object): this

Sets the footer of the embed.

Parameters

ParameterTypeDescription
footerObjectThe footer information.
footer.iconUrlundefined | string-
footer.textstring-

Returns

this

The updated Embed instance.

Example

1
embed.setFooter({ text: 'This is the footer', iconURL: 'https://example.com/footer.png' });

Source

seyfert/src/builders/Embed.ts:92


setImage()

1
setImage(url: string): this

Sets the image of the embed.

Parameters

ParameterTypeDescription
urlstringThe URL of the image.

Returns

this

The updated Embed instance.

Example

1
embed.setImage('https://example.com/image.png');

Source

seyfert/src/builders/Embed.ts:104


setThumbnail()

1
setThumbnail(url?: string): Embed

Sets the thumbnail of the embed.

Parameters

ParameterTypeDescription
url?stringThe URL of the thumbnail.

Returns

Embed

The updated Embed instance.

Example

1
embed.setThumbnail('https://example.com/thumbnail.png');

Source

seyfert/src/builders/Embed.ts:154


setTimestamp()

1
setTimestamp(time: string | number | Date): this

Sets the timestamp of the embed.

Parameters

ParameterTypeDescription
timestring | number | DateThe timestamp value.

Returns

this

The updated Embed instance.

Example

1
embed.setTimestamp();
2
embed.setTimestamp(1628761200000);
3
embed.setTimestamp(new Date());

Source

seyfert/src/builders/Embed.ts:118


setTitle()

1
setTitle(title: string): this

Sets the title of the embed.

Parameters

ParameterTypeDescription
titlestringThe title of the embed.

Returns

this

The updated Embed instance.

Example

1
embed.setTitle('This is the title');

Source

seyfert/src/builders/Embed.ts:130


setURL()

1
setURL(url: string): this

Sets the URL of the embed.

Parameters

ParameterTypeDescription
urlstringThe URL of the embed.

Returns

this

The updated Embed instance.

Example

1
embed.setURL('https://seyfert.com');

Source

seyfert/src/builders/Embed.ts:142


toJSON()

1
toJSON(): APIEmbed

Converts the Embed instance to a JSON object.

Returns

APIEmbed

The JSON representation of the MessageEmbed instance.

Source

seyfert/src/builders/Embed.ts:163