ReactionCollector
collectorOn this page
ReactionCollector is a DiscordLua collector representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Constructor
ReactionCollector.new(message, options) The class table is callable, so ReactionCollector(message, options) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
message |
any |
required | Passed through to the implementation as written. |
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
local discord = require("discord")
local object = discord.ReactionCollector({}, {})Properties
- Name
message- Type
any- Access
- readonly
- Description
- Instance field
ReactionCollector.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 ReactionCollector.
- Name
options- Type
any- Access
- readonly
- Description
- Instance field
ReactionCollector.options. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ReactionCollector.
- Name
total- Type
any- Access
- readonly
- Description
- Instance field
ReactionCollector.total. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ReactionCollector.
- Name
users- Type
- Collection
- Access
- readonly
- Description
- Instance field
ReactionCollector.users. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ReactionCollector.
- Related
- Collection
Methods
ReactionCollector:collect()
#Performs collect on this ReactionCollector. Call it from bot code when you need that operation on the current object.
Signature
ReactionCollector:collect(reaction) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
reaction |
any |
required | Passed through to the implementation as written. |
Returns
ReactionCollector — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ReactionCollector
object:collect(reaction)ReactionCollector:dispose()
#Performs dispose on this ReactionCollector. Call it from bot code when you need that operation on the current object.
Signature
ReactionCollector:dispose(reaction) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
reaction |
any |
required | Passed through to the implementation as written. |
Returns
ReactionCollector — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ReactionCollector
object:dispose(reaction)ReactionCollector:empty()
#Performs empty on this ReactionCollector. Call it from bot code when you need that operation on the current object.
Signature
ReactionCollector:empty() Parameters
No parameters.
Returns
ReactionCollector — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ReactionCollector
object:empty()ReactionCollector:key()
#Performs key on this ReactionCollector. Call it from bot code when you need that operation on the current object.
Signature
ReactionCollector:key(reaction) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
reaction |
any |
required | Passed through to the implementation as written. |
Returns
ReactionCollector — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ReactionCollector
object:key(reaction)Events
create
#Emitted by ReactionCollector when the corresponding Gateway or local lifecycle update occurs. Listen with :on("create", handler).
object:on("create", function(...)
-- handler arguments match the DiscordLua emit for this event
end)remove
#Emitted by ReactionCollector when the corresponding Gateway or local lifecycle update occurs. Listen with :on("remove", handler).
object:on("remove", function(...)
-- handler arguments match the DiscordLua emit for this event
end)Examples
local discord = require("discord")
local object = discord.ReactionCollector({})Related APIs
Collector · InteractionCollector · MessageCollector
Version: discord 1.2.4 · runtime 1.0.0