aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/episode.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/commands/episode.js b/commands/episode.js
index bf5b9f2..d6113a4 100644
--- a/commands/episode.js
+++ b/commands/episode.js
@@ -10,6 +10,13 @@ module.exports = async (interaction) => {
let select = interaction.options.getSubcommand();
let episode = interaction.options.getString('episode').toLowerCase();
+ if (statsEpisodes[select + "-" + episode] !== undefined) {
+ statsEpisodes[select + "-" + episode]++;
+ } else {
+ statsEpisodes[select + "-" + episode] = 1;
+ }
+ fs.writeFile("./stats/episodes.json", JSON.stringify(statsEpisodes), () => {});
+
let sdata = series.filter(i => i.command.toLowerCase() === select)[0];
if (typeof episode === "string") {
await episodeReply(interaction, select, episode, sdata);