DiscordLua
discorddiscord
v1.2.4
Install

Emoji

Class
On this page

Emoji 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.4 REST Source

Properties

Emoji.animated

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

Emoji.author

# readonly
Name
author
Type
User
Access
readonly
Description
User that created this Emoji.
Availability
Populated from the Gateway/REST payload or constructor for this Emoji.
Related
User

Emoji.available

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

Emoji.client

# readonly
Name
client
Type
any
Access
readonly
Description
Owning Client instance used for REST, cache, and event dispatch.
Availability
Populated from the Gateway/REST payload or constructor for this Emoji.

Emoji.guildId

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

Emoji.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this Emoji.
Availability
Populated from the Gateway/REST payload or constructor for this Emoji.

Emoji.managed

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

Emoji.name

# mutable
Name
name
Type
any
Access
mutable
Description
Display name of this Emoji.
Availability
Populated from the Gateway/REST payload or constructor for this Emoji.

Emoji.raw

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

Emoji.reaction

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

Emoji.requireColons

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

Emoji.requiresColons

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

Emoji.roles

# readonly
Name
roles
Type
GuildEmojiRoleManager
Access
readonly
Description
Cache and REST facade for guildemojirole objects owned by this Emoji. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Emoji.new and remains valid for the lifetime of the Emoji.
Related
GuildEmojiRoleManager

Methods

Emoji:application()

#

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

Signature

Emoji:application()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:application()

Emoji:createdAt()

#

Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.

Signature

Emoji:createdAt()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:createdAt()

Emoji:createdTimestamp()

#

Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.

Signature

Emoji:createdTimestamp()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:createdTimestamp()

Emoji:deletable()

#

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

Signature

Emoji:deletable()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:deletable()

Emoji:delete()

#

Permanently delete this resource through REST.

Signature

Emoji:delete(callback)

Parameters

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:delete(function(err, result)
    if err then error(err) end
end)

Emoji:edit()

#

Apply a REST update to this resource.

Signature

Emoji:edit(options, callback)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:edit({}, function(err, result)
    if err then error(err) end
end)

Emoji:equals()

#

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

Signature

Emoji:equals(other)

Parameters

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

Returns

Emoji — the same instance, for chaining.

Example

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

Emoji:fetchAuthor()

#

Fetch Author from REST and update the local cache when the request succeeds.

Signature

Emoji:fetchAuthor(callback)

Parameters

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:fetchAuthor(function(err, result)
    if err then error(err) end
end)

Emoji:guild()

#

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

Signature

Emoji:guild()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:guild()

Emoji:identifier()

#

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

Signature

Emoji:identifier()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:identifier()

Emoji:imageURL()

#

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

Signature

Emoji:imageURL(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:imageURL({})

Emoji:setName()

#

Set the Name field. Builders return this Emoji so setters can be chained.

Signature

Emoji:setName(name, reason, callback)

Parameters

NameTypeRequiredBehavior
name any required Passed through to the implementation as written.
reason string optional Audit-log reason sent as X-Audit-Log-Reason on REST mutations.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:setName(name, reason, function(err, result)
    if err then error(err) end
end)

Emoji:toJSON()

#

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

Signature

Emoji:toJSON()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

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

Emoji:toString()

#

function toString() { [native code] }

Signature

Emoji:toString()

Parameters

No parameters.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:toString()

Emoji:url()

#

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

Signature

Emoji:url(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Emoji — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Emoji
object:url({})

Static members

  • Emoji.GuildPreviewEmoji
  • Emoji.ReactionEmoji

Examples

Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc