From 9ee311810e4632ea46662b07aaafce5d654963f9 Mon Sep 17 00:00:00 2001 From: Xtao_dada Date: Sun, 7 Jun 2020 01:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=AD=20=E4=BF=AE=E5=A4=8D=20gtts=20lang?= =?UTF-8?q?=20=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/modules/external.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pagermaid/modules/external.py b/pagermaid/modules/external.py index bee0aa8..dd4f09c 100644 --- a/pagermaid/modules/external.py +++ b/pagermaid/modules/external.py @@ -73,7 +73,7 @@ async def tts(context): try: await context.edit("生成语音中 . . .") - gTTS(message, lang) + gTTS(message, lang=lang) except AssertionError: await context.edit("出错了呜呜呜 ~ 无效的参数。") return @@ -83,13 +83,13 @@ async def tts(context): except RuntimeError: await context.edit('出错了呜呜呜 ~ 加载语言数组时出错。') return - google_tts = gTTS(message, lang) + google_tts = gTTS(message, lang=lang) google_tts.save("vocals.mp3") with open("vocals.mp3", "rb") as audio: line_list = list(audio) line_count = len(line_list) if line_count == 1: - google_tts = gTTS(message, lang) + google_tts = gTTS(message, lang=lang) google_tts.save("vocals.mp3") with open("vocals.mp3", "r"): await context.client.send_file(context.chat_id, "vocals.mp3", voice_note=True)