DiscordLua
discorddiscord
v1.2.4
Install

ReactionCollector

collector
On 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.

collector Module 1.2.4 Source

Constructor

ReactionCollector.new(message, options)

The class table is callable, so ReactionCollector(message, options) is the same as .new.

NameTypeRequiredBehavior
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.
lua
local discord = require("discord")
local object = discord.ReactionCollector({}, {})

Properties

ReactionCollector.message

# readonly
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.

ReactionCollector.options

# readonly
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.

ReactionCollector.total

# readonly
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.

ReactionCollector.users

# readonly
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

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

Returns

ReactionCollector — the same instance, for chaining.

Example

lua
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

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

Returns

ReactionCollector — the same instance, for chaining.

Example

lua
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

lua
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

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

Returns

ReactionCollector — the same instance, for chaining.

Example

lua
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).

lua
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).

lua
object:on("remove", function(...)
    -- handler arguments match the DiscordLua emit for this event
end)

Examples

lua
local discord = require("discord")
local object = discord.ReactionCollector({})

Collector · InteractionCollector · MessageCollector

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc