refactor(events/interaction): adding the tsconfig + eslint correction
This commit is contained in:
parent
6d9ee2f966
commit
c807c12d01
1 changed files with 2 additions and 10 deletions
|
|
@ -6,20 +6,12 @@ export default {
|
||||||
async execute(interaction: Interaction) {
|
async execute(interaction: Interaction) {
|
||||||
if (!interaction.isChatInputCommand()) return;
|
if (!interaction.isChatInputCommand()) return;
|
||||||
const command: CommandInteraction = interaction.client.commands.get(interaction.commandName);
|
const command: CommandInteraction = interaction.client.commands.get(interaction.commandName);
|
||||||
if (!command) {
|
|
||||||
console.error(`⚠️ | Can't execute ${interaction.commandName}`);
|
|
||||||
await interaction.reply({
|
|
||||||
content: `${emoji.answer.error} | Cannot execute the command ${interaction.commandName}`,
|
|
||||||
flags: MessageFlags.Ephemeral,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
await command.execute(interaction);
|
await command.execute(interaction);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (err) {
|
||||||
console.error(
|
console.error(
|
||||||
`⚠️ | Error when occured this command ${interaction.commandName}\n\t${error}`,
|
`⚠️ | Error when occured this command ${interaction.commandName}\n\t${err as Error}`,
|
||||||
);
|
);
|
||||||
if (interaction.replied || interaction.deferred) {
|
if (interaction.replied || interaction.deferred) {
|
||||||
await interaction.followUp({
|
await interaction.followUp({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue