From 9afddd0d38d296a857cb20046bd9ba59464b1642 Mon Sep 17 00:00:00 2001 From: biscot <32405102+biscotit@users.noreply.github.com> Date: Sun, 21 Feb 2021 12:55:37 +1000 Subject: [PATCH] Fixed Double Queue Bug Fixed an issue where it will ignore all messages that don't have a number it from the author, now this would be good, however if a user ignores the track selection and starts another play command, bringing up another track selection and they select, it will double queue up the songs. --- examples/commands/play.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/commands/play.js b/examples/commands/play.js index 4bde836..492587c 100644 --- a/examples/commands/play.js +++ b/examples/commands/play.js @@ -52,7 +52,7 @@ module.exports = { if (!player.playing && !player.paused && player.queue.totalSize === res.tracks.length) player.play(); return message.reply(`enqueuing playlist \`${res.playlist.name}\` with ${res.tracks.length} tracks.`); case 'SEARCH_RESULT': - let max = 5, collected, filter = (m) => m.author.id === message.author.id && /^(\d+|end)$/i.test(m.content); + let max = 5, collected, filter = (m) => m.author.id === message.author.id; if (res.tracks.length < max) max = res.tracks.length; const results = res.tracks @@ -70,6 +70,11 @@ module.exports = { } const first = collected.first().content; + + if(isNaN(first)) { + if (!player.queue.current) return player.destroy(); + return; + } if (first.toLowerCase() === 'end') { if (!player.queue.current) player.destroy();