Add chat history limit
This commit is contained in:
parent
c94069bb37
commit
2590f161c6
|
@ -1110,6 +1110,12 @@ export class Channel extends EventEmitter {
|
||||||
|
|
||||||
this.sendArray([outgoing]);
|
this.sendArray([outgoing]);
|
||||||
this.chatHistory.push(outgoing);
|
this.chatHistory.push(outgoing);
|
||||||
|
|
||||||
|
// Limit chat history to 512 messages
|
||||||
|
if (this.chatHistory.length > 512) {
|
||||||
|
this.chatHistory.splice(0, this.chatHistory.length - 512);
|
||||||
|
}
|
||||||
|
|
||||||
await saveChatHistory(this.getID(), this.chatHistory);
|
await saveChatHistory(this.getID(), this.chatHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue