2022-06-17 01:25:05 +02:00
|
|
|
export default {
|
2022-06-16 09:18:39 +02:00
|
|
|
name: 'interactionCreate',
|
|
|
|
async execute(interaction) {
|
|
|
|
const client = interaction.client;
|
|
|
|
if (!interaction.isCommand()) return;
|
|
|
|
|
|
|
|
const command = client.commands.get(interaction.commandName);
|
|
|
|
|
2022-06-16 13:29:23 +02:00
|
|
|
console.log(`\x1b[33m${interaction.user.tag}\x1b[0m launched command \x1b[33m${interaction.commandName}\x1b[0m`);
|
|
|
|
|
2022-06-16 09:18:39 +02:00
|
|
|
if (!command) return;
|
|
|
|
|
|
|
|
try {
|
|
|
|
await command.execute(interaction);
|
|
|
|
}
|
|
|
|
catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|