mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Channels now store 1000 messages maximum
Will drastically improve the longevity of the process and reduce memory required
This commit is contained in:
@@ -18,9 +18,15 @@ class Channel {
|
||||
}
|
||||
|
||||
addMessage(data){
|
||||
|
||||
if(this.messages.length > 1000){
|
||||
this.messages.splice(0,1);
|
||||
}
|
||||
|
||||
if(!this.getMessage("id", data.id)){
|
||||
this.messages.push(data);
|
||||
}
|
||||
|
||||
return this.getMessage("id", data.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user