diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/episode.js | 17 | ||||
-rw-r--r-- | commands/info.js | 2 |
2 files changed, 18 insertions, 1 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 diff --git a/commands/info.js b/commands/info.js index 77082bf..47d290a 100644 --- a/commands/info.js +++ b/commands/info.js @@ -76,7 +76,7 @@ module.exports = async (interaction) => { } let fields = [ - { name: l("Software version", "Version du logiciel", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: "v" + fs.readFileSync("./config/version.txt").toString().trim() + "." + fs.readFileSync("./.git/refs/heads/trunk").toString().substr(0, 8) + suffix + " (#" + client.shard.count + ")", inline: false }, + { name: l("Software version", "Version du logiciel", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: "v" + fs.readFileSync("./config/version.txt").toString().trim() + "." + fs.readFileSync("./.git/refs/heads/trunk").toString().substring(0, 8) + suffix + " (#" + client.shard.count + ")", inline: false }, { name: l("Kernel version", "Version du noyau", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: process.version, inline: true }, { name: l("Experience channel", "Canal d'expériences", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: channel, inline: true }, { name: l("Known ponies", "Poneys connus", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: Object.keys(JSON.parse(fs.readFileSync("./data/data.json").toString())).length.toString(), inline: true }, |