diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/embed.js | 24 | ||||
-rw-r--r-- | modules/registers.js | 3 |
2 files changed, 23 insertions, 4 deletions
diff --git a/modules/embed.js b/modules/embed.js index dd846fe..49ab4a3 100644 --- a/modules/embed.js +++ b/modules/embed.js @@ -1,7 +1,10 @@ const { MessageEmbed } = require("discord.js"); +const fs = require('fs'); const data = require('../data/data.json'); -module.exports = (page, id, gid) => { +const cuties = fs.readFileSync("./config/cuties.txt").toString(); + +module.exports = (page, id, gid, isPublic, user) => { if (typeof data[page] === "undefined") { return false; } @@ -34,6 +37,12 @@ module.exports = (page, id, gid) => { sign = "🦄"; break; + case "Scootaloo": + case "Apple Bloom": + case "Sweetie Belle": + sign = cuties.trim(); + break; + default: sign = ""; break; @@ -179,18 +188,25 @@ module.exports = (page, id, gid) => { { name: l("Kind", "Type", id, gid), value: kind, inline: true }, ]; - if (spoils[id] === 1) { + if (spoils[id] === 1 && !isPublic) { fields.push( { name: l("Occupation(s)", "Occupation(s)", id, gid), value: "(" + l("spoilers", "révélations", id, gid) + ")\n||" + jobs + "||", inline: true }, { name: l("Home(s)", "Résidence(s)", id, gid), value: "(" + l("spoilers", "révélations", id, gid) + ")\n||" + location + "||", inline: true } ) - } else if (spoils[id] === 2) { + } else if (spoils[id] === 2 && !isPublic) { fields.push( { name: l("Occupation(s)", "Occupation(s)", id, gid), value: jobs, inline: true }, { name: l("Home(s)", "Résidence(s)", id, gid), value: location, inline: true } ) } + let footer = ""; + if (isPublic) { + footer = l("Content provided without warranty, use at your own risk.\nRequested by " + user.tag, "Contenu fourni sans aucune garantie, utilisez à vos risques et périls\nDemandé par " + user.tag, id, gid) + } else { + footer = l("Content provided without warranty, use at your own risk.", "Contenu fourni sans aucune garantie, utilisez à vos risques et périls", id, gid) + } + return new MessageEmbed() .setColor(d.color.length === 6 ? d.color : "ffffff") .setTitle(page + " " + sign) @@ -198,5 +214,5 @@ module.exports = (page, id, gid) => { .setImage(d.image) .setThumbnail(d.mark) .addFields(fields) - .setFooter(l("Content provided without warranty, use at your own risk.", "Contenu fourni sans aucune garantie, utilisez à vos risques et périls", id, gid)) + .setFooter({ text: footer }) }
\ No newline at end of file diff --git a/modules/registers.js b/modules/registers.js index a1cf4b5..001735f 100644 --- a/modules/registers.js +++ b/modules/registers.js @@ -21,6 +21,9 @@ module.exports = [ .setName('info') .setDescription("Gets stats and info about the bot"), new SlashCommandBuilder() + .setName('help') + .setDescription("Gets help about how to use the bot"), + new SlashCommandBuilder() .setName('random') .setDescription("Picks a random pony"), // new SlashCommandBuilder() |