MessageReaction
ClassOn 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.
Properties
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.newand 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
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
MessageReaction — the same instance, for chaining.
Example
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
local discord = require("discord")
-- object is a MessageReaction
object:react()MessageReaction:remove()
#Remove an item from this MessageReaction.
Signature
MessageReaction:remove(user) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
user |
any |
required | Passed through to the implementation as written. |
Returns
MessageReaction — the same instance, for chaining.
Example
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.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0