Embed
ClassOn 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.
Constructor
Embed.new(data) The class table is callable, so Embed(data) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
data |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.Embed({})Properties
- 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
Performs from on this Embed. Call it from bot code when you need that operation on the current object.
Signature
Embed.from(other) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
Embed — the same instance, for chaining.
Example
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
local discord = require("discord")
-- object is a Embed
object:toJSON()Static members
-
Embed.equals
Examples
local discord = require("discord")
local object = discord.Embed({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationCommandNumericOptionMinMaxValueMixin · ApplicationCommandOptionBase
Version: discord 1.2.9 · runtime 1.0.0