diff --git a/test.py b/test.py index 0cba0c7..58cd2f6 100644 --- a/test.py +++ b/test.py @@ -731,22 +731,24 @@ class CWindow: class Broadcast: chat: PytchatCore + code: str def __init__ ( self, broadcast_code, ): - self.chat = pytchat.create (broadcast_code) + self.code = broadcast_code + self.chat = pytchat.create (self.code) def fetch_chat ( self, ) -> Chat | None: if not self.chat.is_alive (): + self.chat = pytchat.create (self.code) return None chats = self.chat.get ().items if not chats: return None - print (f"{ datetime.now () }: { chats }") return random.choice (chats)