From c7091d00115e8c6c04f82dff2b610731e8a7b5c4 Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Sun, 8 Aug 2021 16:35:34 +0200 Subject: [PATCH] no default reply when interaction already replied --- src/Command.ts | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/Command.ts b/src/Command.ts index cd8076f..d6a3a91 100644 --- a/src/Command.ts +++ b/src/Command.ts @@ -181,25 +181,16 @@ export class Command { embeds: [fnResult], }); } else { - interaction.replied - ? await interaction.editReply({ - embeds: [ - new MessageEmbed() - .setColor("#00ff00") - .setTitle( - "✅ Task completed successfully" - ), - ], - }) - : await interaction.reply({ - embeds: [ - new MessageEmbed() - .setColor("#00ff00") - .setTitle( - "✅ Task completed successfully" - ), - ], - }); + interaction.replied && + (await interaction.editReply({ + embeds: [ + new MessageEmbed() + .setColor("#00ff00") + .setTitle( + "✅ Task completed successfully" + ), + ], + })); } } catch (e) { console.error("[❌ ERROR] Cannot reply.", e);