More documentation and updated some PM Channel code

The PM Channel will now also trunc messages and cap the array size
This commit is contained in:
hydrabolt
2015-09-30 18:23:21 +01:00
parent d50d8907d0
commit e7adc3ddbf
5 changed files with 49 additions and 2 deletions

View File

@@ -13,6 +13,11 @@ class PMChannel {
}
getMessage(key, value){
if(this.messages.length > 1000){
this.messages.splice(0,1);
}
for(var message of this.messages){
if(message[key] === value){
return message;