Skip to content

EmbedBuilder

EmbedBuilder is used to construct an embed object for a Discord message.

Usage:

local embed = EmbedBuilder.new()
:setTitle("Embed Title")
:setDescription("This is an embed description.")
:setColor(0x00FF00)
:addField({name = "Field 1", value = "Value 1", inline = true})

Properties

Type

EmbedBuilder.Type  :: table

An enumeration of embed types.

  • Rich: “rich”
  • Image: “image”
  • Video: “video”
  • Gif: “gifv”
  • Article: “article”
  • Link: “link”

Methods

setTitle

EmbedBuilder : setTitle (

     title: string
)  -> Builders.EmbedBuilder

Sets the title of the embed.

setType

EmbedBuilder : setType (

     type: string
)  -> Builders.EmbedBuilder

Sets the type of the embed.

setDescription

EmbedBuilder : setDescription (

     description: string
)  -> Builders.EmbedBuilder

Sets the description of the embed.

setUrl

EmbedBuilder : setUrl (

     url: string
)  -> Builders.EmbedBuilder

Sets the URL of the embed.

setTimestamp

EmbedBuilder : setTimestamp (

     epoch: number
)  -> Builders.EmbedBuilder

Sets the timestamp of the embed.

setColor

EmbedBuilder : setColor (

     colorHex: HexLike | RGB
)  -> Builders.EmbedBuilder

Sets the color of the embed.

setFooter

EmbedBuilder : setFooter (

     footerSettings: {
       text: string,
       icon: string,
    }
)  -> Builders.EmbedBuilder

Sets the footer of the embed.

setImage

EmbedBuilder : setImage (

     imageSettings: {
       imageUrl: string,
       height: number,
       width: number,
    }
)  -> Builders.EmbedBuilder

Sets the image of the embed.

setThumbnail

EmbedBuilder : setThumbnail (

     thumbnailSettings: {
       thumbnailUrl: string,
       height: number,
       width: number,
    }
)  -> Builders.EmbedBuilder

Sets the thumbnail of the embed.

setVideo

EmbedBuilder : setVideo (

     videoSettings: {
       videoUrl: string,
       height: number,
       width: number,
    }
)  -> Builders.EmbedBuilder

Sets the video of the embed.

setProvider

EmbedBuilder : setProvider (

     providerSettings: {
       name: string,
       url: string,
    }
)  -> Builders.EmbedBuilder

Sets the provider of the embed.

setAuthor

EmbedBuilder : setAuthor (

     authorSettings: {
       name: string,
       url: string,
       iconUrl: string,
    }
)  -> Builders.EmbedBuilder

Sets the author of the embed.

addField

EmbedBuilder : addField (

     fieldSettings: {
       name: string,
       value: string,
       inline: boolean?,
    }
)  -> Builders.EmbedBuilder

Adds a field to the embed.

toPayloadObject

EmbedBuilder : toPayloadObject ()  -> Network.Resolvable

Converts the embed to a JSON object that can be sent to the Discord API.

Functions

new

EmbedBuilder . new ()  -> ()

Creates a new instance of EmbedBuilder.