Holana/events/discord/interactionCreate.js

15 lines
503 B
JavaScript
Raw Normal View History

2023-04-29 09:59:08 +00:00
module.exports = (client, interaction) => {
// Check if our interaction is a slash command
if (interaction.isCommand()) {
// Get the command from our slash command collection
const command = client.interactions.get(interaction.commandName);
// If command does not exist return an error message
if (!command) return interaction.reply({
content: "Something Went Wrong | Perhaps command not registered?",
ephemeral: true
});
command.run(client, interaction);
}
}