AI 移行 #38

マージ済み
みてるぞ が 49 個のコミットを ai-migration から main へマージ 2025-12-03 02:02:36 +09:00
コミット 270b4515d8 の変更だけを表示してゐます - すべてのコミットを表示
+4 -2
ファイルの表示
@@ -731,22 +731,24 @@ class CWindow:
class Broadcast: class Broadcast:
chat: PytchatCore chat: PytchatCore
code: str
def __init__ ( def __init__ (
self, self,
broadcast_code, broadcast_code,
): ):
self.chat = pytchat.create (broadcast_code) self.code = broadcast_code
self.chat = pytchat.create (self.code)
def fetch_chat ( def fetch_chat (
self, self,
) -> Chat | None: ) -> Chat | None:
if not self.chat.is_alive (): if not self.chat.is_alive ():
self.chat = pytchat.create (self.code)
return None return None
chats = self.chat.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)