solve build errors

This commit is contained in:
Marius Begby committed 2023-08-31 13:46:25 +02:00
1 parent d81fc1d2e7
commit 775d942e2d
16 files changed
+60 -75

No files matched your search

+12 -3
View File
@@ -1,4 +1,4 @@
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { ApplicationCommandOption, ApplicationCommandOptionData, EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { ExtendedClient } from '../../../types/clientTypes';
import {
BaseSlashCommandInteraction,
@@ -50,8 +50,17 @@ class ReloadCommand extends BaseSlashCommandInteraction {
});
}
const commands: string[] | undefined = client!.commands?.map((command) => {
const params: string = command.data.options[0] ? `**\`${command.data.options[0].name}\`**` + ' ' : '';
const commands: string[] | undefined = client!.commands?.map((command: BaseSlashCommandInteraction) => {
let params: string = '';
if (command.data.options && command.data.options.length > 1) {
const options = command.data.options as unknown as ApplicationCommandOptionData[];
options.map((option: ApplicationCommandOption) => {
params += `**\`${option.name}\`**` + ' ';
});
}
return `- **\`/${command.data.name}\`** ${params}- ${command.data.description}`;
});