diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/embed.js | 27 | ||||
-rw-r--r-- | modules/emoji.js | 25 | ||||
-rw-r--r-- | modules/episodepublic.js | 27 | ||||
-rw-r--r-- | modules/episodereply.js | 27 | ||||
-rw-r--r-- | modules/findepisode.js | 25 | ||||
-rw-r--r-- | modules/findpony.js | 25 | ||||
-rw-r--r-- | modules/generation.js | 25 | ||||
-rw-r--r-- | modules/help.js | 37 | ||||
-rw-r--r-- | modules/icons.js | 25 | ||||
-rw-r--r-- | modules/kind.js | 25 | ||||
-rw-r--r-- | modules/pixel.js | 25 | ||||
-rw-r--r-- | modules/public.js | 29 | ||||
-rw-r--r-- | modules/registers.js | 31 | ||||
-rw-r--r-- | modules/result.js | 27 |
14 files changed, 370 insertions, 10 deletions
diff --git a/modules/embed.js b/modules/embed.js index 23bd392..9766055 100644 --- a/modules/embed.js +++ b/modules/embed.js @@ -1,4 +1,29 @@ -const { MessageEmbed } = require("discord.js"); +/* + * 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 {MessageEmbed} = require("discord.js"); const fs = require('fs'); const data = require('../data/data.json'); diff --git a/modules/emoji.js b/modules/emoji.js index 10e3b44..3916a5e 100644 --- a/modules/emoji.js +++ b/modules/emoji.js @@ -1,3 +1,28 @@ +/* + * 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; diff --git a/modules/episodepublic.js b/modules/episodepublic.js index 629ed69..1b1ac64 100644 --- a/modules/episodepublic.js +++ b/modules/episodepublic.js @@ -1,4 +1,29 @@ -const { MessageButton } = require("discord.js"); +/* + * 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; diff --git a/modules/episodereply.js b/modules/episodereply.js index 79a05c1..3d60a0b 100644 --- a/modules/episodereply.js +++ b/modules/episodereply.js @@ -1,4 +1,29 @@ -const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js"); +/* + * 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"); diff --git a/modules/findepisode.js b/modules/findepisode.js index fd56a65..0c2313c 100644 --- a/modules/findepisode.js +++ b/modules/findepisode.js @@ -1,3 +1,28 @@ +/* + * 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 Fuse = require('fuse.js'); module.exports = (series, query) => { diff --git a/modules/findpony.js b/modules/findpony.js index 9159cc6..15fd865 100644 --- a/modules/findpony.js +++ b/modules/findpony.js @@ -1,3 +1,28 @@ +/* + * 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 Fuse = require('fuse.js'); const assocs = require('../data/search.json').associations; const list = Object.keys(require('../data/data.json')); diff --git a/modules/generation.js b/modules/generation.js index da5cd60..1f5553f 100644 --- a/modules/generation.js +++ b/modules/generation.js @@ -1,3 +1,28 @@ +/* + * 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()); diff --git a/modules/help.js b/modules/help.js index c507378..77925c0 100644 --- a/modules/help.js +++ b/modules/help.js @@ -1,3 +1,28 @@ +/* + * 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 {MessageEmbed} = require("discord.js"); module.exports = (guild, gid, uid, inMessage) => { if (inMessage === undefined) { @@ -5,8 +30,14 @@ module.exports = (guild, gid, uid, inMessage) => { } let fields = [ - { name: l("Search for a pony", "Rechercher un poney", uid, guild ? gid : 0), value: l("With the `/pony` command, you can search for any known pony from My Little Pony generations 4 and 5.", "Avec la commande `/pony`, vous pouvez chercher n'importe quel poney de My Little Pony générations 4 ou 5.", uid, guild ? gid : 0) }, - { 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("Search for a pony", "Rechercher un poney", uid, guild ? gid : 0), + value: l("With the `/pony` command, you can search for any known pony from My Little Pony generations 4 and 5.", "Avec la commande `/pony`, vous pouvez chercher n'importe quel poney de My Little Pony générations 4 ou 5.", uid, guild ? gid : 0) + }, + { + 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) }, @@ -26,6 +57,6 @@ module.exports = (guild, gid, uid, inMessage) => { if (!inMessage) { obj.ephemeral = guild !== null; } - + return obj; }
\ No newline at end of file diff --git a/modules/icons.js b/modules/icons.js index 13651cd..a68d6ed 100644 --- a/modules/icons.js +++ b/modules/icons.js @@ -1,3 +1,28 @@ +/* + * 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 = { diff --git a/modules/kind.js b/modules/kind.js index 205014e..522e426 100644 --- a/modules/kind.js +++ b/modules/kind.js @@ -1,3 +1,28 @@ +/* + * 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()); diff --git a/modules/pixel.js b/modules/pixel.js index ec6ee0a..9e5330d 100644 --- a/modules/pixel.js +++ b/modules/pixel.js @@ -1,3 +1,28 @@ +/* + * 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 Fuse = require('fuse.js'); const list = fs.readdirSync("./pixel"); diff --git a/modules/public.js b/modules/public.js index 8c43df8..293bafd 100644 --- a/modules/public.js +++ b/modules/public.js @@ -1,10 +1,35 @@ -const { MessageButton } = require("discord.js"); +/* + * 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)) + .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 { diff --git a/modules/registers.js b/modules/registers.js index f2f13c7..24b0fc9 100644 --- a/modules/registers.js +++ b/modules/registers.js @@ -1,4 +1,33 @@ -const { SlashCommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandBuilder } = require('@discordjs/builders'); +/* + * 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() diff --git a/modules/result.js b/modules/result.js index d83c550..b381cda 100644 --- a/modules/result.js +++ b/modules/result.js @@ -1,10 +1,35 @@ +/* + * 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 db = require('../data/search.json').associations; const list = Object.keys(require('../data/data.json')); const Fuse = require('fuse.js'); module.exports = (query) => { const fuse = new Fuse(db, { - keys: [ 'title', 'endpoint' ] + keys: ['title', 'endpoint'] }) let results = []; |