mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
Rename max_message_lifetime to message_cache_lifetime
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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.
|
* If the message has been edited, the time of the edit is used rather than the time of the original message.
|
||||||
*/
|
*/
|
||||||
sweepMessages() {
|
sweepMessages() {
|
||||||
if (this.options.max_message_lifetime <= 0) return;
|
if (this.options.message_cache_lifetime <= 0) return;
|
||||||
const now = Date.now();
|
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()) {
|
for (const channel of this.channels.values()) {
|
||||||
if (!channel.messages) continue;
|
if (!channel.messages) continue;
|
||||||
for (const message of channel.messages.values()) {
|
for (const message of channel.messages.values()) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* @property {number} [shard_id=0] The ID of this shard
|
* @property {number} [shard_id=0] The ID of this shard
|
||||||
* @property {number} [shard_count=0] The number of shards
|
* @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_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)
|
* (in seconds, 0 for forever)
|
||||||
* @property {number} [message_sweep_interval=0] How frequently to remove messages from the cache that are older than
|
* @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)
|
* the max message lifetime (in seconds, 0 for never)
|
||||||
@@ -21,7 +21,7 @@ exports.DefaultOptions = {
|
|||||||
shard_id: 0,
|
shard_id: 0,
|
||||||
shard_count: 0,
|
shard_count: 0,
|
||||||
max_message_cache: 200,
|
max_message_cache: 200,
|
||||||
max_message_lifetime: 0,
|
message_cache_lifetime: 0,
|
||||||
message_sweep_interval: 0,
|
message_sweep_interval: 0,
|
||||||
fetch_all_members: false,
|
fetch_all_members: false,
|
||||||
disable_everyone: false,
|
disable_everyone: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user