mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-10 03:00:18 +00:00
19 lines
782 B
JavaScript
19 lines
782 B
JavaScript
module.exports = function (client, msg, command) {
|
|
let message = {};
|
|
const radio = client.radio.get(msg.guild.id);
|
|
const permissions = msg.channel.permissionsFor(msg.author);
|
|
if (!radio || !radio.playing){
|
|
msg.channel.send(client.messageEmojis["x"] + client.messages.notPlaying);
|
|
return false;
|
|
}
|
|
if (msg.member.voice.channel !== radio.voiceChannel){
|
|
msg.channel.send(client.messageEmojis["x"] + client.messages.wrongVoiceChannel);
|
|
return false;
|
|
}
|
|
if (!permissions.has(command.permission)) {
|
|
message.noPerms = client.messages.noPerms.replace("%commands.permissions%", commands.permissions);
|
|
msg.channel.send(client.messageEmojis["x"] + message.noPerms);
|
|
return false;
|
|
} else return true;
|
|
};
|