DiscordLua
discorddiscord
v1.2.4
Install

MessageCollector

collector
On this page

MessageCollector 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

MessageCollector.new(channel, options)

The class table is callable, so MessageCollector(channel, options) is the same as .new.

NameTypeRequiredBehavior
channel 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.MessageCollector({}, {})

Properties

MessageCollector.channel

# readonly
Name
channel
Type
any
Access
readonly
Description
Channel this MessageCollector belongs to, when resolved from cache.
Availability
Populated from the Gateway/REST payload or constructor for this MessageCollector.

MessageCollector.options

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

MessageCollector.received

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

Methods

MessageCollector:collect()

#

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

Signature

MessageCollector:collect(message)

Parameters

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a MessageCollector
object:collect(message)

Examples

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

Collector · InteractionCollector · ReactionCollector

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc