function sendMessageUser({ type, payload, userId }) {
  if (!this.connections[userId]) {
    return;
  }
  this.connections[userId].forEach((userConnection) => {
    if (userConnection && userConnection.client && userConnection.client.readyState === WebSocket.OPEN) {
      userConnection.client.send(formatWebsocketMessage(type, payload));
    }
  });
}
@description Send a websocket message to the user.
@param {object} event - The event to send.
@param {string} event.type - The type of event to send.
@param {object} event.payload - The payload of the event containing data.
@param {string} event.userId - The userId to send the message to.
@example
sendMessageUser(event);