DiscordLua
discorddiscord
v1.2.9
Install

Embed

Class
On this page

Embed is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.

class Module 1.2.9 Source

Constructor

Embed.new(data)

The class table is callable, so Embed(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.Embed({})

Properties

Embed.data

# readonly
Name
data
Type
any
Access
readonly
Description
Instance field Embed.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 Embed.

Methods

Embed.from()

# static

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

Signature

Embed.from(other)

Parameters

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

Returns

Embed — the same instance, for chaining.

Example

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

Embed:toJSON()

#

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

Signature

Embed:toJSON()

Parameters

No parameters.

Returns

Embed — the same instance, for chaining.

Example

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

Static members

  • Embed.equals

Examples

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

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationCommandNumericOptionMinMaxValueMixin · ApplicationCommandOptionBase

Version: discord 1.2.9 · runtime 1.0.0

Search Ctrl K Navigate Open Esc