DiscordLua
discorddiscord
v1.2.4
Install

EmbedBuilder

Builder
On this page

EmbedBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.

builder Module 1.2.4 Source

Constructor

EmbedBuilder.new(data)

The class table is callable, so EmbedBuilder(data) is the same as .new.

NameTypeRequiredBehavior
data any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.EmbedBuilder({})

Properties

EmbedBuilder.data

# readonly
Name
data
Type
any
Access
readonly
Description
Instance field EmbedBuilder.data. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this EmbedBuilder.

Methods

EmbedBuilder:addField()

#

Add Field to this EmbedBuilder.

Signature

EmbedBuilder:addField(name, value, inline)

Parameters

NameTypeRequiredBehavior
name any required Passed through to the implementation as written.
value any required Passed through to the implementation as written.
inline any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:addField(name, value, inline)

EmbedBuilder:addFields()

#

Add Fields to this EmbedBuilder.

Signature

EmbedBuilder:addFields(...)

Parameters

NameTypeRequiredBehavior
... any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:addFields(...)

EmbedBuilder:author()

#

Performs author on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:author()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:author()

EmbedBuilder:clearFields()

#

Performs clear fields on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:clearFields()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:clearFields()

EmbedBuilder:color()

#

Performs color on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:color()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:color()

EmbedBuilder:description()

#

Performs description on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:description()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:description()

EmbedBuilder:equals()

#

Return whether this EmbedBuilder refers to the same resource as the argument.

Signature

EmbedBuilder:equals(other)

Parameters

NameTypeRequiredBehavior
other any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:equals(other)

EmbedBuilder:fields()

#

Performs fields on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:fields()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:fields()

EmbedBuilder.from()

# static

Performs from on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder.from(other)

Parameters

NameTypeRequiredBehavior
other any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
EmbedBuilder.from(other)

EmbedBuilder:hexColor()

#

Performs hex color on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:hexColor()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:hexColor()

EmbedBuilder:image()

#

Performs image on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:image()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:image()

EmbedBuilder:length()

#

Performs length on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:length()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:length()

EmbedBuilder:provider()

#

Performs provider on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:provider()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:provider()

EmbedBuilder:setAuthor()

#

Set the Author field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setAuthor(author)

Parameters

NameTypeRequiredBehavior
author any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setAuthor(author)

EmbedBuilder:setColor()

#

Set the Color field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setColor(color)

Parameters

NameTypeRequiredBehavior
color any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setColor(color)

EmbedBuilder:setDescription()

#

Set the Description field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setDescription(description)

Parameters

NameTypeRequiredBehavior
description any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setDescription(description)

EmbedBuilder:setFields()

#

Set the Fields field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setFields(fields)

Parameters

NameTypeRequiredBehavior
fields any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setFields(fields)

EmbedBuilder:setFooter()

#

Set the Footer field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setFooter(footer)

Parameters

NameTypeRequiredBehavior
footer any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setFooter(footer)

EmbedBuilder:setImage()

#

Set the Image field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setImage(url)

Parameters

NameTypeRequiredBehavior
url any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setImage(url)

EmbedBuilder:setThumbnail()

#

Set the Thumbnail field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setThumbnail(url)

Parameters

NameTypeRequiredBehavior
url any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setThumbnail(url)

EmbedBuilder:setTimestamp()

#

Set the Timestamp field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setTimestamp(timestamp)

Parameters

NameTypeRequiredBehavior
timestamp any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setTimestamp(timestamp)

EmbedBuilder:setTitle()

#

Set the Title field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setTitle(title)

Parameters

NameTypeRequiredBehavior
title any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setTitle(title)

EmbedBuilder:setUrl()

#

Set the Url field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setUrl(url)

Parameters

NameTypeRequiredBehavior
url any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setUrl(url)

EmbedBuilder:setURL()

#

Set the URL field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setURL(url)

Parameters

NameTypeRequiredBehavior
url any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setURL(url)

EmbedBuilder:setVideo()

#

Set the Video field. Builders return this EmbedBuilder so setters can be chained.

Signature

EmbedBuilder:setVideo(url)

Parameters

NameTypeRequiredBehavior
url any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:setVideo(url)

EmbedBuilder:spliceFields()

#

Performs splice fields on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:spliceFields(index, deleteCount, ...)

Parameters

NameTypeRequiredBehavior
index any required Passed through to the implementation as written.
deleteCount any required Passed through to the implementation as written.
... any required Passed through to the implementation as written.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:spliceFields(index, deleteCount, ...)

EmbedBuilder:thumbnail()

#

Performs thumbnail on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:thumbnail()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:thumbnail()

EmbedBuilder:timestamp()

#

Performs timestamp on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:timestamp()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:timestamp()

EmbedBuilder:title()

#

Performs title on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:title()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:title()

EmbedBuilder:toJSON()

#

Serialize this EmbedBuilder into a Lua table suitable for REST or debugging.

Signature

EmbedBuilder:toJSON()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:toJSON()

EmbedBuilder:url()

#

Performs url on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:url()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:url()

EmbedBuilder:video()

#

Performs video on this EmbedBuilder. Call it from bot code when you need that operation on the current object.

Signature

EmbedBuilder:video()

Parameters

No parameters.

Returns

EmbedBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a EmbedBuilder
object:video()

Examples

lua
local discord = require("discord")
local object = discord.EmbedBuilder({})

ActionRowBuilder · AttachmentBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ContainerBuilder · ContextMenuCommandBuilder · FileBuilder

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc