mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-05-03 16:24:58 +00:00
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
module.exports = function check(client, interaction, command) {
|
|
let message = {};
|
|
const radio = client.radio.get(interaction.guild.id);
|
|
const permissions = interaction.channel.permissionsFor(interaction.user);
|
|
if(client.config.maintenanceMode){
|
|
interaction.reply({
|
|
content: client.messageEmojis["error"] + client.messages.maintenance,
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
if(!client.stations) {
|
|
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
|
interaction.reply({
|
|
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
if (!radio) {
|
|
interaction.reply({
|
|
content: client.messageEmojis["error"] + client.messages.notPlaying,
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
if (interaction.member.voice.channel !== radio.voiceChannel) {
|
|
interaction.reply({
|
|
content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel,
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
};
|