mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(Client): add global sweepers (#6825)
Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
@@ -590,14 +590,11 @@ class Util extends null {
|
||||
/**
|
||||
* Creates a sweep filter that sweeps archived threads
|
||||
* @param {number} [lifetime=14400] How long a thread has to be archived to be valid for sweeping
|
||||
* @deprecated When not using with `makeCache` use `Sweepers.archivedThreadSweepFilter` instead
|
||||
* @returns {SweepFilter}
|
||||
*/
|
||||
static archivedThreadSweepFilter(lifetime = 14400) {
|
||||
const filter = require('./LimitedCollection').filterByLifetime({
|
||||
lifetime,
|
||||
getComparisonTimestamp: e => e.archiveTimestamp,
|
||||
excludeFromSweep: e => !e.archived,
|
||||
});
|
||||
const filter = require('./Sweepers').archivedThreadSweepFilter(lifetime);
|
||||
filter.isDefault = true;
|
||||
return filter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user