Added interaction event handler

This commit is contained in:
2023-11-18 19:05:26 +01:00
parent 1befe97f90
commit 3d5c83ad63
4 changed files with 48 additions and 18 deletions

View File

@@ -0,0 +1,21 @@
module.exports = {
name: "logBtnsCmds",
description: "Logs all button and command interactions",
type: "interaction",
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */
execute(interaction) {
if (interaction.isCommand()) {
console.log(interaction.user.username + "#" +
interaction.user.discriminator + " ran " +
interaction.commandName
);
} else if (interaction.isButton()) {
console.log(interaction.user.username + "#" +
interaction.user.discriminator + " clicked " +
interaction.customId
);
}
}
}