Updated code

This commit is contained in:
Christer Warén 2021-09-05 03:37:03 +03:00
parent ea2be5d5fb
commit 534bc74936
5 changed files with 10 additions and 32 deletions

View File

@ -3,21 +3,10 @@ module.exports = {
description: 'Next Station', description: 'Next Station',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
async execute(interaction, client) { async execute(interaction, client, command) {
let message = {}; if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id); const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({ console.log(client.stations.find(station => station.name == radio.station.name));
content: 'There is nothing playing.',
ephemeral: true
});
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply({
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
ephemeral: true
});
} }
} }
} }

View File

@ -5,7 +5,7 @@ module.exports = {
description: 'Current Radio Station', description: 'Current Radio Station',
permission: 'none', permission: 'none',
category: 'radio', category: 'radio',
async execute(interaction, client) { async execute(interaction, client, command) {
if (client.funcs.check(client, interaction, command)) { if (client.funcs.check(client, interaction, command)) {
let message = {}; let message = {};
const radio = client.radio.get(interaction.guild.id); const radio = client.radio.get(interaction.guild.id);

View File

@ -4,20 +4,9 @@ module.exports = {
permission: 'none', permission: 'none',
category: 'info', category: 'info',
async execute(interaction, client) { async execute(interaction, client) {
let message = {}; if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id); const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({ console.log(client.stations.find(station => station.name == radio.station.name));
content: 'There is nothing playing.',
ephemeral: true
});
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply({
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
ephemeral: true
});
} }
} }
} }

View File

@ -5,7 +5,7 @@ module.exports = {
description: 'Stop radio', description: 'Stop radio',
permission: 'none', permission: 'none',
category: 'radio', category: 'radio',
async execute(interaction, client) { async execute(interaction, client, 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);

View File

@ -25,7 +25,7 @@ module.exports = {
if (!command) return; if (!command) return;
try { try {
command.execute(interaction, client); command.execute(interaction, client, command);
} catch (error) { } catch (error) {
interaction.reply({ interaction.reply({
content: client.messages.runningCommandFailed, content: client.messages.runningCommandFailed,