From 3dd36604e51c150b8dfeb816a8eac3fab86a3831 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 22 Apr 2020 17:53:41 +1000 Subject: [PATCH] songName no longer causes problems --- commands/movesong.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/movesong.js b/commands/movesong.js index 363e900..c56d95e 100644 --- a/commands/movesong.js +++ b/commands/movesong.js @@ -35,7 +35,6 @@ module.exports.run = (client, message, args, level) => { const oldPosition = +args[0] const newPosition = +args[1] - const songName = queue[oldPosition].video.title if (isNaN(oldPosition) === true) { return message.channel.send('That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') @@ -61,6 +60,8 @@ module.exports.run = (client, message, args, level) => { return message.channel.send('This number is too high!') } + const songName = queue[oldPosition].video.title + queue.splice(newPosition, 0, queue.splice(oldPosition, 1)[0]) message.channel.send(`Moved **${songName}** from position \`${oldPosition}\` to \`${newPosition}\``)