Embed
Represents a message embed.
Signature
export declare class Embedconst embed = new Embed();
embed.setTitle('Seyfert');
embed.setDescription('Better than discord.js');
embed.setColor('Green');
const embedJSON = embed.json();Properties
1Methods
13Properties
Methods
constructorConstructorconstructor(data?: Partial<APIEmbed>);setAuthor(author?: ObjectToLower<APIEmbedAuthor>): this;Sets the author of the embed.
author- The author information.
The updated Embed instance.
embed.setAuthor({ name: 'John Doe', iconUrl: 'https://example.com/avatar.png' });setColor(color?: ColorResolvable): this;Sets the color of the embed.
color- The color of the embed.
The updated Embed instance.
embed.setColor('#FF0000');
embed.setColor('Blurple');setDescription(desc?: string): this;Sets the description of the embed.
desc- The description of the embed.
The updated Embed instance.
embed.setDescription('This is the description of the embed');addFields(...fields: RestOrArray<APIEmbedField>): this;Adds one or more fields to the embed.
fields- The fields to add to the embed.
The updated Embed instance.
embed.addFields({ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' });setFields(fields?: APIEmbedField[]): this;Sets the fields of the embed.
fields- The fields of the embed.
The updated Embed instance.
embed.setFields([{ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' }]);setFooter(footer?: ObjectToLower<Omit<APIEmbedFooter, 'proxy_icon_url'>>): this;Sets the footer of the embed.
footer- The footer information.
The updated Embed instance.
embed.setFooter({ text: 'This is the footer', iconUrl: 'https://example.com/footer.png' });setImage(url?: string): this;Sets the image of the embed.
url- The URL of the image.
The updated Embed instance.
embed.setImage('https://example.com/image.png');setTimestamp(time?: string | number | Date): this;Sets the timestamp of the embed.
time- The timestamp value.
The updated Embed instance.
embed.setTimestamp();
embed.setTimestamp(1628761200000);
embed.setTimestamp(new Date());setTitle(title?: string): this;Sets the title of the embed.
title- The title of the embed.
The updated Embed instance.
embed.setTitle('This is the title');setURL(url?: string): this;Sets the URL of the embed.
url- The URL of the embed.
The updated Embed instance.
embed.setURL('https://seyfert.com');setThumbnail(url?: string): this;Sets the thumbnail of the embed.
url- The URL of the thumbnail.
The updated Embed instance.
embed.setThumbnail('https://example.com/thumbnail.png');toJSON(): APIEmbed;Converts the Embed instance to a JSON object.
The JSON representation of the MessageEmbed instance.