fix: checking is global_listener None

This commit is contained in:
MadCat9958 2023-07-02 22:16:53 +03:00
parent 2a3b4c4af6
commit 5511fd7818

View file

@ -168,7 +168,7 @@ class BotiCordWebsocket:
listener = self._listeners.get(data["data"]["type"]) listener = self._listeners.get(data["data"]["type"])
if listener: if listener:
self.loop.create_task(listener(data["data"])) self.loop.create_task(listener(data["data"]))
else: elif self._global_listener:
self.loop.create_task(self._global_listener(data['data'])) self.loop.create_task(self._global_listener(data['data']))
elif data["event"] == "pong": elif data["event"] == "pong":
_logger.info("Received pong-response.") _logger.info("Received pong-response.")