TODO: Chat logs

This commit is contained in:
Daniel 2024-02-03 21:29:35 -03:00
parent 2332ec38f9
commit c257ffbd2a
1 changed files with 13 additions and 0 deletions

View File

@ -126,6 +126,19 @@ export class Channel extends EventEmitter {
this.sendArray([outgoing]);
this.chatHistory.push(outgoing);
prisma.chatHistory.upsert({
where:{
id: this._id
},
update:{
messages: JSON.stringify(this.chatHistory)
},
create: {
id:this._id,
messages: JSON.stringify(this.chatHistory)
}
})
try {
if (msg.message.startsWith("/")) {
this.emit("command", msg, socket);