JaBa/commands/Music/stop.js

48 lines
1.1 KiB
JavaScript
Raw Normal View History

const Command = require("../../base/Command"),
2022-01-04 02:18:28 +05:00
Discord = require("discord.js");
class Stop extends Command {
constructor(client) {
super(client, {
name: "stop",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: ["leave", "st"],
memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 3000
});
}
async run(message, args, data) {
const voice = message.member.voice.channel;
const queue = await this.client.player.getQueue(message);
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
if (!queue) return message.error("music/play:NOT_PLAYING");
const embed = new Discord.MessageEmbed()
.setAuthor({
name: message.translate("music/stop:DESCRIPTION")
})
.setFooter({
text: data.config.embed.footer
})
2022-01-04 02:18:28 +05:00
.setColor(data.config.embed.color);
const m = await message.channel.send({
embeds: [embed]
});
2022-01-04 02:18:28 +05:00
this.client.player.stop(message);
embed.setDescription(message.translate("music/stop:SUCCESS"));
m.edit({
embeds: [embed]
});
2022-01-04 02:18:28 +05:00
}
2022-01-13 00:26:23 +05:00
}
2022-01-04 02:18:28 +05:00
module.exports = Stop;