From f75060bc9cda44902cf872def73c116a6df039d7 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Mon, 24 Jun 2024 20:20:45 +0700 Subject: [PATCH] fix(bots/discord): follow-up if reply is already sent when error --- .../src/events/discord/interactionCreate/chat-commmand.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/discord/src/events/discord/interactionCreate/chat-commmand.ts b/bots/discord/src/events/discord/interactionCreate/chat-commmand.ts index 0cfb65e..79d262a 100644 --- a/bots/discord/src/events/discord/interactionCreate/chat-commmand.ts +++ b/bots/discord/src/events/discord/interactionCreate/chat-commmand.ts @@ -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, })