From a7102acd6fda9168b057d90c961618aead034336 Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 10 Feb 2022 23:29:06 +0100 Subject: Fix: make /random ponies count towards stats --- commands/random.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'commands') 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: [ -- cgit