blob: ff5f4ae8c95f3b88f7c0974750bf6df2f4afda60 [file] [log] [blame]
import type { ButtonInteraction, ContextMenuCommandInteraction } from 'discord.js';
import type { CommandInteraction } from 'discord.js';
import type { NucleusClient } from "../utils/client.js";
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
export const event = "commandError";
export async function callback(_: NucleusClient, interaction: CommandInteraction | ButtonInteraction | ContextMenuCommandInteraction, error: string) {
const embed = new EmojiEmbed()
.setTitle("Something went wrong")
.setDescription(error)
.setStatus("Danger")
.setEmoji("CONTROL.BLOCKCROSS")
if (interaction.replied || interaction.deferred) {
await interaction.followUp({
embeds: [embed],
ephemeral: true
});
} else {
await interaction.reply({
embeds: [embed],
ephemeral: true
});
}
}