nyx/commands/Music/loop.js

23 lines
916 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
module.exports = {
name: "loop",
2021-07-13 05:17:39 +02:00
aliases: ["repeat"],
2021-06-12 12:53:51 +02:00
description: "Music loop",
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", "loop", 34);
const { channel } = message.member.voice;
if (!channel) return client.err(message, "Music", "loop", 35);
if (channel.id !== player.voiceChannel)
return client.err(message, "Music", "loop", 55);
if (args.length && /queue/i.test(args[0])) {
player.setQueueRepeat(!player.queueRepeat);
const queueRepeat = player.queueRepeat ? "enabled" : "disabled";
2021-09-06 12:38:25 +02:00
return message.reply(`Queue repeat is ${queueRepeat}`);
2021-06-12 12:53:51 +02:00
}
2021-07-13 05:17:39 +02:00
player.setTrackRepeat(!player.trackRepeat);
const trackRepeat = player.trackRepeat ? "enabled" : "disabled";
2021-09-06 12:38:25 +02:00
return message.reply(`Queue repeat is ${trackRepeat}`);
2021-06-12 12:53:51 +02:00
},
};