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