Typescript Continue

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

View File

@ -1,15 +1,9 @@
import RadioClient from "../../Client";
import { command } from "../commands";
export default function check(client: RadioClient, interaction: any, command: any) {
export default function check(client: RadioClient, interaction: any, command: command) {
let message: any = {};
const radio = client.radio?.get(interaction.guild.id);
if(client.config.maintenanceMode){
interaction.reply({
content: client.messageEmojis["error"] + client.messages.maintenance,
ephemeral: true
});
return false;
}
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
interaction.reply({

View File

@ -1,5 +1,5 @@
export default function logger(area : string, text: string){
export default function logger(area: string, text?: string){
let date = new Date();
console.log('[' + area + '] - ' + date.toISOString());
if(text) console.log(text + '\n');
if(text) console.log(text + '\n');
}

View File

@ -15,7 +15,7 @@ export default async function play(client: RadioClient, interaction: any, guild:
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
const embed = new EmbedBuilder()
.setTitle(client.user.username)
.setTitle(client.user?.username || "-")
.setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, '')))
.setColor(client.config.embedColor as ColorResolvable)
.addFields({