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