Change module name

This commit is contained in:
taizan-hokouto
2020-11-01 19:29:09 +09:00
parent 8f5c3f312a
commit d362152c77
2 changed files with 9 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ def main():
print("You can specify only one video ID.")
return
try:
SimpleEcho(Arguments().video_ids[0]).run()
Echo(Arguments().video_ids[0]).run()
except InvalidVideoIdException as e:
print("Invalid video id:", str(e))
except Exception as e:

View File

@@ -1,4 +1,5 @@
import pytchat
from ..exceptions import ChatDataFinished, NoContents
from ..util.extract_video_id import extract_video_id
@@ -12,6 +13,10 @@ class Echo:
chatdata = livechat.get()
for c in chatdata.sync_items():
print(f"{c.datetime} [{c.author.name}] {c.message} {c.amountString}")
try:
livechat.raise_for_status()
except (ChatDataFinished, NoContents):
print("Chat finished.")
except Exception as e:
print(type(e), str(e))