From 62a4bc35c8c3877a814217a78966ff827717e1c0 Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Sat, 7 Aug 2021 17:33:18 +0200 Subject: [PATCH] interaction closing --- src/Command.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Command.ts b/src/Command.ts index 07fc22f..0ea5ec3 100644 --- a/src/Command.ts +++ b/src/Command.ts @@ -131,6 +131,22 @@ export class Command { await interaction.reply(fnResult); } else if (fnResult instanceof MessageEmbed) { await interaction.reply({ embeds: [fnResult] }); + } else if (!interaction.replied) { + try { + await interaction.reply({ + embeds: [ + new MessageEmbed() + .setColor("#00ff00") + .setTitle( + "✅ Task completed successfully" + ), + ], + }); + } catch (e) { + console.log( + "Cannot reply. The interaction has been closed" + ); + } } } } else {