mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +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){
|
addMessage(data){
|
||||||
|
|
||||||
|
if(this.messages.length > 1000){
|
||||||
|
this.messages.splice(0,1);
|
||||||
|
}
|
||||||
|
|
||||||
if(!this.getMessage("id", data.id)){
|
if(!this.getMessage("id", data.id)){
|
||||||
this.messages.push(data);
|
this.messages.push(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.getMessage("id", data.id);
|
return this.getMessage("id", data.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user