fixes TypeError bug

This commit is contained in:
onyx-and-iris 2023-07-01 23:07:10 +01:00
parent 99ab0f00f8
commit e92c3b2e6f
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "streamlabsio" name = "streamlabsio"
version = "1.0.1" version = "1.0.2"
description = "Get real time Twitch/Youtube events through Streamlabs SocketIO API" description = "Get real time Twitch/Youtube events through Streamlabs SocketIO API"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

@ -71,12 +71,13 @@ class Client:
if "for" in data and data["type"] in set( if "for" in data and data["type"] in set(
self.streamlabs + self.twitch + self.youtube self.streamlabs + self.twitch + self.youtube
): ):
message = data["message"][0] if isinstance(data["message"][0], dict) else {}
self.obs.trigger( self.obs.trigger(
data["for"], data["for"],
data["type"], data["type"],
*data["message"] message
if self._raw if self._raw
else as_dataclass(data["type"], *data["message"]), else as_dataclass(data["type"], message),
) )
self.logger.debug(data) self.logger.debug(data)