The embed builder for Guilded embeds.

Example

new Embed()
.setTitle('Embed Title')
.setDescription('This is the embed description.');

Hierarchy

  • Embed

Constructors

Properties

The author of the embed.

color?: number

The color of the embed.

description?: string

The description of the embed.

fields: APIEmbedField[]

The fields of the embed.

The footer of the embed.

The image of the embed.

thumbnail?: APIEmbedMedia

The thumbnail of the embed.

timestamp?: Date

The timestamp of the embed.

title?: string

The title of the embed.

url?: string

The URL of the embed.

Methods

  • Add a field to the embed.

    Returns

    The embed builder.

    Example

    // Add a field to the embed.
    embed.addField('Field Name', 'Field Value');
    // Add a inline field to the embed.
    embed.addField('Field Name', 'Field Value', true);

    Parameters

    • name: string

      The name of the field.

    • value: string

      The value of the field.

    • Optional inline: boolean

      Whether the field is inline.

    Returns Embed

  • Set the author of the embed.

    Returns

    The embed builder.

    Example

    // Set the author of the embed with a name.
    embed.setAuthor('Author Name');
    // Set the author of the embed with a name, icon, and URL.
    embed.setAuthor({ name: 'Author Name', icon_url: 'https://example.com', url: 'https://example.com' });

    Parameters

    Returns Embed

  • Set the color of the embed.

    Returns

    The embed builder.

    Example

    // Set the color of the embed with a hex color.
    embed.setColor(0xFFFFFF);
    embed.setColor('#FFFFFF');
    // Set the color of the embed with a preset color.
    embed.setColor('WHITE');
    // Set the color of the embed with RGB values.
    embed.setColor([255, 255, 255]);

    Parameters

    Returns Embed

  • Set the description of the embed.

    Returns

    The embed builder.

    Example

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

    Parameters

    • Optional description: string

      The description of the embed.

    Returns Embed

  • Set the footer of the embed.

    Returns

    The embed builder.

    Example

    embed.setFooter('Footer Text', 'https://example.com');
    

    Parameters

    • Optional text: string

      The text of the footer.

    • Optional iconUrl: string

      The icon URL of the footer.

    Returns Embed

  • Set the image of the embed.

    Returns

    The embed builder.

    Example

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

    Parameters

    • Optional imageUrl: string

      The image URL of the embed.

    Returns Embed

  • Set the thumbnail of the embed.

    Returns

    The embed builder.

    Example

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

    Parameters

    • Optional thumbnailUrl: string

      The thumbnail URL of the embed.

    Returns Embed

  • Set the timestamp of the embed.

    Returns

    The embed builder.

    Example

    // Set the timestamp of the embed with an ISO 8601 date.
    embed.setTimestamp('2022-01-01T00:00:00.000Z');
    // Set the timestamp of the embed with a number of milliseconds since the epoch.
    embed.setTimestamp(1640995200000);
    // Set the timestamp of the embed with a Date object.
    embed.setTimestamp(new Date('2022-01-01T00:00:00.000Z'));

    Parameters

    • Optional timestamp: string | number | Date

      The timestamp of the embed.

    Returns Embed

  • Set the title of the embed.

    Returns

    This embed builder.

    Example

    embed.setTitle('Embed Title');
    

    Parameters

    • Optional title: string

      The title of the embed.

    Returns Embed

  • Set the URL of the embed.

    Returns

    The embed builder.

    Example

    embed.setUrl('https://example.com');
    

    Parameters

    • Optional url: string

      The URL of the embed.

    Returns Embed