📝 Modifications handler / code / command name

This commit is contained in:
Zerio
2020-06-24 14:59:27 +02:00
committed by GitHub
parent 8cb5dc3c27
commit 70fdd8c432
2 changed files with 33 additions and 24 deletions

33
commands/loop.js Normal file
View File

@@ -0,0 +1,33 @@
const emotes = require ("../config/emojis.json");
const Discord = require("discord.js")
exports.run = async (client, message, args) => {
//If the member is not in a voice channel
if(!message.member.voice.channel) return message.channel.send(`You're not in a voice channel ${emotes.error}`);
//If there's no music
if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`No music playing on this server ${emotes.error}`);
//Repeat mode
const repeatMode = client.player.getQueue(message.guild.id).repeatMode;
//If the mode is enabled
if(repeatMode) {
client.player.setRepeatMode(message.guild.id, false);
//Message
return message.channel.send(`Repeat mode disabled ${emotes.success}`);
//If the mode is disabled
} else {
client.player.setRepeatMode(message.guild.id, true);
//Message
return message.channel.send(`Repeat mode enabled ${emotes.success}`);
}
}

View File

@@ -1,24 +0,0 @@
const emotes = require ("../config/emojis.json");
module.exports.run = async (client, message) => {
if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`);
if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`**No music playing on this server ${emotes.error}**`);
const repeatMode = client.player.getQueue(message.guild.id).repeatMode;
if(repeatMode){
client.player.setRepeatMode(message.guild.id, false);
return message.channel.send(`**Repeat mode disabled ${emotes.success}**`);
} else {
client.player.setRepeatMode(message.guild.id, true);
return message.channel.send(`**Repeat mode enabled ${emotes.success}**`);
}
};
module.exports.config = {
name: "set-repeat",
aliases: []
};