Updated error handling

This commit is contained in:
2024-01-09 14:44:01 +01:00
parent 60c655c334
commit 4090446dee
4 changed files with 70 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
embeds: [
{
title: "Command error occured",
description: String(error),
description: "```" + error + "```",
color: embedColor,
footer: {
icon_url: interaction.guild!.iconURL() || undefined,
@@ -61,10 +61,22 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
}
console.error(error)
await interaction.reply({
content: "There was an error while executing this command!",
ephemeral: true,
})
if (!interaction.deferred) {
await interaction.reply({
embeds: [{
description: "There was an error while executing this command!",
color: embedColor,
}],
ephemeral: true,
})
} else {
await interaction.editReply({
embeds: [{
description: "There was an error while executing this command!",
color: embedColor,
}]
})
}
}
})
}