From cfd760936c81274d50869fe4292d92b858af49e3 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 3 Jul 2022 21:06:34 +0200 Subject: [PATCH] Add interaction event --- src/events/interactions/interactionCreate.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/events/interactions/interactionCreate.js diff --git a/src/events/interactions/interactionCreate.js b/src/events/interactions/interactionCreate.js new file mode 100644 index 0000000..bfc98af --- /dev/null +++ b/src/events/interactions/interactionCreate.js @@ -0,0 +1,13 @@ +export default (interaction, client) => { + if (interaction.isCommand()) { + const command = client.commands.get(interaction.commandName); + if (!command) { + return interaction.reply({ + content: 'Désolé la commande n\'existe probablement plus...', + ephemeral: true, + }); + } + + return command.interaction(interaction, client); + } +};