Options

export class Options extends null
export class Options extends null
Contains various utilities for client options.

Extends

null
StaticReadonly
DefaultMakeCacheSettings:CacheWithLimitsOptions
The default settings passed to makeCache. The caches that this changes are:* MessageManager - Limit to 200 messages If you want to keep default behavior and add on top of it you can use this object and add on to it, e.g. makeCache: Options.cacheWithLimits({ ...Options.DefaultMakeCacheSettings, ReactionManager: 0 })
StaticReadonly
DefaultSweeperSettings:SweeperOptions
The default settings passed to sweepers. The sweepers that this changes are:* threads - Sweep archived threads every hour, removing those archived more than 4 hours ago If you want to keep default behavior and add on top of it you can use this object and add on to it, e.g. sweepers: { ...Options.DefaultSweeperSettings, messages: { interval: 300, lifetime: 600 } }
Static
cacheEverything():CacheFactory
Create a cache factory that always caches everything.
Static
cacheWithLimits(settings?):CacheFactory
Create a cache factory using predefined settings to sweep or limit.
Example
// Store up to 200 messages per channel and 200 members per guild, always keeping the client member.
Options.cacheWithLimits({
MessageManager: 200,
GuildMemberManager: {
maxSize: 200,
keepOverLimit: (member) => member.id === client.user.id,
},
});
// Store up to 200 messages per channel and 200 members per guild, always keeping the client member.
Options.cacheWithLimits({
MessageManager: 200,
GuildMemberManager: {
maxSize: 200,
keepOverLimit: (member) => member.id === client.user.id,
},
});
NameTypeOptionalDescription
settingsCacheWithLimitsOptionsYesSettings passed to the relevant constructor. If no setting is provided for a manager, it uses Collection. If a number is provided for a manager, it uses that number as the max size for a LimitedCollection. If LimitedCollectionOptions are provided for a manager, it uses those settings to form a LimitedCollection.
Static
createDefault():ClientOptions
The default client options.