interaction closing

This commit is contained in:
mmacierzanka committed 2021-08-07 17:33:18 +02:00
1 parent 6fd5e8b892
commit 62a4bc35c8
1 file changed
+16
+16
View File
@@ -131,6 +131,22 @@ export class Command {
await interaction.reply(fnResult); await interaction.reply(fnResult);
} else if (fnResult instanceof MessageEmbed) { } else if (fnResult instanceof MessageEmbed) {
await interaction.reply({ embeds: [fnResult] }); 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 { } else {