diff options
| author | Samlon <stankiewiczgracjan2019@gmail.com> | 2025-08-11 15:28:20 +0200 |
|---|---|---|
| committer | Samlon <stankiewiczgracjan2019@gmail.com> | 2025-08-11 15:28:20 +0200 |
| commit | 4b9bd0278267b34fc65a9ed0d0f1b8a1a29c0c8a (patch) | |
| tree | 0000a9333411bd9054f959d0e7efa2398a7e71db /cogs/music/skip.py | |
| parent | play.py fix (diff) | |
| download | senator-sperma-4b9bd0278267b34fc65a9ed0d0f1b8a1a29c0c8a.tar.gz senator-sperma-4b9bd0278267b34fc65a9ed0d0f1b8a1a29c0c8a.zip | |
fixing not working skip
Diffstat (limited to '')
| -rw-r--r-- | cogs/music/skip.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/cogs/music/skip.py b/cogs/music/skip.py deleted file mode 100644 index b0023fe..0000000 --- a/cogs/music/skip.py +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | from discord.ext import commands | ||
| 2 | |||
| 3 | |||
| 4 | class Skip(commands.Cog): | ||
| 5 | def __init__(self, bot): | ||
| 6 | self.bot = bot | ||
| 7 | |||
| 8 | @commands.slash_command(name="pomiń", description="przeskocz do nastepnej melodyji") | ||
| 9 | async def pomin(self, ctx): | ||
| 10 | """Skip the current song and play the next one in the queue.""" | ||
| 11 | vc = ctx.voice_client | ||
| 12 | |||
| 13 | if not vc or not vc.is_connected(): | ||
| 14 | await ctx.respond("Nie jestem połączony z kanałem głosowym.") | ||
| 15 | return | ||
| 16 | |||
| 17 | if not vc.is_playing() and not vc.is_paused(): | ||
| 18 | await ctx.respond("Nic nie jest teraz odtwarzane.") | ||
| 19 | return | ||
| 20 | |||
| 21 | # Get the play cog | ||
| 22 | play_cog = self.bot.get_cog('Play') | ||
| 23 | if not play_cog: | ||
| 24 | await ctx.respond("Błąd: Nie można znaleźć modułu odtwarzania.") | ||
| 25 | return | ||
| 26 | |||
| 27 | queue = play_cog.get_queue(ctx.guild.id) | ||
| 28 | |||
| 29 | if not queue: | ||
| 30 | await ctx.respond("Kolejka jest pusta.") | ||
| 31 | return | ||
| 32 | |||
| 33 | # Stop the current song (this will trigger play_next in the after callback) | ||
| 34 | vc.stop() | ||
| 35 | await ctx.respond("Pominięto aktualną piosenkę.") | ||
| 36 | |||
| 37 | @commands.slash_command(name="kolejka", description="pokaż aktualną kolejkę") | ||
| 38 | async def queue_list(self, ctx): | ||
| 39 | """Show the current queue.""" | ||
| 40 | play_cog = self.bot.get_cog('Play') | ||
| 41 | if not play_cog: | ||
| 42 | await ctx.respond("Błąd: Nie można znaleźć modułu odtwarzania.") | ||
| 43 | return | ||
| 44 | |||
| 45 | queue = play_cog.get_queue(ctx.guild.id) | ||
| 46 | |||
| 47 | if not queue: | ||
| 48 | await ctx.respond("Kolejka jest pusta.") | ||
| 49 | return | ||
| 50 | |||
| 51 | queue_list = [] | ||
| 52 | for i, (title, _) in enumerate(queue[:10], 1): # Show up to 10 songs | ||
| 53 | queue_list.append(f"{i}. {title}") | ||
| 54 | |||
| 55 | if len(queue) > 10: | ||
| 56 | queue_list.append(f"...i {len(queue) - 10} więcej") | ||
| 57 | |||
| 58 | await ctx.respond("\n".join(["**Kolejka:**"] + queue_list)) | ||
| 59 | |||
| 60 | |||
| 61 | def setup(bot): | ||
| 62 | bot.add_cog(Skip(bot)) | ||
