add left chat

This commit is contained in:
NyxiumYuuki 2021-05-30 11:25:10 +02:00
parent c14c46a444
commit 8547ebf403

View file

@ -82,6 +82,13 @@ io.on('connection',socket => {
socket.on("disconnect", function() {
console.log(`${getUsername} left the chat.`);
socket.broadcast.emit('general',[{
username: 'Server',
date: new Date(),
channel: 'general',
message: `${getUsername} left the chat.`
}]);
});
}
});