mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
Channels now store 1000 messages maximum
Will drastically improve the longevity of the process and reduce memory required
This commit is contained in:
parent
3e9af4454d
commit
1ef4fa41a7
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue