aboutsummaryrefslogtreecommitdiff
path: root/commands/episode.js
blob: bf5b9f2975ea267702f59fbee474b4c40786ada9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
    }
}