2020-03-02 19:38:42 +00:00
|
|
|
module.exports = function (client, msg, command) {
|
2020-03-12 22:57:20 +00:00
|
|
|
let message = {};
|
2020-03-02 19:38:42 +00:00
|
|
|
const radio = client.radio.get(msg.guild.id);
|
|
|
|
const permissions = msg.channel.permissionsFor(msg.author);
|
2020-03-22 15:10:46 +00:00
|
|
|
if (!radio) {
|
2020-03-15 01:30:15 +00:00
|
|
|
msg.channel.send(client.messageEmojis["x"] + client.messages.notPlaying);
|
2020-03-13 18:55:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
2020-03-22 15:10:46 +00:00
|
|
|
if (msg.member.voice.channel !== radio.voiceChannel) {
|
2020-03-15 01:30:15 +00:00
|
|
|
msg.channel.send(client.messageEmojis["x"] + client.messages.wrongVoiceChannel);
|
2020-03-13 18:55:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
2020-03-30 01:20:45 +00:00
|
|
|
if(!command.permission == 'none'){
|
|
|
|
if (!permissions.has(command.permission)) {
|
|
|
|
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
|
|
|
|
msg.channel.send(client.messageEmojis["x"] + message.noPerms);
|
|
|
|
return false;
|
|
|
|
} else return true;
|
2020-03-02 19:38:42 +00:00
|
|
|
} else return true;
|
|
|
|
};
|