From 95f8375d425f58f501f32ead03f7927e6596f8e6 Mon Sep 17 00:00:00 2001 From: Koyamie Date: Sat, 8 Jan 2022 12:39:48 +0100 Subject: [PATCH] fix(Sweepers): add sweepStickers function (#7213) --- packages/discord.js/src/util/Sweepers.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/discord.js/src/util/Sweepers.js b/packages/discord.js/src/util/Sweepers.js index ab91bf958..a826115a3 100644 --- a/packages/discord.js/src/util/Sweepers.js +++ b/packages/discord.js/src/util/Sweepers.js @@ -192,6 +192,15 @@ class Sweepers { return this._sweepGuildDirectProp('stageInstances', filter, { outputName: 'stage instances' }).items; } + /** + * Sweeps all guild stickers and removes the ones which are indicated by the filter. + * @param {Function} filter The function used to determine which stickers will be removed from the caches. + * @returns {number} Amount of stickers that were removed from the caches + */ + sweepStickers(filter) { + return this._sweepGuildDirectProp('stickers', filter).items; + } + /** * 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