This reverts commit 41f5a7718f.
このコミットが含まれているのは:
2025-01-05 17:37:15 +00:00
コミット 9d0b5aff70
+5 -5
ファイルの表示
@@ -730,23 +730,23 @@ class CWindow:
class Broadcast: class Broadcast:
code: str chat: PytchatCore
def __init__ ( def __init__ (
self, self,
broadcast_code, broadcast_code,
): ):
self.code = broadcast_code self.chat = pytchat.create (broadcast_code)
def fetch_chat ( def fetch_chat (
self, self,
) -> Chat | None: ) -> Chat | None:
chat_obj = pytchat.create (self.code) if not self.chat.is_alive ():
if not chat_obj.is_alive ():
return None return None
chats = chat_obj.get ().items chats = self.chat.get ().items
if not chats: if not chats:
return None return None
print (f"{ datetime.now () }: { chats }")
return random.choice (chats) return random.choice (chats)