mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-22 21:13:18 +00:00
Duplicate command
This commit is contained in:
parent
4ddef360fe
commit
ec93ed0a42
15
commands/duplicate.js
Normal file
15
commands/duplicate.js
Normal file
@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
name: 'duplicate',
|
||||
description: 'Duplicate command.',
|
||||
cooldown: 5,
|
||||
execute(message, args, client, RichEmbed) {
|
||||
const serverQueue = client.queue.get(message.guild.id);
|
||||
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
|
||||
const voiceChannel = message.member.voiceChannel;
|
||||
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to duplicate songs!');
|
||||
if (!args[1]) return message.channel.send(':x: You need to enter the position for the song you want to duplicate!')
|
||||
if (isNaN(args[1])) return msg.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.');
|
||||
serverQueue.songs.push(serverQueue.songs[args[1]])
|
||||
return msg.channel.send(`Duplicated ${serverQueue.songs[args[1]].title}`)
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user