From ca0b4ecf005e1c1f4066460a45393ebffef1ef1c Mon Sep 17 00:00:00 2001 From: Samlon Date: Mon, 11 Aug 2025 17:39:21 +0200 Subject: more logging --- cogs/music/play_compressed.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cogs/music/play_compressed.py') diff --git a/cogs/music/play_compressed.py b/cogs/music/play_compressed.py index 038a15e..dd8dfd8 100644 --- a/cogs/music/play_compressed.py +++ b/cogs/music/play_compressed.py @@ -31,6 +31,7 @@ class GrajcujZkompresowane(commands.Cog): output_path = f"{base}_compressed.opus" ffmpeg_command = f"ffmpeg -i {input_path} -ac 1 -b:a 500 -acodec libopus {output_path}" subprocess.run(ffmpeg_command, check=True, shell=True) + logger.info(f"Audio compressed to {output_path}") return output_path @commands.slash_command(name="grajcuj_zkompresowane", description="grajcuj zkompresowane melodyje") @@ -38,10 +39,12 @@ class GrajcujZkompresowane(commands.Cog): await ctx.defer() if not (ctx.author.voice and ctx.author.voice.channel): await ctx.followup.send("nie jesteś w kanale głosowym") + logger.info("User is not in a voice channel") return channel = ctx.author.voice.channel if ctx.voice_client is not None: vc = ctx.voice_client + logger.info(f"User is already in a voice channel, moving to new {channel}") await vc.move_to(channel) else: vc = await channel.connect() @@ -81,6 +84,7 @@ class GrajcujZkompresowane(commands.Cog): compressed_file_path = self.compress_audio(file_path) except subprocess.CalledProcessError as e: await ctx.followup.send(f"skompresowanie nie powiodło się: {str(e)}", ephemeral=True) + logger.error(f"Failed to compress audio: {e}", exc_info=True) return found_file = compressed_file_path found_title = title @@ -99,6 +103,7 @@ class GrajcujZkompresowane(commands.Cog): vc.stop() vc.play(discord.FFmpegPCMAudio(found_file), after=after_playing) await ctx.followup.send(f"gra (zkompresowane): {title}") + logger.info(f"Playing audio: {title}") def setup(bot): -- cgit v1.2.3