Typescript Continue

This commit is contained in:
Christer Warén committed 2023-06-06 01:39:35 +03:00
1 parent 7acabe411b
commit 2d17c33d21
32 files changed
+233 -149

No files matched your search

+9 -3
View File
@@ -1,6 +1,7 @@
import { ButtonInteraction, ChatInputCommandInteraction, StringSelectMenuInteraction } from "discord.js";
import RadioClient from "../../Client";
import { command } from "../commands";
import { station } from "../classes/Stations"
export default {
name: 'prev',
@@ -8,9 +9,14 @@ export default {
category: 'radio',
async execute(interaction: ButtonInteraction | ChatInputCommandInteraction | StringSelectMenuInteraction, client: RadioClient, command: command) {
if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id);
const radio = client.radio?.get(interaction.guild?.id);
let index = client.stations.findIndex((station: { name: any; }) => station.name == radio.station.name) - 1;
if(!client.stations) return interaction.reply({
content: client.messageEmojis["error"] + client.messages.maintenance,
ephemeral: true
});
let index = client.stations.findIndex((station: station) => station.name == radio.station.name) - 1;
if(index == -1) index = client.stations.length - 1;
let station = client.stations[index];
@@ -20,7 +26,7 @@ export default {
ephemeral: true
});
client.statistics.update(client, interaction.guild, radio);
client.statistics?.update(client, interaction.guild, radio);
let date = new Date();
radio.station = station;