From 182b5f0f707d934b9ba63fae2499a2a33b8ce56c Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 10 Feb 2022 23:19:40 +0100 Subject: Fix: #3 not counting ponies --- commands/pony.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'commands') diff --git a/commands/pony.js b/commands/pony.js index 1cd6006..4654b12 100644 --- a/commands/pony.js +++ b/commands/pony.js @@ -26,6 +26,12 @@ module.exports = async (interaction) => { fs.writeFile("./stats/queries.json", JSON.stringify(statsQueries), () => {}); if (result.results[0].toLowerCase().trim() === query.toLowerCase().trim()) { keys = [null, result.results[0]]; + if (statsPonies[keys[1]] !== undefined) { + statsPonies[keys[1]]++; + } else { + statsPonies[keys[1]] = 1; + } + fs.writeFile("./stats/ponies.json", JSON.stringify(statsPonies), () => {}); if (interaction.guild) { row = new MessageActionRow() .addComponents( -- cgit