DiscordLua
discorddiscord
v1.2.4
Install

Sweepers

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

class Module 1.2.4 Source

Constructor

Sweepers.new(client, settings)

The class table is callable, so Sweepers(client, settings) is the same as .new.

NameTypeRequiredBehavior
client any required Passed through to the implementation as written.
settings any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.Sweepers({}, {})

Properties

Sweepers.client

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

Sweepers.counts

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

Sweepers.intervals

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

Sweepers.options

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

Sweepers.settings

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

Sweepers.archivedThreadSweepFilter()

# static

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

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

Returns

any.

Example

lua
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

lua
local discord = require("discord")
-- object is a Sweepers
object:destroy()

Sweepers.expiredInviteSweepFilter()

# static

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

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Sweepers
Sweepers.expiredInviteSweepFilter(lifetime)

Sweepers.filterByLifetime()

# static

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

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Sweepers
Sweepers.filterByLifetime({})

Sweepers.outdatedMessageSweepFilter()

# static

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

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

Returns

any.

Example

lua
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

lua
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

lua
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

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

Returns

any.

Example

lua
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

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

Returns

any.

Example

lua
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

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

Returns

any.

Example

lua
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

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

Returns

any.

Example

lua
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

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

Returns

any.

Example

lua
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

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

Returns

any.

Example

lua
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

lua
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

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

Returns

any.

Example

lua
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

lua
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

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

Returns

Sweepers — the same instance, for chaining.

Example

lua
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

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

Returns

Sweepers — the same instance, for chaining.

Example

lua
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

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

Returns

Sweepers — the same instance, for chaining.

Example

lua
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

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

Returns

Sweepers — the same instance, for chaining.

Example

lua
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

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

Returns

Sweepers — the same instance, for chaining.

Example

lua
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

lua
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

lua
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

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

Returns

Sweepers — the same instance, for chaining.

Example

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

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

Static members

  • Sweepers.SweeperKeys

Examples

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

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc