mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-24 18:03:18 +00:00
21 lines
890 B
JavaScript
21 lines
890 B
JavaScript
module.exports = function (client, msg, command) {
|
|
let message = {};
|
|
const radio = client.radio.get(interaction.guild.id);
|
|
const permissions = interaction.channel.permissionsFor(interaction.user);
|
|
if (!radio) {
|
|
interaction.reply(client.messageEmojis["error"] + client.messages.notPlaying);
|
|
return false;
|
|
}
|
|
if (interaction.member.voice.channel !== radio.voiceChannel) {
|
|
interaction.reply(client.messageEmojis["error"] + client.messages.wrongVoiceChannel);
|
|
return false;
|
|
}
|
|
if(!command.permission == 'none'){
|
|
if (!permissions.has(command.permission)) {
|
|
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
|
|
interaction.reply(client.messageEmojis["error"] + message.noPerms);
|
|
return false;
|
|
} else return true;
|
|
} else return true;
|
|
};
|