blob: e7d9bf587fed5fd0e8b9cb51f0c71dc9ac8f2dc4 [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
});
}
}