From f92cda371c7125bbed00148609921379e3941a21 Mon Sep 17 00:00:00 2001 From: lss233 <8984680+lss233@users.noreply.github.com> Date: Fri, 21 Apr 2023 00:55:23 +0800 Subject: [PATCH] chore(edge-tts): clear logs --- bot.py | 9 ++++++++- utils/edge_tts.py | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index d145bae7..bcfd9031 100644 --- a/bot.py +++ b/bot.py @@ -38,7 +38,14 @@ logger.info("检测到 mirai 配置,将启动 mirai 模式……") from platforms.ariadne_bot import start_task bots.append(loop.create_task(start_task())) -loop.run_until_complete(load_edge_tts_voices()) +try: + logger.info("[Edge TTS] 读取 Edge TTS 可用音色列表……") + loop.run_until_complete(load_edge_tts_voices()) + logger.info("[Edge TTS] 读取成功!") +except Exception as e: + logger.exception(e) + logger.error("[Edge TTS] 读取失败!") + loop.run_until_complete(asyncio.gather(*bots)) loop.run_forever() diff --git a/utils/edge_tts.py b/utils/edge_tts.py index 0d69b0d8..9ee12aa9 100644 --- a/utils/edge_tts.py +++ b/utils/edge_tts.py @@ -16,7 +16,6 @@ async def load_edge_tts_voices(): "edge", el.get('ShortName', ''), el.get('Gender', None) ): edge_tts_voices[tts_voice.alias] = tts_voice - logger.info(f"{len(edge_tts_voices)} edge tts voices loaded.") return edge_tts_voices