mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 19:49:50 +01: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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (command.autocomplete) command.autocomplete(interaction);
|
||||||
if (command.autocomplete) command.autocomplete(interaction);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
} else if (interaction.isChatInputCommand()) {
|
} else if (interaction.isChatInputCommand()) {
|
||||||
const command = commandCollection.get(interaction.commandName);
|
const command = commandCollection.get(interaction.commandName);
|
||||||
|
|
||||||
@@ -95,22 +91,8 @@ export default async function interactionCreate(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
console.log(interaction.toString());
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
console.log(interaction.toString());
|
command.execute(interaction);
|
||||||
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!',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user