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',
permission: 'none',
category: 'info',
async execute(interaction, client) {
let message = {};
async execute(interaction, client, command) {
if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({
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
});
}
console.log(client.stations.find(station => station.name == radio.station.name));
}
}
}

View File

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

View File

@ -4,20 +4,9 @@ module.exports = {
permission: 'none',
category: 'info',
async execute(interaction, client) {
let message = {};
if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({
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
});
}
console.log(client.stations.find(station => station.name == radio.station.name));
}
}
}

View File

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

View File

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