1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 10:51:56 +00:00
musix-oss/commands/loopsong.js

24 lines
770 B
JavaScript
Raw Normal View History

2020-02-05 20:02:53 +00:00
module.exports = {
name: 'loopsong',
alias: 'loops',
2020-02-24 18:41:40 +00:00
usage: '',
2020-02-05 20:02:53 +00:00
description: 'loop the currently playing song.',
onlyDev: false,
permission: 'MANAGE_MESSAGES',
category: 'music',
async execute(msg, args, client, Discord, prefix, command) {
2020-03-14 16:38:02 +00:00
const queue = client.queue.get(msg.guild.id);
2020-02-05 20:02:53 +00:00
if (client.funcs.check(client, msg, command)) {
2020-03-14 16:38:02 +00:00
if (!queue.songLooping) {
queue.songLooping = true;
2020-03-13 14:20:23 +00:00
let message;
2020-03-14 16:38:02 +00:00
message = client.messages.loopingSong.replace("%TITLE%", queue.songs[0].title);
2020-03-13 14:20:23 +00:00
msg.channel.send(message);
2020-02-05 20:02:53 +00:00
} else {
2020-03-14 16:38:02 +00:00
queue.songLooping = false;
2020-03-13 14:20:23 +00:00
msg.channel.send(message);
2020-02-05 20:02:53 +00:00
}
}
}
};