1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 07:41:56 +00:00
musix-oss/commands/loopsong.js
2020-03-14 18:38:02 +02:00

24 lines
770 B
JavaScript

module.exports = {
name: 'loopsong',
alias: 'loops',
usage: '',
description: 'loop the currently playing song.',
onlyDev: false,
permission: 'MANAGE_MESSAGES',
category: 'music',
async execute(msg, args, client, Discord, prefix, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!queue.songLooping) {
queue.songLooping = true;
let message;
message = client.messages.loopingSong.replace("%TITLE%", queue.songs[0].title);
msg.channel.send(message);
} else {
queue.songLooping = false;
msg.channel.send(message);
}
}
}
};