pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame^] | 1 | import generateEmojiEmbed from "../utils/generateEmojiEmbed.js"; |
| 2 | |
| 3 | export const event = 'commandError' |
| 4 | |
| 5 | export 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 | } |