1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-07 01:20:48 +00:00
This commit is contained in:
MatteZ02
2020-04-20 19:56:23 +03:00
parent 2d55a3a8da
commit a6e3e8b0de
71 changed files with 158 additions and 164 deletions

31
src/commands/remove.js Normal file
View File

@ -0,0 +1,31 @@
module.exports = {
name: "remove",
alias: "rm",
usage: "<song pos>",
description: "Remove a song from the queue",
onlyDev: false,
permission: "MANAGE_MESSAGES",
category: "music",
execute(msg, args, client, Discord, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!args[1]) return msg.channel.send(client.messages.provideASong);
const pos = parseInt(args[1]);
if (isNaN(pos)) return msg.channel.send(client.messages.validNumber);
if (pos < 1) return msg.channel.send(client.messages.noSongs);
let message1;
let message2;
message1 = client.messages.queueLength.replace(
"%LENGTH%",
queue.songs.length
);
if (pos > queue.songs.length) return msg.channel.send(message1);
message2 = client.messages.removed.replace(
"%SONG%",
queue.songs[pos].title
);
msg.channel.send(message2);
return queue.songs.splice(pos, 1);
}
},
};