naar-music-bot
Version:
Simple JavaScript Music Discord Bot Powerd By: NAAR Studio.
34 lines • 1.47 kB
JavaScript
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "pause",
aliases: ['pau'],
cooldown: 10,
description: `Pause the song!.`,
run: async(client, message, args) => {
if (client.pause_command == true) {
if (!message.guild) return;
const queue = message.client.queue.get(message.guild.id);
if (!queue) return message.channel.send(
new MessageEmbed()
.setTitle("Thare is nothing in the music queue!")
.setColor("RED")).catch(err => {
throw new TypeError(err)
});
if (queue.playing) {
queue.playing = false;
queue.connection.dispatcher.pause(true);
const pausemebed = new MessageEmbed().setColor("#c219d8")
.setAuthor(`**${message.author.username}** paused the music.`)
message.react("✅")
return queue.textChannel.send(pausemebed).catch(err => {
throw new TypeError(err)
});
}
} else if (client.help_command == false) {
message.channel.send(
new MessageEmbed()
.setTitle(`\`${module.exports.name}\` Has Been Disabled From The Music System`)
)
} else throw new TypeError(`❌ | "${module.exports.name}_command" value must be true or false`)
}
};