From 791e75cb2beeca45a6edf52b65f7e299e03b5eaf Mon Sep 17 00:00:00 2001 From: SamlonDev Date: Sat, 14 Jun 2025 18:54:02 +0200 Subject: code-style issues --- cogs/music/skip.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'cogs/music/skip.py') diff --git a/cogs/music/skip.py b/cogs/music/skip.py index 67c391e..b0023fe 100644 --- a/cogs/music/skip.py +++ b/cogs/music/skip.py @@ -1,5 +1,5 @@ from discord.ext import commands -import discord + class Skip(commands.Cog): def __init__(self, bot): @@ -9,31 +9,31 @@ class Skip(commands.Cog): async def pomin(self, ctx): """Skip the current song and play the next one in the queue.""" vc = ctx.voice_client - + if not vc or not vc.is_connected(): await ctx.respond("Nie jestem połączony z kanałem głosowym.") return - + if not vc.is_playing() and not vc.is_paused(): await ctx.respond("Nic nie jest teraz odtwarzane.") return - + # Get the play cog play_cog = self.bot.get_cog('Play') if not play_cog: await ctx.respond("Błąd: Nie można znaleźć modułu odtwarzania.") return - + queue = play_cog.get_queue(ctx.guild.id) - + if not queue: await ctx.respond("Kolejka jest pusta.") return - + # Stop the current song (this will trigger play_next in the after callback) vc.stop() await ctx.respond("Pominięto aktualną piosenkę.") - + @commands.slash_command(name="kolejka", description="pokaż aktualną kolejkę") async def queue_list(self, ctx): """Show the current queue.""" @@ -41,21 +41,22 @@ class Skip(commands.Cog): if not play_cog: await ctx.respond("Błąd: Nie można znaleźć modułu odtwarzania.") return - + queue = play_cog.get_queue(ctx.guild.id) - + if not queue: await ctx.respond("Kolejka jest pusta.") return - + queue_list = [] for i, (title, _) in enumerate(queue[:10], 1): # Show up to 10 songs queue_list.append(f"{i}. {title}") - + if len(queue) > 10: queue_list.append(f"...i {len(queue) - 10} więcej") - + await ctx.respond("\n".join(["**Kolejka:**"] + queue_list)) + def setup(bot): - bot.add_cog(Skip(bot)) \ No newline at end of file + bot.add_cog(Skip(bot)) -- cgit v1.2.3