Sweepers

export class Sweepers
export class Sweepers
A container for all cache sweeping intervals and their associated sweep methods.
constructor(client, options)
Constructs a new instance of the Sweepers class
NameTypeOptionalDescription
clientClient<true>NoNone
optionsSweeperOptionsNoNone
Readonly
client:Client
intervals:Record<SweeperKey, NodeJS.Timeout | null>
A record of interval timeout that is used to sweep the indicated items, or null if not being swept
The options the sweepers were instantiated with
Static
archivedThreadSweepFilter(lifetime?):GlobalSweepFilter<SweeperDefinitions['threads'][0], SweeperDefinitions['threads'][1]>
Creates a sweep filter that sweeps archived threads
NameTypeOptionalDescription
lifetimenumberYesHow long a thread has to be archived to be valid for sweeping
Static
expiredInviteSweepFilter(lifetime?):GlobalSweepFilter<SweeperDefinitions['invites'][0], SweeperDefinitions['invites'][1]>
Creates a sweep filter that sweeps expired invites
NameTypeOptionalDescription
lifetimenumberYesHow long ago an invite has to have expired to be valid for sweeping
Static
filterByLifetime(options?):GlobalSweepFilter<K, V>
Create a sweepFilter function that uses a lifetime to determine sweepability.
NameTypeOptionalDescription
optionsLifetimeFilterOptions<K, V>YesThe options used to generate the filter function
Static
outdatedMessageSweepFilter(lifetime?):GlobalSweepFilter<SweeperDefinitions['messages'][0], SweeperDefinitions['messages'][1]>
Creates a sweep filter that sweeps outdated messages (edits taken into account)
NameTypeOptionalDescription
lifetimenumberYesHow long ago a message has to have been sent or edited to be valid for sweeping
sweepApplicationCommands(filter):number
Sweeps all guild and global application commands and removes the ones which are indicated by the filter.
Returns
Amount of commands that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter< SweeperDefinitions['applicationCommands'][0], SweeperDefinitions['applicationCommands'][1] >NoThe function used to determine which commands will be removed from the caches.
sweepAutoModerationRules(filter):number
Sweeps all auto moderation rules and removes the ones which are indicated by the filter.
Returns
Amount of auto moderation rules that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter< SweeperDefinitions['autoModerationRules'][0], SweeperDefinitions['autoModerationRules'][1] >NoThe function used to determine which auto moderation rules will be removed from the caches
sweepBans(filter):number
Sweeps all guild bans and removes the ones which are indicated by the filter.
Returns
Amount of bans that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['bans'][0], SweeperDefinitions['bans'][1]>NoThe function used to determine which bans will be removed from the caches.
sweepEmojis(filter):number
Sweeps all guild emojis and removes the ones which are indicated by the filter.
Returns
Amount of emojis that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['emojis'][0], SweeperDefinitions['emojis'][1]>NoThe function used to determine which emojis will be removed from the caches.
sweepGuildMembers(filter):number
Sweeps all guild members and removes the ones which are indicated by the filter. It is highly recommended to keep the client guild member cached
Returns
Amount of guild members that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['guildMembers'][0], SweeperDefinitions['guildMembers'][1]>NoThe function used to determine which guild members will be removed from the caches.
sweepInvites(filter):number
Sweeps all guild invites and removes the ones which are indicated by the filter.
Returns
Amount of invites that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['invites'][0], SweeperDefinitions['invites'][1]>NoThe function used to determine which invites will be removed from the caches.
sweepMessages(filter):number
Sweeps all text-based channels' messages and removes the ones which are indicated by the filter.
Returns
Amount of messages that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['messages'][0], SweeperDefinitions['messages'][1]>NoThe function used to determine which messages will be removed from the caches.
sweepPresences(filter):number
Sweeps all presences and removes the ones which are indicated by the filter.
Returns
Amount of presences that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['presences'][0], SweeperDefinitions['presences'][1]>NoThe function used to determine which presences will be removed from the caches.
sweepReactions(filter):number
Sweeps all message reactions and removes the ones which are indicated by the filter.
Returns
Amount of reactions that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['reactions'][0], SweeperDefinitions['reactions'][1]>NoThe function used to determine which reactions will be removed from the caches.
sweepStageInstances(filter):number
Sweeps all guild stage instances and removes the ones which are indicated by the filter.
Returns
Amount of stage instances that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['stageInstances'][0], SweeperDefinitions['stageInstances'][1]>NoThe function used to determine which stage instances will be removed from the caches.
sweepStickers(filter):number
Sweeps all guild stickers and removes the ones which are indicated by the filter.
Returns
Amount of stickers that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['stickers'][0], SweeperDefinitions['stickers'][1]>NoThe function used to determine which stickers will be removed from the caches.
sweepThreadMembers(filter):number
Sweeps all thread members and removes the ones which are indicated by the filter. It is highly recommended to keep the client thread member cached
Returns
Amount of thread members that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['threadMembers'][0], SweeperDefinitions['threadMembers'][1]>NoThe function used to determine which thread members will be removed from the caches.
sweepThreads(filter):number
Sweeps all threads and removes the ones which are indicated by the filter.
Returns
filter Amount of threads that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['threads'][0], SweeperDefinitions['threads'][1]>NoThe function used to determine which threads will be removed from the caches.
sweepUsers(filter):number
Sweeps all users and removes the ones which are indicated by the filter.
Returns
Amount of users that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['users'][0], SweeperDefinitions['users'][1]>NoThe function used to determine which users will be removed from the caches.
sweepVoiceStates(filter):number
Sweeps all guild voice states and removes the ones which are indicated by the filter.
Returns
Amount of voice states that were removed from the caches
NameTypeOptionalDescription
filterCollectionSweepFilter<SweeperDefinitions['voiceStates'][0], SweeperDefinitions['voiceStates'][1]>NoThe function used to determine which voice states will be removed from the caches.