2021-11-09 09:34:55 +01:00
|
|
|
module.exports = {
|
|
|
|
name: 'interactionCreate',
|
|
|
|
async execute(interaction) {
|
2021-11-10 00:49:27 +01:00
|
|
|
if(interaction.isButton()){
|
|
|
|
console.log(interaction);
|
|
|
|
interaction.reply({ content: `${interaction.user.tag} clicked me`, ephemeral : true });
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-11-09 09:34:55 +01:00
|
|
|
if (!interaction.isCommand()) return;
|
|
|
|
|
|
|
|
const command = interaction.client.commands.get(interaction.commandName);
|
|
|
|
|
|
|
|
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 });
|
|
|
|
} console.log(`${interaction.user.tag} in #${interaction.channel.name} triggered an interaction.`);
|
|
|
|
},
|
|
|
|
};
|