mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
feat: add Collection#sweep() (#2528)
This commit is contained in:
@@ -358,12 +358,9 @@ class Client extends BaseClient {
|
||||
if (!channel.messages) continue;
|
||||
channels++;
|
||||
|
||||
for (const message of channel.messages.values()) {
|
||||
if (now - (message.editedTimestamp || message.createdTimestamp) > lifetimeMs) {
|
||||
channel.messages.delete(message.id);
|
||||
messages++;
|
||||
}
|
||||
}
|
||||
messages += channel.messages.sweep(
|
||||
message => now - (message.editedTimestamp || message.createdTimestamp) > lifetimeMs
|
||||
);
|
||||
}
|
||||
|
||||
this.emit(Events.DEBUG,
|
||||
|
||||
Reference in New Issue
Block a user