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

View File

@ -9,10 +9,10 @@ module.exports = {
let message = {}; let message = {};
const radio = client.radio.get(interaction.guild.id); const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply('There is nothing playing.'); if (!radio) return interaction.reply('There is nothing playing.');
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
} }
const completed = (radio.connection.dispatcher.streamTime.toFixed(0)); const completed = (radio.connection.dispatcher.streamTime.toFixed(0));
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name); 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 currentGuild = client.datastore.getEntry(interaction.guild.id);
let statistics = ""; let statistics = "";
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
} }
if(!currentGuild || currentGuild && !currentGuild.statistics){ if(!currentGuild || currentGuild && !currentGuild.statistics){
statistics = "You have not listened any radio station"; statistics = "You have not listened any radio station";

View File

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