MessageEmbed

MessageEmbed

This class is used to create embeds for guilded messages

Constructor

new MessageEmbed()

Source:

Methods

addField(field) → {MessageEmbed}

Add a field to the embed

Source:
Parameters:
Name Type Description
field field

The field to add

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.addField({
   name: 'Field 1',
   value: 'This is field 1',
   inline: true
});
embed.addField({
   name: 'Field 2',
   value: 'This is field 2',
   inline: false
});

setAuthor(author) → {MessageEmbed}

Set the author for the embed

Source:
Parameters:
Name Type Description
author Object

The author object

Name Type Description
name string

The name of the author

icon string | undefined

The icon of the author

url string | undefined

The url of the author

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setAuthor({name: 'Guilded', icon: 'https://i.imgur.com/sINzKh7.png', url: 'https://guilded.gg'});

setColor(color) → {MessageEmbed}

Set the color of the embed

Source:
Parameters:
Name Type Default Description
color string | number null

The color of the embed

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setColor('#0099ff');
embed.setColor(0x0099ff);
embed.setColor('grey');
embed.setColor('RANDOM');
embed.setColor('RED');

setDescription(description) → {MessageEmbed}

Set the description of the embed

Source:
Parameters:
Name Type Description
description string

The description of the embed

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setDescription('This is a description');

setFields(fields) → {MessageEmbed}

Set the fields for the embed, all fields must be an array of field objects

Source:
Parameters:
Name Type Description
fields Array.<field>

The fields for the embed

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setFields([
 {
     name: 'Field 1',
     value: 'This is field 1',
     inline: true
 },
 {
     name: 'Field 2',
     value: 'This is field 2',
     inline: false
 }
]);

setFooter(footer) → {MessageEmbed}

Set the footer for the embed

Source:
Parameters:
Name Type Description
footer Object

The footer object

Name Type Description
text string

The text of the footer

icon string | undefined

The icon of the footer

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setFooter({text: 'This is a footer', icon: 'https://i.imgur.com/sINzKh7.png'});

setImage(url) → {MessageEmbed}

Set the image for the embed

Source:
Parameters:
Name Type Description
url string

The url of the image

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setImage('https://i.imgur.com/sINzKh7.png');

setThumbnail(url) → {MessageEmbed}

Set the thumbnail for the embed

Source:
Parameters:
Name Type Description
url string

The url of the thumbnail

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setThumbnail('https://i.imgur.com/sINzKh7.png');

setTimestamp(date) → {MessageEmbed}

Set the time for the embed

Source:
Parameters:
Name Type Description
date Date | undefined

The date for the embed

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setTime(new Date());
embed.setTime(Date.now());

setTitle(title) → {MessageEmbed}

Set the title of the embed

Source:
Parameters:
Name Type Description
title string

The title of the embed

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setTitle('This is a title');

setURL(url) → {MessageEmbed}

Set a URL for the embed

Source:
Parameters:
Name Type Description
url String

The URL

Returns:
Type:
MessageEmbed
  • The embed
Example
embed.setURL('https://guilded.gg');