From 026d0d94ea39112e9ca3e23c829c85d903350487 Mon Sep 17 00:00:00 2001 From: End Date: Thu, 19 Mar 2026 08:44:23 -0700 Subject: [PATCH] why --- bot.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index b77d2a3..fb72cbd 100644 --- a/bot.py +++ b/bot.py @@ -26,7 +26,6 @@ with open("config.json", "r", encoding="utf-8") as f: with open("voices.json", "r", encoding="utf-8") as f: voices_data = json.load(f) - data directory (set this in your deployment environment, e.g. Coolify) DATA_DIR = os.getenv("DATA_DIR", "/app/data") Path(DATA_DIR).mkdir(parents=True, exist_ok=True) @@ -181,8 +180,7 @@ async def enqueue( guild: discord.Guild, member: discord.Member, text: str, voice_id: str ): q = tts_queues.setdefault(guild.id, asyncio.Queue()) - await q.put((text -, voice_id, member)) + await q.put((text, voice_id, member)) if q.qsize() == 1: asyncio.create_task(queue_worker(guild)) @@ -233,7 +231,9 @@ async def queue_worker(guild: discord.Guild): except Exception as e: logger.error(f"Playback error: {e}") try: - await member.send("Failed to play audio. Check that ffmpeg is installed.") + await member.send( + "Failed to play audio. Check that ffmpeg is installed." + ) except Exception: pass @@ -271,7 +271,9 @@ async def on_message(message: discord.Message): if not message.author.voice or not message.author.voice.channel: try: - await message.reply("You need to be in a voice channel.", mention_author=False) + await message.reply( + "You need to be in a voice channel.", mention_author=False + ) except Exception: pass return @@ -521,7 +523,6 @@ async def tts_enable(interaction: discord.Interaction): ) return - enabled = tts_enabled.setdefault(interaction.guild_id, set()) if interaction.user.id in enabled: await interaction.response.send_message(