mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
refactor: merge collections with keeping entries at max (#6242)
This commit is contained in:
@@ -3,6 +3,8 @@ import {
|
||||
ApplicationCommandData,
|
||||
ApplicationCommandManager,
|
||||
ApplicationCommandResolvable,
|
||||
CacheFactory,
|
||||
Caches,
|
||||
CategoryChannel,
|
||||
Client,
|
||||
ClientApplication,
|
||||
@@ -22,12 +24,14 @@ import {
|
||||
GuildResolvable,
|
||||
Intents,
|
||||
Interaction,
|
||||
LimitedCollection,
|
||||
Message,
|
||||
MessageActionRow,
|
||||
MessageAttachment,
|
||||
MessageButton,
|
||||
MessageCollector,
|
||||
MessageEmbed,
|
||||
MessageManager,
|
||||
MessageReaction,
|
||||
NewsChannel,
|
||||
Options,
|
||||
@@ -59,9 +63,12 @@ const client: Client = new Client({
|
||||
// @ts-expect-error
|
||||
Message: 100,
|
||||
ThreadManager: {
|
||||
sweepInterval: require('./SweptCollection').filterByLifetime({
|
||||
getComparisonTimestamp: (e: any) => e.archiveTimestamp,
|
||||
excludeFromSweep: (e: any) => !e.archived,
|
||||
maxSize: 1000,
|
||||
keepOverLimit: (x: ThreadChannel) => x.id === '123',
|
||||
sweepInterval: 5000,
|
||||
sweepFilter: LimitedCollection.filterByLifetime({
|
||||
getComparisonTimestamp: (x: ThreadChannel) => x.archiveTimestamp ?? 0,
|
||||
excludeFromSweep: (x: ThreadChannel) => !x.archived,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user