Methods
addField(field) → {MessageEmbed}
Add a field to the embed
Parameters:
Name | Type | Description |
---|---|---|
field |
field
|
The field to add |
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
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
author |
Object
|
The author object
|
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
Parameters:
Name | Type | Default | Description |
---|---|---|---|
color |
string
|
number
|
null |
The color of 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
Parameters:
Name | Type | Description |
---|---|---|
description |
string
|
The description of 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
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array.<field>
|
The fields for 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
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
footer |
Object
|
The footer object
|
Example
embed.setFooter({text: 'This is a footer', icon: 'https://i.imgur.com/sINzKh7.png'});
setImage(url) → {MessageEmbed}
Set the image for the embed
Parameters:
Name | Type | Description |
---|---|---|
url |
string
|
The url of the image |
Example
embed.setImage('https://i.imgur.com/sINzKh7.png');
setThumbnail(url) → {MessageEmbed}
Set the thumbnail for the embed
Parameters:
Name | Type | Description |
---|---|---|
url |
string
|
The url of the thumbnail |
Example
embed.setThumbnail('https://i.imgur.com/sINzKh7.png');
setTimestamp(date) → {MessageEmbed}
Set the time for the embed
Parameters:
Name | Type | Description |
---|---|---|
date |
Date
|
undefined
|
The date for the embed |
Example
embed.setTime(new Date());
embed.setTime(Date.now());
setTitle(title) → {MessageEmbed}
Set the title of the embed
Parameters:
Name | Type | Description |
---|---|---|
title |
string
|
The title of the embed |
Example
embed.setTitle('This is a title');
setURL(url) → {MessageEmbed}
Set a URL for the embed
Parameters:
Name | Type | Description |
---|---|---|
url |
String
|
The URL |
Example
embed.setURL('https://guilded.gg');