From e92c3b2e6f4361cb3e9cb29975d64f3723cfc261 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 1 Jul 2023 23:07:10 +0100 Subject: [PATCH] fixes TypeError bug --- pyproject.toml | 2 +- streamlabsio/client.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0536f4b..4122122 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "streamlabsio" -version = "1.0.1" +version = "1.0.2" description = "Get real time Twitch/Youtube events through Streamlabs SocketIO API" authors = ["onyx-and-iris "] license = "MIT" diff --git a/streamlabsio/client.py b/streamlabsio/client.py index 0e9f9a0..5f6f564 100644 --- a/streamlabsio/client.py +++ b/streamlabsio/client.py @@ -71,12 +71,13 @@ class Client: if "for" in data and data["type"] in set( self.streamlabs + self.twitch + self.youtube ): + message = data["message"][0] if isinstance(data["message"][0], dict) else {} self.obs.trigger( data["for"], data["type"], - *data["message"] + message if self._raw - else as_dataclass(data["type"], *data["message"]), + else as_dataclass(data["type"], message), ) self.logger.debug(data)