Added interaction event handler
This commit is contained in:
21
events/interactions/logBtnsCmds.js
Normal file
21
events/interactions/logBtnsCmds.js
Normal 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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user