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()