Adding command logger

This commit is contained in:
2023-05-24 22:22:24 +02:00
parent 9b27f861e1
commit e7d43697b3
2 changed files with 152 additions and 142 deletions

View File

@@ -164,6 +164,17 @@ for (const file of modalFiles) {
console.log(`[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`);
}
}
client.on(Events.InteractionCreate, async 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);
}
});
client.on(Events.ClientReady, () => {
console.log("Logged in as " + client.user.tag + "!");
const channel = client.channels.cache.get(botLogChannel);