aboutsummaryrefslogtreecommitdiff
path: root/handler
diff options
context:
space:
mode:
Diffstat (limited to 'handler')
-rw-r--r--handler/button.js7
-rw-r--r--handler/command.js8
-rw-r--r--handler/menu.js7
3 files changed, 22 insertions, 0 deletions
diff --git a/handler/button.js b/handler/button.js
index 30a8e58..7f5893f 100644
--- a/handler/button.js
+++ b/handler/button.js
@@ -7,6 +7,13 @@ const getEmbed = require("../modules/embed");
module.exports = async (interaction) => {
keys = interaction.customId.split("|")
+ console.log(interaction.user.tag + " (" + interaction.user.id + ") pressed button " + keys[0]);
+ if (statsButtons[keys[0]] !== undefined) {
+ statsButtons[keys[0]]++;
+ } else {
+ statsButtons[keys[0]] = 1;
+ }
+ fs.writeFile("./stats/buttons.json", JSON.stringify(statsButtons), () => {});
if (keys[0] === "pony.display") {
let row;
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);
}
diff --git a/handler/menu.js b/handler/menu.js
index 6552735..1102b9e 100644
--- a/handler/menu.js
+++ b/handler/menu.js
@@ -3,6 +3,13 @@ const { MessageActionRow, MessageButton, MessageSelectMenu, MessageEmbed } = req
module.exports = async (interaction) => {
keys = interaction.values[0].split("|")
+ console.log(interaction.user.tag + " (" + interaction.user.id + ") selected menu item " + keys[0]);
+ if (statsMenu[keys[0]] !== undefined) {
+ statsMenu[keys[0]]++;
+ } else {
+ statsMenu[keys[0]] = 1;
+ }
+ fs.writeFile("./stats/menu.json", JSON.stringify(statsMenu), () => {});
if (keys[0].startsWith("report.issue.")) {
item = keys[0].substr(13)