mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-10 03:00:18 +00:00
Updated maintenance command
This commit is contained in:
parent
3609e6af10
commit
1e24e89568
@ -10,43 +10,53 @@ module.exports = {
|
|||||||
|
|
||||||
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed);
|
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed);
|
||||||
|
|
||||||
if(!client.stations) {
|
if(client.config.version.includes("-dev")){
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
interaction.reply({
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
content: "Maintenance Initiated",
|
||||||
}
|
ephemeral: true
|
||||||
|
});
|
||||||
let currentRadios = client.radio.keys();
|
|
||||||
let radio = currentRadios.next();
|
|
||||||
let stoppedRadios = "";
|
|
||||||
|
|
||||||
client.user.setStatus('dnd');
|
process.emit('SIGINT');
|
||||||
|
} else {
|
||||||
while (!radio.done) {
|
if(!client.stations) {
|
||||||
let currentRadio = client.radio.get(radio.value);
|
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||||
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
|
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
||||||
|
|
||||||
if(currentRadio){
|
|
||||||
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
|
|
||||||
currentRadio.connection?.destroy();
|
|
||||||
currentRadio.audioPlayer?.stop();
|
|
||||||
currentRadio.message?.delete();
|
|
||||||
client.radio.delete(radio.value);
|
|
||||||
stoppedRadios += "-" + radio.value + ": " + currentRadio.guild.name + "\n";
|
|
||||||
}
|
}
|
||||||
radio = currentRadios.next();
|
|
||||||
|
let currentRadios = client.radio.keys();
|
||||||
|
let radio = currentRadios.next();
|
||||||
|
let stoppedRadios = "";
|
||||||
|
|
||||||
|
client.user.setStatus('dnd');
|
||||||
|
|
||||||
|
while (!radio.done) {
|
||||||
|
let currentRadio = client.radio.get(radio.value);
|
||||||
|
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
|
||||||
|
|
||||||
|
if(currentRadio){
|
||||||
|
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
|
||||||
|
currentRadio.connection?.destroy();
|
||||||
|
currentRadio.audioPlayer?.stop();
|
||||||
|
currentRadio.message?.delete();
|
||||||
|
client.radio.delete(radio.value);
|
||||||
|
stoppedRadios += "-" + radio.value + ": " + currentRadio.guild.name + "\n";
|
||||||
|
}
|
||||||
|
radio = currentRadios.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(client.messages.maintenanceTitle)
|
||||||
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, ''))
|
||||||
|
.setColor(client.config.embedColor)
|
||||||
|
.setDescription("Stopped all radios" + "\n" + stoppedRadios)
|
||||||
|
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
|
||||||
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [embed],
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(client.messages.maintenanceTitle)
|
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, ''))
|
|
||||||
.setColor(client.config.embedColor)
|
|
||||||
.setDescription("Stopped all radios" + "\n" + stoppedRadios)
|
|
||||||
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
|
|
||||||
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
|
||||||
|
|
||||||
interaction.reply({
|
|
||||||
embeds: [embed],
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user