コミットを比較
2 コミット
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
| 270b4515d8 | |||
| 9d0b5aff70 |
@@ -730,6 +730,7 @@ class CWindow:
|
||||
|
||||
|
||||
class Broadcast:
|
||||
chat: PytchatCore
|
||||
code: str
|
||||
|
||||
def __init__ (
|
||||
@@ -737,14 +738,15 @@ class Broadcast:
|
||||
broadcast_code,
|
||||
):
|
||||
self.code = broadcast_code
|
||||
self.chat = pytchat.create (self.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 ():
|
||||
self.chat = pytchat.create (self.code)
|
||||
return None
|
||||
chats = chat_obj.get ().items
|
||||
chats = self.chat.get ().items
|
||||
if not chats:
|
||||
return None
|
||||
return random.choice (chats)
|
||||
|
||||
新しい課題から参照
ユーザをブロックする