Well, in chatspot 3, whenever the server replied to you, it just echoed it to the browser, as a message.

This makes sure it only echoes messages. Without any weirdo hard to code stuff.