nyx/commands/Music/stop.js

18 lines
631 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
module.exports = {
name: "stop",
2021-07-13 05:17:39 +02:00
aliases: ["dc"],
2021-06-12 12:53:51 +02:00
description: "To stop the music and clear the queue",
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", "stop", 34);
const { channel } = message.member.voice;
2021-06-12 12:53:51 +02:00
if (!channel) return client.err(message, "Music", "stop", 35);
2021-07-13 05:17:39 +02:00
if (channel.id !== player.voiceChannel)
return client.err(message, "Music", "stop", 55);
player.destroy();
2021-06-12 12:53:51 +02:00
message.react("✅");
2021-09-06 12:38:25 +02:00
return message.reply("The player has been destroyed");
2021-06-12 12:53:51 +02:00
},
};