Merge branch 'next' of github.com:mudkipscience/woomy into next

This commit is contained in:
Lukáš H 2020-04-22 09:53:57 +02:00
commit 13254e47ac

View file

@ -35,7 +35,6 @@ module.exports.run = (client, message, args, level) => {
const oldPosition = +args[0] const oldPosition = +args[0]
const newPosition = +args[1] const newPosition = +args[1]
const songName = queue[oldPosition].video.title
if (isNaN(oldPosition) === true) { 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.)') 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!') return message.channel.send('This number is too high!')
} }
const songName = queue[oldPosition].video.title
queue.splice(newPosition, 0, queue.splice(oldPosition, 1)[0]) queue.splice(newPosition, 0, queue.splice(oldPosition, 1)[0])
message.channel.send(`Moved **${songName}** from position \`${oldPosition}\` to \`${newPosition}\``) message.channel.send(`Moved **${songName}** from position \`${oldPosition}\` to \`${newPosition}\``)