From 2e60abde5246de8c78be8bc4b17a6204177bcb3c Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Wed, 5 Jul 2023 10:14:55 +0200 Subject: [PATCH] Fix logging --- index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 6a552eb..d4682d2 100644 --- a/index.js +++ b/index.js @@ -69,11 +69,12 @@ client.on('interactionCreate', async (interaction) => { const command = client.commands.get(interaction.commandName); if (!command) return; - console.log(`Command '/${interaction.commandName}' was used.`); - try { await interaction.deferReply(); await command.run({ client, interaction }); + console.log( + `Command '/${interaction.commandName}' was executed successfully.` + ); } catch (error) { console.error(error); console.log( @@ -84,10 +85,6 @@ client.on('interactionCreate', async (interaction) => { content: 'There was an error while executing this command!', ephemeral: true }); - } finally { - console.log( - `Command '/${interaction.commandName}' was executed successfully.` - ); } });