diff --git a/src/client/commands.ts b/src/client/commands.ts index 5874489..56814a3 100644 --- a/src/client/commands.ts +++ b/src/client/commands.ts @@ -6,7 +6,6 @@ import invite from "./commands/invite"; import list from "./commands/list"; import maintenance from "./commands/maintenance"; import next from "./commands/next"; -import nowplaying from "./commands/nowplaying"; import play from "./commands/play"; import prev from "./commands/prev"; import statistics from "./commands/statistics"; @@ -22,7 +21,7 @@ export interface command { } export default async function commands(client: RadioClient) { - const commands : command[] = [ bug, help, invite, list, maintenance, next, nowplaying, play, prev, statistics, status, stop ]; + const commands : command[] = [ bug, help, invite, list, maintenance, next, play, prev, statistics, status, stop ]; for(const command of commands){ client.commands.set(command.name, command); diff --git a/src/client/commands/nowplaying.ts b/src/client/commands/nowplaying.ts deleted file mode 100644 index 4bfcf97..0000000 --- a/src/client/commands/nowplaying.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ButtonInteraction, ChatInputCommandInteraction, EmbedBuilder, StringSelectMenuInteraction } from "discord.js"; -import RadioClient from "../../Client"; -import { command } from "../commands"; - -export default { - name: 'nowplaying', - description: 'Current Radio Station', - 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); - - let date = new Date(); - radio.currentTime = date.getTime(); - radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime); - const completed = (radio.playTime); - - if(radio.station?.playlist?.type == "supla" || radio.station?.playlist?.type == "yle"){ - let playlist: any = await fetch(radio.station.playlist.address) - .then((response: Response) => response.json()) - .catch(error => { - }); - try { - switch(radio.station?.playlist.type){ - case "supla": - radio.station.track = "__" + playlist.items[0]?.artist + "__" + "\n" + playlist.items[0]?.song; - break; - case "yle": - radio.station.track = "-"; - break; - default: - radio.station.track = "-"; - } - } catch(TypeError) { - - } - } - - const embed = new EmbedBuilder() - .setTitle(client.messages.nowplayingTitle) - .setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messages.emojis["play"].replace(/[^0-9]+/g, ''))) - .setColor(client.config.embedColor) - .setDescription(client.messages.replace(client.messages.nowplayingDescription, { - "%radio.station.name%": radio.station.name, - "%radio.station.owner%\n": radio.station.name != radio.station.owner ? radio.station.owner + "\n" : "", - "%client.funcs.msToTime(completed)%": client.funcs.msToTime(completed), - "\n\n%radio.station.track%": radio.station.track != undefined ? "\n\n" + radio.station.track : "" - })) - .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') - .setFooter({ - text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') - }); - - interaction.reply({ - embeds: [embed], - ephemeral: true - }); - } - } -}; diff --git a/src/client/commands/stop.ts b/src/client/commands/stop.ts index aa15563..18276be 100644 --- a/src/client/commands/stop.ts +++ b/src/client/commands/stop.ts @@ -18,7 +18,7 @@ export default { .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["stop"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor) .addFields({ - name: client.messages.nowplayingTitle, + name: client.messages.playTitle1, value: "-" }) .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')