feat: delete queued songs on message delete

This commit is contained in:
2025-01-05 17:26:36 -05:00
parent d5623502b0
commit 17bcdc687d
2 changed files with 26 additions and 0 deletions

View File

@@ -328,6 +328,17 @@ async def volume(message):
await utils.add_check_reaction(message)
def delete_queued(messages):
found = []
for message in messages:
for queued in players[message.guild.id].queue:
if queued.trigger_message.id == message.id:
found.append(queued)
for queued in found:
if queued in players[messages[0].guild.id].queue:
players[messages[0].guild.id].queue.remove(queued)
def play_after_callback(e, message, once):
if e:
print(f"player error: {e}")