Lanbot_Music/commands/music/remove.js

18 lines
588 B
JavaScript
Raw Normal View History

2022-04-03 04:34:37 +02:00
module.exports = {
name: 'remove',
aliases: ['remove', 'rm'],
utilisation: `{prefix}remove <id>`,
voiceChannel: true,
execute(client, message, args) {
const queue = player.getQueue(message.guild.id);
if (!queue || !args[1]) return;
const trackIndex = args[1] - 1;
if(!queue.tracks[trackIndex]) return;
const trackName = queue.tracks[trackIndex].title;
//const trackUrl = queue.tracks[trackIndex].url;
queue.remove(trackIndex);
message.reply(`It's good, ${trackName} removed ! :white_check_mark:`)
},
};