seyfert
    Preparing search index...

    Class Embed

    Represents a message embed.

    const embed = new Embed();
    embed.setTitle('Seyfert');
    embed.setDescription('Better than discord.js');
    embed.setColor('Green');
    const embedJSON = embed.json();
    Index

    Constructors

    • Creates a new instance of Embed.

      Parameters

      • data: Partial<APIEmbed> = {}

        The initial data for the embed.

      Returns Embed

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

    Properties

    data: Partial<APIEmbed>

    Methods

    • Adds one or more fields to the embed.

      Parameters

      • ...fields: RestOrArray<APIEmbedField>

        The fields to add to the embed.

      Returns this

      The updated Embed instance.

      embed.addFields({ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' });
      
    • Sets the author of the embed.

      Parameters

      • Optionalauthor: { iconUrl?: string; name: string; proxyIconUrl?: string; url?: string }

        The author information.

      Returns this

      The updated Embed instance.

      embed.setAuthor({ name: 'John Doe', iconUrl: 'https://example.com/avatar.png' });
      
    • Sets the color of the embed.

      Parameters

      • Optionalcolor: ColorResolvable

        The color of the embed.

      Returns this

      The updated Embed instance.

      embed.setColor('#FF0000');
      embed.setColor('Blurple');
    • Sets the description of the embed.

      Parameters

      • Optionaldesc: string

        The description of the embed.

      Returns this

      The updated Embed instance.

      embed.setDescription('This is the description of the embed');
      
    • Sets the fields of the embed.

      Parameters

      • Optionalfields: APIEmbedField[]

        The fields of the embed.

      Returns this

      The updated Embed instance.

      embed.setFields([{ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' }]);
      
    • Sets the footer of the embed.

      Parameters

      • Optionalfooter: { iconUrl?: string; text: string }

        The footer information.

      Returns this

      The updated Embed instance.

      embed.setFooter({ text: 'This is the footer', iconUrl: 'https://example.com/footer.png' });
      
    • Sets the image of the embed.

      Parameters

      • Optionalurl: string

        The URL of the image.

      Returns this

      The updated Embed instance.

      embed.setImage('https://example.com/image.png');
      
    • Sets the thumbnail of the embed.

      Parameters

      • Optionalurl: string

        The URL of the thumbnail.

      Returns Embed

      The updated Embed instance.

      embed.setThumbnail('https://example.com/thumbnail.png');
      
    • Sets the timestamp of the embed.

      Parameters

      • time: string | number | Date = ...

        The timestamp value.

      Returns this

      The updated Embed instance.

      embed.setTimestamp();
      embed.setTimestamp(1628761200000);
      embed.setTimestamp(new Date());
    • Sets the title of the embed.

      Parameters

      • Optionaltitle: string

        The title of the embed.

      Returns this

      The updated Embed instance.

      embed.setTitle('This is the title');
      
    • Sets the URL of the embed.

      Parameters

      • Optionalurl: string

        The URL of the embed.

      Returns this

      The updated Embed instance.

      embed.setURL('https://seyfert.com');
      
    • Converts the Embed instance to a JSON object.

      Returns APIEmbed

      The JSON representation of the MessageEmbed instance.