Browse Source

Revert "#35"

This reverts commit 41f5a7718f.
ai-migration
みてるぞ 1 week ago
parent
commit
9d0b5aff70
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      test.py

+ 5
- 5
test.py View File

@@ -730,23 +730,23 @@ class CWindow:


class Broadcast:
code: str
chat: PytchatCore

def __init__ (
self,
broadcast_code,
):
self.code = broadcast_code
self.chat = pytchat.create (broadcast_code)

def fetch_chat (
self,
) -> Chat | None:
chat_obj = pytchat.create (self.code)
if not chat_obj.is_alive ():
if not self.chat.is_alive ():
return None
chats = chat_obj.get ().items
chats = self.chat.get ().items
if not chats:
return None
print (f"{ datetime.now () }: { chats }")
return random.choice (chats)




Loading…
Cancel
Save