blob: 29f0c36ee193d31735fcca91bfd0bc35f909b4f1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
from discord.ext import commands
class Queue(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.queues = {}
def get_queue(self, guild_id):
return self.queues.setdefault(guild_id, [])
@commands.slash_command(name="koleyjka", description="pokazuje koleyjke")
async def queue(self, ctx):
guild_id = ctx.guild.id
queue = self.get_queue(guild_id)
if queue:
queue_str = "\n".join(f"{i+1}. {title}" for i, (_, title, _) in enumerate(queue))
await ctx.respond(f"koleyjka:\n{queue_str}")
else:
await ctx.respond("koleyjka jest pustawa")
def setup(bot):
bot.add_cog(Queue(bot))
|