Update chat.js

Works good enough for now