Skip to content

Latest commit

 

History

History
192 lines (127 loc) · 10.5 KB

File metadata and controls

192 lines (127 loc) · 10.5 KB

EmbedConstructor

EmbedConstructor to create embeds easily.


Properties

.author

The author of the embed
type Object?

.color

The color of the embed
type Number?

.description

The description of the embed
type String?

.fields

The fields of the embed
type Array<Object>?

.footer

The footer of the embed
type Object?

.image

The image of the embed
type Object?

.thumbnail

The thumbnail of the embed
type Object?

.timestamp

The timestamp of the embed
type String? | Date?

.title

The title of the embed
type String?

.url

The url of the embed title
type String?

Constructor

new EmbedConstructor(data)

Parameter Default Description
data {} Object (optional)
The data of the embed. See

Methods

setTitle(title)

Sets the title of the embed

Parameter Description
title String
The new title of the embed

Returns this

setDescription(description)

Sets the description of the embed

Parameter Description
description String
The new description of the embed

Returns this

setURL(url)

Sets the title URL of the embed

Parameter Description
url String
The new URL of the title

Returns this

setTimestamp(timestamp)

Sets the timestamp of the embed

Parameter Description
timestamp String | Date | Number
The new timestamp of the embed

Returns this

setColor(color)

Sets the color of the embed

Parameter Description
color String | Number
The new color of the embed
g Number (optional)
b Number (optional)

Returns this

setFooter(footer, iconURL)

Sets the footer of the embed

Parameter Description
footer String | Object
The new footer of the embed
footer.text String
The footer text
footer.icon_url String (optional)
The icon URL of the new footer
iconURL String (optional)
The URL of the new footer icon

Returns this

setImage(image)

Sets the image of the embed

Parameter Description
image String | Object
The new image of the embed
image.url String (optional)
The url of the new embed image

Returns this

setThumbnail(thumbnail)

Sets the thumbnail of the embed

Parameter Description
thumbnail String | Object
The new thumbnail of the embed
thumbnail.url String (optional)
The url of the new embed thumbnail

Returns this

setAuthor(author, iconURL, url)

Sets the author of the embed

Parameter Description
author String | Object
The new author of the embed
author.name String
The name of the author
author.icon_url String (optional)
The icon url of the author
author.url String (optional)
The url of the author
iconURL String (optional)
The icon url of the author
url String (optional)
The url of the author

Returns this

setFields(fields)

Sets the fields of the embed

Parameter Description
fields Array<Object>
fields[].name String
The name of the field
fields[].value String
The value of the field
fields[].inline Boolean (optional)

Returns this

addField(field, value, inline)

Add a field to the embed

Parameter Description
field Object | String
The new field of the embed or the name
field.name String
The name of the field
field.value String
The value of the field
field.inline Boolean (optional)
value String (optional)
The value of the field
inline Boolean (optional)

Returns this

addFields(...fields)

Add fields to the embed

Parameter Description
fields Array<Object> | Array<Array<Object>>
fields[].name String
The name of the field
fields[].value String
The value of the field
fields[].inline Boolean (optional)

Returns this

toJSON()

Returns APIEmbed