feat(commands/voice/queue): replace queued song on message edit

This commit is contained in:
2025-01-05 17:04:34 -05:00
parent 186eda4934
commit d5623502b0
3 changed files with 13 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ import youtubedl
from state import client, players
async def queue_or_play(message):
async def queue_or_play(message, edited=False):
await ensure_joined(message)
if not command_allowed(message):
return
@@ -73,6 +73,15 @@ async def queue_or_play(message):
if not (args := await parser.parse_args(message, tokens)):
return
if edited:
found = None
for queued in players[message.guild.id].queue:
if queued.trigger_message.id == message.id:
found = queued
break
if found:
players[message.guild.id].queue.remove(found)
if args.clear:
players[message.guild.id].queue.clear()
await utils.add_check_reaction(message)