diff options
Diffstat (limited to 'modules')
-rwxr-xr-x[-rw-r--r--] | modules/embed.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/emoji.js | 74 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/episodepublic.js | 116 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/episodereply.js | 198 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/findepisode.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/findpony.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/generation.js | 88 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/help.js | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/icons.js | 80 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/kind.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/pixel.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/public.js | 80 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/registers.js | 216 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/result.js | 0 |
14 files changed, 429 insertions, 438 deletions
diff --git a/modules/embed.js b/modules/embed.js index 9766055..9766055 100644..100755 --- a/modules/embed.js +++ b/modules/embed.js diff --git a/modules/emoji.js b/modules/emoji.js index 3916a5e..34dfaaa 100644..100755 --- a/modules/emoji.js +++ b/modules/emoji.js @@ -1,38 +1,38 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -module.exports = (emoji, member, guild) => { - if (guild) { - let me = guild.me; - - if (guild.roles.everyone.permissions.has("USE_EXTERNAL_EMOJIS") && me.permissions.has("USE_EXTERNAL_EMOJIS")) { - return emoji; - } else { - return ""; - } - } else { - return emoji; - } +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+module.exports = (emoji, member, guild) => {
+ if (guild) {
+ let me = guild.me;
+
+ if (guild.roles.everyone.permissions.has("USE_EXTERNAL_EMOJIS") && me.permissions.has("USE_EXTERNAL_EMOJIS")) {
+ return emoji;
+ } else {
+ return "";
+ }
+ } else {
+ return emoji;
+ }
}
\ No newline at end of file diff --git a/modules/episodepublic.js b/modules/episodepublic.js index 1b1ac64..9690678 100644..100755 --- a/modules/episodepublic.js +++ b/modules/episodepublic.js @@ -1,59 +1,59 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -const {MessageButton} = require("discord.js"); - -module.exports = (interaction, series, episode) => { - let ep = episode.split("-")[1] - 1 + 1; - let se = episode.split("-")[0].substring(1) - 1 + 1; - - if (se > 3 || se === 3 && ep === 13) { - if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) { - return new MessageButton() - .setCustomId("episode.public.warn|" + series + "|" + episode) - .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("PRIMARY") - .setDisabled(true); - } else { - return new MessageButton() - .setCustomId("episode.public.warn|" + series + "|" + episode) - .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("PRIMARY") - } - } else { - if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) { - return new MessageButton() - .setCustomId("episode.public|" + series + "|" + episode) - .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("PRIMARY") - .setDisabled(true); - } else { - return new MessageButton() - .setCustomId("episode.public|" + series + "|" + episode) - .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("PRIMARY") - } - } +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+const {MessageButton} = require("discord.js");
+
+module.exports = (interaction, series, episode) => {
+ let ep = episode.split("-")[1] - 1 + 1;
+ let se = episode.split("-")[0].substring(1) - 1 + 1;
+
+ if (se > 3 || se === 3 && ep === 13) {
+ if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) {
+ return new MessageButton()
+ .setCustomId("episode.public.warn|" + series + "|" + episode)
+ .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ .setDisabled(true);
+ } else {
+ return new MessageButton()
+ .setCustomId("episode.public.warn|" + series + "|" + episode)
+ .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ }
+ } else {
+ if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) {
+ return new MessageButton()
+ .setCustomId("episode.public|" + series + "|" + episode)
+ .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id]))/1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ .setDisabled(true);
+ } else {
+ return new MessageButton()
+ .setCustomId("episode.public|" + series + "|" + episode)
+ .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ }
+ }
}
\ No newline at end of file diff --git a/modules/episodereply.js b/modules/episodereply.js index 3d60a0b..db1f340 100644..100755 --- a/modules/episodereply.js +++ b/modules/episodereply.js @@ -1,100 +1,100 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -const {MessageActionRow, MessageButton, MessageEmbed} = require("discord.js"); -const getEpisodePublic = require("./episodepublic"); -const fs = require("fs"); - -module.exports = async (interaction, series, episode, sdata, isPublic) => { - let sid = episode.split("-")[0]; - let spt = sid.substring(1); - let eid = episode.split("-")[1]; - let edata = sdata.seasons.filter(i => i.id === sid)[0].episodes.filter(i => i.local - 1 + 1 === eid - 1 + 1)[0]; - - let fields = [ - { name: l("Airing Date", "Date de diffusion", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.date_pre, inline: true }, - { name: l("Written by", "Écrit par", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.writer, inline: true }, - { name: l("Overall no.", "N° global", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.global + "/" + sdata.seasons.map(i => { return i.count }).reduce((a, b) => { return a + b; }), inline: true }, - { name: l("Season no.", "N° dans la saison", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.local + "/" + sdata.seasons.filter(i => i.id === sid)[0].count, inline: true }, - ] - - if (edata.characters.length > 0) { - fields.push({ name: l("Characters", "Personnages", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.characters.join("\n"), inline: true }); - } - - let row; - if (interaction.guild && !isPublic) { - row = new MessageActionRow() - .addComponents( - getEpisodePublic(interaction, series, episode), - new MessageButton() - .setLabel(l("Read More", "Lire plus", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("LINK") - .setURL("https://mlp.fandom.com/wiki/" + encodeURI(edata.name)), - new MessageButton() - .setCustomId("result.report|" + edata.name) - .setLabel(l("Report an issue", "Signaler un problème", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("DANGER") - ) - } else { - row = new MessageActionRow() - .addComponents( - new MessageButton() - .setLabel(l("Read More", "Lire plus", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("LINK") - .setURL("https://mlp.fandom.com/wiki/" + encodeURI(edata.name)), - new MessageButton() - .setCustomId("result.report|" + edata.name) - .setLabel(l("Report an issue", "Signaler un problème", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("DANGER") - ) - } - - let reply = { - embeds: [ - new MessageEmbed() - .setColor("DEFAULT") - .setAuthor({ name: l("Season", "Saison", interaction.user.id, interaction.guild ? interaction.guild.id : 0) + " " + spt + " " + l("Episode", "Épisode", interaction.user.id, interaction.guild ? interaction.guild.id : 0) + " " + eid }) - .setTitle(edata.name) - .setDescription(edata.plot) - .setImage(edata.cover) - .addFields(fields) - .setFooter({ text: l("Content provided without warranty, use at your own risk.", "Contenu fourni sans aucune garantie, utilisez à vos risques et périls", interaction.user.id, interaction.guild ? interaction.guild.id : 0) }) - ], - components: [ - row - ] - }; - - if (!isPublic) { - reply.ephemeral = interaction.guild !== null; - } - - if (isPublic) { - await interaction.channel.send(reply); - } else { - await interaction.reply(reply); - } +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+const {MessageActionRow, MessageButton, MessageEmbed} = require("discord.js");
+const getEpisodePublic = require("./episodepublic");
+const fs = require("fs");
+
+module.exports = async (interaction, series, episode, sdata, isPublic) => {
+ let sid = episode.split("-")[0];
+ let spt = sid.substring(1);
+ let eid = episode.split("-")[1];
+ let edata = sdata.seasons.filter(i => i.id === sid)[0].episodes.filter(i => i.local - 1 + 1 === eid - 1 + 1)[0];
+
+ let fields = [
+ { name: l("Airing Date", "Date de diffusion", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.date_pre, inline: true },
+ { name: l("Written by", "Écrit par", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.writer, inline: true },
+ { name: l("Overall no.", "N° global", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.global + "/" + sdata.seasons.map(i => { return i.count }).reduce((a, b) => { return a + b; }), inline: true },
+ { name: l("Season no.", "N° dans la saison", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.local + "/" + sdata.seasons.filter(i => i.id === sid)[0].count, inline: true },
+ ]
+
+ if (edata.characters.length > 0) {
+ fields.push({ name: l("Characters", "Personnages", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: edata.characters.join("\n"), inline: true });
+ }
+
+ let row;
+ if (interaction.guild && !isPublic) {
+ row = new MessageActionRow()
+ .addComponents(
+ getEpisodePublic(interaction, series, episode),
+ new MessageButton()
+ .setLabel(l("Read More", "Lire plus", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("LINK")
+ .setURL("https://mlp.fandom.com/wiki/" + encodeURI(edata.name)),
+ new MessageButton()
+ .setCustomId("result.report|" + edata.name)
+ .setLabel(l("Report an issue", "Signaler un problème", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("DANGER")
+ )
+ } else {
+ row = new MessageActionRow()
+ .addComponents(
+ new MessageButton()
+ .setLabel(l("Read More", "Lire plus", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("LINK")
+ .setURL("https://mlp.fandom.com/wiki/" + encodeURI(edata.name)),
+ new MessageButton()
+ .setCustomId("result.report|" + edata.name)
+ .setLabel(l("Report an issue", "Signaler un problème", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("DANGER")
+ )
+ }
+
+ let reply = {
+ embeds: [
+ new MessageEmbed()
+ .setColor("DEFAULT")
+ .setAuthor({ name: l("Season", "Saison", interaction.user.id, interaction.guild ? interaction.guild.id : 0) + " " + spt + " " + l("Episode", "Épisode", interaction.user.id, interaction.guild ? interaction.guild.id : 0) + " " + eid })
+ .setTitle(edata.name)
+ .setDescription(edata.plot)
+ .setImage(edata.cover)
+ .addFields(fields)
+ .setFooter({ text: l("Content provided without warranty, use at your own risk.", "Contenu fourni sans aucune garantie, utilisez à vos risques et périls", interaction.user.id, interaction.guild ? interaction.guild.id : 0) })
+ ],
+ components: [
+ row
+ ]
+ };
+
+ if (!isPublic) {
+ reply.ephemeral = interaction.guild !== null;
+ }
+
+ if (isPublic) {
+ await interaction.channel.send(reply);
+ } else {
+ await interaction.reply(reply);
+ }
}
\ No newline at end of file diff --git a/modules/findepisode.js b/modules/findepisode.js index 0c2313c..0c2313c 100644..100755 --- a/modules/findepisode.js +++ b/modules/findepisode.js diff --git a/modules/findpony.js b/modules/findpony.js index 15fd865..15fd865 100644..100755 --- a/modules/findpony.js +++ b/modules/findpony.js diff --git a/modules/generation.js b/modules/generation.js index 1f5553f..c2a2ea7 100644..100755 --- a/modules/generation.js +++ b/modules/generation.js @@ -1,45 +1,45 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -const fs = require('fs'); -const db = JSON.parse(fs.readFileSync("./data/data.json").toString()); - -const icons = require('./icons.js'); -const customEmoji = require("./emoji"); -const getKindIcon = require("./kind"); - -module.exports = (pony, uid, gid, member, guild) => { - sel = db[pony]; - switch (d.generation) { - case 4: - return customEmoji(icons.generations.g4, member, guild) + " " + l("Friendship is Magic", "Les amies c'est magique", uid, gid); - - case 5: - return customEmoji(icons.generations.g5, member, guild) + " " + l("A New Generation", "Nouvelle Génération", uid, gid); - - default: - return customEmoji(icons.generations.other, member, guild) + " " + l("Other/Unknown", "Autre/inconnu", uid, gid); - } +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+const fs = require('fs');
+const db = JSON.parse(fs.readFileSync("./data/data.json").toString());
+
+const icons = require('./icons.js');
+const customEmoji = require("./emoji");
+const getKindIcon = require("./kind");
+
+module.exports = (pony, uid, gid, member, guild) => {
+ sel = db[pony];
+ switch (d.generation) {
+ case 4:
+ return customEmoji(icons.generations.g4, member, guild) + " " + l("Friendship is Magic", "Les amies c'est magique", uid, gid);
+
+ case 5:
+ return customEmoji(icons.generations.g5, member, guild) + " " + l("A New Generation", "Nouvelle Génération", uid, gid);
+
+ default:
+ return customEmoji(icons.generations.other, member, guild) + " " + l("Other/Unknown", "Autre/inconnu", uid, gid);
+ }
}
\ No newline at end of file diff --git a/modules/help.js b/modules/help.js index 3e4794b..5aa0d9e 100644..100755 --- a/modules/help.js +++ b/modules/help.js @@ -42,18 +42,9 @@ module.exports = (guild, gid, uid, inMessage) => { name: l("Enable or disable spoilers", "Activer ou désactiver le révélations", uid, guild ? gid : 0), value: l("With `/config spoilers`, you can adjust whether or not you want to see spoilers.", "Avec `/config spoilers`, vous pouvez ajuster si vous voulez ou non voir des révélations.", uid, guild ? gid : 0) }, - { - name: l("Get stats about the bot", "Obtenir des statistiques sur le robot", uid, guild ? gid : 0), - value: l("`/info` helps you get stats and other useful information about the bot and its inner workings.", "`/info` vous permet d'obtenir des statistiques ainsi que d'autres informations utiles à propos du robot et de son fonctionnement.", uid, guild ? gid : 0) - }, - { - name: l("Having issues with custom emojis?", "Vous avez des problèmes avec les emojis personnalisés ?", uid, guild), - value: l("Ponyfind relies on custom emojis in some commands. If they don't show properly, make sure both the bot and the \\@everyone have the permission to use external emojis.", "Ponyfind s'appuie sur des emojis personnalisés dans certaines commandes. Si ils ne s'affichent pas correctement, assurez-vous que le robot ainsi que le role \\@everyone disposent de la permission d'utiliser des emojis externes", uid, guild) - }, - { - name: l("Add some more magic!", "Ajouter encore plus de magie !", uid, guild ? gid : 0), - value: l("Try `/random`, you will be surprised!.", "Essayez `/random`, vous serez surpris(e) !", uid, guild ? gid : 0) - }, + { name: l("Get stats about the bot", "Obtenir des statistiques sur le robot", uid, guild ? gid : 0), value: l("`/info` helps you get stats and other useful information about the bot and its inner workings.", "`/info` vous permet d'obtenir des statistiques ainsi que d'autres informations utiles à propos du robot et de son fonctionnement.", uid, guild ? gid : 0) }, + { name: l("Having issues with custom emojis?", "Vous avez des problèmes avec les emojis personnalisés ?", uid, guild ? gid : 0), value: l("Ponyfind relies on custom emojis in some commands. If they don't show properly, make sure both the bot and the \\@everyone have the permission to use external emojis.", "Ponyfind s'appuie sur des emojis personnalisés dans certaines commandes. Si ils ne s'affichent pas correctement, assurez-vous que le robot ainsi que le role \\@everyone disposent de la permission d'utiliser des emojis externes", uid, guild ? gid : 0) }, + { name: l("Add some more magic!", "Ajouter encore plus de magie !", uid, guild ? gid : 0), value: l("Try `/random`, you will be surprised!.", "Essayez `/random`, vous serez surpris(e) !", uid, guild ? gid : 0) }, ]; let obj = { diff --git a/modules/icons.js b/modules/icons.js index a68d6ed..9c6ea6f 100644..100755 --- a/modules/icons.js +++ b/modules/icons.js @@ -1,41 +1,41 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -const fs = require('fs'); - -module.exports = { - kind: { - alicorn: fs.readFileSync("./config/icons/kind_alicorn.txt").toString().trim(), - earth: fs.readFileSync("./config/icons/kind_earth.txt").toString().trim(), - other: fs.readFileSync("./config/icons/kind_other.txt").toString().trim(), - pegasus: fs.readFileSync("./config/icons/kind_pegasus.txt").toString().trim(), - unicorn: fs.readFileSync("./config/icons/kind_unicorn.txt").toString().trim(), - }, - generations: { - g4: fs.readFileSync("./config/icons/gen_4.txt").toString().trim(), - g5: fs.readFileSync("./config/icons/gen_5.txt").toString().trim(), - other: fs.readFileSync("./config/icons/gen_unknown.txt").toString().trim(), - } +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+const fs = require('fs');
+
+module.exports = {
+ kind: {
+ alicorn: fs.readFileSync("./config/icons/kind_alicorn.txt").toString().trim(),
+ earth: fs.readFileSync("./config/icons/kind_earth.txt").toString().trim(),
+ other: fs.readFileSync("./config/icons/kind_other.txt").toString().trim(),
+ pegasus: fs.readFileSync("./config/icons/kind_pegasus.txt").toString().trim(),
+ unicorn: fs.readFileSync("./config/icons/kind_unicorn.txt").toString().trim(),
+ },
+ generations: {
+ g4: fs.readFileSync("./config/icons/gen_4.txt").toString().trim(),
+ g5: fs.readFileSync("./config/icons/gen_5.txt").toString().trim(),
+ other: fs.readFileSync("./config/icons/gen_unknown.txt").toString().trim(),
+ }
}
\ No newline at end of file diff --git a/modules/kind.js b/modules/kind.js index 522e426..522e426 100644..100755 --- a/modules/kind.js +++ b/modules/kind.js diff --git a/modules/pixel.js b/modules/pixel.js index 9e5330d..9e5330d 100644..100755 --- a/modules/pixel.js +++ b/modules/pixel.js diff --git a/modules/public.js b/modules/public.js index 293bafd..6648796 100644..100755 --- a/modules/public.js +++ b/modules/public.js @@ -1,41 +1,41 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -const {MessageButton} = require("discord.js"); - -module.exports = (interaction, keys) => { - if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) { - return new MessageButton() - .setCustomId("pony.public|" + keys[1]) - .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id])) / 1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id])) / 1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("PRIMARY") - .setDisabled(true); - } else { - return new MessageButton() - .setCustomId("pony.public|" + keys[1]) - .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0)) - .setStyle("PRIMARY") - } +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+const {MessageButton} = require("discord.js");
+
+module.exports = (interaction, keys) => {
+ if (typeof cooldowns[interaction.user.id] !== "undefined" && new Date() - cooldowns[interaction.user.id] < 30000) {
+ return new MessageButton()
+ .setCustomId("pony.public|" + keys[1])
+ .setLabel(l("Wait " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id])) / 1000) + " seconds", "Patientez " + Math.ceil((30000 - (new Date() - cooldowns[interaction.user.id])) / 1000) + " secondes", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ .setDisabled(true);
+ } else {
+ return new MessageButton()
+ .setCustomId("pony.public|" + keys[1])
+ .setLabel(l("Show to everypony", "Afficher à tous", interaction.user.id, interaction.guild ? interaction.guild.id : 0))
+ .setStyle("PRIMARY")
+ }
}
\ No newline at end of file diff --git a/modules/registers.js b/modules/registers.js index 24b0fc9..a8f2e7f 100644..100755 --- a/modules/registers.js +++ b/modules/registers.js @@ -1,109 +1,109 @@ -/* - * MIT License - * - * Copyright (c) 2022- Minteck - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -const { - SlashCommandBuilder, - SlashCommandSubcommandGroupBuilder, - SlashCommandSubcommandBuilder -} = require('@discordjs/builders'); -const fs = require('fs'); - -let episodesCmd = new SlashCommandBuilder() - .setName("episode") - .setDescription("Gets info about a series' episode") - -for (let series of JSON.parse(fs.readFileSync("./data/series.json").toString())) { - let command = new SlashCommandSubcommandBuilder() - .setName(series.command.toLowerCase()) - .setDescription("Gets info about a series' episode · " + series.title + " (" + series.date + ")") - .addStringOption(s => - s.setName("episode") - .setDescription("The episode to search for") - .setRequired(true) - .setAutocomplete(true) - ) - - episodesCmd.addSubcommand(command) -} - -module.exports = [ - new SlashCommandBuilder() - .setName('pony') - .setDescription("Searches for a pony") - .addStringOption(option => - option.setName("query") - .setDescription("The pony to search for") - .setRequired(true) - .setAutocomplete(true) - ), - new SlashCommandBuilder() - .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"), - episodesCmd, - new SlashCommandBuilder() - .setName('config') - .setDescription("Configure all aspects of the bot") - .addSubcommand(subcommand => - subcommand.setName('lang') - .setDescription("Changes the bot's language") - .addStringOption(option => - option.setName('locale') - .setDescription('The selected language') - .setRequired(true) - .addChoice('Français', 'fr') - .addChoice('English', 'en') - ) - ) - .addSubcommand(subcommand => - subcommand.setName('spoilers') - .setDescription("Enable, disable or hide spoilers in replies") - .addStringOption(option => - option.setName('status') - .setDescription('Value') - .setRequired(true) - .addChoice('Always show spoilers', 'yes') - .addChoice('Show under spoiler tags (default)', 'hide') - .addChoice('Never show spoilers', 'no') - ) - ) - .addSubcommand(subcommand => - subcommand.setName('serverlang') - .setDescription("Changes the bot's language on this server") - .addStringOption(option => - option.setName('locale') - .setDescription('The selected language') - .setRequired(true) - .addChoice('Français', 'fr') - .addChoice('English', 'en') - .addChoice('User prefered language (default)', 'off') - ) - ) +/*
+ * MIT License
+ *
+ * Copyright (c) 2022- Minteck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+const {
+ SlashCommandBuilder,
+ SlashCommandSubcommandGroupBuilder,
+ SlashCommandSubcommandBuilder
+} = require('@discordjs/builders');
+const fs = require('fs');
+
+let episodesCmd = new SlashCommandBuilder()
+ .setName("episode")
+ .setDescription("Gets info about a series' episode")
+
+for (let series of JSON.parse(fs.readFileSync("./data/series.json").toString())) {
+ let command = new SlashCommandSubcommandBuilder()
+ .setName(series.command.toLowerCase())
+ .setDescription("Gets info about a series' episode · " + series.title + " (" + series.date + ")")
+ .addStringOption(s =>
+ s.setName("episode")
+ .setDescription("The episode to search for")
+ .setRequired(true)
+ .setAutocomplete(true)
+ )
+
+ episodesCmd.addSubcommand(command)
+}
+
+module.exports = [
+ new SlashCommandBuilder()
+ .setName('pony')
+ .setDescription("Searches for a pony")
+ .addStringOption(option =>
+ option.setName("query")
+ .setDescription("The pony to search for")
+ .setRequired(true)
+ .setAutocomplete(true)
+ ),
+ new SlashCommandBuilder()
+ .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"),
+ episodesCmd,
+ new SlashCommandBuilder()
+ .setName('config')
+ .setDescription("Configure all aspects of the bot")
+ .addSubcommand(subcommand =>
+ subcommand.setName('lang')
+ .setDescription("Changes the bot's language")
+ .addStringOption(option =>
+ option.setName('locale')
+ .setDescription('The selected language')
+ .setRequired(true)
+ .addChoice('Français', 'fr')
+ .addChoice('English', 'en')
+ )
+ )
+ .addSubcommand(subcommand =>
+ subcommand.setName('spoilers')
+ .setDescription("Enable, disable or hide spoilers in replies")
+ .addStringOption(option =>
+ option.setName('status')
+ .setDescription('Value')
+ .setRequired(true)
+ .addChoice('Always show spoilers', 'yes')
+ .addChoice('Show under spoiler tags (default)', 'hide')
+ .addChoice('Never show spoilers', 'no')
+ )
+ )
+ .addSubcommand(subcommand =>
+ subcommand.setName('serverlang')
+ .setDescription("Changes the bot's language on this server")
+ .addStringOption(option =>
+ option.setName('locale')
+ .setDescription('The selected language')
+ .setRequired(true)
+ .addChoice('Français', 'fr')
+ .addChoice('English', 'en')
+ .addChoice('User prefered language (default)', 'off')
+ )
+ )
]
\ No newline at end of file diff --git a/modules/result.js b/modules/result.js index b381cda..b381cda 100644..100755 --- a/modules/result.js +++ b/modules/result.js |