Rename max_message_lifetime to message_cache_lifetime

This commit is contained in:
Schuyler Cebulskie
2016-09-19 17:52:11 -04:00
parent 6362c94f11
commit 9503990a86
3 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -252,9 +252,9 @@ class Client extends EventEmitter {
* If the message has been edited, the time of the edit is used rather than the time of the original message.
*/
sweepMessages() {
if (this.options.max_message_lifetime <= 0) return;
if (this.options.message_cache_lifetime <= 0) return;
const now = Date.now();
const lifetime = this.options.max_message_lifetime * 1000;
const lifetime = this.options.message_cache_lifetime * 1000;
for (const channel of this.channels.values()) {
if (!channel.messages) continue;
for (const message of channel.messages.values()) {

View File

@@ -6,7 +6,7 @@
* @property {number} [shard_id=0] The ID of this shard
* @property {number} [shard_count=0] The number of shards
* @property {number} [max_message_cache=200] Number of messages to cache per channel
* @property {number} [max_message_lifetime=0] How long until a message should be uncached by the message sweeping
* @property {number} [message_cache_lifetime=0] How long until a message should be uncached by the message sweeping
* (in seconds, 0 for forever)
* @property {number} [message_sweep_interval=0] How frequently to remove messages from the cache that are older than
* the max message lifetime (in seconds, 0 for never)
@@ -21,7 +21,7 @@ exports.DefaultOptions = {
shard_id: 0,
shard_count: 0,
max_message_cache: 200,
max_message_lifetime: 0,
message_cache_lifetime: 0,
message_sweep_interval: 0,
fetch_all_members: false,
disable_everyone: false,