From 41f5a7718ffdd6cbe78b215487f5a2e727415567 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sun, 5 Jan 2025 17:18:14 +0000 Subject: [PATCH] #35 --- test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test.py b/test.py index 0cba0c7..cc0e61f 100644 --- a/test.py +++ b/test.py @@ -730,23 +730,23 @@ class CWindow: class Broadcast: - chat: PytchatCore + code: str def __init__ ( self, broadcast_code, ): - self.chat = pytchat.create (broadcast_code) + self.code = broadcast_code def fetch_chat ( self, ) -> Chat | None: - if not self.chat.is_alive (): + chat_obj = pytchat.create (self.code) + if not chat_obj.is_alive (): return None - chats = self.chat.get ().items + chats = chat_obj.get ().items if not chats: return None - print (f"{ datetime.now () }: { chats }") return random.choice (chats)