Add slash commands support #20
1 changed files with 13 additions and 0 deletions
13
src/events/interactions/interactionCreate.js
Normal file
13
src/events/interactions/interactionCreate.js
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue