mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
fix: removed not needed try catch for executing commands
This commit is contained in:
1 parent
96ae6b715f
commit
84056d7036
1 file changed
+4
-22
@@ -80,11 +80,7 @@ export default async function interactionCreate(
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (command.autocomplete) command.autocomplete(interaction);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
if (command.autocomplete) command.autocomplete(interaction);
|
||||
} else if (interaction.isChatInputCommand()) {
|
||||
const command = commandCollection.get(interaction.commandName);
|
||||
|
||||
@@ -95,22 +91,8 @@ export default async function interactionCreate(
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await interaction.deferReply();
|
||||
console.log(interaction.toString());
|
||||
command.execute(interaction);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
if (interaction.replied || interaction.deferred) {
|
||||
await interaction.followUp({
|
||||
content: 'There was an error while executing this command!',
|
||||
ephemeral: true,
|
||||
});
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
content: 'There was an error while executing this command!',
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log(interaction.toString());
|
||||
await interaction.deferReply();
|
||||
command.execute(interaction);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user