mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Rename maxMessageCache -> messageCacheMaxSize
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -364,8 +364,8 @@ class Client extends EventEmitter {
|
||||
if (options.shardId !== 0 && options.shardId >= options.shardCount) {
|
||||
throw new RangeError('The shardId option must be less than shardCount.');
|
||||
}
|
||||
if (typeof options.maxMessageCache !== 'number' || isNaN(options.maxMessageCache)) {
|
||||
throw new TypeError('The maxMessageCache option must be a number.');
|
||||
if (typeof options.messageCacheMaxSize !== 'number' || isNaN(options.messageCacheMaxSize)) {
|
||||
throw new TypeError('The messageCacheMaxSize option must be a number.');
|
||||
}
|
||||
if (typeof options.messageCacheLifetime !== 'number' || isNaN(options.messageCacheLifetime)) {
|
||||
throw new TypeError('The messageCacheLifetime option must be a number.');
|
||||
|
||||
@@ -323,7 +323,7 @@ class TextBasedChannel {
|
||||
}
|
||||
|
||||
_cacheMessage(message) {
|
||||
const maxSize = this.client.options.maxMessageCache;
|
||||
const maxSize = this.client.options.messageCacheMaxSize;
|
||||
if (maxSize === 0) return null;
|
||||
if (this.messages.size >= maxSize) this.messages.delete(this.messages.keys().next().value);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ exports.Package = require('../../package.json');
|
||||
* the order they are triggered, whereas burst runs multiple at a time, and doesn't guarantee a particular order.
|
||||
* @property {number} [shardId=0] The ID of this shard
|
||||
* @property {number} [shardCount=0] The number of shards
|
||||
* @property {number} [maxMessageCache=200] Number of messages to cache per channel
|
||||
* @property {number} [messageCacheMaxSize=200] Maximum number of messages to cache per channel
|
||||
* @property {number} [messageCacheLifetime=0] How long until a message should be uncached by the message sweeping
|
||||
* (in seconds, 0 for forever)
|
||||
* @property {number} [messageSweepInterval=0] How frequently to remove messages from the cache that are older than
|
||||
@@ -26,7 +26,7 @@ exports.DefaultOptions = {
|
||||
apiRequestMethod: 'sequential',
|
||||
shardId: 0,
|
||||
shardCount: 0,
|
||||
maxMessageCache: 200,
|
||||
messageCacheMaxSize: 200,
|
||||
messageCacheLifetime: 0,
|
||||
messageSweepInterval: 0,
|
||||
fetchAllMembers: false,
|
||||
|
||||
Reference in New Issue
Block a user