23 lines
823 B
JavaScript
23 lines
823 B
JavaScript
|
const { MESSAGES } = require("../../util/constants");
|
||
|
const move = require("array-move");
|
||
|
const { canModifyQueue } = require("../../util/LanBot");
|
||
|
|
||
|
module.exports.run = (client, message, args, settings) => {
|
||
|
const queue = message.client.queue.get(message.guild.id);
|
||
|
if (!queue) return message.channel.send("Il n'y a pas de musique dans la file d'attente.").catch(console.error);
|
||
|
if (!canModifyQueue(message.member)) return;
|
||
|
|
||
|
let song = queue.songs[args[0] - 1];
|
||
|
|
||
|
queue.songs = move(queue.songs, args[0] - 1, args[1] == 1 ? 1 : args[1] - 1);
|
||
|
queue.textChannel.send(
|
||
|
("Déplacement effectué !", {
|
||
|
author: message.author,
|
||
|
title: song.title,
|
||
|
index: args[1] == 1 ? 1 : args[1]
|
||
|
})
|
||
|
);
|
||
|
};
|
||
|
|
||
|
module.exports.help = MESSAGES.COMMANDS.MUSIQUE.MOVE;
|