pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 1 | import EmojiEmbed from "../utils/generateEmojiEmbed.js"; |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 2 | |
| 3 | export const event = 'commandError' |
| 4 | |
| 5 | export async function callback(client, interaction, error) { |
| 6 | if (interaction.replied || interaction.deferred) { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 7 | await interaction.followUp({embeds: [new EmojiEmbed() |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 8 | .setTitle("Something went") |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 9 | .setDescription(error.message ?? error.toString()) |
| 10 | .setStatus("Danger") |
| 11 | .setEmoji("CONTROL.BLOCKCROSS") |
| 12 | ], ephemeral: true}) |
| 13 | } else { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 14 | await interaction.reply({embeds: [new EmojiEmbed() |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 15 | .setTitle("Something went wrong") |
| 16 | .setDescription(error.message ?? error.toString()) |
| 17 | .setStatus("Danger") |
| 18 | .setEmoji("CONTROL.BLOCKCROSS") |
| 19 | ], ephemeral: true}) |
| 20 | } |
| 21 | } |