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) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 7 | 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 | }); |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 17 | } else { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 18 | 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 | }); |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 28 | } |
| 29 | } |