Merge pull request #117 from mariusbegby/interaction-not-replied

fix: Possibly fix interaction not reply errors
This commit is contained in:
Marius Begby authored and GitHub committed 2023-07-25 08:37:27 +02:00
commit 412116b4d7
1 file changed
+12
@@ -56,6 +56,7 @@ module.exports = {
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' failed to execute.` `[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' failed to execute.`
); );
if (interaction.replied) {
await interaction.followUp({ await interaction.followUp({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
@@ -65,6 +66,17 @@ module.exports = {
.setColor(embedOptions.colors.error) .setColor(embedOptions.colors.error)
] ]
}); });
} else {
await interaction.editReply({
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)
]
});
}
} }
} }
} }