Fix logging

This commit is contained in:
Marius Begby committed 2023-07-05 10:14:55 +02:00
1 parent 6cf29ae5d2
commit 2e60abde52
1 file changed
+3 -6
+3 -6
View File
@@ -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.`
);
}
});