nyx/commands/Music/skip.js

19 lines
715 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
module.exports = {
name: "skip",
2021-07-13 05:17:39 +02:00
aliases: ["sk"],
description: "Skips the current playing music",
2021-06-12 12:53:51 +02:00
category: "Music",
run: async (client, message, args) => {
2021-07-13 05:17:39 +02:00
const player = message.client.manager.get(message.guild.id);
if (!player) return client.err(message, "Music", "skip", 34);
const { channel } = message.member.voice;
2021-06-12 12:53:51 +02:00
if (!channel) return client.err(message, "Music", "skip", 35);
2021-07-13 05:17:39 +02:00
if (channel.id !== player.voiceChannel)
return client.err(message, "Music", "skip", 55);
if (!player.queue.current) return client.err(message, "Music", "skip", 34);
const { title } = player.queue.current;
player.stop();
2021-09-06 12:38:25 +02:00
return message.reply(`**${title}** was skipped`);
2021-06-12 12:53:51 +02:00
},
};