Embed

Create a custom embed

Constructor

new Embed()

Example
const { Embed } = require("interactions.js");

const embed = new Embed()
.setTitle('This is a Title')
.setURL('https://github.com/fb-sean/interactions.js')
.setColor('#31B505')
.setAuthor("This is a Author", null, "https://github.com/fb-sean/interactions.js");

Methods

addField(name, value, inline) → {Embed}

Add a field to the embed

You can have a maximum of 25 fields.

Parameters:
NameTypeDefaultDescription
nameString

The field name

valueString

The field value

inlineBooleanfalse

boolean if the embed should be inline

Returns:
Type: 
Embed

addFields(ArrayOfFields) → {Embed}

Appends fields to the embed You can have a maximum of 25 fields.

Parameters:
NameTypeDescription
ArrayOfFieldsArray

fields The fields to add

Returns:
Type: 
Embed
Example
const embed = new Embed()
   .addFields(ArrayOfFields);

setAuthor(name, iconUrl, url) → {Embed}

Sets the author of this embed

Parameters:
NameTypeDescription
nameString

The name for the author

iconUrlString

The icon url for the author

urlString

The url for the author

Returns:
Type: 
Embed

setColor(color) → {Embed}

Sets the color of this embed

Parameters:
NameTypeDescription
colorString

The color of the embed

Returns:
Type: 
Embed

setDescription(desc) → {Embed}

Sets the description of this embed

Parameters:
NameTypeDescription
descString

The description

Returns:
Type: 
Embed

setFields(ArrayOfFields) → {Embed}

Sets the embed's fields You can set a maximum of 25 fields.

Parameters:
NameTypeDescription
ArrayOfFieldsArray

fields The fields to set

Returns:
Type: 
Embed

setFooter(text, iconUrl) → {Embed}

Sets the footer of this embed

Parameters:
NameTypeDescription
textString

The name for the footer

iconUrlString

The iconUrl for the footer

Returns:
Type: 
Embed

setImage(url) → {Embed}

Sets the image of this embed

Parameters:
NameTypeDescription
urlString

The URL of the image

Returns:
Type: 
Embed

setThumbnail(url) → {Embed}

Sets the thumbnail of this embed

Parameters:
NameTypeDescription
urlString

The URL of the thumbnail

Returns:
Type: 
Embed

setTimestamp(timestamp) → {Embed}

Sets the timestamp of this embed

Parameters:
NameTypeDescription
timestampString

The timestamp or date

Returns:
Type: 
Embed

setTitle(title) → {Embed}

Sets the title of this embed

Parameters:
NameTypeDescription
titleString

The title

Returns:
Type: 
Embed

setURL(url) → {Embed}

Sets the URL of this embed

Parameters:
NameTypeDescription
urlString

The URL

Returns:
Type: 
Embed