diff options
author | Minteck <contact@minteck.org> | 2022-02-13 16:16:18 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-02-13 16:16:18 +0100 |
commit | 327119b4d1c2248b8a075cad3cd05ab92560e75d (patch) | |
tree | ce143399e74c120f7311e75490efd0defd9b58d8 /commands/episode.js | |
parent | ede8d0750f3f16e3ba5c3c3f716c98d267512b09 (diff) | |
download | ponyfind-327119b4d1c2248b8a075cad3cd05ab92560e75d.tar.gz ponyfind-327119b4d1c2248b8a075cad3cd05ab92560e75d.tar.bz2 ponyfind-327119b4d1c2248b8a075cad3cd05ab92560e75d.zip |
Feature: implements #8, voids #9
Diffstat (limited to 'commands/episode.js')
-rw-r--r-- | commands/episode.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/commands/episode.js b/commands/episode.js new file mode 100644 index 0000000..bf5b9f2 --- /dev/null +++ b/commands/episode.js @@ -0,0 +1,17 @@ +const fs = require('fs'); +const { MessageActionRow, MessageButton, MessageSelectMenu, MessageEmbed } = require('discord.js'); + +const getEpisodePublic = require("../modules/episodepublic"); +const episodeReply = require("../modules/episodereply"); + +const series = JSON.parse(fs.readFileSync("./data/series.json").toString()); + +module.exports = async (interaction) => { + let select = interaction.options.getSubcommand(); + let episode = interaction.options.getString('episode').toLowerCase(); + + let sdata = series.filter(i => i.command.toLowerCase() === select)[0]; + if (typeof episode === "string") { + await episodeReply(interaction, select, episode, sdata); + } +}
\ No newline at end of file |