songName no longer causes problems

This commit is contained in:
Emily 2020-04-22 17:53:41 +10:00
parent 4d97bc1ad0
commit 3dd36604e5

View file

@ -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}\``)