blob: ce50122922d77487c7f2cf1a4210d40bee41ba8c [file] [log] [blame]
pineafan4edb7762022-06-26 19:21:04 +01001import EmojiEmbed from "../utils/generateEmojiEmbed.js";
pineafan34369e62022-05-18 16:52:37 +01002
pineafan63fc5e22022-08-04 22:04:10 +01003export const event = "commandError";
pineafan34369e62022-05-18 16:52:37 +01004
5export async function callback(client, interaction, error) {
6 if (interaction.replied || interaction.deferred) {
Skyler Grey75ea9172022-08-06 10:22:23 +01007 await interaction.followUp({
8 embeds: [
9 new EmojiEmbed()
10 .setTitle("Something went wrong")
11 .setDescription(error.message ?? error.toString())
12 .setStatus("Danger")
13 .setEmoji("CONTROL.BLOCKCROSS")
14 ],
15 ephemeral: true
16 });
pineafan34369e62022-05-18 16:52:37 +010017 } else {
Skyler Grey75ea9172022-08-06 10:22:23 +010018 await interaction.reply({
19 embeds: [
20 new EmojiEmbed()
21 .setTitle("Something went wrong")
22 .setDescription(error.message ?? error.toString())
23 .setStatus("Danger")
24 .setEmoji("CONTROL.BLOCKCROSS")
25 ],
26 ephemeral: true
27 });
pineafan34369e62022-05-18 16:52:37 +010028 }
29}