Merge pull request #586 from lluiscab/lluiscab/fix-client_echo

Fixed client echo crash on /say
This commit is contained in:
Romain Beaumont 2018-09-24 22:10:12 +02:00 committed by GitHub
commit 6988345f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ client.on('chat', function (packet) {
const username = jsonMsg.with[0].text
const msg = jsonMsg.with[1]
if (username === client.username) return
client.write('chat', { message: msg })
if (msg.text) client.write('chat', { message: msg.text})
else client.write('chat', { message: msg})
}
})