aboutsummaryrefslogtreecommitdiff
path: root/handler/command.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-02-10 23:17:10 +0100
committerMinteck <contact@minteck.org>2022-02-10 23:17:10 +0100
commit11995e8d8d4c97e5c17bf11d8238f42ea269dd26 (patch)
treeb0225886782c701f701b2b1f8e136d2de69d66bb /handler/command.js
parent38a17a51fd082c0f893e4d9f8a99330b073a2ade (diff)
downloadponyfind-11995e8d8d4c97e5c17bf11d8238f42ea269dd26.tar.gz
ponyfind-11995e8d8d4c97e5c17bf11d8238f42ea269dd26.tar.bz2
ponyfind-11995e8d8d4c97e5c17bf11d8238f42ea269dd26.zip
Feature: add many statistics (#3)
Diffstat (limited to 'handler/command.js')
-rw-r--r--handler/command.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/handler/command.js b/handler/command.js
index 1447332..3869c6d 100644
--- a/handler/command.js
+++ b/handler/command.js
@@ -19,6 +19,14 @@ const commandPony = require('../commands/pony');
const commandHelp = require('../commands/help');
module.exports = async (interaction) => {
+ console.log(interaction.user.tag + " (" + interaction.user.id + ") used command /" + interaction.commandName);
+ if (statsCommands[interaction.commandName] !== undefined) {
+ statsCommands[interaction.commandName]++;
+ } else {
+ statsCommands[interaction.commandName] = 1;
+ }
+ fs.writeFile("./stats/commands.json", JSON.stringify(statsCommands), () => {});
+
if (interaction.commandName === 'random') {
await commandRandom(interaction);
}