fix(bots/discord): follow-up if reply is already sent when error

This commit is contained in:
PalmDevs
2024-06-24 20:20:45 +07:00
parent 9dea90712e
commit f75060bc9c

View File

@@ -72,7 +72,7 @@ export default on('interactionCreate', async (context, interaction) => {
await command.execute(context, interaction)
} catch (err) {
logger.error(`Error while executing command ${interaction.commandName}:`, err)
await interaction.reply({
await interaction[interaction.replied ? 'followUp' : 'reply']({
embeds: [err instanceof CommandError ? err.toEmbed() : createStackTraceEmbed(err)],
ephemeral: true,
})