DiscordLua
discorddiscord
v1.2.4
Install

MessageReaction

Class
On this page

MessageReaction 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 Source

Properties

MessageReaction.burstColors

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

MessageReaction.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 MessageReaction.

MessageReaction.count

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

MessageReaction.countDetails

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

MessageReaction.emoji

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

MessageReaction.me

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

MessageReaction.meBurst

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

MessageReaction.message

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

MessageReaction.partial

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

MessageReaction.raw

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

MessageReaction.users

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

Methods

MessageReaction:fetch()

#

Request a fresh copy of this resource from REST and update the cache.

Signature

MessageReaction:fetch(callback)

Parameters

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

Returns

MessageReaction — the same instance, for chaining.

Example

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

MessageReaction:react()

#

Add an emoji reaction to this message.

Signature

MessageReaction:react()

Parameters

No parameters.

Returns

MessageReaction — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a MessageReaction
object:react()

MessageReaction:remove()

#

Remove an item from this MessageReaction.

Signature

MessageReaction:remove(user)

Parameters

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

Returns

MessageReaction — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a MessageReaction
object:remove(user)

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