Limit commands in maintenance mode

This commit is contained in:
Christer Warén committed 2023-06-08 00:28:48 +03:00
1 parent 3f1d576c44
commit 408c5aaab8
4 files changed
+37 -15

No files matched your search

+15 -4
View File
@@ -11,10 +11,21 @@ export default {
if (client.funcs.check(client, interaction, command)) {
const radio = client.radio?.get(interaction.guild?.id);
if(!client.stations) return interaction.reply({
content: client.messages.emojis["error"] + client.messages.maintenance,
ephemeral: true
});
if(client.config.maintenanceMode){
return interaction.reply({
content: client.messages.emojis["error"] + client.messages.maintenance,
ephemeral: true
});
}
if(!client.stations) {
return interaction.reply({
content: client.messages.emojis["error"] + client.messages.replace(client.messages.errorToGetPlaylist, {
"%client.config.supportGuild%": client.config.supportGuild
}),
ephemeral: true
});
}
let index = client.stations.findIndex((station: station) => station.name == radio.station.name) - 1;
if(index == -1) index = client.stations.length - 1;