code: function handleChat(payload) {
          if (!payload.message) {
              return Promise.reject(new Error('Event payload did not include chat message'));
          }
          const message = ChatRoom.Message.parse(payload.message);
  
          forum.emit('chatMessage', message);
          const ids = {
              post: -1,
              topic: -1,
              user: message.from.id,
              pm: message.room,
              chat: message.id
          };
          return forum.Commands.get(ids, message.content, (content) => message.reply(content))
              .then((command) => command.execute());
      }
docs: Handle Chat events from websocket
  
  @private
  
  @param {*} payload websocket event payload
  @returns {Promise} resolves when processing has been completed for event