A container for all cache sweeping intervals and their associated sweep methods.
Constructs a new instance of the
Sweepers
className | Type | Optional | Description |
---|---|---|---|
client | Client<true> | No | None |
options | SweeperOptions | No | None |
Static
archivedThreadSweepFilter(lifetime?):GlobalSweepFilter<SweeperDefinitions['threads'][0], SweeperDefinitions['threads'][1]>
Creates a sweep filter that sweeps archived threads
Name | Type | Optional | Description |
---|---|---|---|
lifetime | number | Yes | How 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
Name | Type | Optional | Description |
---|---|---|---|
lifetime | number | Yes | How long ago an invite has to have expired to be valid for sweeping |
Create a sweepFilter function that uses a lifetime to determine sweepability.
Name | Type | Optional | Description |
---|---|---|---|
options | LifetimeFilterOptions<K, V> | Yes | The 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)
Name | Type | Optional | Description |
---|---|---|---|
lifetime | number | Yes | How long ago a message has to have been sent or edited to be valid for sweeping |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter< SweeperDefinitions['applicationCommands'][0], SweeperDefinitions['applicationCommands'][1] > | No | The function used to determine which commands will be removed from the caches. |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter< SweeperDefinitions['autoModerationRules'][0], SweeperDefinitions['autoModerationRules'][1] > | No | The function used to determine which auto moderation rules will be removed from the caches |
Sweeps all guild bans and removes the ones which are indicated by the filter.
Returns
Amount of bans that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['bans'][0], SweeperDefinitions['bans'][1]> | No | The function used to determine which bans will be removed from the caches. |
Sweeps all guild emojis and removes the ones which are indicated by the filter.
Returns
Amount of emojis that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['emojis'][0], SweeperDefinitions['emojis'][1]> | No | The function used to determine which emojis will be removed from the caches. |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['guildMembers'][0], SweeperDefinitions['guildMembers'][1]> | No | The function used to determine which guild members will be removed from the caches. |
Sweeps all guild invites and removes the ones which are indicated by the filter.
Returns
Amount of invites that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['invites'][0], SweeperDefinitions['invites'][1]> | No | The function used to determine which invites will be removed from the caches. |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['messages'][0], SweeperDefinitions['messages'][1]> | No | The function used to determine which messages will be removed from the caches. |
Sweeps all presences and removes the ones which are indicated by the filter.
Returns
Amount of presences that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['presences'][0], SweeperDefinitions['presences'][1]> | No | The function used to determine which presences will be removed from the caches. |
Sweeps all message reactions and removes the ones which are indicated by the filter.
Returns
Amount of reactions that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['reactions'][0], SweeperDefinitions['reactions'][1]> | No | The function used to determine which reactions will be removed from the caches. |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['stageInstances'][0], SweeperDefinitions['stageInstances'][1]> | No | The function used to determine which stage instances will be removed from the caches. |
Sweeps all guild stickers and removes the ones which are indicated by the filter.
Returns
Amount of stickers that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['stickers'][0], SweeperDefinitions['stickers'][1]> | No | The function used to determine which stickers will be removed from the caches. |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['threadMembers'][0], SweeperDefinitions['threadMembers'][1]> | No | The function used to determine which thread members will be removed from the caches. |
Sweeps all threads and removes the ones which are indicated by the filter.
Returns
filter Amount of threads that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['threads'][0], SweeperDefinitions['threads'][1]> | No | The function used to determine which threads will be removed from the caches. |
Sweeps all users and removes the ones which are indicated by the filter.
Returns
Amount of users that were removed from the cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['users'][0], SweeperDefinitions['users'][1]> | No | The function used to determine which users will be removed from the caches. |
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 cachesName | Type | Optional | Description |
---|---|---|---|
filter | CollectionSweepFilter<SweeperDefinitions['voiceStates'][0], SweeperDefinitions['voiceStates'][1]> | No | The function used to determine which voice states will be removed from the caches. |