nyx/commands/Music/loop.js
night0721 bc346138dd Bot
2021-06-12 18:53:51 +08:00

26 lines
717 B
JavaScript

const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "loop",
description: "Music loop",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const serverQueue = message.client.queue.get(message.guild.id);
if (serverQueue) {
serverQueue.loop = !serverQueue.loop;
return message.channel.send({
embed: {
color: "GREEN",
description: `🔁 **|** Loop is ${
serverQueue.loop === true ? "enabled" : "disabled"
}`,
},
});
}
return client.err(message, "Music", "loop", 34);
},
};