blob: 8edb480858b44d63c456262baeaa4f7d117cd957 [file] [log] [blame]
pineafan4edb7762022-06-26 19:21:04 +01001import EmojiEmbed from "../utils/generateEmojiEmbed.js";
pineafan34369e62022-05-18 16:52:37 +01002
3export const event = 'commandError'
4
5export async function callback(client, interaction, error) {
6 if (interaction.replied || interaction.deferred) {
pineafan4edb7762022-06-26 19:21:04 +01007 await interaction.followUp({embeds: [new EmojiEmbed()
pineafan34369e62022-05-18 16:52:37 +01008 .setTitle("Something went wrong")
9 .setDescription(error.message ?? error.toString())
10 .setStatus("Danger")
11 .setEmoji("CONTROL.BLOCKCROSS")
12 ], ephemeral: true})
13 } else {
pineafan4edb7762022-06-26 19:21:04 +010014 await interaction.reply({embeds: [new EmojiEmbed()
pineafan34369e62022-05-18 16:52:37 +010015 .setTitle("Something went wrong")
16 .setDescription(error.message ?? error.toString())
17 .setStatus("Danger")
18 .setEmoji("CONTROL.BLOCKCROSS")
19 ], ephemeral: true})
20 }
21}