diff options
| author | Samlon <stankiewiczgracjan2019@gmail.com> | 2025-08-11 17:39:21 +0200 |
|---|---|---|
| committer | Samlon <stankiewiczgracjan2019@gmail.com> | 2025-08-11 17:39:21 +0200 |
| commit | ca0b4ecf005e1c1f4066460a45393ebffef1ef1c (patch) | |
| tree | 4c175ba876ae35d9248dfab33d2a981fe3cfb207 /cogs/tts.py | |
| parent | changed printing to proper logging (diff) | |
| download | senator-sperma-ca0b4ecf005e1c1f4066460a45393ebffef1ef1c.tar.gz senator-sperma-ca0b4ecf005e1c1f4066460a45393ebffef1ef1c.zip | |
more logging
Diffstat (limited to '')
| -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 |
