diff options
Diffstat (limited to 'cogs/tts.py')
| -rw-r--r-- | cogs/tts.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cogs/tts.py b/cogs/tts.py index 2481ab3..dceb26c 100644 --- a/cogs/tts.py +++ b/cogs/tts.py | |||
| @@ -4,6 +4,9 @@ import os | |||
| 4 | import discord | 4 | import discord |
| 5 | from discord.ext import commands | 5 | from discord.ext import commands |
| 6 | from gtts import gTTS | 6 | from gtts import gTTS |
| 7 | import logging | ||
| 8 | |||
| 9 | logger = logging.getLogger(__name__) | ||
| 7 | 10 | ||
| 8 | 11 | ||
| 9 | class TTS(commands.Cog): | 12 | class TTS(commands.Cog): |
| @@ -24,6 +27,7 @@ class TTS(commands.Cog): | |||
| 24 | # Check if the user is in a voice channel | 27 | # Check if the user is in a voice channel |
| 25 | if not (ctx.author.voice and ctx.author.voice.channel): | 28 | if not (ctx.author.voice and ctx.author.voice.channel): |
| 26 | await ctx.respond("Musisz być na kanale głosowym, aby odtworzyć TTS!", ephemeral=True) | 29 | await ctx.respond("Musisz być na kanale głosowym, aby odtworzyć TTS!", ephemeral=True) |
| 30 | logger.info("tts: User is not in a voice channel") | ||
| 27 | os.remove('tts.mp3') | 31 | os.remove('tts.mp3') |
| 28 | return | 32 | return |
| 29 | channel = ctx.author.voice.channel | 33 | channel = ctx.author.voice.channel |
