mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Fix logging
This commit is contained in:
1 parent
6cf29ae5d2
commit
2e60abde52
1 file changed
+3
-6
@@ -69,11 +69,12 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
const command = client.commands.get(interaction.commandName);
|
const command = client.commands.get(interaction.commandName);
|
||||||
if (!command) return;
|
if (!command) return;
|
||||||
|
|
||||||
console.log(`Command '/${interaction.commandName}' was used.`);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
await command.run({ client, interaction });
|
await command.run({ client, interaction });
|
||||||
|
console.log(
|
||||||
|
`Command '/${interaction.commandName}' was executed successfully.`
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
console.log(
|
console.log(
|
||||||
@@ -84,10 +85,6 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
content: 'There was an error while executing this command!',
|
content: 'There was an error while executing this command!',
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
} finally {
|
|
||||||
console.log(
|
|
||||||
`Command '/${interaction.commandName}' was executed successfully.`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user