This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
legacy-musicbot/commands/music/loop.js
2020-12-27 01:18:00 +01:00

32 lines
1.6 KiB
JavaScript

module.exports = {
name: 'loop',
aliases: ['lp', 'repeat'],
category: 'Music',
utilisation: '{prefix}loop',
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
if (args.join(" ").toLowerCase() === 'queue') {
if (client.player.getQueue(message).loopMode) {
client.player.setLoopMode(message, false);
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
} else {
client.player.setLoopMode(message, true);
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** the whole queue will be repeated endlessly !`);
};
} else {
if (client.player.getQueue(message).repeatMode) {
client.player.setRepeatMode(message, false);
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
} else {
client.player.setRepeatMode(message, true);
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** the current music will be repeated endlessly !`);
};
};
},
};