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 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame^] | 3 | export const event = "commandError"; |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 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 | 41d9356 | 2022-07-30 22:10:15 +0100 | [diff] [blame] | 8 | .setTitle("Something went wrong") |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 9 | .setDescription(error.message ?? error.toString()) |
| 10 | .setStatus("Danger") |
| 11 | .setEmoji("CONTROL.BLOCKCROSS") |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame^] | 12 | ], ephemeral: true}); |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 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") |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame^] | 19 | ], ephemeral: true}); |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 20 | } |
| 21 | } |