From 9790ef2914e5acb57a979cd97b4ccfde635265cc Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Sun, 5 Jan 2025 16:51:39 -0500 Subject: [PATCH] feat(commands/voice): limit to 5 queued songs without manage channels permission --- commands/voice.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/commands/voice.py b/commands/voice.py index d70d566..e784c4c 100644 --- a/commands/voice.py +++ b/commands/voice.py @@ -105,6 +105,25 @@ async def queue_or_play(message): f"removed **{len(targets)}** queued {'song' if len(targets) == 1 else 'songs'}", ) elif query := args.query: + if ( + not message.channel.permissions_for(message.author).manage_channels + and len( + list( + filter( + lambda queued: queued.trigger_message.author.id + == message.author.id, + players[message.guild.id].queue, + ) + ) + ) + >= 5 + ): + await utils.reply( + message, + "you can only queue **5 songs** without the manage channels permission!", + ) + return + try: async with message.channel.typing(): player = await youtubedl.YTDLSource.from_url(