Skip to content

Embed

Implementation of discords Embed object as a Luau builder.

https://discord.com/developers/docs/resources/message#embed-object

Embed.title  :: string?

The title of the embed.

Embed.type  :: EmbedType?

The type of embed.

Embed.description  :: string?

The description of the embed.

Embed.url  :: string?

The URL of the embed.

Embed.timestamp  :: string?

The timestamp of the embed (ISO 8601 string).

Embed.color  :: number?

The color of the embed.

Embed.footer  :: EmbedFooter?

The footer of the embed.

Embed.image  :: EmbedImage?

The image of the embed.

Embed.thumbnail  :: EmbedThumbnail?

The thumbnail of the embed.

Embed.video  :: EmbedVideo?

The video of the embed.

Embed.provider  :: EmbedProvider?

The provider of the embed.

Embed.author  :: EmbedAuthor?

The author of the embed.

Embed.fields  :: EmbedField}

The fields in the embed.

Embed : setTitle ( title )  -> Embed

Set the title of the embed.

Parameters

title: string

Returns

Embed
Embed : setType ( type )  -> Embed

Sets the Type of the embed.

Parameters

type: EmbedType

Returns

Embed
Embed : setDescription ( description )  -> Embed

Set the description of the embed.

Parameters

description: string

Returns

Embed
Embed : setUrl ( url )  -> Embed

Set the URL of the embed, URL will provide a hyperlinked title.

Parameters

url: string

Returns

Embed
Embed : setTimestamp ( timestamp )  -> Embed

Set the timestamp of the embed, timestamps will exist at the bottom/footer of the embed.

Parameters

timestamp: DateTime

Returns

Embed
Embed : setColor ( color )  -> Embed

Set the color of the embed, colors are numbers and in luau you can render hex as: 0x<HEX>

example:

  • Red Color: 0xFF0000
  • Green Color: 0x00FF00
  • Blue Clor: 0x0000FF

Parameters

color: number

Returns

Embed
Embed : setFooter ( footer )  -> Embed

Set the footer of the embed.

Parameters

footer: JSON

Returns

Embed
Embed : setImage ( image )  -> Embed

Set the image of the embed.

Parameters

image: JSON

Returns

Embed
Embed : setThumbnail ( thumbnail )  -> Embed

Set the thumbnail of the embed.

Parameters

thumbnail: JSON

Returns

Embed
Embed : setVideo ( video )  -> Embed

Set the video of the embed.

Parameters

video: JSON

Returns

Embed
Embed : setProvider ( provider )  -> Embed

Set the provider of the embed.

Parameters

provider: JSON

Returns

Embed
Embed : setAuthor ( author )  -> Embed

Set the author of the embed.

Parameters

author: JSON

Returns

Embed
Embed : addField ( field )  -> Embed

Add a field to the embeds.

Parameters

field: JSON

Returns

Embed
Embed : build ( )  -> JSON

Responsible for building the Embed JSON that can be parsed by the Discord API.

Returns

JSON
Embed . new ( resource )  -> Embed

Responsible for creating a new Embed.

Parameters

resource: {
title: string?,
type: apiTypes.EmbedType?,
description: string?,
url: string?,
timestamp: stdPolyfills.DateTime?,
color: number?,
footer: embedFooter.JSON?,
image: embedImage.JSON?,
thumbnail: embedThumbnail.JSON?,
video: embedVideo.JSON?,
provider: embedProvider.JSON?,
author: embedAuthor.JSON?,
fields: { embedField.JSON,
}

Returns

Embed