Add more reliable way to recover from crashes

This commit is contained in:
Deko
2024-03-10 15:01:32 +01:00
parent 231b83c8a7
commit 046c101f1c
3 changed files with 47 additions and 33 deletions

View File

@@ -25,6 +25,7 @@ class CachePrevent:
@dataclass
class StreamInformation:
id: str
user_id: str
user_name: str
user_login: str
@@ -33,6 +34,7 @@ class StreamInformation:
viewer_count: int
started_at: str
_thumbnail_url: str
discord_message_id: str = ""
@property
def thumbnail_url(self):
@@ -140,6 +142,7 @@ class TwitchClient:
stream_data = streams[0]
return StreamInformation(
id=stream_data.get("id"),
user_id=stream_data.get("user_id"),
user_name=stream_data.get("user_name"),
user_login=stream_data.get("user_login"),