Sweepers
ClassOn this page
Sweepers is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Constructor
Sweepers.new(client, settings) The class table is callable, so Sweepers(client, settings) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
client |
any |
required | Passed through to the implementation as written. |
settings |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.Sweepers({}, {})Properties
- 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 Sweepers.
- Name
counts- Type
any- Access
- readonly
- Description
- Instance field
Sweepers.counts. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Sweepers.
- Name
intervals- Type
any- Access
- readonly
- Description
- Instance field
Sweepers.intervals. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Sweepers.
- Name
options- Type
any- Access
- readonly
- Description
- Instance field
Sweepers.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 Sweepers.
- Name
settings- Type
any- Access
- readonly
- Description
- Instance field
Sweepers.settings. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Sweepers.
Methods
Performs archived thread sweep filter on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers.archivedThreadSweepFilter(lifetime) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
lifetime |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
Sweepers.archivedThreadSweepFilter(lifetime)Sweepers:destroy()
#Close the Gateway, voice, and REST resources owned by this client.
Signature
Sweepers:destroy() Parameters
No parameters.
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:destroy()Performs expired invite sweep filter on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers.expiredInviteSweepFilter(lifetime) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
lifetime |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
Sweepers.expiredInviteSweepFilter(lifetime)Performs filter by lifetime on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers.filterByLifetime(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
Sweepers.filterByLifetime({})Performs outdated message sweep filter on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers.outdatedMessageSweepFilter(lifetime) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
lifetime |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
Sweepers.outdatedMessageSweepFilter(lifetime)Sweepers:start()
#Performs start on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:start() Parameters
No parameters.
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:start()Sweepers:stop()
#Stop the native event loop so the process can exit cleanly.
Signature
Sweepers:stop() Parameters
No parameters.
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:stop()Sweepers:sweep()
#Performs sweep on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweep(name) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweep(name)Sweepers:sweepApplicationCommands()
#Performs sweep application commands on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepApplicationCommands(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepApplicationCommands(filter)Sweepers:sweepAutoModerationRules()
#Performs sweep auto moderation rules on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepAutoModerationRules(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepAutoModerationRules(filter)Sweepers:sweepBans()
#Performs sweep bans on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepBans(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepBans(filter)Sweepers:sweepEmojis()
#Performs sweep emojis on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepEmojis(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepEmojis(filter)Sweepers:sweepEntitlements()
#Performs sweep entitlements on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepEntitlements(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepEntitlements(filter)Sweepers:sweepGuildMembers()
#Performs sweep guild members on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepGuildMembers() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepGuildMembers()Sweepers:sweepInvites()
#Performs sweep invites on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepInvites(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepInvites(filter)Sweepers:sweepMessages()
#Performs sweep messages on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepMessages() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepMessages()Sweepers:sweepPresences()
#Performs sweep presences on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepPresences(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepPresences(filter)Sweepers:sweepReactions()
#Performs sweep reactions on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepReactions(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepReactions(filter)Sweepers:sweepStageInstances()
#Performs sweep stage instances on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepStageInstances(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepStageInstances(filter)Sweepers:sweepStickers()
#Performs sweep stickers on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepStickers(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepStickers(filter)Sweepers:sweepThreadMembers()
#Performs sweep thread members on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepThreadMembers(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepThreadMembers(filter)Sweepers:sweepThreads()
#Performs sweep threads on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepThreads() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepThreads()Sweepers:sweepUsers()
#Performs sweep users on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepUsers() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepUsers()Sweepers:sweepVoiceStates()
#Performs sweep voice states on this Sweepers. Call it from bot code when you need that operation on the current object.
Signature
Sweepers:sweepVoiceStates(filter) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
filter |
any |
required | Passed through to the implementation as written. |
Returns
Sweepers — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Sweepers
object:sweepVoiceStates(filter)Events
cacheSweep
#Emitted by Sweepers when the corresponding Gateway or local lifecycle update occurs. Listen with :on("cacheSweep", handler).
object:on("cacheSweep", function(...)
-- handler arguments match the DiscordLua emit for this event
end)Static members
-
Sweepers.SweeperKeys
Examples
local discord = require("discord")
local object = discord.Sweepers({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0