From 4f5ca391fa8cac04d6adb8f074977c7b712edf1d Mon Sep 17 00:00:00 2001 From: Marcin Macierzanka Date: Sat, 4 Jul 2026 15:37:02 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20naprawa=20dzia=C5=82ania=20p=C4=99tli=20?= =?UTF-8?q?utworu=20-=20wy=C5=82=C4=85czanie=20p=C4=99tli=20pojedynczego?= =?UTF-8?q?=20utworu=20przy=20r=C4=99cznym=20pomini=C4=99ciu=20(/skip,=20p?= =?UTF-8?q?rzycisk=20w=20web)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 5 ++++- web.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 8bce716..eb8b862 100644 --- a/bot.py +++ b/bot.py @@ -444,7 +444,10 @@ class MusicBot(commands.Cog): @app_commands.command(name="skip", description="Pomiń aktualny utwór") async def skip(self, interaction: discord.Interaction): """Pomiń aktualny utwór""" - if interaction.guild.voice_client.is_playing(): + guild_id = interaction.guild.id + if self.get_loop_current(guild_id): + self.set_loop_current(guild_id, False) + if interaction.guild.voice_client and (interaction.guild.voice_client.is_playing() or interaction.guild.voice_client.is_paused()): interaction.guild.voice_client.stop() await self.trigger_state_change() await interaction.response.send_message( diff --git a/web.py b/web.py index aad7d8c..7ceef09 100644 --- a/web.py +++ b/web.py @@ -290,10 +290,14 @@ async def api_resume(): @app.post("/api/skip") async def api_skip(): + music_cog = bot.get_cog("MusicBot") guild = get_active_guild() if not guild: raise HTTPException(status_code=400, detail="Bot has no active server context") + if music_cog and music_cog.get_loop_current(guild.id): + music_cog.set_loop_current(guild.id, False) + voice_client = discord.utils.get(bot.voice_clients, guild__id=guild.id) if voice_client and (voice_client.is_playing() or voice_client.is_paused()): voice_client.stop()