Embed
Implementation of discords Embed object as a Luau builder.
https://discord.com/developers/docs/resources/message#embed-object
Summary
Properties
Embed.title :: string?Embed.type :: apiTypes.EmbedType?Embed.description :: string?Embed.url :: string?Embed.timestamp :: string?Embed.color :: number?Embed.footer :: Builders.EmbedFooter?Embed.image :: Builders.EmbedImage?Embed.thumbnail :: Builders.EmbedThumbnail?Embed.video :: Builders.EmbedVideo?Embed.provider :: Builders.EmbedProvider?Embed.author :: Builders.EmbedAuthor?Embed.fields :: {Builders.EmbedField}Methods
Embed:setTitle(title: string) → EmbedEmbed:setType(type: apiTypes.EmbedType) → EmbedEmbed:setDescription(description: string) → EmbedEmbed:setUrl(url: string) → EmbedEmbed:setTimestamp(timestamp: stdPolyfills.DateTime) → EmbedEmbed:setColor(color: number) → EmbedEmbed:setFooter(footer: embedFooter.JSON) → EmbedEmbed:setImage(image: embedImage.JSON) → EmbedEmbed:setThumbnail(thumbnail: embedThumbnail.JSON) → EmbedEmbed:setVideo(video: embedVideo.JSON) → EmbedEmbed:setProvider(provider: embedProvider.JSON) → EmbedEmbed:setAuthor(author: embedAuthor.JSON) → EmbedEmbed:addField(field: embedField.JSON) → EmbedEmbed:build() → JSONProperties
Section titled “Properties”The title of the embed.
The type of embed.
description
Section titled “description”The description of the embed.
The URL of the embed.
timestamp
Section titled “timestamp”The timestamp of the embed (ISO 8601 string).
The color of the embed.
footer
Section titled “footer”The footer of the embed.
The image of the embed.
thumbnail
Section titled “thumbnail”The thumbnail of the embed.
The video of the embed.
provider
Section titled “provider”The provider of the embed.
author
Section titled “author”The author of the embed.
fields
Section titled “fields”The fields in the embed.
Methods
Section titled “Methods”setTitle
Section titled “setTitle”Embed : setTitle ( title ) -> Embed
Set the title of the embed.
Parameters
| title: string |
Returns
| Embed |
setType
Section titled “setType”Embed : setType ( type ) -> Embed
Sets the Type of the embed.
Parameters
| type: EmbedType |
Returns
| Embed |
setDescription
Section titled “setDescription”Embed : setDescription ( description ) -> Embed
Set the description of the embed.
Parameters
| description: string |
Returns
| Embed |
setUrl
Section titled “setUrl”Embed : setUrl ( url ) -> Embed
Set the URL of the embed, URL will provide a hyperlinked title.
Parameters
| url: string |
Returns
| Embed |
setTimestamp
Section titled “setTimestamp”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 |
setColor
Section titled “setColor”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 |
setFooter
Section titled “setFooter”Embed : setFooter ( footer ) -> Embed
Set the footer of the embed.
Parameters
| footer: JSON |
Returns
| Embed |
setImage
Section titled “setImage”Embed : setImage ( image ) -> Embed
Set the image of the embed.
Parameters
| image: JSON |
Returns
| Embed |
setThumbnail
Section titled “setThumbnail”Embed : setThumbnail ( thumbnail ) -> Embed
Set the thumbnail of the embed.
Parameters
| thumbnail: JSON |
Returns
| Embed |
setVideo
Section titled “setVideo”Embed : setVideo ( video ) -> Embed
Set the video of the embed.
Parameters
| video: JSON |
Returns
| Embed |
setProvider
Section titled “setProvider”Embed : setProvider ( provider ) -> Embed
Set the provider of the embed.
Parameters
| provider: JSON |
Returns
| Embed |
setAuthor
Section titled “setAuthor”Embed : setAuthor ( author ) -> Embed
Set the author of the embed.
Parameters
| author: JSON |
Returns
| Embed |
addField
Section titled “addField”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 |
Functions
Section titled “Functions”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 |