aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-02-10 23:29:06 +0100
committerMinteck <contact@minteck.org>2022-02-10 23:29:06 +0100
commita7102acd6fda9168b057d90c961618aead034336 (patch)
tree3db90ae0fe6f78352607d838e29dbf0ba083e09a /commands
parenta7d6b3f75056445d86fbf1cdbc4b4b9d9194e8dc (diff)
downloadponyfind-a7102acd6fda9168b057d90c961618aead034336.tar.gz
ponyfind-a7102acd6fda9168b057d90c961618aead034336.tar.bz2
ponyfind-a7102acd6fda9168b057d90c961618aead034336.zip
Fix: make /random ponies count towards stats
Diffstat (limited to 'commands')
-rw-r--r--commands/random.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/random.js b/commands/random.js
index 9ac50e2..3769552 100644
--- a/commands/random.js
+++ b/commands/random.js
@@ -16,6 +16,12 @@ module.exports = async (interaction) => {
null,
list[Math.floor(Math.random() * list.length)]
]
+ if (statsPonies[keys[1]] !== undefined) {
+ statsPonies[keys[1]]++;
+ } else {
+ statsPonies[keys[1]] = 1;
+ }
+ fs.writeFile("./stats/ponies.json", JSON.stringify(statsPonies), () => {});
await interaction.reply({
ephemeral: interaction.guild !== null,
embeds: [