| 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 |
| }); |
| } |
| } |