From fcc3635b9f24051ae07ed597632597e20372c889 Mon Sep 17 00:00:00 2001 From: SamlonDev Date: Tue, 20 May 2025 05:45:23 +0200 Subject: initial push --- cogs/music/loop.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cogs/music/loop.py (limited to 'cogs/music/loop.py') diff --git a/cogs/music/loop.py b/cogs/music/loop.py new file mode 100644 index 0000000..5f51c7e --- /dev/null +++ b/cogs/music/loop.py @@ -0,0 +1,22 @@ +from discord.ext import commands + +class Loop(commands.Cog): + def __init__(self, bot): + self.bot = bot + self.looping = {} + + def is_looping(self, guild_id): + return self.looping.get(guild_id, False) + + def set_looping(self, guild_id, value): + self.looping[guild_id] = value + + @commands.slash_command(name="loop", description="włącz/wyłącz loopowanie dla bieżącej melodyji") + async def loop(self, ctx): + guild_id = ctx.guild.id + looping = not self.is_looping(guild_id) + self.set_looping(guild_id, looping) + await ctx.respond(f"looping jest teraz {'włączony' if looping else 'wyłączony'}.") + +def setup(bot): + bot.add_cog(Loop(bot)) \ No newline at end of file -- cgit v1.2.3