From 960b66a5b88e6ca162a1df09a21c281538106274 Mon Sep 17 00:00:00 2001 From: BogdanWDK Date: Wed, 30 Sep 2020 06:54:18 +0100 Subject: [PATCH] Language Support Added Supports Language as [p]tts --- tts/tts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tts/tts.py b/tts/tts.py index 235d585..8584f5a 100644 --- a/tts/tts.py +++ b/tts/tts.py @@ -28,12 +28,12 @@ class TTS(Cog): return @commands.command(aliases=["t2s", "text2"]) - async def tts(self, ctx: commands.Context, *, text: str): - """ - Send Text to speech messages as an mp3 + async def tts(self, ctx: commands.Context, *, lang: str, text: str): """ + Send Text to speech messages as an mp3 + """ mp3_fp = io.BytesIO() - tts = gTTS(text, lang="en") + tts = gTTS(text, lang=lang) tts.write_to_fp(mp3_fp) mp3_fp.seek(0) await ctx.send(file=discord.File(mp3_fp, "text.mp3"))