code: def run(self):
          
          while True:
              result = json.loads(self.ws.recv())
              if result["cmd"] == "chat" and not result["nick"] == self.nick:
                  for handler in list(self.on_message):
                      handler(self, result["text"], result["nick"])
              elif result["cmd"] == "onlineAdd":
                  self.online_users.append(result["nick"])
                  for handler in list(self.on_join):
                      handler(self, result["nick"])
              elif result["cmd"] == "onlineRemove":
                  self.online_users.remove(result["nick"])
                  for handler in list(self.on_leave):
                      handler(self, result["nick"])
              elif result["cmd"] == "onlineSet":
                  for nick in result["nicks"]:
                      self.online_users.append(nick)
docs: Sends data to the callback functions.