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