Rename maxMessageCache -> messageCacheMaxSize

This commit is contained in:
Schuyler Cebulskie
2016-10-09 15:16:54 -04:00
parent a717b60417
commit 7a53f70978
4 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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.');

View File

@@ -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);

View File

@@ -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,