Fixing indentations in multiple commands

This commit is contained in:
Christer Warén 2021-08-26 18:14:15 +03:00
parent 8d15567f85
commit f0887514af
4 changed files with 28 additions and 28 deletions

View File

@ -7,10 +7,10 @@ module.exports = {
category: 'radio',
execute(interaction, client, Discord, command) {
let message = {};
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
const hashs = stations.split('**#**').length;
for (let i = 0; i < hashs; i++) {

View File

@ -9,10 +9,10 @@ module.exports = {
let message = {};
const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply('There is nothing playing.');
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
const completed = (radio.connection.dispatcher.streamTime.toFixed(0));
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name);

View File

@ -11,10 +11,10 @@ module.exports = {
let currentGuild = client.datastore.getEntry(interaction.guild.id);
let statistics = "";
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
if(!currentGuild || currentGuild && !currentGuild.statistics){
statistics = "You have not listened any radio station";

View File

@ -1,19 +1,19 @@
module.exports = {
name: 'stop',
description: 'Stop radio',
alias: 's',
usage: '',
permission: 'none',
category: 'radio',
execute(interaction, client, Discord, command) {
const radio = client.radio.get(interaction.guild.id);
if (client.funcs.check(client, interaction, command)) {
name: 'stop',
description: 'Stop radio',
alias: 's',
usage: '',
permission: 'none',
category: 'radio',
execute(interaction, client, Discord, command) {
const radio = client.radio.get(interaction.guild.id);
if (client.funcs.check(client, interaction, command)) {
client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
client.funcs.logger('Radio', 'Stream stopped' + " / " + interaction.guild.id);
client.radio.delete(interaction.guild.id);
interaction.reply(client.messageEmojis["stop"] + client.messages.stop);
}
}
radio.connection?.destroy();
radio.audioPlayer?.stop();
client.funcs.logger('Radio', 'Stream stopped' + " / " + interaction.guild.id);
client.radio.delete(interaction.guild.id);
interaction.reply(client.messageEmojis["stop"] + client.messages.stop);
}
}
};