mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-12-16 14:19:20 +00:00
TypeScript Initial
This commit is contained in:
35
src/client/funcs/check.ts
Normal file
35
src/client/funcs/check.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
module.exports = function check(client, interaction, command) {
|
||||
let message = {};
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user