fix: Additional handling of autocomplete interaction errors

This commit is contained in:
Marius Begby committed 2023-07-25 08:44:36 +02:00
1 parent 412116b4d7
commit 524b4d2f30
2 files changed
+15 -1

No files matched your search

+4
View File
@@ -41,6 +41,10 @@ module.exports = {
value: track.url
}));
if (!interaction.isRepliable() || interaction.responded()) {
return;
}
return interaction.respond(response);
},
execute: async ({ interaction }) => {
+11 -1
View File
@@ -66,7 +66,7 @@ module.exports = {
.setColor(embedOptions.colors.error)
]
});
} else {
} else if (interaction.deferred) {
await interaction.editReply({
embeds: [
new EmbedBuilder()
@@ -76,6 +76,16 @@ module.exports = {
.setColor(embedOptions.colors.error)
]
});
} else {
await interaction.reply({
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nThere was an unexpected error while trying to execute this command.\n\nYou can try to perform the command again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
)
.setColor(embedOptions.colors.error)
]
});
}
}
}