From 8680983e11c32fd301c3c064fc107461ee7a0731 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:58:53 +0000 Subject: [PATCH 01/56] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20Additional=20info=20?= =?UTF-8?q?to=20Safety=20Error=20Message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/taurusai.js | 4 ++-- interactions/modals/category/ask.js | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index b6619ed..d93cefd 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -101,7 +101,7 @@ module.exports = { category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, }, - ]; + ]; const user_status = message.member?.presence.clientStatus || {} const status_devices = Object.entries(user_status) @@ -183,7 +183,7 @@ module.exports = { case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": const safety_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") - .setDescription("> *The response was blocked due to **SAFETY**.*") + .setDescription("> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*") .setColor("Red") return await loadingMsg.edit({ embeds: [safety_error]}); diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index c4c514e..132dbdd 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -41,9 +41,7 @@ module.exports = { .setDescription("*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*") .setFooter({text: "⏳ This may take a while", iconURL: interaction.user.displayAvatarURL()}) .setTimestamp() - const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] - //, ephemeral: true - }); + const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); const loadingDots = [""," . ", " . . ", " . . ."]; let i = 0; const loadingInterval = setInterval(async () => { @@ -69,7 +67,7 @@ module.exports = { category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, }, - ]; + ]; const user_status = interaction.member?.presence.clientStatus || {} const status_devices = Object.entries(user_status) @@ -143,7 +141,7 @@ module.exports = { case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": const safety_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") - .setDescription("> *The response was blocked due to **SAFETY**.*") + .setDescription("> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*") .setColor("Red") return await interaction.editReply({ embeds: [safety_error]}); From f9314cded3089651384397cd50f3b3d229a10330 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 23 Mar 2024 22:51:20 +0000 Subject: [PATCH 02/56] Add SDXL Models --- interactions/slash/misc/image.js | 26 +++++++++++++++++--------- interactions/slash/misc/models.js | 23 ++++++++++++----------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index 7422310..745fca7 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -163,18 +163,25 @@ module.exports = { sdk.auth(XProdiaKey); - try{ - const {data} = await sdk.listModels(); - choices = JSON.parse(data); - } catch (e) { - return interaction.followUp({embeds: [error]}); + async function fetchModels(apiMethod) { + try { + const { data } = await apiMethod(); + return JSON.parse(data); + } catch (e) { + return interaction.followUp({embeds: [error]}); + } } - - if (model && !choices.includes(model)) { + + const choices = await fetchModels(sdk.listModels); + const sdxlChoices = await fetchModels(sdk.listSdxlModels); + + const allModels = [...choices, ...sdxlChoices]; + + if (model && !allModels.includes(model)) { const no_model = new EmbedBuilder() .setDescription(`**${model}** is not a valid model!\n\n> Run \`/models\` to see the available models!`) .setColor('Red'); - + return interaction.followUp({embeds: [no_model]}); } @@ -196,7 +203,8 @@ module.exports = { try{ - sdk.generate(generateParams) + const generateMethod = sdxlChoices.includes(model) ? sdk.sdxlGenerate : sdk.generate; + generateMethod(generateParams) .then(({ data }) => { const jobId = data.job; const intervalId = setInterval(() => { diff --git a/interactions/slash/misc/models.js b/interactions/slash/misc/models.js index 01fe140..a1d4e39 100644 --- a/interactions/slash/misc/models.js +++ b/interactions/slash/misc/models.js @@ -37,24 +37,25 @@ module.exports = { sdk.auth(XProdiaKey); - try{ - const {data} = await sdk.listModels(); - choices = JSON.parse(data); - } catch (e) { - return interaction.followUp({embeds: [error]}); + async function fetchAndFormatModels(apiMethod) { + try { + const { data } = await apiMethod(); + const models = JSON.parse(data); + return "```\n- " + models.join("\n- ") + "\n```"; + } catch (e) { + return interaction.followUp({embeds: [error]}); + } } - + + const choices_string = await fetchAndFormatModels(sdk.listModels); + const sdxlChoices_string = await fetchAndFormatModels(sdk.listSdxlModels); - const choices_string = "```\n- " + choices.join("\n- ") + "\n```"; - const models = new EmbedBuilder() .setTitle('🖼️ Available Models') - .setDescription(choices_string) + .setDescription(`**\n🌟 SD Models:**\n\n ${choices_string}\n\n**🚀 SDXL Models:**\n\n ${sdxlChoices_string}`) .setColor('Random') return interaction.followUp({embeds: [models]}); - - }, }; From 89ffe73911b44019ed4fdbdff1a76df31e47823f Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 24 Mar 2024 12:35:28 +0000 Subject: [PATCH 03/56] Add context menu AI --- bot.js | 25 ++ events/contextInteraction.js | 74 ++++++ .../context-menus/message/taurusai.js | 235 ++++++++++++++++++ 3 files changed, 334 insertions(+) create mode 100644 events/contextInteraction.js create mode 100644 interactions/context-menus/message/taurusai.js diff --git a/bot.js b/bot.js index 9a276f3..ad4c014 100644 --- a/bot.js +++ b/bot.js @@ -67,6 +67,7 @@ for (const file of eventFiles) { client.slashCommands = new Collection(); client.modalCommands = new Collection(); +client.contextCommands = new Collection(); client.cooldowns = new Collection(); client.functions = new Collection(); @@ -93,6 +94,29 @@ for (const module of slashCommands) { } } +/**********************************************************************/ +// Registration of Context-Menu Interactions + +/** + * @type {String[]} + * @description All Context Menu commands. + */ + +const contextMenus = fs.readdirSync("./interactions/context-menus"); + +// Loop through all files and store context-menus in contextMenus collection. + +for (const folder of contextMenus) { + const files = fs + .readdirSync(`./interactions/context-menus/${folder}`) + .filter((file) => file.endsWith(".js")); + for (const file of files) { + const menu = require(`./interactions/context-menus/${folder}/${file}`); + const keyName = `${folder.toUpperCase()} ${menu.data.name}`; + client.contextCommands.set(keyName, menu); + } +} + /**********************************************************************/ // Registration of Modal-Command Interactions. @@ -144,6 +168,7 @@ const rest = new REST({ version: "9" }).setToken(token); const commandJsonData = [ ...Array.from(client.slashCommands.values()).map((c) => c.data.toJSON()), + ...Array.from(client.contextCommands.values()).map((c) => c.data) ]; (async () => { diff --git a/events/contextInteraction.js b/events/contextInteraction.js new file mode 100644 index 0000000..235aa81 --- /dev/null +++ b/events/contextInteraction.js @@ -0,0 +1,74 @@ +/** + * @file Context Interaction Handler + * @author Krish Garg & Naman Vrati + * @since 3.0.0 + * @version 3.3.2 + */ +const { Events } = require("discord.js"); + +module.exports = { + name: Events.InteractionCreate, + + /** + * @description Executes when an interaction is created and handle it. + * @author Naman Vrati + * @param {import("discord.js").ContextMenuCommandInteraction & { client: import("../typings").Client }} interaction The interaction which was created + */ + + execute: async (interaction) => { + // Deconstructed client from interaction object. + const { client } = interaction; + + // Checks if the interaction is a context interaction (to prevent weird bugs) + + if (!interaction.isContextMenuCommand()) return; + + /**********************************************************************/ + + // Checks if the interaction target was a user + + if (interaction.isUserContextMenuCommand()) { + const command = client.contextCommands.get( + "USER " + interaction.commandName + ); + + // A try to execute the interaction. + + try { + return await command.execute(interaction); + } catch (err) { + console.error(err); + await interaction.reply({ + content: "There was an issue while executing that context command! If the issue persists please contact the bot owners.", + ephemeral: true + }); + } + } + // Checks if the interaction target was a message + else if (interaction.isMessageContextMenuCommand()) { + const command = client.contextCommands.get( + "MESSAGE " + interaction.commandName + ); + + // A try to execute the interaction. + + try { + return await command.execute(interaction); + } catch (err) { + console.error(err); + await interaction.reply({ + content: "There was an issue while executing that context command! If the issue persists please contact the bot owners.", + ephemeral: true + }); + } + } + + // Practically not possible, but we are still caching the bug. + // Possible Fix is a restart! + else { + return console.log( + "Something weird happening in context menu. Received a context menu of unknown type. If the issue persists please contact the bot owners." + ); + } + } +}; \ No newline at end of file diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js new file mode 100644 index 0000000..1855c8e --- /dev/null +++ b/interactions/context-menus/message/taurusai.js @@ -0,0 +1,235 @@ +/** + * @file Taurus Context Menu. + * @author TechyGiraffe999 + */ + +/** + * @type {import("../../../typings").ContextInteractionCommand} + */ + +const { Collection, ChannelType, Events, EmbedBuilder } = require("discord.js"); +const fs = require('fs').promises; +const path = require('path'); +const { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } = require("@google/generative-ai"); +const { Gemini_API_KEY } = require("../../../config.json"); +const genAI = new GoogleGenerativeAI(Gemini_API_KEY); + + +module.exports = { + data: { + name: "TaurusAI", + type: 3 + }, + + async execute(interaction) { + const { channel, targetId } = interaction; + + const message = await channel.messages.fetch(targetId); + + if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { + invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription("> **The API Key for Gemini is invalid or not provided.**") + .setColor("Red") + return interaction.reply({ embeds: [invalid_api] }); + } + + if (message.author.bot || message.author.id === message.client.user.id){ + return interaction.reply({ content: "I cant reply to myself or another bot!", ephemeral: true}); + } + + const sendTypingInterval = setInterval(() => { + interaction.channel.sendTyping(); + }, 5000); + + const user = message.author; + + const loadingEmbed = new EmbedBuilder() + .setTitle("**⌛Loading your response**") + .setDescription("*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*") + .setFooter({text: "This may take a while", iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`}) + .setTimestamp() + const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); + const loadingDots = [" ⌛ ", " ⏳ "]; + let i = 0; + const loadingInterval = setInterval(() => { + loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); + loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 2000); + + + const personalityFilePath = path.join(__dirname, '../../../../personality.txt'); + const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); + const personalityLines = personalityContent.split('\n'); + + let userQuestion + let threadMessages = []; + + if (message.reference) { + const originalMessage = await message.channel.messages.fetch(message.reference.messageId); + + if (originalMessage.author.id !== message.client.user.id) return; + + if (originalMessage.author.id === message.client.user.id) { + let currentMessage = message; + + while (currentMessage.reference) { + currentMessage = await message.channel.messages.fetch(currentMessage.reference.messageId); + const sender = currentMessage.author.id === message.client.user.id ? 'model' : 'user'; + let content = currentMessage.content; + if (sender === 'user') { + content = content.replace(/<@\d+>\s*/, ''); + } + threadMessages.unshift({ role: sender, parts: content }); + } + } + userQuestion = message.content; + } + else if (!message.reference) { + const botMention = `<@${message.client.user.id}>`; + userQuestion = message.content + .replace(botMention, "") + .trim(); + } + + const safetySettings = [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + ]; + + const user_status = message.member?.presence.clientStatus || {} + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.` + + if (Object.keys(user_status).length) { + parts1 += ` The user's presence is currently:\n${status_devices}`; + } + + async function run() { + const generationConfig = { + maxOutputTokens: 750, + }; + const model = genAI.getGenerativeModel({ model: "gemini-pro", safetySettings, generationConfig}); + + var history = [ + { + role: "user", + parts: parts1, + }, + { + role: "model", + parts: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + }, + ]; + + if (history.length > 0 && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model') { + history[history.length - 1].parts += threadMessages[0].parts; + threadMessages.shift(); + } + + history = history.concat(threadMessages); + + const chat = model.startChat({ + history, + generationConfig: { + maxOutputTokens: 750, + }, + }); + + const result = await chat.sendMessage(userQuestion); + const response = await result.response; + + const responseLength = response.text().length; + if (responseLength > 2000) { + response.text = response.text().substring(0, 1928 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; + } + + clearInterval(loadingInterval); + clearInterval(sendTypingInterval); + + let responseText = response.text(); + const regex = /<@&?\d+>/g; + let match; + + while ((match = regex.exec(responseText)) !== null) { + if (match[0] !== `<@${message.author.id}>`) { + const ping_error = new EmbedBuilder() + .setTitle("⚠️ Response Cannot Be Sent") + .setDescription("> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*") + .setColor("Red") + return await loadingMsg.edit({ embeds: [ping_error] }); + } + } + responseText = responseText.replace(/(https?:\/\/(?!media\.discordapp\.net\/attachments\/)[^\s\)]+)/g, "<$1>"); + const footerText = `Response to message by ${message.author.tag}\n\n${message.content}`; + const truncatedFooterText = footerText.length > 2030 ? `${footerText.slice(0, 2027)}...` : footerText; + + const info = new EmbedBuilder() + .setFooter({text: truncatedFooterText}) + .setColor("Blue") + + return await loadingMsg.edit({ content: responseText, embeds: [info] }); + } + + try{ + await run(); + } catch (err) { + clearInterval(loadingInterval); + clearInterval(sendTypingInterval); + + switch (err.message) { + case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": + const safety_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("> *The response was blocked due to **SAFETY**.*") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [safety_error]}); + + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent: [400 Bad Request] User location is not supported for the API use.": + const location_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("> *The user location is not supported for Gemini API use. Please contact the Developers.*") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [location_error]}); + + case "Cannot send an empty message": + case "response.text is not a function": + const error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [error]}); + + default: + const error_unknown = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers*\n> - Token Limit for this minute may have been reached.") + .setColor("Red") + + await loadingMsg.edit({embeds: [error_unknown] + }); + } + } + } +}; \ No newline at end of file From 7f546d45e5cd2ed366e70461e0d96413fbb3fe8b Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 24 Mar 2024 18:52:52 +0000 Subject: [PATCH 04/56] Add Model autocomplete --- bot.js | 24 ++++++++++ events/autocompleteInteraction.js | 46 +++++++++++++++++++ .../autocomplete/category/image_model.js | 45 ++++++++++++++++++ interactions/slash/misc/image.js | 2 +- 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 events/autocompleteInteraction.js create mode 100644 interactions/autocomplete/category/image_model.js diff --git a/bot.js b/bot.js index ad4c014..13ca4a7 100644 --- a/bot.js +++ b/bot.js @@ -69,6 +69,7 @@ client.slashCommands = new Collection(); client.modalCommands = new Collection(); client.contextCommands = new Collection(); client.cooldowns = new Collection(); +client.autocompleteInteractions = new Collection(); client.functions = new Collection(); /**********************************************************************/ @@ -94,6 +95,29 @@ for (const module of slashCommands) { } } +/**********************************************************************/ +// Registration of Autocomplete Interactions. + +/** + * @type {String[]} + * @description All autocomplete interactions. + */ + +const autocompleteInteractions = fs.readdirSync("./interactions/autocomplete"); + +// Loop through all files and store autocomplete interactions in autocompleteInteractions collection. + +for (const module of autocompleteInteractions) { + const files = fs + .readdirSync(`./interactions/autocomplete/${module}`) + .filter((file) => file.endsWith(".js")); + + for (const interactionFile of files) { + const interaction = require(`./interactions/autocomplete/${module}/${interactionFile}`); + client.autocompleteInteractions.set(interaction.name, interaction); + } +} + /**********************************************************************/ // Registration of Context-Menu Interactions diff --git a/events/autocompleteInteraction.js b/events/autocompleteInteraction.js new file mode 100644 index 0000000..1e23c64 --- /dev/null +++ b/events/autocompleteInteraction.js @@ -0,0 +1,46 @@ +/** + * @file Autocomplete Interaction Handler + * @author Naman Vrati + * @since 3.3.0 + * @version 3.3.2 + */ + +const { Events } = require("discord.js"); + +module.exports = { + name: Events.InteractionCreate, + + /** + * @description Executes when an interaction is created and handle it. + * @author Naman Vrati + * @param {import('discord.js').AutocompleteInteraction & { client: import('../typings').Client }} interaction The interaction which was created + */ + + async execute(interaction) { + // Deconstructed client from interaction object. + const { client } = interaction; + + // Checks if the interaction is an autocomplete interaction (to prevent weird bugs) + + if (!interaction.isAutocomplete()) return; + + // Checks if the request is available in our code. + + const request = client.autocompleteInteractions.get( + interaction.commandName + ); + + // If the interaction is not a request in cache return. + + if (!request) return; + + // A try to execute the interaction. + + try { + await request.execute(interaction); + } catch (err) { + console.error(err); + return Promise.reject(err); + } + }, +}; \ No newline at end of file diff --git a/interactions/autocomplete/category/image_model.js b/interactions/autocomplete/category/image_model.js new file mode 100644 index 0000000..fed6ace --- /dev/null +++ b/interactions/autocomplete/category/image_model.js @@ -0,0 +1,45 @@ +/** + * @file Image Autocomplete Interaction + * @author TechyGiraffe999 + */ + +/** + * @type {import("../../../typings").AutocompleteInteraction} + */ + +const {XProdiaKey} = require('../../../config.json') + +module.exports = { + name: "image", + async execute(interaction) { + + const focusedOption = interaction.options.getFocused(); + + const sdk = require('api')('@prodia/v1.3.0#6fdmny2flsvwyf65'); + sdk.auth(XProdiaKey); + + async function fetchAndFormatModels(apiMethod) { + try { + const { data } = await apiMethod(); + const models = JSON.parse(data); + return models; + } catch (e) { + console.error("Error fetching models: ", e) + } + } + + const sdModels = await fetchAndFormatModels(sdk.listModels); + const sdxlModels = await fetchAndFormatModels(sdk.listSdxlModels); + + const allModels = sdModels.concat(sdxlModels); + const filteredModels = allModels.filter(model => model.toLowerCase().startsWith(focusedOption.toLowerCase())); + + const results = filteredModels.map(model => ({ + name: model, + value: model + })); + + await interaction.respond(results.slice(0, 25)).catch(() => {}); + return; + } +}; \ No newline at end of file diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index 745fca7..0cf24fe 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -19,7 +19,7 @@ module.exports = { .setName('image') .setDescription('Have AI generate an image!') .addStringOption(o => o.setName('prompt').setDescription('The description of the image to generate!').setRequired(true)) - .addStringOption(o => o.setName('model').setDescription('The Model to Use')) + .addStringOption(o => o.setName('model').setDescription('The Model to Use').setAutocomplete(true)) .addStringOption(o => o.setName('negative-prompt').setDescription('The Negative Prompt to Use')) .addIntegerOption(option => option.setName("steps") From faf1cb00815080df5242466d508590ac914cdb3c Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 24 Mar 2024 19:10:41 +0000 Subject: [PATCH 05/56] Fixes - Context Menu --- interactions/context-menus/message/taurusai.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 1855c8e..eed0fba 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -17,7 +17,7 @@ const genAI = new GoogleGenerativeAI(Gemini_API_KEY); module.exports = { data: { - name: "TaurusAI", + name: "Taurus", type: 3 }, @@ -59,7 +59,7 @@ module.exports = { }, 2000); - const personalityFilePath = path.join(__dirname, '../../../../personality.txt'); + const personalityFilePath = path.join(__dirname + '../../../../personality.txt'); const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); const personalityLines = personalityContent.split('\n'); From 9b2e9bb813bee24535da38d9a369cc7d57f1a13d Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Tue, 26 Mar 2024 18:48:25 +0000 Subject: [PATCH 06/56] Implement User Commands --- bot.js | 17 ++++++++++++++--- package.json | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bot.js b/bot.js index 13ca4a7..5377274 100644 --- a/bot.js +++ b/bot.js @@ -15,7 +15,8 @@ const { GatewayIntentBits, Partials, REST, - Routes + Routes, + SlashCommandBuilder } = require("discord.js"); const { token, client_id } = require("./config.json"); @@ -191,8 +192,18 @@ for (const functionFile of functionFiles) { const rest = new REST({ version: "9" }).setToken(token); const commandJsonData = [ - ...Array.from(client.slashCommands.values()).map((c) => c.data.toJSON()), - ...Array.from(client.contextCommands.values()).map((c) => c.data) + ...Array.from(client.slashCommands.values()).map((c) => { + const commandData = c.data instanceof SlashCommandBuilder ? c.data.toJSON() : c.data; + commandData.integration_types = [1]; + commandData.contexts = [0, 1, 2]; + return commandData; + }), + ...Array.from(client.contextCommands.values()).map((c) => { + const commandData = c.data; + commandData.integration_types = [1]; + commandData.contexts = [0, 1, 2]; + return commandData; + }) ]; (async () => { diff --git a/package.json b/package.json index 126c4a4..3277446 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "blessed": "^0.1.81", "chalk": "^5.3.0", "discord-api-types": "^0.37.43", - "discord.js": "^14.11.0", + "discord.js": "^14.14.1", "figlet": "^1.7.0", "moment": "^2.30.1", "nsfwjs": "^3.0.0", From a62533dd36cad4be44ca7f399d185ed02ca02bfc Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:18:33 +0000 Subject: [PATCH 07/56] Update Google Generative AI Package --- events/taurusai.js | 4 ++-- interactions/context-menus/message/taurusai.js | 4 ++-- interactions/modals/category/ask.js | 4 ++-- package.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index d93cefd..8154ecf 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -123,11 +123,11 @@ module.exports = { var history = [ { role: "user", - parts: parts1, + parts: [{text: parts1}], }, { role: "model", - parts: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + parts: [{text:`I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], }, ]; diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index eed0fba..d76c47e 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -132,11 +132,11 @@ module.exports = { var history = [ { role: "user", - parts: parts1, + parts: [{text: parts1}], }, { role: "model", - parts: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + parts: [{text:`I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], }, ]; diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 132dbdd..006d742 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -90,11 +90,11 @@ module.exports = { history: [ { role: "user", - parts: parts1, + parts: [{text: parts1}], }, { role: "model", - parts: `I will greet the user with their name: <@${interaction.user.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + parts: [{text: `I will greet the user with their name: <@${interaction.user.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], }, ], generationConfig: { diff --git a/package.json b/package.json index 3277446..2a806bf 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.2.1", + "@google/generative-ai": "^0.3.1", "@iamtraction/google-translate": "^2.0.1", "@tensorflow/tfjs-node": "^4.17.0", "api": "^6.1.1", From 3b6420ec36b817c7afb7cecfe817b6fa5cef33eb Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:07:54 +0000 Subject: [PATCH 08/56] Fix User Slash command issues --- bot.js | 14 ++++++++++++-- events/contextInteraction.js | 2 +- events/slashCreate.js | 11 +++++++---- interactions/modals/category/ask.js | 14 ++++++++------ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/bot.js b/bot.js index 5377274..63bf91a 100644 --- a/bot.js +++ b/bot.js @@ -228,10 +228,20 @@ client.login(token); /**********************************************************************/ // Anti Crash script - -process.on("unhandRejection", (reason, promise) => { +process.on("unhandledRejection", (reason, promise) => { console.error(`🚫 Critical Error detected:\n\n`, reason, promise); + + // Uncomment the below lines below to see the full error details. - ADVANCED DEBUGGING // + + // console.dir(reason, { showHidden: true, depth: null }); + // console.log("Promise: ", promise); }); + process.on("uncaughtException", (error, origin) => { console.error(`🚫 Critical Error detected:\n\n`, error, origin); + + // Uncomment the below lines below to see the full error details. - ADVANCED DEBUGGING // + + // console.dir(error, { showHidden: true, depth: null }); + // console.log("Origin: ", origin); }); \ No newline at end of file diff --git a/events/contextInteraction.js b/events/contextInteraction.js index 235aa81..cbfe758 100644 --- a/events/contextInteraction.js +++ b/events/contextInteraction.js @@ -55,7 +55,7 @@ module.exports = { try { return await command.execute(interaction); } catch (err) { - console.error(err); + console.dir(err, { showHidden: true }); await interaction.reply({ content: "There was an issue while executing that context command! If the issue persists please contact the bot owners.", ephemeral: true diff --git a/events/slashCreate.js b/events/slashCreate.js index 402fddd..4b68f79 100644 --- a/events/slashCreate.js +++ b/events/slashCreate.js @@ -42,10 +42,13 @@ module.exports = { let cooldownAmount = command.cooldown ?? defaultCooldownDuration; if (interaction.inGuild()) { - allowedRoleIds = ["...", "..."]; - if (interaction.member.roles.cache.some(role => allowedRoleIds.includes(role.id))) { - const cooldownPercentage = 0.5; - cooldownAmount = Math.floor(cooldownAmount * cooldownPercentage); + const botGuilds = interaction.client.guilds.cache; + if (botGuilds.has(interaction.guildId)) { + allowedRoleIds = ["...", "..."]; + if (interaction.member.roles.cache.some(role => allowedRoleIds.includes(role.id))) { + const cooldownPercentage = 0.5; + cooldownAmount = Math.floor(cooldownAmount * cooldownPercentage); + } } } diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 006d742..4c699d2 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -32,9 +32,9 @@ module.exports = { const userQuestion = interaction.fields.getTextInputValue("question_taurusai"); - const sendTypingInterval = setInterval(() => { - interaction.channel.sendTyping(); - }, 5000); + let sendTypingInterval = interaction.inGuild() && interaction.client.guilds.cache.has(interaction.guildId) + ? setInterval(() => interaction.channel.sendTyping(), 5000) + : null; const loadingEmbed = new EmbedBuilder() .setTitle("**Loading your response . . .**") @@ -69,7 +69,10 @@ module.exports = { }, ]; - const user_status = interaction.member?.presence.clientStatus || {} + const user_status = interaction.inGuild() && interaction.client.guilds.cache.has(interaction.guildId) + ? interaction.member?.presence.clientStatus + : {}; + const status_devices = Object.entries(user_status) .map(([platform, status]) => `${platform}: ${status}`) .join("\n"); @@ -135,8 +138,7 @@ module.exports = { await run(); } catch (err) { clearInterval(loadingInterval); - clearInterval(sendTypingInterval); - + sendTypingInterval && clearInterval(sendTypingInterval); switch (err.message) { case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": const safety_error = new EmbedBuilder() From 481b217c08df8cbc78fff174c90e8ae5c5f93ff3 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Wed, 10 Apr 2024 22:37:50 +0100 Subject: [PATCH 09/56] Switch to Gemini 1.5 Pro Model [V1.BETA] Create utils file common functions --- events/contextInteraction.js | 2 +- events/slashCreate.js | 4 +- events/taurusai.js | 157 ++++------------ functions/logConsole.js | 1 - .../context-menus/message/taurusai.js | 173 +++++------------- interactions/modals/category/ask.js | 112 ++---------- utils.js | 148 +++++++++++++++ 7 files changed, 243 insertions(+), 354 deletions(-) create mode 100644 utils.js diff --git a/events/contextInteraction.js b/events/contextInteraction.js index cbfe758..3109c7d 100644 --- a/events/contextInteraction.js +++ b/events/contextInteraction.js @@ -63,7 +63,7 @@ module.exports = { } } - // Practically not possible, but we are still caching the bug. + // Practically not possible, but we are still caching the bug. // Possible Fix is a restart! else { return console.log( diff --git a/events/slashCreate.js b/events/slashCreate.js index 4b68f79..1f9405f 100644 --- a/events/slashCreate.js +++ b/events/slashCreate.js @@ -7,6 +7,7 @@ */ const { Collection, EmbedBuilder, Events } = require("discord.js"), +{ botInGuild } = require("../utils"), { owner } = require("../config.json"); module.exports = { @@ -42,8 +43,7 @@ module.exports = { let cooldownAmount = command.cooldown ?? defaultCooldownDuration; if (interaction.inGuild()) { - const botGuilds = interaction.client.guilds.cache; - if (botGuilds.has(interaction.guildId)) { + if (botInGuild(interaction)) { allowedRoleIds = ["...", "..."]; if (interaction.member.roles.cache.some(role => allowedRoleIds.includes(role.id))) { const cooldownPercentage = 0.5; diff --git a/events/taurusai.js b/events/taurusai.js index 8154ecf..4cbbd93 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -4,11 +4,12 @@ */ -const { Collection, ChannelType, Events, EmbedBuilder } = require("discord.js"); +const { Events, EmbedBuilder } = require("discord.js"); const fs = require('fs').promises; const path = require('path'); -const { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } = require("@google/generative-ai"); +const { GoogleGenerativeAI } = require("@google/generative-ai"); const { Gemini_API_KEY } = require("../config.json"); +const { safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey, fetchThreadMessages } = require("../utils"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); module.exports = { @@ -18,43 +19,20 @@ module.exports = { if (message.author.bot || message.author.id === message.client.user.id) return; if (message.type === 21) return; - if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { - invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription("> **The API Key for Gemini is invalid or not provided.**") - .setColor("Red") - return message.reply({ embeds: [invalid_api] }); - } - let userQuestion let threadMessages = []; if (message.reference) { - const originalMessage = await message.channel.messages.fetch(message.reference.messageId); - - if (originalMessage.author.id !== message.client.user.id) return; - - if (originalMessage.author.id === message.client.user.id) { - let currentMessage = message; - - while (currentMessage.reference) { - currentMessage = await message.channel.messages.fetch(currentMessage.reference.messageId); - const sender = currentMessage.author.id === message.client.user.id ? 'model' : 'user'; - let content = currentMessage.content; - if (sender === 'user') { - content = content.replace(/<@\d+>\s*/, ''); - } - threadMessages.unshift({ role: sender, parts: content }); - } - } - userQuestion = message.content - + const { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages } = await fetchThreadMessages(Gemini_API_KEY, message); + if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; + threadMessages = fetchedThreadMessages; + userQuestion = fetchedUserQuestion } else if (!message.reference) { const botMention = `<@${message.client.user.id}>`; const regex = new RegExp(`^${botMention}\\s+.+`); - if (!regex.test(message.content)) return; - + if (!regex.test(message.content)) return; + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; userQuestion = message.content .replace(botMention, "") .trim(); @@ -79,35 +57,15 @@ module.exports = { i = (i + 1) % loadingDots.length; }, 2000); - const personalityFilePath = path.join(__dirname, '../personality.txt'); - const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); - const personalityLines = personalityContent.split('\n'); - - - const safetySettings = [ - { - category: HarmCategory.HARM_CATEGORY_HARASSMENT, - threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, - }, - { - category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - ]; - const user_status = message.member?.presence.clientStatus || {} const status_devices = Object.entries(user_status) .map(([platform, status]) => `${platform}: ${status}`) .join("\n"); + const personalityFilePath = path.join(__dirname, '../personality.txt'); + const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); + const personalityLines = personalityContent.split('\n'); + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.` if (Object.keys(user_status).length) { @@ -118,8 +76,13 @@ module.exports = { const generationConfig = { maxOutputTokens: 750, }; - const model = genAI.getGenerativeModel({ model: "gemini-pro", safetySettings, generationConfig}); + const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, { + apiVersion: 'v1beta', + safetySettings, + generationConfig + }); + var history = [ { role: "user", @@ -131,90 +94,32 @@ module.exports = { }, ]; - if (history.length > 0 && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model') { - history[history.length - 1].parts += threadMessages[0].parts; + if (history.length > 0 && threadMessages && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model' && Array.isArray(history[history.length - 1].parts) && Array.isArray(threadMessages[0].parts)) { + history[history.length - 1].parts = history[history.length - 1].parts.concat(threadMessages[0].parts); threadMessages.shift(); } - - history = history.concat(threadMessages); - + history.push(...threadMessages); + const chat = model.startChat({ history, generationConfig: { maxOutputTokens: 750, }, }); - - const result = await chat.sendMessage(userQuestion); - const response = await result.response; - const responseLength = response.text().length; - if (responseLength > 2000) { - response.text = response.text().substring(0, 1928 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; - } - clearInterval(loadingInterval); - clearInterval(sendTypingInterval); - - let responseText = response.text(); - const regex = /<@&?\d+>/g; - let match; - - while ((match = regex.exec(responseText)) !== null) { - if (match[0] !== `<@${message.author.id}>`) { - const ping_error = new EmbedBuilder() - .setTitle("⚠️ Response Cannot Be Sent") - .setDescription("> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*") - .setColor("Red") - return await loadingMsg.edit({ embeds: [ping_error] }); - } - } - - responseText = responseText.replace(/(?"); - return await loadingMsg.edit({ content: responseText, embeds: [] }); + clearInterval(loadingInterval); + clearInterval(sendTypingInterval); + await handleResponse(chat, userQuestion, false, message, loadingMsg) } try{ await run(); } catch (err) { clearInterval(loadingInterval); - clearInterval(sendTypingInterval); - - switch (err.message) { - case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": - const safety_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [safety_error]}); - - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent: [400 Bad Request] User location is not supported for the API use.": - const location_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The user location is not supported for Gemini API use. Please contact the Developers.*") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [location_error]}); - - case "Cannot send an empty message": - case "response.text is not a function": - const error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [error]}); - - default: - const error_unknown = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - - await loadingMsg.edit({embeds: [error_unknown] - }); - } - } - + sendTypingInterval && clearInterval(sendTypingInterval); + + handleGeminiError(err, loadingMsg); + + } }, }; \ No newline at end of file diff --git a/functions/logConsole.js b/functions/logConsole.js index b89b71b..c1db88f 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -60,5 +60,4 @@ module.exports = (client) => { console.originalInfo = console.info; console.info = customLogger.bind(null, 'info'); - }; \ No newline at end of file diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index d76c47e..712640f 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -10,7 +10,8 @@ const { Collection, ChannelType, Events, EmbedBuilder } = require("discord.js"); const fs = require('fs').promises; const path = require('path'); -const { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } = require("@google/generative-ai"); +const { GoogleGenerativeAI } = require("@google/generative-ai"); +const { safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey, fetchThreadMessages } = require("../../../utils"); const { Gemini_API_KEY } = require("../../../config.json"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); @@ -26,18 +27,31 @@ module.exports = { const message = await channel.messages.fetch(targetId); - if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { - invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription("> **The API Key for Gemini is invalid or not provided.**") - .setColor("Red") - return interaction.reply({ embeds: [invalid_api] }); - } - + if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; + if (message.author.bot || message.author.id === message.client.user.id){ return interaction.reply({ content: "I cant reply to myself or another bot!", ephemeral: true}); } + + let userQuestion + let threadMessages = []; + + if (message.reference) { + const { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages } = await fetchThreadMessages(Gemini_API_KEY, message); + if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; + threadMessages = fetchedThreadMessages; + userQuestion = fetchedUserQuestion + } else if (!message.reference) { + const botMention = `<@${message.client.user.id}>`; + const regex = new RegExp(`^${botMention}\\s+.+`); + + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + userQuestion = message.content + .replace(botMention, "") + .trim(); + } + const sendTypingInterval = setInterval(() => { interaction.channel.sendTyping(); }, 5000); @@ -58,59 +72,16 @@ module.exports = { i = (i + 1) % loadingDots.length; }, 2000); - const personalityFilePath = path.join(__dirname + '../../../../personality.txt'); const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); const personalityLines = personalityContent.split('\n'); - let userQuestion - let threadMessages = []; - - if (message.reference) { - const originalMessage = await message.channel.messages.fetch(message.reference.messageId); - - if (originalMessage.author.id !== message.client.user.id) return; + const botMention = `<@${message.client.user.id}>`; - if (originalMessage.author.id === message.client.user.id) { - let currentMessage = message; - - while (currentMessage.reference) { - currentMessage = await message.channel.messages.fetch(currentMessage.reference.messageId); - const sender = currentMessage.author.id === message.client.user.id ? 'model' : 'user'; - let content = currentMessage.content; - if (sender === 'user') { - content = content.replace(/<@\d+>\s*/, ''); - } - threadMessages.unshift({ role: sender, parts: content }); - } - } - userQuestion = message.content; - } - else if (!message.reference) { - const botMention = `<@${message.client.user.id}>`; - userQuestion = message.content - .replace(botMention, "") - .trim(); - } - - const safetySettings = [ - { - category: HarmCategory.HARM_CATEGORY_HARASSMENT, - threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, - }, - { - category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - ]; + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + userQuestion = message.content + .replace(botMention, "") + .trim(); const user_status = message.member?.presence.clientStatus || {} const status_devices = Object.entries(user_status) @@ -127,7 +98,12 @@ module.exports = { const generationConfig = { maxOutputTokens: 750, }; - const model = genAI.getGenerativeModel({ model: "gemini-pro", safetySettings, generationConfig}); + + const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, { + apiVersion: 'v1beta', + safetySettings, + generationConfig + }); var history = [ { @@ -139,13 +115,12 @@ module.exports = { parts: [{text:`I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], }, ]; - - if (history.length > 0 && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model') { - history[history.length - 1].parts += threadMessages[0].parts; + + if (history.length > 0 && threadMessages && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model' && Array.isArray(history[history.length - 1].parts) && Array.isArray(threadMessages[0].parts)) { + history[history.length - 1].parts = history[history.length - 1].parts.concat(threadMessages[0].parts); threadMessages.shift(); } - - history = history.concat(threadMessages); + history.push(...threadMessages); const chat = model.startChat({ history, @@ -154,82 +129,18 @@ module.exports = { }, }); - const result = await chat.sendMessage(userQuestion); - const response = await result.response; - - const responseLength = response.text().length; - if (responseLength > 2000) { - response.text = response.text().substring(0, 1928 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; - } - clearInterval(loadingInterval); - clearInterval(sendTypingInterval); - - let responseText = response.text(); - const regex = /<@&?\d+>/g; - let match; - - while ((match = regex.exec(responseText)) !== null) { - if (match[0] !== `<@${message.author.id}>`) { - const ping_error = new EmbedBuilder() - .setTitle("⚠️ Response Cannot Be Sent") - .setDescription("> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*") - .setColor("Red") - return await loadingMsg.edit({ embeds: [ping_error] }); - } - } - responseText = responseText.replace(/(https?:\/\/(?!media\.discordapp\.net\/attachments\/)[^\s\)]+)/g, "<$1>"); - const footerText = `Response to message by ${message.author.tag}\n\n${message.content}`; - const truncatedFooterText = footerText.length > 2030 ? `${footerText.slice(0, 2027)}...` : footerText; - - const info = new EmbedBuilder() - .setFooter({text: truncatedFooterText}) - .setColor("Blue") - - return await loadingMsg.edit({ content: responseText, embeds: [info] }); + sendTypingInterval && clearInterval(sendTypingInterval); + await handleResponse(chat, userQuestion, interaction, message, loadingMsg, true) } try{ await run(); } catch (err) { clearInterval(loadingInterval); - clearInterval(sendTypingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); - switch (err.message) { - case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": - const safety_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The response was blocked due to **SAFETY**.*") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [safety_error]}); - - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent: [400 Bad Request] User location is not supported for the API use.": - const location_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The user location is not supported for Gemini API use. Please contact the Developers.*") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [location_error]}); - - case "Cannot send an empty message": - case "response.text is not a function": - const error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [error]}); - - default: - const error_unknown = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - - await loadingMsg.edit({embeds: [error_unknown] - }); - } + handleGeminiError(err, loadingMsg); } } }; \ No newline at end of file diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 4c699d2..349670e 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -9,8 +9,9 @@ const fs = require('fs').promises; const path = require('path'); const { EmbedBuilder } = require("discord.js"); -const { GoogleGenerativeAI, HarmBlockThreshold, HarmCategory } = require("@google/generative-ai"); +const { GoogleGenerativeAI } = require("@google/generative-ai"); const { Gemini_API_KEY } = require("../../../config.json"); +const { botInGuild, safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey } = require("../../../utils"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); @@ -18,24 +19,20 @@ module.exports = { id: "taurus_ai", async execute(interaction) { - if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { - invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription("> **The API Key for Gemini is invalid or not provided.**") - .setColor("Red") - return interaction.reply({ embeds: [invalid_api] }); - } - + if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; + const personalityFilePath = path.join(__dirname + '../../../../personality.txt'); const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); const personalityLines = personalityContent.split('\n'); const userQuestion = interaction.fields.getTextInputValue("question_taurusai"); - let sendTypingInterval = interaction.inGuild() && interaction.client.guilds.cache.has(interaction.guildId) - ? setInterval(() => interaction.channel.sendTyping(), 5000) + const sendTypingInterval = interaction.inGuild() && botInGuild(interaction) + ? setInterval(() => { + interaction.channel.sendTyping(); + }, 5000) : null; - + const loadingEmbed = new EmbedBuilder() .setTitle("**Loading your response . . .**") .setDescription("*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*") @@ -48,28 +45,9 @@ module.exports = { loadingEmbed.setTitle(`**Loading your response ${loadingDots[i]}**`); await loadingMsg.edit({ embeds: [loadingEmbed] }); i = (i + 1) % loadingDots.length; - }, 500); + }, 500); - const safetySettings = [ - { - category: HarmCategory.HARM_CATEGORY_HARASSMENT, - threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, - }, - { - category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - ]; - - const user_status = interaction.inGuild() && interaction.client.guilds.cache.has(interaction.guildId) + const user_status = interaction.inGuild() && botInGuild(interaction) ? interaction.member?.presence.clientStatus : {}; @@ -87,7 +65,12 @@ module.exports = { const generationConfig = { maxOutputTokens: 750, }; - const model = genAI.getGenerativeModel({ model: "gemini-pro", safetySettings, generationConfig}); + + const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, { + apiVersion: 'v1beta', + safetySettings, + generationConfig + }); const chat = model.startChat({ history: [ @@ -104,34 +87,10 @@ module.exports = { maxOutputTokens: 750, }, }); - - const result = await chat.sendMessage(userQuestion); - const response = await result.response; - - const responseLength = response.text().length; - if (responseLength > 2000) { - response.text = response.text().substring(0, 1928 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; - } clearInterval(loadingInterval); clearInterval(sendTypingInterval); - - let responseText = response.text(); - const regex = /<@&?\d+>/g; - let match; - - while ((match = regex.exec(responseText)) !== null) { - if (match[0] !== `<@${interaction.user.id}>`) { - const ping_error = new EmbedBuilder() - .setTitle("⚠️ Response Cannot Be Sent") - .setDescription("> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*") - .setColor("Red") - return await interaction.editReply({ embeds: [ping_error] }); - } - } - - responseText = responseText.replace(/(?"); - return await loadingMsg.edit({ content: responseText, embeds: [] }); + await handleResponse(chat, userQuestion, interaction, false, loadingMsg); } try{ @@ -139,41 +98,8 @@ module.exports = { } catch (err) { clearInterval(loadingInterval); sendTypingInterval && clearInterval(sendTypingInterval); - switch (err.message) { - case "[GoogleGenerativeAI Error]: Text not available. Response was blocked due to SAFETY": - const safety_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*") - .setColor("Red") - - return await interaction.editReply({ embeds: [safety_error]}); - - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent: [400 Bad Request] User location is not supported for the API use.": - const location_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The user location is not supported for Gemini API use. Please contact the Developers.*") - .setColor("Red") - - return await interaction.editReply({ embeds: [location_error]}); - - case "Cannot send an empty message": - case "response.text is not a function": - const error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - - return await interaction.editReply({ embeds: [error]}); - - default: - const error_unknown = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - await interaction.editReply({embeds: [error_unknown] - }); - } + handleGeminiError(err, loadingMsg); } } }; \ No newline at end of file diff --git a/utils.js b/utils.js new file mode 100644 index 0000000..dec91c6 --- /dev/null +++ b/utils.js @@ -0,0 +1,148 @@ +const { HarmCategory, HarmBlockThreshold } = require('@google/generative-ai'); +const { EmbedBuilder } = require("discord.js"); + +function botInGuild(interaction) { + const botGuilds = interaction.client.guilds.cache; + return botGuilds.has(interaction.guildId); +} + +const safetySettings = [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, +]; + +async function handleGeminiError(err, loadingMsg) { + switch (err.message) { + case "[GoogleGenerativeAI Error]: Candidate was blocked due to SAFETY": + const safety_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [safety_error]}); + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [400 Bad Request] User location is not supported for the API use.": + const location_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("> *The user location is not supported for Gemini API use. Please contact the Developers.*") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [location_error]}); + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [429 Too Many Requests] Resource has been exhausted (e.g. check quota).": + const quota_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("There are alot of requests at the moment Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Token Limit for this minute has been reached.") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [quota_error]}); + case "Cannot send an empty message": + case "response.text is not a function": + const error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.") + .setColor("Red") + + return await loadingMsg.edit({ embeds: [error]}); + default: + const error_unknown = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription("An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.*\n> - Token Limit for this minute may have been reached.") + .setColor("Red"); + + return await loadingMsg.edit({embeds: [error_unknown]}); + } +} + +async function handleResponse(chat, userQuestion, interaction, message, loadingMsg, isContextMenuCommand) { + const result = await chat.sendMessage(userQuestion); + const response = await result.response; + + const responseLength = response.text().length; + if (responseLength > 2000) { + response.text = response.text().substring(0, 1928 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; + } + + let responseText = response.text(); + const regex = /<@&?\d+>/g; + let match; + + while ((match = regex.exec(responseText)) !== null) { + const id = interaction ? interaction.user.id : message.author.id; + + if (match[0] !== `<@${id}>`) { + const ping_error = new EmbedBuilder() + .setTitle("⚠️ Response Cannot Be Sent") + .setDescription("> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*") + .setColor("Red") + return await loadingMsg.edit({ embeds: [ping_error] }); + } + } + + let info_embed = []; + if (isContextMenuCommand) { + const footerText = `Response to message by ${message.author.tag}\n\n${message.content}`; + const truncatedFooterText = footerText.length > 2030 ? `${footerText.slice(0, 2027)}...` : footerText; + + const info = new EmbedBuilder() + .setFooter({text: truncatedFooterText}) + .setColor("Blue"); + + info_embed.push(info); + } + + // responseText = responseText.replace(/(https?:\/\/(?!media\.discordapp\.net\/attachments\/)[^\s\)]+)/g, "<$1>"); + return await loadingMsg.edit({ content: responseText, embeds: info_embed }); +} + +async function checkGeminiApiKey(Gemini_API_KEY, interaction, message) { + if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { + const invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription("> **The API Key for Gemini is invalid or not provided.**") + .setColor("Red"); + + return (interaction ? interaction.reply({ embeds: [invalid_api] }) : message.reply({ embeds: [invalid_api] })); + } +} + +async function fetchThreadMessages(Gemini_API_KEY, message) { + let userQuestion; + let threadMessages = []; + + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + const originalMessage = await message.channel.messages.fetch(message.reference.messageId); + + if (originalMessage.author.id !== message.client.user.id) return { userQuestion: null, threadMessages: null }; + + if (originalMessage.author.id === message.client.user.id) { + let currentMessage = message; + + while (currentMessage.reference) { + currentMessage = await message.channel.messages.fetch(currentMessage.reference.messageId); + const sender = currentMessage.author.id === message.client.user.id ? 'model' : 'user'; + let content = currentMessage.content; + if (sender === 'user') { + content = content.replace(/<@\d+>\s*/, ''); + } + threadMessages.unshift({ role: sender, parts: [{text: content}] }); + } + } + userQuestion = message.content + + return { userQuestion, threadMessages }; +} + +module.exports = { botInGuild, safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey, fetchThreadMessages }; \ No newline at end of file From b88c5c1ee2a2745397c3b742cd04dc565e93b5a2 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:14:07 +0100 Subject: [PATCH 10/56] Fix Thread Errors --- events/taurusai.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index 4cbbd93..5844cda 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -17,8 +17,8 @@ module.exports = { async execute(message) { if (message.author.bot || message.author.id === message.client.user.id) return; - if (message.type === 21) return; - + if ([18, 21].includes(message.type)) return; + let userQuestion let threadMessages = []; From 2898342e93d2bcd2fe4f0aca7b8ae983fe4ea102 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:30:39 +0100 Subject: [PATCH 11/56] Update Packages --- functions/logConsole.js | 4 +--- package.json | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/functions/logConsole.js b/functions/logConsole.js index c1db88f..5974c7c 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -14,9 +14,7 @@ module.exports = (client) => { function customLogger(type, ...messages) { const combinedMessage = messages.map(m => (typeof m === 'object' ? JSON.stringify(m, null, 2) : m)).join(' '); - if (combinedMessage === "By passing no model path, you're using the model hosted by Infinite.red - Please download and host the model before releasing this in production. See NSFWJS docs for instructions.") { - return; - } + if (combinedMessage === "%cBy not specifying 'modelOrUrl' parameter, you're using the default model: 'MobileNetV2'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model). color: lightblue") return; let messageToSend = combinedMessage; if (combinedMessage.length > 4070) { diff --git a/package.json b/package.json index 2a806bf..672d495 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taurus", - "version": "3.0", + "version": "3.1", "description": "An AI Discord Bot!", "types": "./typings.d.ts", "main": "bot.js", @@ -23,18 +23,18 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.3.1", + "@google/generative-ai": "^0.5.0", "@iamtraction/google-translate": "^2.0.1", "@tensorflow/tfjs-node": "^4.17.0", "api": "^6.1.1", - "axios": "^1.6.7", + "axios": "^1.6.8", "blessed": "^0.1.81", "chalk": "^5.3.0", - "discord-api-types": "^0.37.43", + "discord-api-types": "^0.37.79", "discord.js": "^14.14.1", "figlet": "^1.7.0", "moment": "^2.30.1", - "nsfwjs": "^3.0.0", + "nsfwjs": "^4.1.0", "os": "^0.1.2" } } From 435d65c993667a82a59f4a468d45ae083dc5e135 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:50:14 +0100 Subject: [PATCH 12/56] Format with Prettier --- .prettierignore | 2 + README.md | 13 +- bot.js | 56 +- events/autocompleteInteraction.js | 4 +- events/contextInteraction.js | 22 +- events/modalInteraction.js | 10 +- events/onMention.js | 11 +- events/onReady.js | 15 +- events/slashCreate.js | 30 +- events/taurusai.js | 259 ++++---- functions/logConsole.js | 134 ++-- .../autocomplete/category/image_model.js | 29 +- .../context-menus/message/taurusai.js | 284 +++++---- interactions/modals/category/ask.js | 208 ++++--- interactions/slash/misc/help.js | 31 +- interactions/slash/misc/image.js | 505 ++++++++------- interactions/slash/misc/info.js | 84 +-- interactions/slash/misc/models.js | 101 +-- interactions/slash/misc/personalise.js | 577 ++++++++++-------- interactions/slash/misc/taurusai.js | 47 +- messages/defaultModalError.js | 4 +- package.json | 3 + start.mjs | 143 +++-- typings.d.ts | 16 +- utils.js | 298 +++++---- 25 files changed, 1601 insertions(+), 1285 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ab3c681 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.github +package.json \ No newline at end of file diff --git a/README.md b/README.md index df56bac..1d86f3b 100644 --- a/README.md +++ b/README.md @@ -3,29 +3,32 @@

## 🤔 What is this bot? + The **Taurus Discord Bot** is a small bot, it can be used for several things such as: + - Image Generation - AI GPT chats and personality customisations ## 💾 Install -1. fill in the token and other values in ``config.json.example`` +1. fill in the token and other values in `config.json.example` -2. Rename the file to ``config.json`` +2. Rename the file to `config.json` -3. Run ``npm i`` +3. Run `npm i` -4. Run ``node bot`` +4. Run `node bot` **Note** - Alternatively **instead of steps 3 & 4** you can **run one of the startbot/start scripts.** - All PR's are welcome for improvements. ### ℹ️ Getting API Keys: + - https://ai.google.dev - https://app.prodia.com/api ### 🏗️ Additional Credits - This bot utilizes a modified version of the [discord bot template](https://github.com/NamVr/DiscordBot-Template) made - by [Naman Vrati](https://github.com/NamVr)! [\[Apache License 2.0\]](https://github.com/NamVr/DiscordBot-Template/blob/master/LICENSE) \ No newline at end of file + by [Naman Vrati](https://github.com/NamVr)! [\[Apache License 2.0\]](https://github.com/NamVr/DiscordBot-Template/blob/master/LICENSE) diff --git a/bot.js b/bot.js index 63bf91a..b4b3c8e 100644 --- a/bot.js +++ b/bot.js @@ -16,7 +16,7 @@ const { Partials, REST, Routes, - SlashCommandBuilder + SlashCommandBuilder, } = require("discord.js"); const { token, client_id } = require("./config.json"); @@ -58,7 +58,7 @@ for (const file of eventFiles) { } else { client.on( event.name, - async (...args) => await event.execute(...args, client) + async (...args) => await event.execute(...args, client), ); } } @@ -114,7 +114,9 @@ for (const module of autocompleteInteractions) { .filter((file) => file.endsWith(".js")); for (const interactionFile of files) { - const interaction = require(`./interactions/autocomplete/${module}/${interactionFile}`); + const interaction = require( + `./interactions/autocomplete/${module}/${interactionFile}`, + ); client.autocompleteInteractions.set(interaction.name, interaction); } } @@ -142,7 +144,6 @@ for (const folder of contextMenus) { } } - /**********************************************************************/ // Registration of Modal-Command Interactions. @@ -179,11 +180,11 @@ const functionFiles = fs.readdirSync("./functions"); // Loop through all files and store functions in functions collection. for (const functionFile of functionFiles) { - if (functionFile.endsWith(".js")) { - const func = require(`./functions/${functionFile}`); - client.functions.set(functionFile.replace('.js', ''), func); - func(client); - } + if (functionFile.endsWith(".js")) { + const func = require(`./functions/${functionFile}`); + client.functions.set(functionFile.replace(".js", ""), func); + func(client); + } } /**********************************************************************/ @@ -192,18 +193,19 @@ for (const functionFile of functionFiles) { const rest = new REST({ version: "9" }).setToken(token); const commandJsonData = [ - ...Array.from(client.slashCommands.values()).map((c) => { - const commandData = c.data instanceof SlashCommandBuilder ? c.data.toJSON() : c.data; - commandData.integration_types = [1]; - commandData.contexts = [0, 1, 2]; - return commandData; - }), + ...Array.from(client.slashCommands.values()).map((c) => { + const commandData = + c.data instanceof SlashCommandBuilder ? c.data.toJSON() : c.data; + commandData.integration_types = [1]; + commandData.contexts = [0, 1, 2]; + return commandData; + }), ...Array.from(client.contextCommands.values()).map((c) => { - const commandData = c.data; - commandData.integration_types = [1]; - commandData.contexts = [0, 1, 2]; - return commandData; - }) + const commandData = c.data; + commandData.integration_types = [1]; + commandData.contexts = [0, 1, 2]; + return commandData; + }), ]; (async () => { @@ -213,7 +215,7 @@ const commandJsonData = [ await rest.put( Routes.applicationCommands(client_id), - { body: commandJsonData } + { body: commandJsonData }, ); console.log("Successfully reloaded application (/) commands."); @@ -233,15 +235,15 @@ process.on("unhandledRejection", (reason, promise) => { // Uncomment the below lines below to see the full error details. - ADVANCED DEBUGGING // - // console.dir(reason, { showHidden: true, depth: null }); - // console.log("Promise: ", promise); + // console.dir(reason, { showHidden: true, depth: null }); + // console.log("Promise: ", promise); }); process.on("uncaughtException", (error, origin) => { console.error(`🚫 Critical Error detected:\n\n`, error, origin); - + // Uncomment the below lines below to see the full error details. - ADVANCED DEBUGGING // - // console.dir(error, { showHidden: true, depth: null }); - // console.log("Origin: ", origin); -}); \ No newline at end of file + // console.dir(error, { showHidden: true, depth: null }); + // console.log("Origin: ", origin); +}); diff --git a/events/autocompleteInteraction.js b/events/autocompleteInteraction.js index 1e23c64..9349331 100644 --- a/events/autocompleteInteraction.js +++ b/events/autocompleteInteraction.js @@ -27,7 +27,7 @@ module.exports = { // Checks if the request is available in our code. const request = client.autocompleteInteractions.get( - interaction.commandName + interaction.commandName, ); // If the interaction is not a request in cache return. @@ -43,4 +43,4 @@ module.exports = { return Promise.reject(err); } }, -}; \ No newline at end of file +}; diff --git a/events/contextInteraction.js b/events/contextInteraction.js index 3109c7d..da2355d 100644 --- a/events/contextInteraction.js +++ b/events/contextInteraction.js @@ -29,7 +29,7 @@ module.exports = { if (interaction.isUserContextMenuCommand()) { const command = client.contextCommands.get( - "USER " + interaction.commandName + "USER " + interaction.commandName, ); // A try to execute the interaction. @@ -39,15 +39,16 @@ module.exports = { } catch (err) { console.error(err); await interaction.reply({ - content: "There was an issue while executing that context command! If the issue persists please contact the bot owners.", - ephemeral: true + content: + "There was an issue while executing that context command! If the issue persists please contact the bot owners.", + ephemeral: true, }); } } // Checks if the interaction target was a message else if (interaction.isMessageContextMenuCommand()) { const command = client.contextCommands.get( - "MESSAGE " + interaction.commandName + "MESSAGE " + interaction.commandName, ); // A try to execute the interaction. @@ -55,10 +56,11 @@ module.exports = { try { return await command.execute(interaction); } catch (err) { - console.dir(err, { showHidden: true }); + console.error(err); await interaction.reply({ - content: "There was an issue while executing that context command! If the issue persists please contact the bot owners.", - ephemeral: true + content: + "There was an issue while executing that context command! If the issue persists please contact the bot owners.", + ephemeral: true, }); } } @@ -67,8 +69,8 @@ module.exports = { // Possible Fix is a restart! else { return console.log( - "Something weird happening in context menu. Received a context menu of unknown type. If the issue persists please contact the bot owners." + "Something weird happening in context menu. Received a context menu of unknown type. If the issue persists please contact the bot owners.", ); } - } -}; \ No newline at end of file + }, +}; diff --git a/events/modalInteraction.js b/events/modalInteraction.js index 828425a..a038e3e 100644 --- a/events/modalInteraction.js +++ b/events/modalInteraction.js @@ -24,7 +24,7 @@ module.exports = { if (!interaction.isModalSubmit()) return; - if (interaction.customId === 'taurus_ai_personality') return; + if (interaction.customId === "taurus_ai_personality") return; const command = client.modalCommands.get(interaction.customId); @@ -32,13 +32,17 @@ module.exports = { // You can modify the error message at ./messages/defaultModalError.js file! if (!command) { - return await require("../messages/defaultModalError").execute(interaction); + return await require("../messages/defaultModalError").execute( + interaction, + ); } // A try to execute the interaction. const error = new EmbedBuilder() - .setDescription("**There was an issue while understanding this modal!\n\nPlease contact the Developers.**") + .setDescription( + "**There was an issue while understanding this modal!\n\nPlease contact the Developers.**", + ) .setColor("Red"); try { diff --git a/events/onMention.js b/events/onMention.js index 2a31b72..3a315b8 100644 --- a/events/onMention.js +++ b/events/onMention.js @@ -5,24 +5,23 @@ const { Events, EmbedBuilder } = require("discord.js"); - module.exports = { name: Events.MessageCreate, - async execute(message) { - - const {client} = message; + const { client } = message; if ( message.content == `<@${client.user.id}>` || message.content == `<@!${client.user.id}>` ) { const bot_message = new EmbedBuilder() - .setDescription(`Hi ${message.author}! I am Taurus. Chat to me by mentioning me and typing your message! Or alternatively run \`/taurus\`!`) + .setDescription( + `Hi ${message.author}! I am Taurus. Chat to me by mentioning me and typing your message! Or alternatively run \`/taurus\`!`, + ) .setColor("Gold"); - return message.reply({embeds: [bot_message]}); + return message.reply({ embeds: [bot_message] }); } }, }; diff --git a/events/onReady.js b/events/onReady.js index da24715..292979c 100644 --- a/events/onReady.js +++ b/events/onReady.js @@ -16,14 +16,15 @@ module.exports = { * @param {import('../typings').Client} client Main Application Client. */ execute(client) { - client.user.setPresence({ - activities: [{ - type: ActivityType.Custom, - name: "Status", - state: "💾 Chilling on my owners computer!" - }] - }) + activities: [ + { + type: ActivityType.Custom, + name: "Status", + state: "💾 Chilling on my owners computer!", + }, + ], + }); console.log(`Ready! Logged in as ${client.user.tag}`); }, diff --git a/events/slashCreate.js b/events/slashCreate.js index 1f9405f..05d66d4 100644 --- a/events/slashCreate.js +++ b/events/slashCreate.js @@ -7,8 +7,8 @@ */ const { Collection, EmbedBuilder, Events } = require("discord.js"), -{ botInGuild } = require("../utils"), -{ owner } = require("../config.json"); + { botInGuild } = require("../utils"), + { owner } = require("../config.json"); module.exports = { name: Events.InteractionCreate, @@ -45,7 +45,11 @@ module.exports = { if (interaction.inGuild()) { if (botInGuild(interaction)) { allowedRoleIds = ["...", "..."]; - if (interaction.member.roles.cache.some(role => allowedRoleIds.includes(role.id))) { + if ( + interaction.member.roles.cache.some((role) => + allowedRoleIds.includes(role.id), + ) + ) { const cooldownPercentage = 0.5; cooldownAmount = Math.floor(cooldownAmount * cooldownPercentage); } @@ -54,10 +58,13 @@ module.exports = { const isOwner = owner.includes(interaction.user.id); if (!isOwner && timestamps.has(interaction.user.id)) { - const expirationTime = timestamps.get(interaction.user.id) + cooldownAmount * 1000; + const expirationTime = + timestamps.get(interaction.user.id) + cooldownAmount * 1000; const timeLeft = (expirationTime - now) / 1000; const embed = new EmbedBuilder() - .setDescription(`Please wait \`\`${timeLeft.toFixed(1)}\`\` more second(s) before reusing the \`${interaction.commandName}\` command.`) + .setDescription( + `Please wait \`\`${timeLeft.toFixed(1)}\`\` more second(s) before reusing the \`${interaction.commandName}\` command.`, + ) .setColor("Orange"); if (now < expirationTime) { const expiredTimestamp = Math.round(expirationTime / 1000); @@ -66,10 +73,15 @@ module.exports = { } timestamps.set(interaction.user.id, now); - setTimeout(() => timestamps.delete(interaction.user.id), cooldownAmount * 1000); + setTimeout( + () => timestamps.delete(interaction.user.id), + cooldownAmount * 1000, + ); const error = new EmbedBuilder() - .setDescription("**There was an issue while executing that command!\n\nPlease contact the Developers.**") + .setDescription( + "**There was an issue while executing that command!\n\nPlease contact the Developers.**", + ) .setColor("Red"); try { @@ -77,8 +89,8 @@ module.exports = { } catch (err) { await interaction.reply({ embeds: [error], - ephemeral: true + ephemeral: true, }); } - } + }, }; diff --git a/events/taurusai.js b/events/taurusai.js index 5844cda..ab23244 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -3,123 +3,152 @@ * @author TechyGiraffe999 */ - const { Events, EmbedBuilder } = require("discord.js"); -const fs = require('fs').promises; -const path = require('path'); +const fs = require("fs").promises; +const path = require("path"); const { GoogleGenerativeAI } = require("@google/generative-ai"); -const { Gemini_API_KEY } = require("../config.json"); -const { safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey, fetchThreadMessages } = require("../utils"); +const { Gemini_API_KEY } = require("../config.json"); +const { + safetySettings, + handleGeminiError, + handleResponse, + checkGeminiApiKey, + fetchThreadMessages, +} = require("../utils"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); module.exports = { - name: Events.MessageCreate, - - async execute(message) { - if (message.author.bot || message.author.id === message.client.user.id) return; - if ([18, 21].includes(message.type)) return; - - let userQuestion - let threadMessages = []; - - if (message.reference) { - const { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages } = await fetchThreadMessages(Gemini_API_KEY, message); - if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; - threadMessages = fetchedThreadMessages; - userQuestion = fetchedUserQuestion - } else if (!message.reference) { - const botMention = `<@${message.client.user.id}>`; - const regex = new RegExp(`^${botMention}\\s+.+`); - - if (!regex.test(message.content)) return; - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; - userQuestion = message.content - .replace(botMention, "") - .trim(); - } - - const user = message.author; - const sendTypingInterval = setInterval(() => { - message.channel.sendTyping(); - }, 5000); - - const loadingEmbed = new EmbedBuilder() - .setTitle("**⌛Loading your response**") - .setDescription("*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*") - .setFooter({text: "This may take a while", iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`}) - .setTimestamp() - const loadingMsg = await message.reply({ embeds: [loadingEmbed] }); - const loadingDots = [" ⌛ ", " ⏳ "]; - let i = 0; - const loadingInterval = setInterval(() => { - loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); - loadingMsg.edit({ embeds: [loadingEmbed] }); - i = (i + 1) % loadingDots.length; - }, 2000); - - const user_status = message.member?.presence.clientStatus || {} - const status_devices = Object.entries(user_status) - .map(([platform, status]) => `${platform}: ${status}`) - .join("\n"); - - const personalityFilePath = path.join(__dirname, '../personality.txt'); - const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); - const personalityLines = personalityContent.split('\n'); - - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.` - - if (Object.keys(user_status).length) { - parts1 += ` The user's presence is currently:\n${status_devices}`; - } - - async function run() { - const generationConfig = { - maxOutputTokens: 750, - }; - - const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, { - apiVersion: 'v1beta', - safetySettings, - generationConfig - }); - - var history = [ - { - role: "user", - parts: [{text: parts1}], - }, - { - role: "model", - parts: [{text:`I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], - }, - ]; - - if (history.length > 0 && threadMessages && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model' && Array.isArray(history[history.length - 1].parts) && Array.isArray(threadMessages[0].parts)) { - history[history.length - 1].parts = history[history.length - 1].parts.concat(threadMessages[0].parts); - threadMessages.shift(); - } - history.push(...threadMessages); - - const chat = model.startChat({ - history, - generationConfig: { - maxOutputTokens: 750, - }, - }); - - clearInterval(loadingInterval); - clearInterval(sendTypingInterval); - await handleResponse(chat, userQuestion, false, message, loadingMsg) - } - - try{ - await run(); - } catch (err) { - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); - - handleGeminiError(err, loadingMsg); - - } - }, -}; \ No newline at end of file + name: Events.MessageCreate, + + async execute(message) { + if (message.author.bot || message.author.id === message.client.user.id) + return; + if ([18, 21].includes(message.type)) return; + + let userQuestion; + let threadMessages = []; + + if (message.reference) { + const { + userQuestion: fetchedUserQuestion, + threadMessages: fetchedThreadMessages, + } = await fetchThreadMessages(Gemini_API_KEY, message); + if (fetchedUserQuestion === null && fetchedThreadMessages === null) + return; + threadMessages = fetchedThreadMessages; + userQuestion = fetchedUserQuestion; + } else if (!message.reference) { + const botMention = `<@${message.client.user.id}>`; + const regex = new RegExp(`^${botMention}\\s+.+`); + + if (!regex.test(message.content)) return; + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + userQuestion = message.content.replace(botMention, "").trim(); + } + + const user = message.author; + const sendTypingInterval = setInterval(() => { + message.channel.sendTyping(); + }, 5000); + + const loadingEmbed = new EmbedBuilder() + .setTitle("**⌛Loading your response**") + .setDescription( + "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", + ) + .setFooter({ + text: "This may take a while", + iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`, + }) + .setTimestamp(); + const loadingMsg = await message.reply({ embeds: [loadingEmbed] }); + const loadingDots = [" ⌛ ", " ⏳ "]; + let i = 0; + const loadingInterval = setInterval(() => { + loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); + loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 2000); + + const user_status = message.member?.presence.clientStatus || {}; + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + const personalityFilePath = path.join(__dirname, "../personality.txt"); + const personalityContent = await fs.readFile(personalityFilePath, "utf-8"); + const personalityLines = personalityContent.split("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.`; + + if (Object.keys(user_status).length) { + parts1 += ` The user's presence is currently:\n${status_devices}`; + } + + async function run() { + const generationConfig = { + maxOutputTokens: 750, + }; + + const model = genAI.getGenerativeModel( + { model: "gemini-1.5-pro-latest" }, + { + apiVersion: "v1beta", + safetySettings, + generationConfig, + }, + ); + + var history = [ + { + role: "user", + parts: [{ text: parts1 }], + }, + { + role: "model", + parts: [ + { + text: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + }, + ], + }, + ]; + + if ( + history.length > 0 && + threadMessages && + threadMessages.length > 0 && + history[history.length - 1].role === "model" && + threadMessages[0].role === "model" && + Array.isArray(history[history.length - 1].parts) && + Array.isArray(threadMessages[0].parts) + ) { + history[history.length - 1].parts = history[ + history.length - 1 + ].parts.concat(threadMessages[0].parts); + threadMessages.shift(); + } + history.push(...threadMessages); + + const chat = model.startChat({ + history, + generationConfig: { + maxOutputTokens: 750, + }, + }); + + clearInterval(loadingInterval); + clearInterval(sendTypingInterval); + await handleResponse(chat, userQuestion, false, message, loadingMsg); + } + + try { + await run(); + } catch (err) { + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); + + handleGeminiError(err, loadingMsg); + } + }, +}; diff --git a/functions/logConsole.js b/functions/logConsole.js index 5974c7c..0ffb289 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -1,61 +1,75 @@ module.exports = (client) => { - const { WebhookClient, EmbedBuilder } = require('discord.js'); - const {webhook_url_console_logs} = require('../config.json'); - const webhookURL = webhook_url_console_logs; - - let webhookClient; - try { - webhookClient = new WebhookClient({ url: webhookURL }); - } catch (error) { - console.log('\x1b[31m\x1b[1m%s\x1b[0m', 'CONSOLE LOGGING IN DISCORD DISABLED. WEBHOOK URL NOT PROVIDED OR INVALID.'); - return; - } - - function customLogger(type, ...messages) { - const combinedMessage = messages.map(m => (typeof m === 'object' ? JSON.stringify(m, null, 2) : m)).join(' '); - - if (combinedMessage === "%cBy not specifying 'modelOrUrl' parameter, you're using the default model: 'MobileNetV2'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model). color: lightblue") return; - - let messageToSend = combinedMessage; - if (combinedMessage.length > 4070) { - messageToSend = `${combinedMessage.slice(0, 4067)}...`; - } - - const embed = new EmbedBuilder() - .setDescription(`\`\`\`console\n${messageToSend}\`\`\``) - .setColor(0x3498DB) - - if (type === 'error') { - embed.setColor('Red'); - } else if (type === 'warn') { - embed.setColor('Orange'); - } else if (combinedMessage === 'Started refreshing application (/) commands.' || - combinedMessage === 'Successfully reloaded application (/) commands.' || - combinedMessage.startsWith('Ready! Logged in as')) { - embed.setColor('Green'); - if (combinedMessage === 'Started refreshing application (/) commands.') { - embed.setTitle('💾 Console Log'); - } - } - - webhookClient.send({ - username: 'Taurus Console', - avatarURL: 'https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c', - embeds: [embed] - }).catch(console.error); - - console.originalLog(combinedMessage); - } - - console.originalLog = console.log; - console.log = customLogger.bind(null, 'log'); - - console.originalError = console.error; - console.error = customLogger.bind(null, 'error'); - - console.originalWarn = console.warn; - console.warn = customLogger.bind(null, 'warn'); - - console.originalInfo = console.info; - console.info = customLogger.bind(null, 'info'); -}; \ No newline at end of file + const { WebhookClient, EmbedBuilder } = require("discord.js"); + const { webhook_url_console_logs } = require("../config.json"); + const webhookURL = webhook_url_console_logs; + + let webhookClient; + try { + webhookClient = new WebhookClient({ url: webhookURL }); + } catch (error) { + console.log( + "\x1b[31m\x1b[1m%s\x1b[0m", + "CONSOLE LOGGING IN DISCORD DISABLED. WEBHOOK URL NOT PROVIDED OR INVALID.", + ); + return; + } + + function customLogger(type, ...messages) { + const combinedMessage = messages + .map((m) => (typeof m === "object" ? JSON.stringify(m, null, 2) : m)) + .join(" "); + + if ( + combinedMessage === + "%cBy not specifying 'modelOrUrl' parameter, you're using the default model: 'MobileNetV2'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model). color: lightblue" + ) + return; + + let messageToSend = combinedMessage; + if (combinedMessage.length > 4070) { + messageToSend = `${combinedMessage.slice(0, 4067)}...`; + } + + const embed = new EmbedBuilder() + .setDescription(`\`\`\`console\n${messageToSend}\`\`\``) + .setColor(0x3498db); + + if (type === "error") { + embed.setColor("Red"); + } else if (type === "warn") { + embed.setColor("Orange"); + } else if ( + combinedMessage === "Started refreshing application (/) commands." || + combinedMessage === "Successfully reloaded application (/) commands." || + combinedMessage.startsWith("Ready! Logged in as") + ) { + embed.setColor("Green"); + if (combinedMessage === "Started refreshing application (/) commands.") { + embed.setTitle("💾 Console Log"); + } + } + + webhookClient + .send({ + username: "Taurus Console", + avatarURL: + "https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c", + embeds: [embed], + }) + .catch(console.error); + + console.originalLog(combinedMessage); + } + + console.originalLog = console.log; + console.log = customLogger.bind(null, "log"); + + console.originalError = console.error; + console.error = customLogger.bind(null, "error"); + + console.originalWarn = console.warn; + console.warn = customLogger.bind(null, "warn"); + + console.originalInfo = console.info; + console.info = customLogger.bind(null, "info"); +}; diff --git a/interactions/autocomplete/category/image_model.js b/interactions/autocomplete/category/image_model.js index fed6ace..ad59571 100644 --- a/interactions/autocomplete/category/image_model.js +++ b/interactions/autocomplete/category/image_model.js @@ -7,39 +7,40 @@ * @type {import("../../../typings").AutocompleteInteraction} */ -const {XProdiaKey} = require('../../../config.json') +const { XProdiaKey } = require("../../../config.json"); module.exports = { name: "image", async execute(interaction) { - const focusedOption = interaction.options.getFocused(); - const sdk = require('api')('@prodia/v1.3.0#6fdmny2flsvwyf65'); + const sdk = require("api")("@prodia/v1.3.0#6fdmny2flsvwyf65"); sdk.auth(XProdiaKey); - + async function fetchAndFormatModels(apiMethod) { try { const { data } = await apiMethod(); const models = JSON.parse(data); return models; } catch (e) { - console.error("Error fetching models: ", e) + console.error("Error fetching models: ", e); } } - + const sdModels = await fetchAndFormatModels(sdk.listModels); const sdxlModels = await fetchAndFormatModels(sdk.listSdxlModels); - + const allModels = sdModels.concat(sdxlModels); - const filteredModels = allModels.filter(model => model.toLowerCase().startsWith(focusedOption.toLowerCase())); - - const results = filteredModels.map(model => ({ + const filteredModels = allModels.filter((model) => + model.toLowerCase().startsWith(focusedOption.toLowerCase()), + ); + + const results = filteredModels.map((model) => ({ name: model, - value: model + value: model, })); - + await interaction.respond(results.slice(0, 25)).catch(() => {}); return; - } -}; \ No newline at end of file + }, +}; diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 712640f..5de91e2 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -8,18 +8,23 @@ */ const { Collection, ChannelType, Events, EmbedBuilder } = require("discord.js"); -const fs = require('fs').promises; -const path = require('path'); +const fs = require("fs").promises; +const path = require("path"); const { GoogleGenerativeAI } = require("@google/generative-ai"); -const { safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey, fetchThreadMessages } = require("../../../utils"); -const { Gemini_API_KEY } = require("../../../config.json"); +const { + safetySettings, + handleGeminiError, + handleResponse, + checkGeminiApiKey, + fetchThreadMessages, +} = require("../../../utils"); +const { Gemini_API_KEY } = require("../../../config.json"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); - module.exports = { data: { name: "Taurus", - type: 3 + type: 3, }, async execute(interaction) { @@ -27,120 +32,153 @@ module.exports = { const message = await channel.messages.fetch(targetId); - if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; - - if (message.author.bot || message.author.id === message.client.user.id){ - return interaction.reply({ content: "I cant reply to myself or another bot!", ephemeral: true}); - } - - - let userQuestion - let threadMessages = []; - - if (message.reference) { - const { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages } = await fetchThreadMessages(Gemini_API_KEY, message); - if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; - threadMessages = fetchedThreadMessages; - userQuestion = fetchedUserQuestion - } else if (!message.reference) { - const botMention = `<@${message.client.user.id}>`; - const regex = new RegExp(`^${botMention}\\s+.+`); - - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; - userQuestion = message.content - .replace(botMention, "") - .trim(); - } - - const sendTypingInterval = setInterval(() => { - interaction.channel.sendTyping(); - }, 5000); - - const user = message.author; - - const loadingEmbed = new EmbedBuilder() - .setTitle("**⌛Loading your response**") - .setDescription("*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*") - .setFooter({text: "This may take a while", iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`}) - .setTimestamp() - const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); - const loadingDots = [" ⌛ ", " ⏳ "]; - let i = 0; - const loadingInterval = setInterval(() => { - loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); - loadingMsg.edit({ embeds: [loadingEmbed] }); - i = (i + 1) % loadingDots.length; - }, 2000); - - const personalityFilePath = path.join(__dirname + '../../../../personality.txt'); - const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); - const personalityLines = personalityContent.split('\n'); - - const botMention = `<@${message.client.user.id}>`; - - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; - userQuestion = message.content - .replace(botMention, "") - .trim(); - - const user_status = message.member?.presence.clientStatus || {} - const status_devices = Object.entries(user_status) - .map(([platform, status]) => `${platform}: ${status}`) - .join("\n"); - - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.` - - if (Object.keys(user_status).length) { - parts1 += ` The user's presence is currently:\n${status_devices}`; - } - - async function run() { - const generationConfig = { - maxOutputTokens: 750, - }; - - const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, { - apiVersion: 'v1beta', - safetySettings, - generationConfig - }); - - var history = [ - { - role: "user", - parts: [{text: parts1}], - }, - { - role: "model", - parts: [{text:`I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], - }, - ]; - - if (history.length > 0 && threadMessages && threadMessages.length > 0 && history[history.length - 1].role === 'model' && threadMessages[0].role === 'model' && Array.isArray(history[history.length - 1].parts) && Array.isArray(threadMessages[0].parts)) { - history[history.length - 1].parts = history[history.length - 1].parts.concat(threadMessages[0].parts); - threadMessages.shift(); - } - history.push(...threadMessages); - - const chat = model.startChat({ - history, - generationConfig: { - maxOutputTokens: 750, - }, - }); - - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); - await handleResponse(chat, userQuestion, interaction, message, loadingMsg, true) - } - - try{ - await run(); - } catch (err) { - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); - - handleGeminiError(err, loadingMsg); - } - } -}; \ No newline at end of file + if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; + + if (message.author.bot || message.author.id === message.client.user.id) { + return interaction.reply({ + content: "I cant reply to myself or another bot!", + ephemeral: true, + }); + } + + let userQuestion; + let threadMessages = []; + + if (message.reference) { + const { + userQuestion: fetchedUserQuestion, + threadMessages: fetchedThreadMessages, + } = await fetchThreadMessages(Gemini_API_KEY, message); + if (fetchedUserQuestion === null && fetchedThreadMessages === null) + return; + threadMessages = fetchedThreadMessages; + userQuestion = fetchedUserQuestion; + } else if (!message.reference) { + const botMention = `<@${message.client.user.id}>`; + const regex = new RegExp(`^${botMention}\\s+.+`); + + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + userQuestion = message.content.replace(botMention, "").trim(); + } + + const sendTypingInterval = setInterval(() => { + interaction.channel.sendTyping(); + }, 5000); + + const user = message.author; + + const loadingEmbed = new EmbedBuilder() + .setTitle("**⌛Loading your response**") + .setDescription( + "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", + ) + .setFooter({ + text: "This may take a while", + iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`, + }) + .setTimestamp(); + const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); + const loadingDots = [" ⌛ ", " ⏳ "]; + let i = 0; + const loadingInterval = setInterval(() => { + loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); + loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 2000); + + const personalityFilePath = path.join( + __dirname + "../../../../personality.txt", + ); + const personalityContent = await fs.readFile(personalityFilePath, "utf-8"); + const personalityLines = personalityContent.split("\n"); + + const botMention = `<@${message.client.user.id}>`; + + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + userQuestion = message.content.replace(botMention, "").trim(); + + const user_status = message.member?.presence.clientStatus || {}; + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.`; + + if (Object.keys(user_status).length) { + parts1 += ` The user's presence is currently:\n${status_devices}`; + } + + async function run() { + const generationConfig = { + maxOutputTokens: 750, + }; + + const model = genAI.getGenerativeModel( + { model: "gemini-1.5-pro-latest" }, + { + apiVersion: "v1beta", + safetySettings, + generationConfig, + }, + ); + + var history = [ + { + role: "user", + parts: [{ text: parts1 }], + }, + { + role: "model", + parts: [ + { + text: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + }, + ], + }, + ]; + + if ( + history.length > 0 && + threadMessages && + threadMessages.length > 0 && + history[history.length - 1].role === "model" && + threadMessages[0].role === "model" && + Array.isArray(history[history.length - 1].parts) && + Array.isArray(threadMessages[0].parts) + ) { + history[history.length - 1].parts = history[ + history.length - 1 + ].parts.concat(threadMessages[0].parts); + threadMessages.shift(); + } + history.push(...threadMessages); + + const chat = model.startChat({ + history, + generationConfig: { + maxOutputTokens: 750, + }, + }); + + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); + await handleResponse( + chat, + userQuestion, + interaction, + message, + loadingMsg, + true, + ); + } + + try { + await run(); + } catch (err) { + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); + + handleGeminiError(err, loadingMsg); + } + }, +}; diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 349670e..9d57fc3 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -6,100 +6,122 @@ /** * @type {import("../../../../typings").ModalInteractionCommand} */ -const fs = require('fs').promises; -const path = require('path'); -const { EmbedBuilder } = require("discord.js"); +const fs = require("fs").promises; +const path = require("path"); +const { EmbedBuilder } = require("discord.js"); const { GoogleGenerativeAI } = require("@google/generative-ai"); -const { Gemini_API_KEY } = require("../../../config.json"); -const { botInGuild, safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey } = require("../../../utils"); +const { Gemini_API_KEY } = require("../../../config.json"); +const { + botInGuild, + safetySettings, + handleGeminiError, + handleResponse, + checkGeminiApiKey, +} = require("../../../utils"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); - module.exports = { - id: "taurus_ai", - - async execute(interaction) { - if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; - - const personalityFilePath = path.join(__dirname + '../../../../personality.txt'); - const personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); - const personalityLines = personalityContent.split('\n'); - - const userQuestion = interaction.fields.getTextInputValue("question_taurusai"); - - const sendTypingInterval = interaction.inGuild() && botInGuild(interaction) - ? setInterval(() => { - interaction.channel.sendTyping(); - }, 5000) - : null; - - const loadingEmbed = new EmbedBuilder() - .setTitle("**Loading your response . . .**") - .setDescription("*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*") - .setFooter({text: "⏳ This may take a while", iconURL: interaction.user.displayAvatarURL()}) - .setTimestamp() - const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); - const loadingDots = [""," . ", " . . ", " . . ."]; - let i = 0; - const loadingInterval = setInterval(async () => { - loadingEmbed.setTitle(`**Loading your response ${loadingDots[i]}**`); - await loadingMsg.edit({ embeds: [loadingEmbed] }); - i = (i + 1) % loadingDots.length; - }, 500); - - const user_status = interaction.inGuild() && botInGuild(interaction) - ? interaction.member?.presence.clientStatus - : {}; - - const status_devices = Object.entries(user_status) - .map(([platform, status]) => `${platform}: ${status}`) - .join("\n"); - - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}>.` - - if (Object.keys(user_status).length) { - parts1 += ` The user's presence is currently:\n${status_devices}`; - } - - async function run() { - const generationConfig = { - maxOutputTokens: 750, - }; - - const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }, { - apiVersion: 'v1beta', - safetySettings, - generationConfig - }); - - const chat = model.startChat({ - history: [ - { - role: "user", - parts: [{text: parts1}], - }, - { - role: "model", - parts: [{text: `I will greet the user with their name: <@${interaction.user.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`}], - }, - ], - generationConfig: { - maxOutputTokens: 750, - }, - }); - - clearInterval(loadingInterval); - clearInterval(sendTypingInterval); - await handleResponse(chat, userQuestion, interaction, false, loadingMsg); - } - - try{ - await run(); - } catch (err) { - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); - - handleGeminiError(err, loadingMsg); - } - } -}; \ No newline at end of file + id: "taurus_ai", + + async execute(interaction) { + if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; + + const personalityFilePath = path.join( + __dirname + "../../../../personality.txt", + ); + const personalityContent = await fs.readFile(personalityFilePath, "utf-8"); + const personalityLines = personalityContent.split("\n"); + + const userQuestion = + interaction.fields.getTextInputValue("question_taurusai"); + + const sendTypingInterval = + interaction.inGuild() && botInGuild(interaction) + ? setInterval(() => { + interaction.channel.sendTyping(); + }, 5000) + : null; + + const loadingEmbed = new EmbedBuilder() + .setTitle("**Loading your response . . .**") + .setDescription( + "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", + ) + .setFooter({ + text: "⏳ This may take a while", + iconURL: interaction.user.displayAvatarURL(), + }) + .setTimestamp(); + const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); + const loadingDots = ["", " . ", " . . ", " . . ."]; + let i = 0; + const loadingInterval = setInterval(async () => { + loadingEmbed.setTitle(`**Loading your response ${loadingDots[i]}**`); + await loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 500); + + const user_status = + interaction.inGuild() && botInGuild(interaction) + ? interaction.member?.presence.clientStatus + : {}; + + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}>.`; + + if (Object.keys(user_status).length) { + parts1 += ` The user's presence is currently:\n${status_devices}`; + } + + async function run() { + const generationConfig = { + maxOutputTokens: 750, + }; + + const model = genAI.getGenerativeModel( + { model: "gemini-1.5-pro-latest" }, + { + apiVersion: "v1beta", + safetySettings, + generationConfig, + }, + ); + + const chat = model.startChat({ + history: [ + { + role: "user", + parts: [{ text: parts1 }], + }, + { + role: "model", + parts: [ + { + text: `I will greet the user with their name: <@${interaction.user.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + }, + ], + }, + ], + generationConfig: { + maxOutputTokens: 750, + }, + }); + + clearInterval(loadingInterval); + clearInterval(sendTypingInterval); + await handleResponse(chat, userQuestion, interaction, false, loadingMsg); + } + + try { + await run(); + } catch (err) { + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); + + handleGeminiError(err, loadingMsg); + } + }, +}; diff --git a/interactions/slash/misc/help.js b/interactions/slash/misc/help.js index f376bca..f04bc30 100644 --- a/interactions/slash/misc/help.js +++ b/interactions/slash/misc/help.js @@ -3,25 +3,28 @@ * @author TechyGiraffe999 */ - const { EmbedBuilder, SlashCommandBuilder, Embed } = require("discord.js"); /** * @type {import('../../../typings').SlashInteractionCommand} */ module.exports = { - data: new SlashCommandBuilder() - .setName('help') - .setDescription('Display available slash commands'), - async execute(interaction, client) { - const commands = interaction.client.slashCommands; - const commandList = commands.map((command) => `**/${command.data.name}**: ${command.data.description}`).join('\n'); + data: new SlashCommandBuilder() + .setName("help") + .setDescription("Display available slash commands"), + async execute(interaction, client) { + const commands = interaction.client.slashCommands; + const commandList = commands + .map( + (command) => `**/${command.data.name}**: ${command.data.description}`, + ) + .join("\n"); - const embed = new EmbedBuilder() - .setTitle("⚙️ Available Commands") - .setDescription(commandList) - .setColor("Blurple") + const embed = new EmbedBuilder() + .setTitle("⚙️ Available Commands") + .setDescription(commandList) + .setColor("Blurple"); - await interaction.reply({ embeds: [embed] }); - }, -}; \ No newline at end of file + await interaction.reply({ embeds: [embed] }); + }, +}; diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index 0cf24fe..fb51c4f 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -7,245 +7,280 @@ * @type {import('../../../typings').SlashInteractionCommand} */ -const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); -const {XProdiaKey, Block_NSFW_Images} = require('../../../config.json') +const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); +const { XProdiaKey, Block_NSFW_Images } = require("../../../config.json"); const translate = require("@iamtraction/google-translate"); -const axios = require('axios'); -const tf = require('@tensorflow/tfjs-node'); -const nsfw = require('nsfwjs'); +const axios = require("axios"); +const tf = require("@tensorflow/tfjs-node"); +const nsfw = require("nsfwjs"); module.exports = { - data: new SlashCommandBuilder() - .setName('image') - .setDescription('Have AI generate an image!') - .addStringOption(o => o.setName('prompt').setDescription('The description of the image to generate!').setRequired(true)) - .addStringOption(o => o.setName('model').setDescription('The Model to Use').setAutocomplete(true)) - .addStringOption(o => o.setName('negative-prompt').setDescription('The Negative Prompt to Use')) - .addIntegerOption(option => - option.setName("steps") - .setDescription("The Number of Steps to Use") - .setMinValue(1) - .setMaxValue(30) - ) - .addIntegerOption(option => - option.setName("cfg-scale") - .setDescription("The CFG Scale") - .setMinValue(1) - .setMaxValue(30) - ) - .addIntegerOption(option => - option.setName("seed") - .setDescription("The Seed") - .setMinValue(-1) - ) - .addStringOption(option => - option.setName("style-preset") + data: new SlashCommandBuilder() + .setName("image") + .setDescription("Have AI generate an image!") + .addStringOption((o) => + o + .setName("prompt") + .setDescription("The description of the image to generate!") + .setRequired(true), + ) + .addStringOption((o) => + o + .setName("model") + .setDescription("The Model to Use") + .setAutocomplete(true), + ) + .addStringOption((o) => + o.setName("negative-prompt").setDescription("The Negative Prompt to Use"), + ) + .addIntegerOption((option) => + option + .setName("steps") + .setDescription("The Number of Steps to Use") + .setMinValue(1) + .setMaxValue(30), + ) + .addIntegerOption((option) => + option + .setName("cfg-scale") + .setDescription("The CFG Scale") + .setMinValue(1) + .setMaxValue(30), + ) + .addIntegerOption((option) => + option.setName("seed").setDescription("The Seed").setMinValue(-1), + ) + .addStringOption((option) => + option + .setName("style-preset") .setDescription("The Image Style Prese") .addChoices( { name: "3d Model", value: "3d-model" }, { name: "Analog Film", value: "analog-film" }, - { name: "Anime", value: "anime" }, - { name: "Cinematic", value: "cinematic" }, - { name: "Comic Book", value: "comic-book" }, - { name: "Digital Art", value: "digital-art" }, - { name: "Enhance", value: "enhance" }, - { name: "Fantasy Art", value: "fantasy-art" }, - { name: "Isometric", value: "isometric" }, - { name: "Line Art", value: "line-art" }, - { name: "Low Poly", value: "low-poly" }, - { name: "Neon Punk", value: "neon-punk" }, - { name: "Origami", value: "origami" }, - { name: "Photographic", value: "photographic" }, - { name: "Pixel Art", value: "pixel-art" }, - { name: "Texture", value: "texture" }, - { name: "Craft Clay", value: "craft-clay" }, - )) - .addStringOption(option => - option.setName("sampler") - .setDescription("The Image Sampler") - .addChoices( - { name: "Euler a", value: "Euler a" }, - { name: "LMS", value: "LMS" }, - { name: "Heun", value: "Heun" }, - { name: "DPM2", value: "DPM2" }, - { name: "DPM2 a", value: "DPM2 a" }, - { name: "DPM++ 2S a", value: "DPM++ 2S a" }, - { name: "DPM++ 2M", value: "DPM++ 2M" }, - { name: "DPM++ 2M SDE", value: "DPM++ 2M SDE" }, - { name: "DPM++ 2M SDE Heun Karras", value: "DPM++ 2M SDE Heun Karras" }, - { name: "DPM++ 3M SD", value: "DPM++ 3M SD" }, - { name: "DPM++ 3M SD Karras", value: "DPM++ 3M SD Karras" }, - { name: "DPM++ 3M SD Exponential", value: "DPM++ 3M SD Exponential" }, - { name: "DPM fast", value: "DPM fast" }, - { name: "DPM adaptive", value: "DPM adaptive" }, - { name: "LMS Karras", value: "LMS Karras" }, - { name: "DPM2 Karras", value: "DPM2 Karras" }, - { name: "DPM2 a Karras", value: "DPM2 a Karras" }, - { name: "DPM++ 2S a Karras", value: "DPM++ 2S a Karras" }, - { name: "DPM++ 2M Karras", value: "DPM++ 2M Karras" }, - { name: "DPM++ SDE Karras", value: "DPM++ SDE Karras" }, - { name: "DPM++ SDE Karras", value: "DPM++ SDE Karras" }, - { name: "DPM++ 2M SDE Exponential", value: "DPM++ 2M SDE Exponential" }, - { name: "DDIM", value: "DDIM" }, - { name: "PLMS", value: "PLMS" }, - { name: "UniPC", value: "UniPC" }, - )), - - async execute(interaction, client) { - - if (!XProdiaKey || XProdiaKey.length < 4) { - invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription("> **The API Key for Prodia is invalid or not provided.**") - .setColor("Red") - return interaction.reply({ embeds: [invalid_api] }); - } - - const error = new EmbedBuilder() - .setTitle('⚠️ Error!') - .setDescription('**An Error Occured, please try again later!**\n\n> - API Monthly Credits may have been used up\n> - Might be a problem with the API at the moment\n> - Or the Model/Sampler/Style is not available.') - .setColor('Red'); - - await interaction.deferReply(); - - const style_preset = interaction.options.getString('style-preset'); - const steps = interaction.options.getInteger('steps'); - const cfg_scale = interaction.options.getInteger('cfg-scale'); - const seed = interaction.options.getInteger('seed'); - const sampler = interaction.options.getString('sampler'); - - let prompt = interaction.options.getString('prompt'); - let negative_prompt = interaction.options.getString('negative-prompt'); - let model = interaction.options.getString('model'); - - prompt = (await translate(prompt, { to: 'en' })).text; - negative_prompt = (await translate(negative_prompt, { to: 'en' })).text; - - const nsfw_embed = new EmbedBuilder() - .setDescription(`**⚠️ NSFW content detected!**`) - .setColor('Red'); - - if (Block_NSFW_Images) { - try { - const response = await fetch('https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en'); - const data = await response.text(); - let nsfw_words = data.split('\n'); - nsfw_words = nsfw_words.filter(word => word !== 'suck' && word !== 'sucks'); - - let promptWords = prompt.split(' '); - - for (let word of nsfw_words) { - if (promptWords.includes(word)) { - await interaction.followUp({ embeds: [nsfw_embed] }); - return; - } - } - } catch (err) { - console.error(err); - } - } - - async function nsfw_getPic(image) { - const pic = await axios.get(image, { responseType: 'arraybuffer' }); - const model = await nsfw.load(); - image_analyse = await tf.node.decodeImage(pic.data, 3); - const predictions = await model.classify(image_analyse); - image_analyse.dispose(); - - if (predictions[0].probability > 0.5 && (predictions[0].className === "Porn") || (predictions[0].className === "Hentai") || (predictions[0].className === "Sexy")) { - await interaction.followUp({ embeds: [nsfw_embed] }); - return true; - } - return image - } - - const sdk = require('api')('@prodia/v1.3.0#6fdmny2flsvwyf65'); - - sdk.auth(XProdiaKey); - - async function fetchModels(apiMethod) { - try { - const { data } = await apiMethod(); - return JSON.parse(data); - } catch (e) { - return interaction.followUp({embeds: [error]}); - } - } - - const choices = await fetchModels(sdk.listModels); - const sdxlChoices = await fetchModels(sdk.listSdxlModels); - - const allModels = [...choices, ...sdxlChoices]; - - if (model && !allModels.includes(model)) { - const no_model = new EmbedBuilder() - .setDescription(`**${model}** is not a valid model!\n\n> Run \`/models\` to see the available models!`) - .setColor('Red'); - - return interaction.followUp({embeds: [no_model]}); - } - - if (!model) { - model = "absolutereality_V16.safetensors [37db0fc3]"; - } - - let generateParams = { - model: model, - prompt: prompt, - ...(style_preset && { style_preset: style_preset }), - ...(negative_prompt && { negative_prompt: negative_prompt }), - ...(steps && { steps: steps }), - ...(sampler && { sampler: sampler }), - ...(cfg_scale && { cfg_scale: cfg_scale }), - ...(seed && { seed: seed }) - }; - - - - try{ - const generateMethod = sdxlChoices.includes(model) ? sdk.sdxlGenerate : sdk.generate; - generateMethod(generateParams) - .then(({ data }) => { - const jobId = data.job; - const intervalId = setInterval(() => { - sdk.getJob({jobId: jobId}) - .then(({ data }) => { - if (data.status === 'succeeded') { - clearInterval(intervalId); - - let image = data.imageUrl; - - (async () => { - if (Block_NSFW_Images) { - const newImage = await nsfw_getPic(image); - image = newImage; - if (image === true) { - return; - } - } - - const success = new EmbedBuilder() - .setImage(image) - .setTitle('🖼️ Generated Image!') - .setDescription(`> **${prompt}**`) - .setColor('Random') - .setFooter({ text: `Requested by ${interaction.user.tag}, Powered By Prodia`, iconURL: interaction.user.displayAvatarURL() }) - - return interaction.followUp({embeds: [success]}); - - })(); - - } else if (data.status === 'failed') { - clearInterval(intervalId); - return interaction.followUp({embeds: [error]}); - } - }) - .catch(err => console.error(err)); - }, 2000); - }) - .catch(err => console.error(err)); - } catch(err) { - return interaction.followUp({embeds: [error]}); - } - } -} \ No newline at end of file + { name: "Anime", value: "anime" }, + { name: "Cinematic", value: "cinematic" }, + { name: "Comic Book", value: "comic-book" }, + { name: "Digital Art", value: "digital-art" }, + { name: "Enhance", value: "enhance" }, + { name: "Fantasy Art", value: "fantasy-art" }, + { name: "Isometric", value: "isometric" }, + { name: "Line Art", value: "line-art" }, + { name: "Low Poly", value: "low-poly" }, + { name: "Neon Punk", value: "neon-punk" }, + { name: "Origami", value: "origami" }, + { name: "Photographic", value: "photographic" }, + { name: "Pixel Art", value: "pixel-art" }, + { name: "Texture", value: "texture" }, + { name: "Craft Clay", value: "craft-clay" }, + ), + ) + .addStringOption((option) => + option.setName("sampler").setDescription("The Image Sampler").addChoices( + { name: "Euler a", value: "Euler a" }, + { name: "LMS", value: "LMS" }, + { name: "Heun", value: "Heun" }, + { name: "DPM2", value: "DPM2" }, + { name: "DPM2 a", value: "DPM2 a" }, + { name: "DPM++ 2S a", value: "DPM++ 2S a" }, + { name: "DPM++ 2M", value: "DPM++ 2M" }, + { name: "DPM++ 2M SDE", value: "DPM++ 2M SDE" }, + { + name: "DPM++ 2M SDE Heun Karras", + value: "DPM++ 2M SDE Heun Karras", + }, + { name: "DPM++ 3M SD", value: "DPM++ 3M SD" }, + { name: "DPM++ 3M SD Karras", value: "DPM++ 3M SD Karras" }, + { name: "DPM++ 3M SD Exponential", value: "DPM++ 3M SD Exponential" }, + { name: "DPM fast", value: "DPM fast" }, + { name: "DPM adaptive", value: "DPM adaptive" }, + { name: "LMS Karras", value: "LMS Karras" }, + { name: "DPM2 Karras", value: "DPM2 Karras" }, + { name: "DPM2 a Karras", value: "DPM2 a Karras" }, + { name: "DPM++ 2S a Karras", value: "DPM++ 2S a Karras" }, + { name: "DPM++ 2M Karras", value: "DPM++ 2M Karras" }, + { name: "DPM++ SDE Karras", value: "DPM++ SDE Karras" }, + { name: "DPM++ SDE Karras", value: "DPM++ SDE Karras" }, + { + name: "DPM++ 2M SDE Exponential", + value: "DPM++ 2M SDE Exponential", + }, + { name: "DDIM", value: "DDIM" }, + { name: "PLMS", value: "PLMS" }, + { name: "UniPC", value: "UniPC" }, + ), + ), + + async execute(interaction, client) { + if (!XProdiaKey || XProdiaKey.length < 4) { + invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription( + "> **The API Key for Prodia is invalid or not provided.**", + ) + .setColor("Red"); + return interaction.reply({ embeds: [invalid_api] }); + } + + const error = new EmbedBuilder() + .setTitle("⚠️ Error!") + .setDescription( + "**An Error Occured, please try again later!**\n\n> - API Monthly Credits may have been used up\n> - Might be a problem with the API at the moment\n> - Or the Model/Sampler/Style is not available.", + ) + .setColor("Red"); + + await interaction.deferReply(); + + const style_preset = interaction.options.getString("style-preset"); + const steps = interaction.options.getInteger("steps"); + const cfg_scale = interaction.options.getInteger("cfg-scale"); + const seed = interaction.options.getInteger("seed"); + const sampler = interaction.options.getString("sampler"); + + let prompt = interaction.options.getString("prompt"); + let negative_prompt = interaction.options.getString("negative-prompt"); + let model = interaction.options.getString("model"); + + prompt = (await translate(prompt, { to: "en" })).text; + negative_prompt = (await translate(negative_prompt, { to: "en" })).text; + + const nsfw_embed = new EmbedBuilder() + .setDescription(`**⚠️ NSFW content detected!**`) + .setColor("Red"); + + if (Block_NSFW_Images) { + try { + const response = await fetch( + "https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en", + ); + const data = await response.text(); + let nsfw_words = data.split("\n"); + nsfw_words = nsfw_words.filter( + (word) => word !== "suck" && word !== "sucks", + ); + + let promptWords = prompt.split(" "); + + for (let word of nsfw_words) { + if (promptWords.includes(word)) { + await interaction.followUp({ embeds: [nsfw_embed] }); + return; + } + } + } catch (err) { + console.error(err); + } + } + + async function nsfw_getPic(image) { + const pic = await axios.get(image, { responseType: "arraybuffer" }); + const model = await nsfw.load(); + image_analyse = await tf.node.decodeImage(pic.data, 3); + const predictions = await model.classify(image_analyse); + image_analyse.dispose(); + + if ( + (predictions[0].probability > 0.5 && + predictions[0].className === "Porn") || + predictions[0].className === "Hentai" || + predictions[0].className === "Sexy" + ) { + await interaction.followUp({ embeds: [nsfw_embed] }); + return true; + } + return image; + } + + const sdk = require("api")("@prodia/v1.3.0#6fdmny2flsvwyf65"); + + sdk.auth(XProdiaKey); + + async function fetchModels(apiMethod) { + try { + const { data } = await apiMethod(); + return JSON.parse(data); + } catch (e) { + return interaction.followUp({ embeds: [error] }); + } + } + + const choices = await fetchModels(sdk.listModels); + const sdxlChoices = await fetchModels(sdk.listSdxlModels); + + const allModels = [...choices, ...sdxlChoices]; + + if (model && !allModels.includes(model)) { + const no_model = new EmbedBuilder() + .setDescription( + `**${model}** is not a valid model!\n\n> Run \`/models\` to see the available models!`, + ) + .setColor("Red"); + + return interaction.followUp({ embeds: [no_model] }); + } + + if (!model) { + model = "absolutereality_V16.safetensors [37db0fc3]"; + } + + let generateParams = { + model: model, + prompt: prompt, + ...(style_preset && { style_preset: style_preset }), + ...(negative_prompt && { negative_prompt: negative_prompt }), + ...(steps && { steps: steps }), + ...(sampler && { sampler: sampler }), + ...(cfg_scale && { cfg_scale: cfg_scale }), + ...(seed && { seed: seed }), + }; + + try { + const generateMethod = sdxlChoices.includes(model) + ? sdk.sdxlGenerate + : sdk.generate; + generateMethod(generateParams) + .then(({ data }) => { + const jobId = data.job; + const intervalId = setInterval(() => { + sdk + .getJob({ jobId: jobId }) + .then(({ data }) => { + if (data.status === "succeeded") { + clearInterval(intervalId); + + let image = data.imageUrl; + + (async () => { + if (Block_NSFW_Images) { + const newImage = await nsfw_getPic(image); + image = newImage; + if (image === true) { + return; + } + } + + const success = new EmbedBuilder() + .setImage(image) + .setTitle("🖼️ Generated Image!") + .setDescription(`> **${prompt}**`) + .setColor("Random") + .setFooter({ + text: `Requested by ${interaction.user.tag}, Powered By Prodia`, + iconURL: interaction.user.displayAvatarURL(), + }); + + return interaction.followUp({ embeds: [success] }); + })(); + } else if (data.status === "failed") { + clearInterval(intervalId); + return interaction.followUp({ embeds: [error] }); + } + }) + .catch((err) => console.error(err)); + }, 2000); + }) + .catch((err) => console.error(err)); + } catch (err) { + return interaction.followUp({ embeds: [error] }); + } + }, +}; diff --git a/interactions/slash/misc/info.js b/interactions/slash/misc/info.js index 899eeb0..4093810 100644 --- a/interactions/slash/misc/info.js +++ b/interactions/slash/misc/info.js @@ -3,45 +3,57 @@ * @author TechyGiraffe999 */ - -const { EmbedBuilder, SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder } = require("discord.js"); +const { + EmbedBuilder, + SlashCommandBuilder, + ButtonBuilder, + ButtonStyle, + ActionRowBuilder, +} = require("discord.js"); /** * @type {import('../../../typings').SlashInteractionCommand} */ module.exports = { - data: new SlashCommandBuilder() - .setName('info') - .setDescription('Displays info on me!'), - async execute(interaction) { - - const github = new ButtonBuilder() - .setURL('https://github.com/TecEash1/Taurus') - .setLabel('GitHub Repository') - .setEmoji("⚒️") - .setStyle(ButtonStyle.Link); - - const buttons = new ActionRowBuilder() - .addComponents(github); - - let totalSecs = (interaction.client.uptime / 1000); - let days = Math.floor(totalSecs / 86400);totalSecs %= 86400; - let hrs = Math.floor(totalSecs / 3600);totalSecs %= 3600; - let mins = Math.floor(totalSecs / 60); - let seconds = Math.floor(totalSecs % 60); - let uptime = `**${days}**d **${hrs}**h **${mins}**m **${seconds}**s`; - - const embed = new EmbedBuilder() - .setTitle("🤖 Info") - .setDescription("I am a bot created by TechyGiraffe999. I was made to be a specialised AI Bot.") - .addFields( - { name: `**⌛ UPTIME**`, value: `${uptime}`}, - { name: `**📡 PING**`, value: `Responded in \`\`${interaction.client.ws.ping}ms\`\``} - ) - .setThumbnail("https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c") - .setColor("Blurple"); - - await interaction.reply({ embeds: [embed], components: [buttons]}); - }, -}; \ No newline at end of file + data: new SlashCommandBuilder() + .setName("info") + .setDescription("Displays info on me!"), + async execute(interaction) { + const github = new ButtonBuilder() + .setURL("https://github.com/TecEash1/Taurus") + .setLabel("GitHub Repository") + .setEmoji("⚒️") + .setStyle(ButtonStyle.Link); + + const buttons = new ActionRowBuilder().addComponents(github); + + let totalSecs = interaction.client.uptime / 1000; + let days = Math.floor(totalSecs / 86400); + totalSecs %= 86400; + let hrs = Math.floor(totalSecs / 3600); + totalSecs %= 3600; + let mins = Math.floor(totalSecs / 60); + let seconds = Math.floor(totalSecs % 60); + let uptime = `**${days}**d **${hrs}**h **${mins}**m **${seconds}**s`; + + const embed = new EmbedBuilder() + .setTitle("🤖 Info") + .setDescription( + "I am a bot created by TechyGiraffe999. I was made to be a specialised AI Bot.", + ) + .addFields( + { name: `**⌛ UPTIME**`, value: `${uptime}` }, + { + name: `**📡 PING**`, + value: `Responded in \`\`${interaction.client.ws.ping}ms\`\``, + }, + ) + .setThumbnail( + "https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c", + ) + .setColor("Blurple"); + + await interaction.reply({ embeds: [embed], components: [buttons] }); + }, +}; diff --git a/interactions/slash/misc/models.js b/interactions/slash/misc/models.js index a1d4e39..7ee5866 100644 --- a/interactions/slash/misc/models.js +++ b/interactions/slash/misc/models.js @@ -7,55 +7,58 @@ * @type {import('../../../typings').SlashInteractionCommand} */ -const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); -const {XProdiaKey} = require('../../../config.json') - +const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); +const { XProdiaKey } = require("../../../config.json"); module.exports = { - data: new SlashCommandBuilder() - .setName('models') - .setDescription('List the available models for image generation!'), - - async execute(interaction, client) { - - if (!XProdiaKey || XProdiaKey.length < 4) { - invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription("> **The API Key for Prodia is invalid or not provided.**") - .setColor("Red") - return interaction.reply({ embeds: [invalid_api] }); - } - - const error = new EmbedBuilder() - .setTitle("⚠️ An Unknown Error Occured") - .setDescription("> **The Prodia API Key usage may have been used up, or the API is invalid or not working at the moment.**\n\n> Please try again later or contact the developers.") - .setColor("Red") - - await interaction.deferReply(); - - const sdk = require('api')('@prodia/v1.3.0#6fdmny2flsvwyf65'); - - sdk.auth(XProdiaKey); - - async function fetchAndFormatModels(apiMethod) { - try { - const { data } = await apiMethod(); - const models = JSON.parse(data); - return "```\n- " + models.join("\n- ") + "\n```"; - } catch (e) { - return interaction.followUp({embeds: [error]}); - } - } - - const choices_string = await fetchAndFormatModels(sdk.listModels); - const sdxlChoices_string = await fetchAndFormatModels(sdk.listSdxlModels); - - const models = new EmbedBuilder() - .setTitle('🖼️ Available Models') - .setDescription(`**\n🌟 SD Models:**\n\n ${choices_string}\n\n**🚀 SDXL Models:**\n\n ${sdxlChoices_string}`) - .setColor('Random') - - return interaction.followUp({embeds: [models]}); - }, -}; + data: new SlashCommandBuilder() + .setName("models") + .setDescription("List the available models for image generation!"), + + async execute(interaction, client) { + if (!XProdiaKey || XProdiaKey.length < 4) { + invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription( + "> **The API Key for Prodia is invalid or not provided.**", + ) + .setColor("Red"); + return interaction.reply({ embeds: [invalid_api] }); + } + + const error = new EmbedBuilder() + .setTitle("⚠️ An Unknown Error Occured") + .setDescription( + "> **The Prodia API Key usage may have been used up, or the API is invalid or not working at the moment.**\n\n> Please try again later or contact the developers.", + ) + .setColor("Red"); + + await interaction.deferReply(); + + const sdk = require("api")("@prodia/v1.3.0#6fdmny2flsvwyf65"); + sdk.auth(XProdiaKey); + + async function fetchAndFormatModels(apiMethod) { + try { + const { data } = await apiMethod(); + const models = JSON.parse(data); + return "```\n- " + models.join("\n- ") + "\n```"; + } catch (e) { + return interaction.followUp({ embeds: [error] }); + } + } + + const choices_string = await fetchAndFormatModels(sdk.listModels); + const sdxlChoices_string = await fetchAndFormatModels(sdk.listSdxlModels); + + const models = new EmbedBuilder() + .setTitle("🖼️ Available Models") + .setDescription( + `**\n🌟 SD Models:**\n\n ${choices_string}\n\n**🚀 SDXL Models:**\n\n ${sdxlChoices_string}`, + ) + .setColor("Random"); + + return interaction.followUp({ embeds: [models] }); + }, +}; diff --git a/interactions/slash/misc/personalise.js b/interactions/slash/misc/personalise.js index 4f17e30..52c5411 100644 --- a/interactions/slash/misc/personalise.js +++ b/interactions/slash/misc/personalise.js @@ -7,284 +7,355 @@ * @type {import('../../../typings').SlashInteractionCommand} */ -const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder, EmbedBuilder, ButtonBuilder } = require("discord.js"); -const axios = require('axios'); -const fs = require('fs').promises; -const path = require('path'); -const {guild_id_logs, channel_id_logs, owner} = require("../../../config.json"); +const { + SlashCommandBuilder, + ModalBuilder, + TextInputBuilder, + TextInputStyle, + ActionRowBuilder, + EmbedBuilder, + ButtonBuilder, +} = require("discord.js"); +const axios = require("axios"); +const fs = require("fs").promises; +const path = require("path"); +const { + guild_id_logs, + channel_id_logs, + owner, +} = require("../../../config.json"); const serverId = guild_id_logs; const channelId = channel_id_logs; const no_access = new EmbedBuilder() - .setDescription("**Only my developers can directly update my global personality prompt!**\n\nIf you want to suggest a change, please let us know!") + .setDescription( + "**Only my developers can directly update my global personality prompt!**\n\nIf you want to suggest a change, please let us know!", + ) .setColor("Red"); const link_error = new EmbedBuilder() - .setDescription("**The file link is not a valid URL!**") - .setColor("Red"); + .setDescription("**The file link is not a valid URL!**") + .setColor("Red"); const error_null = new EmbedBuilder() - .setDescription("**You must select at least one option!**") - .setColor("Red"); + .setDescription("**You must select at least one option!**") + .setColor("Red"); const error_multiple = new EmbedBuilder() - .setDescription("**You can only select one option!**") - .setColor("Red"); + .setDescription("**You can only select one option!**") + .setColor("Red"); const file_read_error = new EmbedBuilder() - .setDescription("**There was an error while reading the file!**") - .setColor("Red"); + .setDescription("**There was an error while reading the file!**") + .setColor("Red"); const txt_only = new EmbedBuilder() - .setDescription("**You can only upload a .txt file!**") - .setColor("Red"); + .setDescription("**You can only upload a .txt file!**") + .setColor("Red"); module.exports = { data: new SlashCommandBuilder() .setName("personalise") .setDescription("Customise my Personality!") - .addAttachmentOption(option => option - .setRequired(false) - .setName("file") - .setDescription("The personality text file")) - .addStringOption(option => option - .setRequired(false) - .setName("file-link") - .setDescription("The personality text file link")) - .addStringOption(option => - option.setName("other") + .addAttachmentOption((option) => + option + .setRequired(false) + .setName("file") + .setDescription("The personality text file"), + ) + .addStringOption((option) => + option + .setRequired(false) + .setName("file-link") + .setDescription("The personality text file link"), + ) + .addStringOption((option) => + option + .setName("other") .setDescription("Other Options") .addChoices( { name: "Get", value: "get" }, { name: "Modal", value: "modal" }, - )), + ), + ), async execute(interaction) { const file = interaction.options.getAttachment("file"); - const file_link = interaction.options.getString("file-link"); - const other = interaction.options.getString("other"); - - if (!owner.includes(interaction.user.id)) { - return await interaction.reply({ embeds: [no_access], ephemeral: true }); - } - - const selectedOptions = [file, file_link, other].filter(option => option != null).length; - - if (selectedOptions === 0 || selectedOptions > 1) { - const errorMessage = selectedOptions === 0 ? error_null : error_multiple; - return await interaction.reply({ embeds: [errorMessage], ephemeral: true }); - } - - const urlRegex = /^(ftp|http|https):\/\/[^ "]+$/; - if (file_link && !urlRegex.test(file_link)) { - return interaction.reply({ embeds: [link_error], ephemeral: true }); - } - - let personalityPrompt; - - async function getPersonalityPrompt(file, file_link) { - const url = file?.url || file_link; - - try { - const response = await axios.get(url); - return response.data; - } catch (error) { - return error - } - } - - if (file || file_link) { - const url = file?.url || file_link; - - const txtRegex = /\.txt(?=\?|$)/; - if (!txtRegex.test(url)) { - return await interaction.reply({ embeds: [txt_only], ephemeral: true }); - } - - const result = await getPersonalityPrompt(file, file_link); - - if (result instanceof Error) { - return await interaction.reply({ embeds: [file_read_error], ephemeral: true }); - } else { - personalityPrompt = result; - } - } - - - const personalityFilePath = path.join(__dirname + '../../../../personality.txt'); - - - let personalityContent; - try { - personalityContent = await fs.readFile(personalityFilePath, 'utf-8'); - } catch (err) { - console.error(err); - } - - let submitted - let modal_error - - if (other) { - switch(other){ - case "get": - return await interaction.reply({ files: [{ attachment: personalityFilePath, name: 'personality.txt' }], ephemeral: true }); - case "modal": - const personalise = new ModalBuilder() - .setTitle("Customise how Taurus responds") - .setCustomId("taurus_ai_personality"); - - const prompt = new TextInputBuilder() - .setCustomId("personalise_taurusai") - .setRequired(true) - .setLabel("Personality Prompt:") - .setStyle(TextInputStyle.Paragraph); - const prompt2 = new TextInputBuilder() - .setCustomId("personalise_taurusai2") - .setRequired(false) - .setLabel("Extra Space:") - .setStyle(TextInputStyle.Paragraph); - const prompt3 = new TextInputBuilder() - .setCustomId("personalise_taurusai3") - .setRequired(false) - .setLabel("Extra Space:") - .setStyle(TextInputStyle.Paragraph); - - - const taurusai_personality_ActionRow = new ActionRowBuilder().addComponents(prompt); - const taurusai_personality_ActionRow2 = new ActionRowBuilder().addComponents(prompt2); - const taurusai_personality_ActionRow3 = new ActionRowBuilder().addComponents(prompt3); - - personalise.addComponents(taurusai_personality_ActionRow, taurusai_personality_ActionRow2, taurusai_personality_ActionRow3); - await interaction.showModal(personalise); - - submitted = await interaction.awaitModalSubmit({ - time: 300000, - filter: i => i.user.id === interaction.user.id, - }).catch(error => { - modal_error = true; - return false - }) - - if (submitted) { - personalityPrompt = await submitted.fields.getTextInputValue("personalise_taurusai"); - const personalityPrompt2 = await submitted.fields.getTextInputValue("personalise_taurusai2"); - const personalityPrompt3 = await submitted.fields.getTextInputValue("personalise_taurusai3"); - if (personalityPrompt2) { - personalityPrompt += personalityPrompt2; - } - if (personalityPrompt3) { - personalityPrompt += personalityPrompt3; - } - } - } - } - - if (modal_error) return; - - success = new EmbedBuilder() - .setDescription("✅ **Personality prompt updated successfully!**") - .setColor("Green"); - - cancel = new EmbedBuilder() - .setDescription("❌ **Operation cancelled.**") - .setColor("Red"); - - const error = new EmbedBuilder() - .setDescription("⚠️ There was an error while fetching the TaurusAI Log channel, please contact the Developers.") - .setColor("Red"); - - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId('yes_botai_personality') - .setLabel('Update') - .setEmoji('✅') - .setStyle('Primary'), - new ButtonBuilder() - .setCustomId('no_botai_personality') - .setLabel('Cancel') - .setEmoji('❌') - .setStyle('Primary'), - ); - - let personalityContent_truncate = personalityContent; - if (personalityContent.length > 2002) { - personalityContent_truncate = personalityContent.substring(0, 2002) + '...'; - } - - let personalityPrompt_truncate = personalityPrompt; - if (personalityPrompt.length > 2002) { - personalityPrompt_truncate = personalityPrompt.substring(0, 2002) + '...'; - } - - let description = `**Current personality prompt:**\n\`\`\`${personalityContent_truncate}\`\`\`\n\n**New personality prompt:**\n\`\`\`${personalityPrompt_truncate}\`\`\``; - - embed = new EmbedBuilder() - .setTitle("Are you sure you want to update the personality prompt?") - .setDescription(description) - .setFooter({ text: `⚠️ This will wipe the old Prompt, resetting it with the new one.`, iconURL: interaction.user.displayAvatarURL() }) - .setColor("Orange") - - await (submitted ?? interaction).reply({ - embeds: [embed], - components: [row], - files: [{ attachment: personalityFilePath, name: 'current_personality.txt' }], - ephemeral: true - }); - - const filter = i => i.customId === 'yes_botai_personality' || i.customId === 'no_botai_personality'; - const collector = interaction.channel.createMessageComponentCollector({ filter, time: 60000 }); - - collector.on('collect', async i => { - collector.stop(); - if (i.customId === 'yes_botai_personality') { - - const personalityFilePath = path.join(__dirname, '../../../personality.txt'); - const tempFilePath = path.join(__dirname, 'temp.txt'); - - let oldPersonalityContent; - try { - oldPersonalityContent = await fs.readFile(personalityFilePath, 'utf-8'); - await fs.writeFile(tempFilePath, oldPersonalityContent); - } catch (err) { - console.error(err); - } - - await fs.writeFile(personalityFilePath, personalityPrompt); - - try{ - const guild = interaction.client.guilds.cache.get(serverId); - const channel = guild.channels.cache.get(channelId); - - - update = new EmbedBuilder() - .setDescription(`**Personality prompt updated by <@${interaction.user.id}>**`) - .setColor("Orange") - .setFooter({ text: `ID: ${interaction.user.id}`, iconURL: interaction.user.displayAvatarURL() }) - .setTimestamp(); - - await channel.send({ - embeds: [update], - files: [ - { attachment: personalityFilePath, name: 'new_personality.txt' }, - { attachment: tempFilePath, name: 'old_personality.txt' } - ] - }); - await i.update({ embeds: [success], components: [], files: [] }); - } catch (err) { - await i.update({ embeds: [success,error], components: [], files: [] }); - } - - try { - await fs.unlink(tempFilePath); - } catch (err) { - console.error(err); - } - - } else { - await i.update({ embeds: [cancel], components: [], files: [] }); - } - }); - } -} \ No newline at end of file + const file_link = interaction.options.getString("file-link"); + const other = interaction.options.getString("other"); + + if (!owner.includes(interaction.user.id)) { + return await interaction.reply({ embeds: [no_access], ephemeral: true }); + } + + const selectedOptions = [file, file_link, other].filter( + (option) => option != null, + ).length; + + if (selectedOptions === 0 || selectedOptions > 1) { + const errorMessage = selectedOptions === 0 ? error_null : error_multiple; + return await interaction.reply({ + embeds: [errorMessage], + ephemeral: true, + }); + } + + const urlRegex = /^(ftp|http|https):\/\/[^ "]+$/; + if (file_link && !urlRegex.test(file_link)) { + return interaction.reply({ embeds: [link_error], ephemeral: true }); + } + + let personalityPrompt; + + async function getPersonalityPrompt(file, file_link) { + const url = file?.url || file_link; + + try { + const response = await axios.get(url); + return response.data; + } catch (error) { + return error; + } + } + + if (file || file_link) { + const url = file?.url || file_link; + + const txtRegex = /\.txt(?=\?|$)/; + if (!txtRegex.test(url)) { + return await interaction.reply({ embeds: [txt_only], ephemeral: true }); + } + + const result = await getPersonalityPrompt(file, file_link); + + if (result instanceof Error) { + return await interaction.reply({ + embeds: [file_read_error], + ephemeral: true, + }); + } else { + personalityPrompt = result; + } + } + + const personalityFilePath = path.join( + __dirname + "../../../../personality.txt", + ); + + let personalityContent; + try { + personalityContent = await fs.readFile(personalityFilePath, "utf-8"); + } catch (err) { + console.error(err); + } + + let submitted; + let modal_error; + + if (other) { + switch (other) { + case "get": + return await interaction.reply({ + files: [ + { attachment: personalityFilePath, name: "personality.txt" }, + ], + ephemeral: true, + }); + case "modal": + const personalise = new ModalBuilder() + .setTitle("Customise how Taurus responds") + .setCustomId("taurus_ai_personality"); + + const prompt = new TextInputBuilder() + .setCustomId("personalise_taurusai") + .setRequired(true) + .setLabel("Personality Prompt:") + .setStyle(TextInputStyle.Paragraph); + const prompt2 = new TextInputBuilder() + .setCustomId("personalise_taurusai2") + .setRequired(false) + .setLabel("Extra Space:") + .setStyle(TextInputStyle.Paragraph); + const prompt3 = new TextInputBuilder() + .setCustomId("personalise_taurusai3") + .setRequired(false) + .setLabel("Extra Space:") + .setStyle(TextInputStyle.Paragraph); + + const taurusai_personality_ActionRow = + new ActionRowBuilder().addComponents(prompt); + const taurusai_personality_ActionRow2 = + new ActionRowBuilder().addComponents(prompt2); + const taurusai_personality_ActionRow3 = + new ActionRowBuilder().addComponents(prompt3); + + personalise.addComponents( + taurusai_personality_ActionRow, + taurusai_personality_ActionRow2, + taurusai_personality_ActionRow3, + ); + await interaction.showModal(personalise); + + submitted = await interaction + .awaitModalSubmit({ + time: 300000, + filter: (i) => i.user.id === interaction.user.id, + }) + .catch((error) => { + modal_error = true; + return false; + }); + + if (submitted) { + personalityPrompt = await submitted.fields.getTextInputValue( + "personalise_taurusai", + ); + const personalityPrompt2 = await submitted.fields.getTextInputValue( + "personalise_taurusai2", + ); + const personalityPrompt3 = await submitted.fields.getTextInputValue( + "personalise_taurusai3", + ); + if (personalityPrompt2) { + personalityPrompt += personalityPrompt2; + } + if (personalityPrompt3) { + personalityPrompt += personalityPrompt3; + } + } + } + } + + if (modal_error) return; + + success = new EmbedBuilder() + .setDescription("✅ **Personality prompt updated successfully!**") + .setColor("Green"); + + cancel = new EmbedBuilder() + .setDescription("❌ **Operation cancelled.**") + .setColor("Red"); + + const error = new EmbedBuilder() + .setDescription( + "⚠️ There was an error while fetching the TaurusAI Log channel, please contact the Developers.", + ) + .setColor("Red"); + + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder() + .setCustomId("yes_botai_personality") + .setLabel("Update") + .setEmoji("✅") + .setStyle("Primary"), + new ButtonBuilder() + .setCustomId("no_botai_personality") + .setLabel("Cancel") + .setEmoji("❌") + .setStyle("Primary"), + ); + + let personalityContent_truncate = personalityContent; + if (personalityContent.length > 2002) { + personalityContent_truncate = + personalityContent.substring(0, 2002) + "..."; + } + + let personalityPrompt_truncate = personalityPrompt; + if (personalityPrompt.length > 2002) { + personalityPrompt_truncate = personalityPrompt.substring(0, 2002) + "..."; + } + + let description = `**Current personality prompt:**\n\`\`\`${personalityContent_truncate}\`\`\`\n\n**New personality prompt:**\n\`\`\`${personalityPrompt_truncate}\`\`\``; + + embed = new EmbedBuilder() + .setTitle("Are you sure you want to update the personality prompt?") + .setDescription(description) + .setFooter({ + text: `⚠️ This will wipe the old Prompt, resetting it with the new one.`, + iconURL: interaction.user.displayAvatarURL(), + }) + .setColor("Orange"); + + await (submitted ?? interaction).reply({ + embeds: [embed], + components: [row], + files: [ + { attachment: personalityFilePath, name: "current_personality.txt" }, + ], + ephemeral: true, + }); + + const filter = (i) => + i.customId === "yes_botai_personality" || + i.customId === "no_botai_personality"; + const collector = interaction.channel.createMessageComponentCollector({ + filter, + time: 60000, + }); + + collector.on("collect", async (i) => { + collector.stop(); + if (i.customId === "yes_botai_personality") { + const personalityFilePath = path.join( + __dirname, + "../../../personality.txt", + ); + const tempFilePath = path.join(__dirname, "temp.txt"); + + let oldPersonalityContent; + try { + oldPersonalityContent = await fs.readFile( + personalityFilePath, + "utf-8", + ); + await fs.writeFile(tempFilePath, oldPersonalityContent); + } catch (err) { + console.error(err); + } + + await fs.writeFile(personalityFilePath, personalityPrompt); + + try { + const guild = interaction.client.guilds.cache.get(serverId); + const channel = guild.channels.cache.get(channelId); + + update = new EmbedBuilder() + .setDescription( + `**Personality prompt updated by <@${interaction.user.id}>**`, + ) + .setColor("Orange") + .setFooter({ + text: `ID: ${interaction.user.id}`, + iconURL: interaction.user.displayAvatarURL(), + }) + .setTimestamp(); + + await channel.send({ + embeds: [update], + files: [ + { attachment: personalityFilePath, name: "new_personality.txt" }, + { attachment: tempFilePath, name: "old_personality.txt" }, + ], + }); + await i.update({ embeds: [success], components: [], files: [] }); + } catch (err) { + await i.update({ + embeds: [success, error], + components: [], + files: [], + }); + } + + try { + await fs.unlink(tempFilePath); + } catch (err) { + console.error(err); + } + } else { + await i.update({ embeds: [cancel], components: [], files: [] }); + } + }); + }, +}; diff --git a/interactions/slash/misc/taurusai.js b/interactions/slash/misc/taurusai.js index 0bc4d16..53890c3 100644 --- a/interactions/slash/misc/taurusai.js +++ b/interactions/slash/misc/taurusai.js @@ -3,27 +3,34 @@ * @author TechyGiraffe999 */ -const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder, EmbedBuilder } = require("discord.js"); - +const { + SlashCommandBuilder, + ModalBuilder, + TextInputBuilder, + TextInputStyle, + ActionRowBuilder, + EmbedBuilder, +} = require("discord.js"); module.exports = { - data: new SlashCommandBuilder() - .setName('taurus') - .setDescription('Ask Taurus a question!'), - async execute(interaction) { - - const taurus = new ModalBuilder() - .setTitle("Ask TaurusAI something") - .setCustomId("taurus_ai"); + data: new SlashCommandBuilder() + .setName("taurus") + .setDescription("Ask Taurus a question!"), + async execute(interaction) { + const taurus = new ModalBuilder() + .setTitle("Ask TaurusAI something") + .setCustomId("taurus_ai"); - const question = new TextInputBuilder() - .setCustomId("question_taurusai") - .setRequired(true) - .setLabel("Question:") - .setStyle(TextInputStyle.Paragraph); + const question = new TextInputBuilder() + .setCustomId("question_taurusai") + .setRequired(true) + .setLabel("Question:") + .setStyle(TextInputStyle.Paragraph); - const taurusai_question_ActionRow = new ActionRowBuilder().addComponents(question); - taurus.addComponents(taurusai_question_ActionRow); - await interaction.showModal(taurus); - } -}; \ No newline at end of file + const taurusai_question_ActionRow = new ActionRowBuilder().addComponents( + question, + ); + taurus.addComponents(taurusai_question_ActionRow); + await interaction.showModal(taurus); + }, +}; diff --git a/messages/defaultModalError.js b/messages/defaultModalError.js index 284fce2..6a98784 100644 --- a/messages/defaultModalError.js +++ b/messages/defaultModalError.js @@ -5,7 +5,9 @@ const { EmbedBuilder } = require("discord.js"); const error = new EmbedBuilder() - .setDescription("**There was an issue while fetching this modal!\n\nPlease contact the Developers.**") + .setDescription( + "**There was an issue while fetching this modal!\n\nPlease contact the Developers.**", + ) .setColor("Red"); module.exports = { diff --git a/package.json b/package.json index 672d495..9ea014b 100644 --- a/package.json +++ b/package.json @@ -36,5 +36,8 @@ "moment": "^2.30.1", "nsfwjs": "^4.1.0", "os": "^0.1.2" + }, + "devDependencies": { + "prettier": "3.2.5" } } diff --git a/start.mjs b/start.mjs index bb06e74..40738c3 100644 --- a/start.mjs +++ b/start.mjs @@ -8,7 +8,7 @@ import figlet from "figlet"; // Create a screen object. const screen = blessed.screen({ smartCSR: true, - title: "Taurus Bot Console" + title: "Taurus Bot Console", }); // Create a box that fills the entire screen. @@ -20,15 +20,15 @@ const box = blessed.box({ content: "", tags: true, border: { - type: "line" + type: "line", }, style: { fg: "white", bg: "black", border: { - fg: "#ff0000" // Red - } - } + fg: "#ff0000", // Red + }, + }, }); // Create a console box at the top right. @@ -40,15 +40,15 @@ const consoleBox = blessed.box({ content: "{underline}Taurus Console{/underline}", tags: true, border: { - type: "line" + type: "line", }, style: { fg: "white", bg: "black", border: { - fg: "#ff0000" // Red - } - } + fg: "#ff0000", // Red + }, + }, }); // Append our boxes to the screen. @@ -62,13 +62,15 @@ let botStatus = "Offline"; // Function to start the Discord bot. function startBot() { if (bot) { - writeToConsole(chalk.red("Bot is already running. Please stop the bot first.")); + writeToConsole( + chalk.red("Bot is already running. Please stop the bot first."), + ); return; } // Modify this line to start your bot with the correct command and arguments bot = spawn("node", ["bot.js"], { - stdio: ["pipe", "pipe", "pipe", "pipe", "pipe", "pipe", process.stderr] + stdio: ["pipe", "pipe", "pipe", "pipe", "pipe", "pipe", process.stderr], }); botStartTime = moment(); @@ -93,7 +95,9 @@ function startBot() { // Function to stop the Discord bot. function stopBot() { if (!bot) { - writeToConsole(chalk.red("Bot is not running. Please start the bot first.")); + writeToConsole( + chalk.red("Bot is not running. Please start the bot first."), + ); return; } @@ -111,24 +115,26 @@ function stopBot() { // Function to restart the Discord bot. function restartBot() { - stopBot(); - const gitPull = spawn('git', ['pull']); - - gitPull.stdout.on('data', (data) => { - writeToConsole(chalk.italic(`[GIT] stdout: ${data}`)); - }); - - gitPull.stderr.on('data', (data) => { - writeToConsole(chalk.italic(`[GIT] stderr: ${data}`)); - }); - - gitPull.on('close', (code) => { - writeToConsole(chalk.italic(`[GIT] child process exited with code ${code}`)); - setTimeout(() => { - startBot(); - writeToConsole(chalk.red("Bot restarted.")); - }, 1000); - }); + stopBot(); + const gitPull = spawn("git", ["pull"]); + + gitPull.stdout.on("data", (data) => { + writeToConsole(chalk.italic(`[GIT] stdout: ${data}`)); + }); + + gitPull.stderr.on("data", (data) => { + writeToConsole(chalk.italic(`[GIT] stderr: ${data}`)); + }); + + gitPull.on("close", (code) => { + writeToConsole( + chalk.italic(`[GIT] child process exited with code ${code}`), + ); + setTimeout(() => { + startBot(); + writeToConsole(chalk.red("Bot restarted.")); + }, 1000); + }); } // Function to refresh the console. @@ -139,20 +145,24 @@ function refreshConsole() { } let title = ""; -figlet.text("Taurus", { - font: "Standard", - horizontalLayout: "default", - verticalLayout: "default", - width: 100, - whitespaceBreak: true -}, function(err, data) { - if (err) { - console.log("Something went wrong..."); - console.dir(err); - return; - } - title = chalk.red(data); // Red -}); +figlet.text( + "Taurus", + { + font: "Standard", + horizontalLayout: "default", + verticalLayout: "default", + width: 100, + whitespaceBreak: true, + }, + function (err, data) { + if (err) { + console.log("Something went wrong..."); + console.dir(err); + return; + } + title = chalk.red(data); // Red + }, +); // Function to update the box content with system and bot stats function updateStats() { @@ -162,25 +172,27 @@ function updateStats() { const cpuCores = os.cpus().length.toString(); const osInfo = `${os.type()} (${os.release()})`; - const botUptime = botStartTime ? moment.duration(moment().diff(botStartTime)).humanize() : "Not available"; - const botMemoryUsage = (process.memoryUsage().heapUsed / 1024 / 1024 / 1024).toFixed(2) + " GB"; - - box.setContent(`${title}\n\n` + - `${chalk.red("Bot Status:")} ${botStatus === "Online" ? chalk.green(botStatus) : chalk.red(botStatus)}\n\n` + - `${chalk.red("VPS Uptime:")} ${chalk.white(serverUptime)}\n` + - `${chalk.red("Total Memory:")} ${chalk.white(totalMemory)}\n` + - `${chalk.red("Bot Uptime:")} ${chalk.white(botUptime)}\n` + - `${chalk.red("Bot Memory Usage:")} ${chalk.white(botMemoryUsage)}\n` + - `${chalk.red("CPU Threads:")} ${chalk.white(cpuCores)}\n` + - `${chalk.red("OS Info:")} ${chalk.white(osInfo)}\n\n` + - `${chalk.red("Commands:")}\n` + - - `${chalk.green("S")} - ${chalk.white("Start Bot")}\n` + - `${chalk.green("X")} - ${chalk.white("Stop Bot")}\n` + - `${chalk.green("R")} - ${chalk.white("Restart & Update Bot")}\n` + - `${chalk.green("L")} - ${chalk.white("Refresh Console")}\n\n` + - - `${chalk.red("Press")} ${chalk.white("Ctrl+C")} ${chalk.red("to stop the bot and exit.")}\n\n\n` + const botUptime = botStartTime + ? moment.duration(moment().diff(botStartTime)).humanize() + : "Not available"; + const botMemoryUsage = + (process.memoryUsage().heapUsed / 1024 / 1024 / 1024).toFixed(2) + " GB"; + + box.setContent( + `${title}\n\n` + + `${chalk.red("Bot Status:")} ${botStatus === "Online" ? chalk.green(botStatus) : chalk.red(botStatus)}\n\n` + + `${chalk.red("VPS Uptime:")} ${chalk.white(serverUptime)}\n` + + `${chalk.red("Total Memory:")} ${chalk.white(totalMemory)}\n` + + `${chalk.red("Bot Uptime:")} ${chalk.white(botUptime)}\n` + + `${chalk.red("Bot Memory Usage:")} ${chalk.white(botMemoryUsage)}\n` + + `${chalk.red("CPU Threads:")} ${chalk.white(cpuCores)}\n` + + `${chalk.red("OS Info:")} ${chalk.white(osInfo)}\n\n` + + `${chalk.red("Commands:")}\n` + + `${chalk.green("S")} - ${chalk.white("Start Bot")}\n` + + `${chalk.green("X")} - ${chalk.white("Stop Bot")}\n` + + `${chalk.green("R")} - ${chalk.white("Restart & Update Bot")}\n` + + `${chalk.green("L")} - ${chalk.white("Refresh Console")}\n\n` + + `${chalk.red("Press")} ${chalk.white("Ctrl+C")} ${chalk.red("to stop the bot and exit.")}\n\n\n`, ); screen.render(); } @@ -208,7 +220,6 @@ process.on("SIGINT", () => { // Start the bot when script is run initially. startBot(); - // Listen for keystrokes and map them to commands. screen.key(["S", "s"], () => { startBot(); @@ -226,9 +237,9 @@ screen.key(["L", "l"], () => { refreshConsole(); }); -screen.key(["escape", "q", "C-c"], function(ch, key) { +screen.key(["escape", "q", "C-c"], function (ch, key) { return process.exit(0); }); // Render the screen. -screen.render(); \ No newline at end of file +screen.render(); diff --git a/typings.d.ts b/typings.d.ts index 85c0395..4d18b5d 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -56,7 +56,7 @@ export interface LegacyCommand { */ execute( message: Discord.Message & { client: Client }, - args: string[] + args: string[], ): void | Promise; } @@ -84,7 +84,7 @@ export interface SlashInteractionCommand { * @param interaction The interaction that triggered this command. */ execute( - interaction: Discord.ChatInputCommandInteraction & { client: Client } + interaction: Discord.ChatInputCommandInteraction & { client: Client }, ): void | Promise; } @@ -102,7 +102,7 @@ export interface ButtonInteractionCommand { * @param interaction The interaction that triggered this command. */ execute( - interaction: Discord.ButtonInteraction & { client: Client } + interaction: Discord.ButtonInteraction & { client: Client }, ): void | Promise; } @@ -120,7 +120,7 @@ export interface SelectInteractionCommand { * @param interaction The interaction that triggered this command. */ execute( - interaction: Discord.SelectMenuInteraction & { client: Client } + interaction: Discord.SelectMenuInteraction & { client: Client }, ): void | Promise; } @@ -155,7 +155,7 @@ export interface ContextInteractionCommand { * @param interaction The interaction that triggered this command. */ execute( - interaction: Discord.ContextMenuCommandInteraction & { client: Client } + interaction: Discord.ContextMenuCommandInteraction & { client: Client }, ): void | Promise; } @@ -173,7 +173,7 @@ export interface ModalInteractionCommand { * @param interaction The interaction that triggered this command. */ execute( - interaction: Discord.ModalSubmitInteraction & { client: Client } + interaction: Discord.ModalSubmitInteraction & { client: Client }, ): void | Promise; } @@ -192,7 +192,7 @@ export interface TriggerCommand { */ execute( message: Discord.Message & { client: Client }, - args: string[] + args: string[], ): void | Promise; } @@ -210,7 +210,7 @@ export interface AutocompleteInteraction { * @param interaction The interaction that triggered this command. */ execute( - interaction: Discord.AutocompleteInteraction & { client: Client } + interaction: Discord.AutocompleteInteraction & { client: Client }, ): void | Promise; } diff --git a/utils.js b/utils.js index dec91c6..fb2eeac 100644 --- a/utils.js +++ b/utils.js @@ -1,148 +1,188 @@ -const { HarmCategory, HarmBlockThreshold } = require('@google/generative-ai'); +const { HarmCategory, HarmBlockThreshold } = require("@google/generative-ai"); const { EmbedBuilder } = require("discord.js"); function botInGuild(interaction) { - const botGuilds = interaction.client.guilds.cache; - return botGuilds.has(interaction.guildId); + const botGuilds = interaction.client.guilds.cache; + return botGuilds.has(interaction.guildId); } const safetySettings = [ - { - category: HarmCategory.HARM_CATEGORY_HARASSMENT, - threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, - }, - { - category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, ]; async function handleGeminiError(err, loadingMsg) { - switch (err.message) { - case "[GoogleGenerativeAI Error]: Candidate was blocked due to SAFETY": - const safety_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [safety_error]}); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [400 Bad Request] User location is not supported for the API use.": - const location_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("> *The user location is not supported for Gemini API use. Please contact the Developers.*") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [location_error]}); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [429 Too Many Requests] Resource has been exhausted (e.g. check quota).": - const quota_error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("There are alot of requests at the moment Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Token Limit for this minute has been reached.") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [quota_error]}); - case "Cannot send an empty message": - case "response.text is not a function": - const error = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.") - .setColor("Red") - - return await loadingMsg.edit({ embeds: [error]}); - default: - const error_unknown = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription("An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.*\n> - Token Limit for this minute may have been reached.") - .setColor("Red"); - - return await loadingMsg.edit({embeds: [error_unknown]}); - } + switch (err.message) { + case "[GoogleGenerativeAI Error]: Candidate was blocked due to SAFETY": + const safety_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "> *The response was blocked due to **SAFETY**.* \n- *Result based on your input. Safety Blocking may not be 100% correct.*", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [safety_error] }); + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [400 Bad Request] User location is not supported for the API use.": + const location_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "> *The user location is not supported for Gemini API use. Please contact the Developers.*", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [location_error] }); + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [429 Too Many Requests] Resource has been exhausted (e.g. check quota).": + const quota_error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "There are alot of requests at the moment Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Token Limit for this minute has been reached.", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [quota_error] }); + case "Cannot send an empty message": + case "response.text is not a function": + const error = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [error] }); + default: + console.error(err.message); + const error_unknown = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.*\n> - Token Limit for this minute may have been reached.", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [error_unknown] }); + } } -async function handleResponse(chat, userQuestion, interaction, message, loadingMsg, isContextMenuCommand) { - const result = await chat.sendMessage(userQuestion); - const response = await result.response; - - const responseLength = response.text().length; - if (responseLength > 2000) { - response.text = response.text().substring(0, 1928 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; - } - - let responseText = response.text(); - const regex = /<@&?\d+>/g; - let match; - - while ((match = regex.exec(responseText)) !== null) { - const id = interaction ? interaction.user.id : message.author.id; - - if (match[0] !== `<@${id}>`) { - const ping_error = new EmbedBuilder() - .setTitle("⚠️ Response Cannot Be Sent") - .setDescription("> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*") - .setColor("Red") - return await loadingMsg.edit({ embeds: [ping_error] }); - } - } - - let info_embed = []; - if (isContextMenuCommand) { - const footerText = `Response to message by ${message.author.tag}\n\n${message.content}`; - const truncatedFooterText = footerText.length > 2030 ? `${footerText.slice(0, 2027)}...` : footerText; - - const info = new EmbedBuilder() - .setFooter({text: truncatedFooterText}) - .setColor("Blue"); - - info_embed.push(info); - } - - // responseText = responseText.replace(/(https?:\/\/(?!media\.discordapp\.net\/attachments\/)[^\s\)]+)/g, "<$1>"); - return await loadingMsg.edit({ content: responseText, embeds: info_embed }); +async function handleResponse( + chat, + userQuestion, + interaction, + message, + loadingMsg, + isContextMenuCommand, +) { + const result = await chat.sendMessage(userQuestion); + const response = await result.response; + + const responseLength = response.text().length; + if (responseLength > 2000) { + response.text = + response.text().substring(0, 1928 - "... \n\n".length) + + "... \n\n*Response was cut short due to Discords character limit of 2000*"; + } + + let responseText = response.text(); + const regex = /<@&?\d+>/g; + let match; + + while ((match = regex.exec(responseText)) !== null) { + const id = interaction ? interaction.user.id : message.author.id; + + if (match[0] !== `<@${id}>`) { + const ping_error = new EmbedBuilder() + .setTitle("⚠️ Response Cannot Be Sent") + .setDescription( + "> *The generated message contains a mention of a Role or different User to the one that sent the original message/command.*", + ) + .setColor("Red"); + return await loadingMsg.edit({ embeds: [ping_error] }); + } + } + + let info_embed = []; + if (isContextMenuCommand) { + const footerText = `Response to message by ${message.author.tag}\n\n${message.content}`; + const truncatedFooterText = + footerText.length > 2030 ? `${footerText.slice(0, 2027)}...` : footerText; + + const info = new EmbedBuilder() + .setFooter({ text: truncatedFooterText }) + .setColor("Blue"); + + info_embed.push(info); + } + + // responseText = responseText.replace(/(https?:\/\/(?!media\.discordapp\.net\/attachments\/)[^\s\)]+)/g, "<$1>"); + return await loadingMsg.edit({ content: responseText, embeds: info_embed }); } async function checkGeminiApiKey(Gemini_API_KEY, interaction, message) { - if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { - const invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription("> **The API Key for Gemini is invalid or not provided.**") - .setColor("Red"); - - return (interaction ? interaction.reply({ embeds: [invalid_api] }) : message.reply({ embeds: [invalid_api] })); - } + if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { + const invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription( + "> **The API Key for Gemini is invalid or not provided.**", + ) + .setColor("Red"); + + return interaction + ? interaction.reply({ embeds: [invalid_api] }) + : message.reply({ embeds: [invalid_api] }); + } } async function fetchThreadMessages(Gemini_API_KEY, message) { - let userQuestion; - let threadMessages = []; - - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; - const originalMessage = await message.channel.messages.fetch(message.reference.messageId); - - if (originalMessage.author.id !== message.client.user.id) return { userQuestion: null, threadMessages: null }; - - if (originalMessage.author.id === message.client.user.id) { - let currentMessage = message; - - while (currentMessage.reference) { - currentMessage = await message.channel.messages.fetch(currentMessage.reference.messageId); - const sender = currentMessage.author.id === message.client.user.id ? 'model' : 'user'; - let content = currentMessage.content; - if (sender === 'user') { - content = content.replace(/<@\d+>\s*/, ''); - } - threadMessages.unshift({ role: sender, parts: [{text: content}] }); - } - } - userQuestion = message.content - - return { userQuestion, threadMessages }; + let userQuestion; + let threadMessages = []; + + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + const originalMessage = await message.channel.messages.fetch( + message.reference.messageId, + ); + + if (originalMessage.author.id !== message.client.user.id) + return { userQuestion: null, threadMessages: null }; + + if (originalMessage.author.id === message.client.user.id) { + let currentMessage = message; + + while (currentMessage.reference) { + currentMessage = await message.channel.messages.fetch( + currentMessage.reference.messageId, + ); + const sender = + currentMessage.author.id === message.client.user.id ? "model" : "user"; + let content = currentMessage.content; + if (sender === "user") { + content = content.replace(/<@\d+>\s*/, ""); + } + threadMessages.unshift({ role: sender, parts: [{ text: content }] }); + } + } + userQuestion = message.content; + + return { userQuestion, threadMessages }; } -module.exports = { botInGuild, safetySettings, handleGeminiError, handleResponse, checkGeminiApiKey, fetchThreadMessages }; \ No newline at end of file +module.exports = { + botInGuild, + safetySettings, + handleGeminiError, + handleResponse, + checkGeminiApiKey, + fetchThreadMessages, +}; From 76f8a1d77ee4f585b309b09bd150866ca875f4ec Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:16:11 +0100 Subject: [PATCH 13/56] Update Error Messages --- interactions/slash/misc/image.js | 2 +- interactions/slash/misc/personalise.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index fb51c4f..24a35a2 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -115,7 +115,7 @@ module.exports = { invalid_api = new EmbedBuilder() .setTitle("⚠️ Invalid API Key") .setDescription( - "> **The API Key for Prodia is invalid or not provided.**", + "> *The API Key for Prodia is invalid or not provided*\n> **Please contact the bot owners**", ) .setColor("Red"); return interaction.reply({ embeds: [invalid_api] }); diff --git a/interactions/slash/misc/personalise.js b/interactions/slash/misc/personalise.js index 52c5411..c7900fd 100644 --- a/interactions/slash/misc/personalise.js +++ b/interactions/slash/misc/personalise.js @@ -30,7 +30,7 @@ const channelId = channel_id_logs; const no_access = new EmbedBuilder() .setDescription( - "**Only my developers can directly update my global personality prompt!**\n\nIf you want to suggest a change, please let us know!", + "**⚠️ Only my developers can update/view my global personality prompt!**\n\n> *If you want to suggest a change, please let us know!*", ) .setColor("Red"); From 7de23b8e01bed4fd72df611633273da32db5b588 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:46:18 +0100 Subject: [PATCH 14/56] Utilise System Instructions --- events/taurusai.js | 50 +++++++++---------- .../context-menus/message/taurusai.js | 50 +++++++++---------- interactions/modals/category/ask.js | 30 +++++------ package.json | 2 +- utils.js | 9 ++++ 5 files changed, 69 insertions(+), 72 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index ab23244..cd8a0e9 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -79,10 +79,10 @@ module.exports = { const personalityContent = await fs.readFile(personalityFilePath, "utf-8"); const personalityLines = personalityContent.split("\n"); - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.`; + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; if (Object.keys(user_status).length) { - parts1 += ` The user's presence is currently:\n${status_devices}`; + parts1 += ` The user's status/presence is currently:\n${status_devices}`; } async function run() { @@ -91,7 +91,17 @@ module.exports = { }; const model = genAI.getGenerativeModel( - { model: "gemini-1.5-pro-latest" }, + { + model: "gemini-1.5-pro-latest", + systemInstruction: { + role: "system", + parts: [ + { + text: parts1, + }, + ], + }, + }, { apiVersion: "v1beta", safetySettings, @@ -99,39 +109,25 @@ module.exports = { }, ); - var history = [ - { + if ( + threadMessages && + threadMessages.length > 0 && + threadMessages[0].role === "model" + ) { + const userMessage = { role: "user", - parts: [{ text: parts1 }], - }, - { - role: "model", parts: [ { - text: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + text: "[User Message Here]", }, ], - }, - ]; + }; - if ( - history.length > 0 && - threadMessages && - threadMessages.length > 0 && - history[history.length - 1].role === "model" && - threadMessages[0].role === "model" && - Array.isArray(history[history.length - 1].parts) && - Array.isArray(threadMessages[0].parts) - ) { - history[history.length - 1].parts = history[ - history.length - 1 - ].parts.concat(threadMessages[0].parts); - threadMessages.shift(); + threadMessages.unshift(userMessage); } - history.push(...threadMessages); const chat = model.startChat({ - history, + history: threadMessages, generationConfig: { maxOutputTokens: 750, }, diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 5de91e2..7957eaf 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -102,10 +102,10 @@ module.exports = { .map(([platform, status]) => `${platform}: ${status}`) .join("\n"); - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}>.`; + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; if (Object.keys(user_status).length) { - parts1 += ` The user's presence is currently:\n${status_devices}`; + parts1 += ` The user's status/presence is currently:\n${status_devices}`; } async function run() { @@ -114,7 +114,17 @@ module.exports = { }; const model = genAI.getGenerativeModel( - { model: "gemini-1.5-pro-latest" }, + { + model: "gemini-1.5-pro-latest", + systemInstruction: { + role: "system", + parts: [ + { + text: parts1, + }, + ], + }, + }, { apiVersion: "v1beta", safetySettings, @@ -122,39 +132,25 @@ module.exports = { }, ); - var history = [ - { + if ( + threadMessages && + threadMessages.length > 0 && + threadMessages[0].role === "model" + ) { + const userMessage = { role: "user", - parts: [{ text: parts1 }], - }, - { - role: "model", parts: [ { - text: `I will greet the user with their name: <@${message.author.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, + text: "[User Message Here]", }, ], - }, - ]; + }; - if ( - history.length > 0 && - threadMessages && - threadMessages.length > 0 && - history[history.length - 1].role === "model" && - threadMessages[0].role === "model" && - Array.isArray(history[history.length - 1].parts) && - Array.isArray(threadMessages[0].parts) - ) { - history[history.length - 1].parts = history[ - history.length - 1 - ].parts.concat(threadMessages[0].parts); - threadMessages.shift(); + threadMessages.unshift(userMessage); } - history.push(...threadMessages); const chat = model.startChat({ - history, + history: threadMessages, generationConfig: { maxOutputTokens: 750, }, diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 9d57fc3..113cbc3 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -70,10 +70,10 @@ module.exports = { .map(([platform, status]) => `${platform}: ${status}`) .join("\n"); - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}>.`; + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}> and limit your responses to 2000 characters or less.`; if (Object.keys(user_status).length) { - parts1 += ` The user's presence is currently:\n${status_devices}`; + parts1 += ` The user's status/presence is currently:\n${status_devices}`; } async function run() { @@ -82,7 +82,17 @@ module.exports = { }; const model = genAI.getGenerativeModel( - { model: "gemini-1.5-pro-latest" }, + { + model: "gemini-1.5-pro-latest", + systemInstruction: { + role: "system", + parts: [ + { + text: parts1, + }, + ], + }, + }, { apiVersion: "v1beta", safetySettings, @@ -91,20 +101,6 @@ module.exports = { ); const chat = model.startChat({ - history: [ - { - role: "user", - parts: [{ text: parts1 }], - }, - { - role: "model", - parts: [ - { - text: `I will greet the user with their name: <@${interaction.user.id}>. I will also limit all of my responses to 2000 characters or less, regardless of what you say. Feel feel free to ask me anything! 😊`, - }, - ], - }, - ], generationConfig: { maxOutputTokens: 750, }, diff --git a/package.json b/package.json index 9ea014b..ec8a488 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.5.0", + "@google/generative-ai": "^0.6.0", "@iamtraction/google-translate": "^2.0.1", "@tensorflow/tfjs-node": "^4.17.0", "api": "^6.1.1", diff --git a/utils.js b/utils.js index fb2eeac..9ce0d3e 100644 --- a/utils.js +++ b/utils.js @@ -64,6 +64,15 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [error] }); + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [500 Internal Server Error] An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting": + const error_internal = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "An error occurred while processing your request. This error originated from Google's side, not ours. \n*If this issue persists, please contact the Developers.* \n\n> - Please retry and make another request.", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [error_internal] }); default: console.error(err.message); const error_unknown = new EmbedBuilder() From dadf08db3545793656e905b95fef41340511710f Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:40:46 +0100 Subject: [PATCH 15/56] Notices & Cleanup --- interactions/slash/misc/help.js | 2 +- interactions/slash/misc/image.js | 4 ++-- interactions/slash/misc/models.js | 2 +- interactions/slash/misc/taurusai.js | 1 - utils.js | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/interactions/slash/misc/help.js b/interactions/slash/misc/help.js index f04bc30..0036559 100644 --- a/interactions/slash/misc/help.js +++ b/interactions/slash/misc/help.js @@ -12,7 +12,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("help") .setDescription("Display available slash commands"), - async execute(interaction, client) { + async execute(interaction) { const commands = interaction.client.slashCommands; const commandList = commands .map( diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index 24a35a2..f19e219 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -110,12 +110,12 @@ module.exports = { ), ), - async execute(interaction, client) { + async execute(interaction) { if (!XProdiaKey || XProdiaKey.length < 4) { invalid_api = new EmbedBuilder() .setTitle("⚠️ Invalid API Key") .setDescription( - "> *The API Key for Prodia is invalid or not provided*\n> **Please contact the bot owners**", + "> *The API Key for Prodia is invalid or not provided*\n> **Please contact the developers**", ) .setColor("Red"); return interaction.reply({ embeds: [invalid_api] }); diff --git a/interactions/slash/misc/models.js b/interactions/slash/misc/models.js index 7ee5866..bb8296b 100644 --- a/interactions/slash/misc/models.js +++ b/interactions/slash/misc/models.js @@ -20,7 +20,7 @@ module.exports = { invalid_api = new EmbedBuilder() .setTitle("⚠️ Invalid API Key") .setDescription( - "> **The API Key for Prodia is invalid or not provided.**", + "> **The API Key for Prodia is invalid or not provided.**\n> **Please contact the developers**", ) .setColor("Red"); return interaction.reply({ embeds: [invalid_api] }); diff --git a/interactions/slash/misc/taurusai.js b/interactions/slash/misc/taurusai.js index 53890c3..d8cb61e 100644 --- a/interactions/slash/misc/taurusai.js +++ b/interactions/slash/misc/taurusai.js @@ -9,7 +9,6 @@ const { TextInputBuilder, TextInputStyle, ActionRowBuilder, - EmbedBuilder, } = require("discord.js"); module.exports = { diff --git a/utils.js b/utils.js index 9ce0d3e..093722a 100644 --- a/utils.js +++ b/utils.js @@ -49,7 +49,7 @@ async function handleGeminiError(err, loadingMsg) { const quota_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( - "There are alot of requests at the moment Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Token Limit for this minute has been reached.", + "There are alot of requests at the moment Please try again later, or in a few minutes. \n*If this issue persists after a few minutes, please contact the Developers.*\n - *We are aware of these issues and apologize for the inconvenience.* \n\n> - Token Limit for this minute has been reached.", ) .setColor("Red"); From 9ac7101e941bfc2b108e5ea755cd1af0c40a66f4 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 12 Apr 2024 22:06:00 +0100 Subject: [PATCH 16/56] Switch to PNPM (NPM -> PNPM) --- pnpm-lock.yaml | 2507 ++++++++++++++++++++++++++++++++++++++++++++++++ startbot.bat | 3 +- startbot.sh | 3 +- 3 files changed, 2511 insertions(+), 2 deletions(-) create mode 100644 pnpm-lock.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..e3a64cf --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2507 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + '@google/generative-ai': + specifier: ^0.6.0 + version: 0.6.0 + '@iamtraction/google-translate': + specifier: ^2.0.1 + version: 2.0.1 + '@tensorflow/tfjs-node': + specifier: ^4.17.0 + version: 4.17.0(seedrandom@3.0.5) + api: + specifier: ^6.1.1 + version: 6.1.1(openapi-types@12.1.3) + axios: + specifier: ^1.6.8 + version: 1.6.8 + blessed: + specifier: ^0.1.81 + version: 0.1.81 + chalk: + specifier: ^5.3.0 + version: 5.3.0 + discord-api-types: + specifier: ^0.37.79 + version: 0.37.79 + discord.js: + specifier: ^14.14.1 + version: 14.14.1 + figlet: + specifier: ^1.7.0 + version: 1.7.0 + moment: + specifier: ^2.30.1 + version: 2.30.1 + nsfwjs: + specifier: ^4.1.0 + version: 4.1.0(@tensorflow/tfjs@4.17.0) + os: {specifier: ^0.1.2, version: 0.1.2} + +devDependencies: + prettier: + specifier: 3.2.5 + version: 3.2.5 + +packages: + + /@apidevtools/openapi-schemas@2.1.0: + resolution: {integrity: sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==} + engines: {node: '>=10'} + dev: false + + /@apidevtools/swagger-methods@3.0.2: + resolution: {integrity: sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==} + dev: false + + /@babel/code-frame@7.24.2: + resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.24.2 + picocolors: 1.0.0 + dev: false + + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: false + + /@babel/highlight@7.24.2: + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.0.0 + dev: false + + /@babel/runtime@7.24.4: + resolution: {integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.1 + dev: false + + /@discordjs/builders@1.7.0: + resolution: {integrity: sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==} + engines: {node: '>=16.11.0'} + dependencies: + '@discordjs/formatters': 0.3.3 + '@discordjs/util': 1.0.2 + '@sapphire/shapeshift': 3.9.7 + discord-api-types: 0.37.61 + fast-deep-equal: 3.1.3 + ts-mixer: 6.0.4 + tslib: 2.6.2 + dev: false + + /@discordjs/collection@1.5.3: + resolution: {integrity: sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==} + engines: {node: '>=16.11.0'} + dev: false + + /@discordjs/collection@2.0.0: + resolution: {integrity: sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==} + engines: {node: '>=18'} + dev: false + + /@discordjs/formatters@0.3.3: + resolution: {integrity: sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==} + engines: {node: '>=16.11.0'} + dependencies: + discord-api-types: 0.37.61 + dev: false + + /@discordjs/rest@2.2.0: + resolution: {integrity: sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==} + engines: {node: '>=16.11.0'} + dependencies: + '@discordjs/collection': 2.0.0 + '@discordjs/util': 1.0.2 + '@sapphire/async-queue': 1.5.2 + '@sapphire/snowflake': 3.5.1 + '@vladfrangu/async_event_emitter': 2.2.4 + discord-api-types: 0.37.61 + magic-bytes.js: 1.10.0 + tslib: 2.6.2 + undici: 5.27.2 + dev: false + + /@discordjs/util@1.0.2: + resolution: {integrity: sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==} + engines: {node: '>=16.11.0'} + dev: false + + /@discordjs/ws@1.0.2: + resolution: {integrity: sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==} + engines: {node: '>=16.11.0'} + dependencies: + '@discordjs/collection': 2.0.0 + '@discordjs/rest': 2.2.0 + '@discordjs/util': 1.0.2 + '@sapphire/async-queue': 1.5.2 + '@types/ws': 8.5.9 + '@vladfrangu/async_event_emitter': 2.2.4 + discord-api-types: 0.37.61 + tslib: 2.6.2 + ws: 8.14.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + + /@exodus/schemasafe@1.3.0: + resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} + dev: false + + /@fastify/busboy@2.1.1: + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} + dev: false + + /@google/generative-ai@0.6.0: + resolution: {integrity: sha512-jkc7vBOW/yKhNtOkpQI1jYFtAybEc0kjf8I6CpSUBWVdrVh45jIikeTlYaYckH+KtZjteARUhg26mh5XnFT6Yg==} + engines: {node: '>=18.0.0'} + dev: false + + /@humanwhocodes/momoa@2.0.4: + resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==} + engines: {node: '>=10.10.0'} + dev: false + + /@iamtraction/google-translate@2.0.1: + resolution: {integrity: sha512-kOTkt23zflxpgxLIe9tLvDU8IvNscXYbgMSXydNkZGWDtJ75YJiU3v7EBz+t7h/gSiY7sT5r4dlFkMrHCl+N6A==} + engines: {node: '>=16.0.0'} + dependencies: + undici: 5.28.4 + dev: false + + /@jsdevtools/ono@7.1.3: + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + dev: false + + /@mapbox/node-pre-gyp@1.0.9: + resolution: {integrity: sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==} + hasBin: true + dependencies: + detect-libc: 2.0.3 + https-proxy-agent: 5.0.1 + make-dir: 3.1.0 + node-fetch: 2.7.0 + nopt: 5.0.0 + npmlog: 5.0.1 + rimraf: 3.0.2 + semver: 7.6.0 + tar: 6.2.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@nodelib/fs.scandir@2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: false + + /@nodelib/fs.stat@2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: false + + /@nodelib/fs.walk@1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + dev: false + + /@readme/better-ajv-errors@1.6.0(ajv@8.12.0): + resolution: {integrity: sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==} + engines: {node: '>=14'} + peerDependencies: + ajv: 4.11.8 - 8 + dependencies: + '@babel/code-frame': 7.24.2 + '@babel/runtime': 7.24.4 + '@humanwhocodes/momoa': 2.0.4 + ajv: 8.12.0 + chalk: 4.1.2 + json-to-ast: 2.1.0 + jsonpointer: 5.0.1 + leven: 3.1.0 + dev: false + + /@readme/data-urls@1.0.1: + resolution: {integrity: sha512-FNP4ntG5rCgmrvQGoNH/Ljivc6jSWaaVeMuXneOyQ6oLuhm/NkysXJN3DnBrIsJUJbSae7qIs2QfPYnaropoHw==} + engines: {node: '>=14'} + dev: false + + /@readme/http-status-codes@7.2.0: + resolution: {integrity: sha512-/dBh9qw3QhJYqlGwt2I+KUP/lQ6nytdCx3aq+GpMUhibLHF3O7fwoowNcTwlbnwtyJ+TJYTIIrp3oVUlRNx3fA==} + dev: false + + /@readme/json-schema-ref-parser@1.2.0: + resolution: {integrity: sha512-Bt3QVovFSua4QmHa65EHUmh2xS0XJ3rgTEUPH998f4OW4VVJke3BuS16f+kM0ZLOGdvIrzrPRqwihuv5BAjtrA==} + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + call-me-maybe: 1.0.2 + js-yaml: 4.1.0 + dev: false + + /@readme/oas-extensions@17.0.1(oas@20.10.3): + resolution: {integrity: sha512-PCU7WLz8TkbdxsiE4eQGvJYDYZQPiyLhXme3SvLboSmH+8G6AJPJ5OymzSAdlf5sXpSSoD2q3dTIou3Cb2DirQ==} + engines: {node: '>=14'} + deprecated: The functionality for this library has been moved into `oas`. + peerDependencies: + oas: ^20.0.0 + dependencies: + oas: 20.10.3 + dev: false + + /@readme/oas-to-har@20.1.1: + resolution: {integrity: sha512-rz8YpdZw+Jqrd8VQhQaYrzctkCAYdBldoQ5qDQyF9vGvq2lpA1yMvQPgKCJXfPGXH8Cm+NjLbunxnYabKQeKeA==} + engines: {node: '>=14'} + dependencies: + '@readme/data-urls': 1.0.1 + '@readme/oas-extensions': 17.0.1(oas@20.10.3) + oas: 20.10.3 + qs: 6.12.0 + remove-undefined-objects: 2.0.2 + transitivePeerDependencies: + - encoding + dev: false + + /@readme/openapi-parser@2.5.0(openapi-types@12.1.3): + resolution: {integrity: sha512-IbymbOqRuUzoIgxfAAR7XJt2FWl6n2yqN09fF5adacGm7W03siA3bj1Emql0X9D2T+RpBYz3x9zDsMhuoMP62A==} + engines: {node: '>=14'} + peerDependencies: + openapi-types: '>=7' + dependencies: + '@apidevtools/openapi-schemas': 2.1.0 + '@apidevtools/swagger-methods': 3.0.2 + '@jsdevtools/ono': 7.1.3 + '@readme/better-ajv-errors': 1.6.0(ajv@8.12.0) + '@readme/json-schema-ref-parser': 1.2.0 + ajv: 8.12.0 + ajv-draft-04: 1.0.0(ajv@8.12.0) + call-me-maybe: 1.0.2 + openapi-types: 12.1.3 + dev: false + + /@readme/postman-to-openapi@4.1.0: + resolution: {integrity: sha512-VvV2Hzjskz01m8doSn7Ypt6cSZzgjnypVqXy1ipThbyYD6SGiM74VSePXykOODj/43Y2m6zeYedPk/ZLts/HvQ==} + engines: {node: '>=14'} + dependencies: + '@readme/http-status-codes': 7.2.0 + js-yaml: 4.1.0 + jsonc-parser: 3.2.0 + lodash.camelcase: 4.3.0 + marked: 4.3.0 + mustache: 4.2.0 + dev: false + + /@sapphire/async-queue@1.5.2: + resolution: {integrity: sha512-7X7FFAA4DngXUl95+hYbUF19bp1LGiffjJtu7ygrZrbdCSsdDDBaSjB7Akw0ZbOu6k0xpXyljnJ6/RZUvLfRdg==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + dev: false + + /@sapphire/shapeshift@3.9.7: + resolution: {integrity: sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g==} + engines: {node: '>=v16'} + dependencies: + fast-deep-equal: 3.1.3 + lodash: 4.17.21 + dev: false + + /@sapphire/snowflake@3.5.1: + resolution: {integrity: sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + dev: false + + /@tensorflow/tfjs-backend-cpu@4.17.0(@tensorflow/tfjs-core@4.17.0): + resolution: {integrity: sha512-2VSCHnX9qhYTjw9HiVwTBSnRVlntKXeBlK7aSVsmZfHGwWE2faErTtO7bWmqNqw0U7gyznJbVAjlow/p+0RNGw==} + engines: {yarn: '>= 1.3.2'} + peerDependencies: + '@tensorflow/tfjs-core': 4.17.0 + dependencies: + '@tensorflow/tfjs-core': 4.17.0 + '@types/seedrandom': 2.4.34 + seedrandom: 3.0.5 + dev: false + + /@tensorflow/tfjs-backend-webgl@4.17.0(@tensorflow/tfjs-core@4.17.0): + resolution: {integrity: sha512-CC5GsGECCd7eYAUaKq0XJ48FjEZdgXZWPxgUYx4djvfUx5fQPp35hCSP9w/k463jllBMbjl2tKRg8u7Ia/LYzg==} + engines: {yarn: '>= 1.3.2'} + peerDependencies: + '@tensorflow/tfjs-core': 4.17.0 + dependencies: + '@tensorflow/tfjs-backend-cpu': 4.17.0(@tensorflow/tfjs-core@4.17.0) + '@tensorflow/tfjs-core': 4.17.0 + '@types/offscreencanvas': 2019.3.0 + '@types/seedrandom': 2.4.34 + seedrandom: 3.0.5 + dev: false + + /@tensorflow/tfjs-converter@4.17.0(@tensorflow/tfjs-core@4.17.0): + resolution: {integrity: sha512-qFxIjPfomCuTrYxsFjtKbi3QfdmTTCWo+RvqD64oCMS0sjp7sUDNhJyKDoLx6LZhXlwXpHIVDJctLMRMwet0Zw==} + peerDependencies: + '@tensorflow/tfjs-core': 4.17.0 + dependencies: + '@tensorflow/tfjs-core': 4.17.0 + dev: false + + /@tensorflow/tfjs-core@4.17.0: + resolution: {integrity: sha512-v9Q5430EnRpyhWNd9LVgXadciKvxLiq+sTrLKRowh26BHyAsams4tZIgX3lFKjB7b90p+FYifVMcqLTTHgjGpQ==} + engines: {yarn: '>= 1.3.2'} + dependencies: + '@types/long': 4.0.2 + '@types/offscreencanvas': 2019.7.3 + '@types/seedrandom': 2.4.34 + '@webgpu/types': 0.1.38 + long: 4.0.0 + node-fetch: 2.6.13 + seedrandom: 3.0.5 + transitivePeerDependencies: + - encoding + dev: false + + /@tensorflow/tfjs-data@4.17.0(@tensorflow/tfjs-core@4.17.0)(seedrandom@3.0.5): + resolution: {integrity: sha512-aPKrDFip+gXicWOFALeNT7KKQjRXFkHd/hNe/zs4mCFcIN00hy1PkZ6xkYsgrsdLDQMBSGeS4B4ZM0k5Cs88QA==} + peerDependencies: + '@tensorflow/tfjs-core': 4.17.0 + seedrandom: ^3.0.5 + dependencies: + '@tensorflow/tfjs-core': 4.17.0 + '@types/node-fetch': 2.6.11 + node-fetch: 2.6.13 + seedrandom: 3.0.5 + string_decoder: 1.3.0 + transitivePeerDependencies: + - encoding + dev: false + + /@tensorflow/tfjs-layers@4.17.0(@tensorflow/tfjs-core@4.17.0): + resolution: {integrity: sha512-DEE0zRKvf3LJ0EcvG5XouJYOgFGWYAneZ0K1d23969z7LfSyqVmBdLC6BTwdLKuJk3ouUJIKXU1TcpFmjDuh7g==} + peerDependencies: + '@tensorflow/tfjs-core': 4.17.0 + dependencies: + '@tensorflow/tfjs-core': 4.17.0 + dev: false + + /@tensorflow/tfjs-node@4.17.0(seedrandom@3.0.5): + resolution: {integrity: sha512-lRe5XPwLzVgpLoxgKWWlqCX9uYybklMai3npgVcvniLQnd6JjkGx+RY2D+7jyQmdo1zJUACfxw3conP88OcBug==} + engines: {node: '>=8.11.0'} + requiresBuild: true + dependencies: + '@mapbox/node-pre-gyp': 1.0.9 + '@tensorflow/tfjs': 4.17.0(seedrandom@3.0.5) + adm-zip: 0.5.12 + google-protobuf: 3.21.2 + https-proxy-agent: 2.2.4 + progress: 2.0.3 + rimraf: 2.7.1 + tar: 4.4.19 + transitivePeerDependencies: + - encoding + - seedrandom + - supports-color + dev: false + + /@tensorflow/tfjs@4.17.0(seedrandom@3.0.5): + resolution: {integrity: sha512-yXRBhpM3frlNA/YaPp6HNk9EfIi8han5RYeQA3R8OCa0Od+AfoG1PUmlxV8fE2wCorlGVyHsgpiJ6M9YZPB56w==} + hasBin: true + dependencies: + '@tensorflow/tfjs-backend-cpu': 4.17.0(@tensorflow/tfjs-core@4.17.0) + '@tensorflow/tfjs-backend-webgl': 4.17.0(@tensorflow/tfjs-core@4.17.0) + '@tensorflow/tfjs-converter': 4.17.0(@tensorflow/tfjs-core@4.17.0) + '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-data': 4.17.0(@tensorflow/tfjs-core@4.17.0)(seedrandom@3.0.5) + '@tensorflow/tfjs-layers': 4.17.0(@tensorflow/tfjs-core@4.17.0) + argparse: 1.0.10 + chalk: 4.1.2 + core-js: 3.29.1 + regenerator-runtime: 0.13.11 + yargs: 16.2.0 + transitivePeerDependencies: + - encoding + - seedrandom + dev: false + + /@ts-morph/common@0.18.1: + resolution: {integrity: sha512-RVE+zSRICWRsfrkAw5qCAK+4ZH9kwEFv5h0+/YeHTLieWP7F4wWq4JsKFuNWG+fYh/KF+8rAtgdj5zb2mm+DVA==} + dependencies: + fast-glob: 3.3.2 + minimatch: 5.1.6 + mkdirp: 1.0.4 + path-browserify: 1.0.1 + dev: false + + /@types/har-format@1.2.15: + resolution: {integrity: sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==} + dev: false + + /@types/json-schema@7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + dev: false + + /@types/long@4.0.2: + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + dev: false + + /@types/node-fetch@2.6.11: + resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} + dependencies: + '@types/node': 20.12.7 + form-data: 4.0.0 + dev: false + + /@types/node@20.12.7: + resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + dependencies: + undici-types: 5.26.5 + dev: false + + /@types/offscreencanvas@2019.3.0: + resolution: {integrity: sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==} + dev: false + + /@types/offscreencanvas@2019.7.3: + resolution: {integrity: sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==} + dev: false + + /@types/seedrandom@2.4.34: + resolution: {integrity: sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A==} + dev: false + + /@types/ws@8.5.9: + resolution: {integrity: sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==} + dependencies: + '@types/node': 20.12.7 + dev: false + + /@vladfrangu/async_event_emitter@2.2.4: + resolution: {integrity: sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + dev: false + + /@webgpu/types@0.1.38: + resolution: {integrity: sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==} + dev: false + + /abbrev@1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + dev: false + + /adm-zip@0.5.12: + resolution: {integrity: sha512-6TVU49mK6KZb4qG6xWaaM4C7sA/sgUMLy/JYMOzkcp3BvVLpW0fXDFQiIzAuxFCt/2+xD7fNIiPFAoLZPhVNLQ==} + engines: {node: '>=6.0'} + dev: false + + /agent-base@4.3.0: + resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} + engines: {node: '>= 4.0.0'} + dependencies: + es6-promisify: 5.0.0 + dev: false + + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /ajv-draft-04@1.0.0(ajv@8.12.0): + resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.12.0 + dev: false + + /ajv@8.12.0: + resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: false + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: false + + /ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: false + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: false + + /api@6.1.1(openapi-types@12.1.3): + resolution: {integrity: sha512-we3fnLinpYWlKOHdX4S/Ky9gZvColCnht/qhtv04K2jQbrC/z4SxvZVAT8W8PCC5NLLU4H35r3u4Lt77ZaiY9w==} + engines: {node: '>=16'} + hasBin: true + dependencies: + '@readme/oas-to-har': 20.1.1 + '@readme/openapi-parser': 2.5.0(openapi-types@12.1.3) + caseless: 0.12.0 + chalk: 4.1.2 + commander: 10.0.1 + datauri: 4.1.0 + execa: 5.1.1 + fetch-har: 8.1.5 + figures: 3.2.0 + find-cache-dir: 3.3.2 + form-data-encoder: 1.9.0 + formdata-node: 4.4.1 + get-stream: 6.0.1 + isomorphic-fetch: 3.0.0 + js-yaml: 4.1.0 + json-schema-to-ts: 2.12.0 + json-schema-traverse: 1.0.0 + lodash.camelcase: 4.3.0 + lodash.deburr: 4.1.0 + lodash.merge: 4.6.2 + lodash.setwith: 4.3.2 + lodash.startcase: 4.4.0 + make-dir: 3.1.0 + node-abort-controller: 3.1.1 + oas: 20.10.3 + ora: 5.4.1 + prompts: 2.4.2 + remove-undefined-objects: 2.0.2 + semver: 7.6.0 + ssri: 10.0.5 + ts-morph: 17.0.1 + validate-npm-package-name: 5.0.0 + transitivePeerDependencies: + - encoding + - openapi-types + dev: false + + /aproba@2.0.0: + resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + dev: false + + /are-we-there-yet@2.0.0: + resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} + engines: {node: '>=10'} + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.2 + dev: false + + /argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + dev: false + + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: false + + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + + /axios@1.6.8: + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} + dependencies: + follow-redirects: 1.15.6 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: false + + /base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: false + + /bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + dev: false + + /blessed@0.1.81: + resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} + engines: {node: '>= 0.8.0'} + hasBin: true + dev: false + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: false + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: false + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: false + + /buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: false + + /builtins@5.1.0: + resolution: {integrity: sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==} + dependencies: + semver: 7.6.0 + dev: false + + /call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + dev: false + + /call-me-maybe@1.0.2: + resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} + dev: false + + /caseless@0.12.0: + resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + dev: false + + /chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: false + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: false + + /chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: false + + /chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + dev: false + + /chownr@2.0.0: + resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} + engines: {node: '>=10'} + dev: false + + /cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + dependencies: + restore-cursor: 3.1.0 + dev: false + + /cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + dev: false + + /cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: false + + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: false + + /clone@1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + dev: false + + /code-block-writer@11.0.3: + resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==} + dev: false + + /code-error-fragment@0.0.230: + resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} + engines: {node: '>= 4'} + dev: false + + /color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: false + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: false + + /color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: false + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: false + + /color-support@1.1.3: + resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} + hasBin: true + dev: false + + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + + /commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + dev: false + + /commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + dev: false + + /compute-gcd@1.2.1: + resolution: {integrity: sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==} + dependencies: + validate.io-array: 1.0.6 + validate.io-function: 1.0.2 + validate.io-integer-array: 1.0.0 + dev: false + + /compute-lcm@1.1.2: + resolution: {integrity: sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==} + dependencies: + compute-gcd: 1.2.1 + validate.io-array: 1.0.6 + validate.io-function: 1.0.2 + validate.io-integer-array: 1.0.0 + dev: false + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: false + + /console-control-strings@1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + dev: false + + /core-js@3.29.1: + resolution: {integrity: sha512-+jwgnhg6cQxKYIIjGtAHq2nwUOolo9eoFZ4sHfUH09BLXBgxnH4gA0zEd+t+BO2cNB8idaBtZFcFTRjQJRJmAw==} + requiresBuild: true + dev: false + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: false + + /d@1.0.2: + resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} + engines: {node: '>=0.12'} + dependencies: + es5-ext: 0.10.64 + type: 2.7.2 + dev: false + + /datauri@4.1.0: + resolution: {integrity: sha512-y17kh32+I82G+ED9MNWFkZiP/Cq/vO1hN9+tSZsT9C9qn3NrvcBnh7crSepg0AQPge1hXx2Ca44s1FRdv0gFWA==} + engines: {node: '>= 10'} + dependencies: + image-size: 1.0.0 + mimer: 2.0.2 + dev: false + + /debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: false + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: false + + /defaults@1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + dependencies: + clone: 1.0.4 + dev: false + + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: false + + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + + /delegates@1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + dev: false + + /detect-libc@2.0.3: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + dev: false + + /discord-api-types@0.37.61: + resolution: {integrity: sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==} + dev: false + + /discord-api-types@0.37.79: + resolution: {integrity: sha512-jblKMZL5f9t/pfUyhHNey8Lb9yVCcBVIPxz/JTY0raAmfj7CuFXdl9m5o/+iiB7E0vv1Kz9V7Ao5HtLRc2gH1Q==} + dev: false + + /discord.js@14.14.1: + resolution: {integrity: sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==} + engines: {node: '>=16.11.0'} + dependencies: + '@discordjs/builders': 1.7.0 + '@discordjs/collection': 1.5.3 + '@discordjs/formatters': 0.3.3 + '@discordjs/rest': 2.2.0 + '@discordjs/util': 1.0.2 + '@discordjs/ws': 1.0.2 + '@sapphire/snowflake': 3.5.1 + '@types/ws': 8.5.9 + discord-api-types: 0.37.61 + fast-deep-equal: 3.1.3 + lodash.snakecase: 4.1.1 + tslib: 2.6.2 + undici: 5.27.2 + ws: 8.14.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: false + + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: false + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: false + + /es5-ext@0.10.64: + resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==} + engines: {node: '>=0.10'} + requiresBuild: true + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.4 + esniff: 2.0.1 + next-tick: 1.1.0 + dev: false + + /es6-iterator@2.0.3: + resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + es6-symbol: 3.1.4 + dev: false + + /es6-promise@3.3.1: + resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} + dev: false + + /es6-promise@4.2.8: + resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} + dev: false + + /es6-promisify@5.0.0: + resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + dependencies: + es6-promise: 4.2.8 + dev: false + + /es6-symbol@3.1.4: + resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} + engines: {node: '>=0.12'} + dependencies: + d: 1.0.2 + ext: 1.7.0 + dev: false + + /es6-weak-map@2.0.3: + resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + es6-iterator: 2.0.3 + es6-symbol: 3.1.4 + dev: false + + /escalade@3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + engines: {node: '>=6'} + dev: false + + /escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: false + + /esniff@2.0.1: + resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} + engines: {node: '>=0.10'} + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + event-emitter: 0.3.5 + type: 2.7.2 + dev: false + + /event-emitter@0.3.5: + resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + dev: false + + /execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: false + + /ext@1.7.0: + resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + dependencies: + type: 2.7.2 + dev: false + + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: false + + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: false + + /fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + dev: false + + /fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + dependencies: + reusify: 1.0.4 + dev: false + + /fetch-har@8.1.5: + resolution: {integrity: sha512-c9WDro4RWC+suOVRJFNW21cgqTOELRZpvFJgfENvOM7Yt/VA4QeFtRax795SyOpTisdpcl5XNQlQZdAE6HERDA==} + engines: {node: '>=14'} + dependencies: + '@readme/data-urls': 1.0.1 + '@types/har-format': 1.2.15 + readable-stream: 3.6.2 + optionalDependencies: + formdata-node: 4.4.1 + dev: false + + /figlet@1.7.0: + resolution: {integrity: sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==} + engines: {node: '>= 0.4.0'} + hasBin: true + dev: false + + /figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + dependencies: + escape-string-regexp: 1.0.5 + dev: false + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: false + + /find-cache-dir@3.3.2: + resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} + engines: {node: '>=8'} + dependencies: + commondir: 1.0.1 + make-dir: 3.1.0 + pkg-dir: 4.2.0 + dev: false + + /find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: false + + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data-encoder@1.9.0: + resolution: {integrity: sha512-rahaRMkN8P8d/tgK/BLPX+WBVM27NbvdXBxqQujBtkDAIFspaRqN7Od7lfdGQA6KAD+f82fYCLBq1ipvcu8qLw==} + dev: false + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + + /formdata-node@4.4.1: + resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} + engines: {node: '>= 12.20'} + dependencies: + node-domexception: 1.0.0 + web-streams-polyfill: 4.0.0-beta.3 + dev: false + + /fs-minipass@1.2.7: + resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} + dependencies: + minipass: 2.9.0 + dev: false + + /fs-minipass@2.1.0: + resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: false + + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: false + + /gauge@3.0.2: + resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} + engines: {node: '>=10'} + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + object-assign: 4.1.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + dev: false + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: false + + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + dev: false + + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: false + + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: false + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + + /google-protobuf@3.21.2: + resolution: {integrity: sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==} + dev: false + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 + dev: false + + /grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: false + + /has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: false + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: false + + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: false + + /has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + dev: false + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: false + + /has-unicode@2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + dev: false + + /hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: false + + /http2-client@1.3.5: + resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} + dev: false + + /https-proxy-agent@2.2.4: + resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} + engines: {node: '>= 4.5.0'} + dependencies: + agent-base: 4.3.0 + debug: 3.2.7 + transitivePeerDependencies: + - supports-color + dev: false + + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: false + + /ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: false + + /image-size@1.0.0: + resolution: {integrity: sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==} + engines: {node: '>=12.0.0'} + hasBin: true + dependencies: + queue: 6.0.2 + dev: false + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: false + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: false + + /is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: false + + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: false + + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: false + + /is-interactive@1.0.0: + resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} + engines: {node: '>=8'} + dev: false + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: false + + /is-promise@2.2.2: + resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} + dev: false + + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: false + + /is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + dev: false + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: false + + /isomorphic-fetch@3.0.0: + resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + dependencies: + node-fetch: 2.7.0 + whatwg-fetch: 3.6.20 + transitivePeerDependencies: + - encoding + dev: false + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: false + + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: false + + /json-schema-compare@0.2.2: + resolution: {integrity: sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==} + dependencies: + lodash: 4.17.21 + dev: false + + /json-schema-merge-allof@0.8.1: + resolution: {integrity: sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==} + engines: {node: '>=12.0.0'} + dependencies: + compute-lcm: 1.1.2 + json-schema-compare: 0.2.2 + lodash: 4.17.21 + dev: false + + /json-schema-to-ts@2.12.0: + resolution: {integrity: sha512-uTde38yBm5lzJSRPWRaasxZo72pb+JGE4iUksNdNfAkFaLhV4N9akeBxPPUpZy5onINt9Zo0oTLrAoEXyZESiQ==} + engines: {node: '>=16'} + dependencies: + '@babel/runtime': 7.24.4 + '@types/json-schema': 7.0.15 + ts-algebra: 1.2.2 + dev: false + + /json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: false + + /json-to-ast@2.1.0: + resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} + engines: {node: '>= 4'} + dependencies: + code-error-fragment: 0.0.230 + grapheme-splitter: 1.0.4 + dev: false + + /jsonc-parser@3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + dev: false + + /jsonpath-plus@7.2.0: + resolution: {integrity: sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA==} + engines: {node: '>=12.0.0'} + dev: false + + /jsonpointer@5.0.1: + resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} + engines: {node: '>=0.10.0'} + dev: false + + /kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + dev: false + + /leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + dev: false + + /locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: false + + /lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + dev: false + + /lodash.deburr@4.1.0: + resolution: {integrity: sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==} + dev: false + + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: false + + /lodash.setwith@4.3.2: + resolution: {integrity: sha512-Cv2pndcuNDaqDMJ0gbLm5qNG5jyfsL6f8+f5PfZVVNhQCv+y+P5gAKkCdZbtiQlux7nsnWF7UmZd8JEFIo/4tg==} + dev: false + + /lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + dev: false + + /lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + dev: false + + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: false + + /log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + dev: false + + /long@4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + dev: false + + /lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: false + + /lru-queue@0.1.0: + resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} + dependencies: + es5-ext: 0.10.64 + dev: false + + /magic-bytes.js@1.10.0: + resolution: {integrity: sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==} + dev: false + + /make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.1 + dev: false + + /marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} + engines: {node: '>= 12'} + hasBin: true + dev: false + + /memoizee@0.4.15: + resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} + dependencies: + d: 1.0.2 + es5-ext: 0.10.64 + es6-weak-map: 2.0.3 + event-emitter: 0.3.5 + is-promise: 2.2.2 + lru-queue: 0.1.0 + next-tick: 1.1.0 + timers-ext: 0.1.7 + dev: false + + /merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: false + + /merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: false + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: false + + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + + /mimer@2.0.2: + resolution: {integrity: sha512-izxvjsB7Ur5HrTbPu6VKTrzxSMBFBqyZQc6dWlZNQ4/wAvf886fD4lrjtFd8IQ8/WmZKdxKjUtqFFNaj3hQ52g==} + engines: {node: '>= 12'} + hasBin: true + dev: false + + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: false + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: false + + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: false + + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: false + + /minipass@2.9.0: + resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} + dependencies: + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: false + + /minipass@3.3.6: + resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} + engines: {node: '>=8'} + dependencies: + yallist: 4.0.0 + dev: false + + /minipass@5.0.0: + resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} + engines: {node: '>=8'} + dev: false + + /minipass@7.0.4: + resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} + engines: {node: '>=16 || 14 >=14.17'} + dev: false + + /minizlib@1.3.3: + resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} + dependencies: + minipass: 2.9.0 + dev: false + + /minizlib@2.1.2: + resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + yallist: 4.0.0 + dev: false + + /mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: false + + /mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + dev: false + + /moment@2.30.1: + resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + dev: false + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: false + + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: false + + /mustache@4.2.0: + resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} + hasBin: true + dev: false + + /next-tick@1.1.0: + resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + dev: false + + /node-abort-controller@3.1.1: + resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + dev: false + + /node-domexception@1.0.0: + resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} + engines: {node: '>=10.5.0'} + dev: false + + /node-fetch-h2@2.3.0: + resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==} + engines: {node: 4.x || >=6.0.0} + dependencies: + http2-client: 1.3.5 + dev: false + + /node-fetch@2.6.13: + resolution: {integrity: sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: false + + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: false + + /node-readfiles@0.2.0: + resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==} + dependencies: + es6-promise: 3.3.1 + dev: false + + /nopt@5.0.0: + resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} + engines: {node: '>=6'} + hasBin: true + dependencies: + abbrev: 1.1.1 + dev: false + + /npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: false + + /npmlog@5.0.1: + resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + dependencies: + are-we-there-yet: 2.0.0 + console-control-strings: 1.1.0 + gauge: 3.0.2 + set-blocking: 2.0.0 + dev: false + + /nsfwjs@4.1.0(@tensorflow/tfjs@4.17.0): + resolution: {integrity: sha512-2V27SoNXUJbAAi+vW8RHJbONs2AHa1odmjlRsVX2mirxR4IGt1OIzZ49IXgPVg6nktwA8Su61YEJql7VreEKyg==} + peerDependencies: + '@tensorflow/tfjs': ^4.0.0 + dependencies: + '@tensorflow/tfjs': 4.17.0(seedrandom@3.0.5) + dev: false + + /oas-kit-common@1.0.8: + resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} + dependencies: + fast-safe-stringify: 2.1.1 + dev: false + + /oas-linter@3.2.2: + resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==} + dependencies: + '@exodus/schemasafe': 1.3.0 + should: 13.2.3 + yaml: 1.10.2 + dev: false + + /oas-normalize@8.4.1: + resolution: {integrity: sha512-cGODg+AntZteJRHBiYDWKtcO2svWGMXuFWYu2I8b4hOrNiwB3hgDs/ScX3O9mYm6RpLsUIftt6rDHGc8eYG8aA==} + engines: {node: '>=14'} + dependencies: + '@readme/openapi-parser': 2.5.0(openapi-types@12.1.3) + '@readme/postman-to-openapi': 4.1.0 + js-yaml: 4.1.0 + node-fetch: 2.7.0 + openapi-types: 12.1.3 + swagger2openapi: 7.0.8 + transitivePeerDependencies: + - encoding + dev: false + + /oas-resolver@2.5.6: + resolution: {integrity: sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==} + hasBin: true + dependencies: + node-fetch-h2: 2.3.0 + oas-kit-common: 1.0.8 + reftools: 1.1.9 + yaml: 1.10.2 + yargs: 17.7.2 + dev: false + + /oas-schema-walker@1.1.5: + resolution: {integrity: sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==} + dev: false + + /oas-validator@5.0.8: + resolution: {integrity: sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==} + dependencies: + call-me-maybe: 1.0.2 + oas-kit-common: 1.0.8 + oas-linter: 3.2.2 + oas-resolver: 2.5.6 + oas-schema-walker: 1.1.5 + reftools: 1.1.9 + should: 13.2.3 + yaml: 1.10.2 + dev: false + + /oas@20.10.3: + resolution: {integrity: sha512-dBxDuwn2ssggPMOqEKEzT4sjCqbkol8JozuWrpwD7chcmbKbverj5vpk2kmsczeyguFkLcKUOMcqUUimf9h+IQ==} + engines: {node: '>=14'} + dependencies: + '@readme/json-schema-ref-parser': 1.2.0 + '@types/json-schema': 7.0.15 + json-schema-merge-allof: 0.8.1 + jsonpath-plus: 7.2.0 + jsonpointer: 5.0.1 + memoizee: 0.4.15 + oas-normalize: 8.4.1 + openapi-types: 12.1.3 + path-to-regexp: 6.2.2 + remove-undefined-objects: 3.0.0 + transitivePeerDependencies: + - encoding + dev: false + + /object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: false + + /object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: false + + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: false + + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: false + + /openapi-types@12.1.3: + resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + dev: false + + /ora@5.4.1: + resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} + engines: {node: '>=10'} + dependencies: + bl: 4.1.0 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-spinners: 2.9.2 + is-interactive: 1.0.0 + is-unicode-supported: 0.1.0 + log-symbols: 4.1.0 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + dev: false + + /os@0.1.2: + resolution: {integrity: sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ==} + dev: false + + /p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: false + + /p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: false + + /p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: false + + /path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + dev: false + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: false + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: false + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: false + + /path-to-regexp@6.2.2: + resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} + dev: false + + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: false + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: false + + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: false + + /prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /progress@2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + dev: false + + /prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + dev: false + + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: false + + /qs@6.12.0: + resolution: {integrity: sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.6 + dev: false + + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: false + + /queue@6.0.2: + resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + dependencies: + inherits: 2.0.4 + dev: false + + /readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: false + + /reftools@1.1.9: + resolution: {integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==} + dev: false + + /regenerator-runtime@0.13.11: + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + dev: false + + /regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + dev: false + + /remove-undefined-objects@2.0.2: + resolution: {integrity: sha512-b6x4MUtR4YBW1aCoGx3tE4mA2PFjiXSmtSdNmLexQzUdZa4ybnJAItXLKpkcVgCUJIzJtk2DFG402sMSEMlonQ==} + engines: {node: '>=14'} + dev: false + + /remove-undefined-objects@3.0.0: + resolution: {integrity: sha512-nxG1yYfc/Jxi+bNCBiqKhxVJPE+QvziIOKbD+Dxc93Uisz92v/ZYpo4WR0TJuf+dk2xE8lW2WPJsA3mDFzXy8w==} + engines: {node: '>=16'} + dev: false + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: false + + /require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + dev: false + + /restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: false + + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: false + + /rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: false + + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: false + + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: false + + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: false + + /seedrandom@3.0.5: + resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} + dev: false + + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + dev: false + + /semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: false + + /set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: false + + /set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: false + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: false + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: false + + /should-equal@2.0.0: + resolution: {integrity: sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==} + dependencies: + should-type: 1.4.0 + dev: false + + /should-format@3.0.3: + resolution: {integrity: sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==} + dependencies: + should-type: 1.4.0 + should-type-adaptors: 1.1.0 + dev: false + + /should-type-adaptors@1.1.0: + resolution: {integrity: sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==} + dependencies: + should-type: 1.4.0 + should-util: 1.0.1 + dev: false + + /should-type@1.4.0: + resolution: {integrity: sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==} + dev: false + + /should-util@1.0.1: + resolution: {integrity: sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==} + dev: false + + /should@13.2.3: + resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==} + dependencies: + should-equal: 2.0.0 + should-format: 3.0.3 + should-type: 1.4.0 + should-type-adaptors: 1.1.0 + should-util: 1.0.1 + dev: false + + /side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + object-inspect: 1.13.1 + dev: false + + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: false + + /sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + dev: false + + /sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: false + + /ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: false + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: false + + /string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + dev: false + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: false + + /strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: false + + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: false + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: false + + /swagger2openapi@7.0.8: + resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} + hasBin: true + dependencies: + call-me-maybe: 1.0.2 + node-fetch: 2.7.0 + node-fetch-h2: 2.3.0 + node-readfiles: 0.2.0 + oas-kit-common: 1.0.8 + oas-resolver: 2.5.6 + oas-schema-walker: 1.1.5 + oas-validator: 5.0.8 + reftools: 1.1.9 + yaml: 1.10.2 + yargs: 17.7.2 + transitivePeerDependencies: + - encoding + dev: false + + /tar@4.4.19: + resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} + engines: {node: '>=4.5'} + dependencies: + chownr: 1.1.4 + fs-minipass: 1.2.7 + minipass: 2.9.0 + minizlib: 1.3.3 + mkdirp: 0.5.6 + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: false + + /tar@6.2.1: + resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} + engines: {node: '>=10'} + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 5.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + dev: false + + /timers-ext@0.1.7: + resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} + dependencies: + es5-ext: 0.10.64 + next-tick: 1.1.0 + dev: false + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: false + + /tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: false + + /ts-algebra@1.2.2: + resolution: {integrity: sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==} + dev: false + + /ts-mixer@6.0.4: + resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} + dev: false + + /ts-morph@17.0.1: + resolution: {integrity: sha512-10PkHyXmrtsTvZSL+cqtJLTgFXkU43Gd0JCc0Rw6GchWbqKe0Rwgt1v3ouobTZwQzF1mGhDeAlWYBMGRV7y+3g==} + dependencies: + '@ts-morph/common': 0.18.1 + code-block-writer: 11.0.3 + dev: false + + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: false + + /type@2.7.2: + resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} + dev: false + + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: false + + /undici@5.27.2: + resolution: {integrity: sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==} + engines: {node: '>=14.0'} + dependencies: + '@fastify/busboy': 2.1.1 + dev: false + + /undici@5.28.4: + resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} + engines: {node: '>=14.0'} + dependencies: + '@fastify/busboy': 2.1.1 + dev: false + + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.1 + dev: false + + /util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: false + + /validate-npm-package-name@5.0.0: + resolution: {integrity: sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + builtins: 5.1.0 + dev: false + + /validate.io-array@1.0.6: + resolution: {integrity: sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==} + dev: false + + /validate.io-function@1.0.2: + resolution: {integrity: sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==} + dev: false + + /validate.io-integer-array@1.0.0: + resolution: {integrity: sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==} + dependencies: + validate.io-array: 1.0.6 + validate.io-integer: 1.0.5 + dev: false + + /validate.io-integer@1.0.5: + resolution: {integrity: sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==} + dependencies: + validate.io-number: 1.0.3 + dev: false + + /validate.io-number@1.0.3: + resolution: {integrity: sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==} + dev: false + + /wcwidth@1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + dependencies: + defaults: 1.0.4 + dev: false + + /web-streams-polyfill@4.0.0-beta.3: + resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} + engines: {node: '>= 14'} + dev: false + + /webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: false + + /whatwg-fetch@3.6.20: + resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} + dev: false + + /whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: false + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: false + + /wide-align@1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + dependencies: + string-width: 4.2.3 + dev: false + + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: false + + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: false + + /ws@8.14.2: + resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: false + + /yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: false + + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: false + + /yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + dev: false + + /yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: false + + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: false + + /yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: false + + /yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: false diff --git a/startbot.bat b/startbot.bat index 4ce816c..8ff2226 100644 --- a/startbot.bat +++ b/startbot.bat @@ -1,7 +1,8 @@ @echo off set "SCRIPT_DIR=%~dp0" cd "%SCRIPT_DIR%" -call npm install +call npm install -g pnpm +call pnpm install pause node start.mjs pause \ No newline at end of file diff --git a/startbot.sh b/startbot.sh index 4cf9cfe..858f855 100644 --- a/startbot.sh +++ b/startbot.sh @@ -1,5 +1,6 @@ SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )" cd "$SCRIPT_DIR" -npm install +npm install -g pnpm +pnpm install node start.mjs read -p "Press Enter to exit" \ No newline at end of file From b0f8dc251b8bcd6176bbc106f49fd8909918c17a Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 12 Apr 2024 22:43:19 +0100 Subject: [PATCH 17/56] Add PNPM Install command to start script --- start.mjs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/start.mjs b/start.mjs index 40738c3..4c364af 100644 --- a/start.mjs +++ b/start.mjs @@ -130,10 +130,27 @@ function restartBot() { writeToConsole( chalk.italic(`[GIT] child process exited with code ${code}`), ); - setTimeout(() => { - startBot(); - writeToConsole(chalk.red("Bot restarted.")); - }, 1000); + + const pnpmInstall = spawn("pnpm", ["install"], { shell: true }); + + pnpmInstall.stdout.on("data", (data) => { + const message = data.toString().trim(); + message && writeToConsole(chalk.italic(`[PNPM] stdout: ${message}`)); + }); + + pnpmInstall.stderr.on("data", (data) => { + writeToConsole(chalk.italic(`[PNPM] stderr: ${data}`)); + }); + + pnpmInstall.on("close", (code) => { + writeToConsole( + chalk.italic(`[PNPM] child process exited with code ${code}`), + ); + setTimeout(() => { + startBot(); + writeToConsole(chalk.red("Bot restarted.")); + }, 1000); + }); }); } From 1fb29a6e01bc041cde099f753a18e353a6ed710d Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 13 Apr 2024 19:22:34 +0100 Subject: [PATCH 18/56] Resolves #21 --- .prettierignore | 3 +- events/taurusai.js | 24 +++--- .../context-menus/message/taurusai.js | 18 ++-- interactions/modals/category/ask.js | 9 +- utils.js | 83 +++++++++++++------ 5 files changed, 89 insertions(+), 48 deletions(-) diff --git a/.prettierignore b/.prettierignore index ab3c681..900ce3a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ .github -package.json \ No newline at end of file +package.json +pnpm-lock.yaml \ No newline at end of file diff --git a/events/taurusai.js b/events/taurusai.js index cd8a0e9..f9d80fb 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -26,17 +26,20 @@ module.exports = { if ([18, 21].includes(message.type)) return; let userQuestion; + let messageDeleted; let threadMessages = []; if (message.reference) { const { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages, + messageDeleted: fetchedMessageDeleted, } = await fetchThreadMessages(Gemini_API_KEY, message); if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; threadMessages = fetchedThreadMessages; userQuestion = fetchedUserQuestion; + messageDeleted = fetchedMessageDeleted; } else if (!message.reference) { const botMention = `<@${message.client.user.id}>`; const regex = new RegExp(`^${botMention}\\s+.+`); @@ -114,16 +117,8 @@ module.exports = { threadMessages.length > 0 && threadMessages[0].role === "model" ) { - const userMessage = { - role: "user", - parts: [ - { - text: "[User Message Here]", - }, - ], - }; - - threadMessages.unshift(userMessage); + messageDeleted = "threadDeleted"; + threadMessages = []; } const chat = model.startChat({ @@ -135,7 +130,14 @@ module.exports = { clearInterval(loadingInterval); clearInterval(sendTypingInterval); - await handleResponse(chat, userQuestion, false, message, loadingMsg); + await handleResponse( + chat, + userQuestion, + false, + message, + loadingMsg, + messageDeleted, + ); } try { diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 7957eaf..52950af 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -7,7 +7,7 @@ * @type {import("../../../typings").ContextInteractionCommand} */ -const { Collection, ChannelType, Events, EmbedBuilder } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const fs = require("fs").promises; const path = require("path"); const { GoogleGenerativeAI } = require("@google/generative-ai"); @@ -42,17 +42,20 @@ module.exports = { } let userQuestion; + let messageDeleted; let threadMessages = []; if (message.reference) { const { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages, + messageDeleted: fetchedMessageDeleted, } = await fetchThreadMessages(Gemini_API_KEY, message); if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; threadMessages = fetchedThreadMessages; userQuestion = fetchedUserQuestion; + messageDeleted = fetchedMessageDeleted; } else if (!message.reference) { const botMention = `<@${message.client.user.id}>`; const regex = new RegExp(`^${botMention}\\s+.+`); @@ -137,16 +140,8 @@ module.exports = { threadMessages.length > 0 && threadMessages[0].role === "model" ) { - const userMessage = { - role: "user", - parts: [ - { - text: "[User Message Here]", - }, - ], - }; - - threadMessages.unshift(userMessage); + messageDeleted = "threadDeleted"; + threadMessages = []; } const chat = model.startChat({ @@ -164,6 +159,7 @@ module.exports = { interaction, message, loadingMsg, + messageDeleted, true, ); } diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 113cbc3..b58a8e1 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -108,7 +108,14 @@ module.exports = { clearInterval(loadingInterval); clearInterval(sendTypingInterval); - await handleResponse(chat, userQuestion, interaction, false, loadingMsg); + await handleResponse( + chat, + userQuestion, + interaction, + false, + loadingMsg, + "slashCommand", + ); } try { diff --git a/utils.js b/utils.js index 093722a..c35033d 100644 --- a/utils.js +++ b/utils.js @@ -1,5 +1,5 @@ const { HarmCategory, HarmBlockThreshold } = require("@google/generative-ai"); -const { EmbedBuilder } = require("discord.js"); +const { EmbedBuilder, DiscordAPIError } = require("discord.js"); function botInGuild(interaction) { const botGuilds = interaction.client.guilds.cache; @@ -92,6 +92,7 @@ async function handleResponse( interaction, message, loadingMsg, + messageDeleted, isContextMenuCommand, ) { const result = await chat.sendMessage(userQuestion); @@ -135,6 +136,29 @@ async function handleResponse( info_embed.push(info); } + switch (messageDeleted) { + case "threadDeleted": + const deletedThread = new EmbedBuilder() + .setFooter({ + text: "A message has been deleted/is not accessible in the reply thread, Taurus does not know the past reply thread history.", + }) + .setColor("Orange"); + + info_embed.push(deletedThread); + break; + case "slashCommand": + const deletedSlashCommand = new EmbedBuilder() + .setFooter({ + text: "Reply thread history not accessible, utilise history by mentioning me to chat instead.", + }) + .setColor("Orange"); + + info_embed.push(deletedSlashCommand); + break; + default: + break; + } + // responseText = responseText.replace(/(https?:\/\/(?!media\.discordapp\.net\/attachments\/)[^\s\)]+)/g, "<$1>"); return await loadingMsg.edit({ content: responseText, embeds: info_embed }); } @@ -155,36 +179,47 @@ async function checkGeminiApiKey(Gemini_API_KEY, interaction, message) { } async function fetchThreadMessages(Gemini_API_KEY, message) { - let userQuestion; let threadMessages = []; + let messageDeleted; + userQuestion = message.content; if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; - const originalMessage = await message.channel.messages.fetch( - message.reference.messageId, - ); - - if (originalMessage.author.id !== message.client.user.id) - return { userQuestion: null, threadMessages: null }; - - if (originalMessage.author.id === message.client.user.id) { - let currentMessage = message; - - while (currentMessage.reference) { - currentMessage = await message.channel.messages.fetch( - currentMessage.reference.messageId, - ); - const sender = - currentMessage.author.id === message.client.user.id ? "model" : "user"; - let content = currentMessage.content; - if (sender === "user") { - content = content.replace(/<@\d+>\s*/, ""); + try { + const originalMessage = await message.channel.messages.fetch( + message.reference.messageId, + ); + + if (originalMessage.author.id !== message.client.user.id) + return { userQuestion: null, threadMessages: null, messageDeleted }; + + if (originalMessage.author.id === message.client.user.id) { + let currentMessage = message; + + while (currentMessage.reference) { + currentMessage = await message.channel.messages.fetch( + currentMessage.reference.messageId, + ); + const sender = + currentMessage.author.id === message.client.user.id + ? "model" + : "user"; + let content = currentMessage.content; + if (sender === "user") { + content = content.replace(/<@\d+>\s*/, ""); + } + threadMessages.unshift({ role: sender, parts: [{ text: content }] }); } - threadMessages.unshift({ role: sender, parts: [{ text: content }] }); + } + } catch (error) { + if (error instanceof DiscordAPIError && error.code === 10008) { + messageDeleted = "threadDeleted"; + threadMessages = []; + } else { + throw error; } } - userQuestion = message.content; - return { userQuestion, threadMessages }; + return { userQuestion, threadMessages, messageDeleted }; } module.exports = { From 7cbe98b439a1b046e1631b705a7061cc208b84c0 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 13 Apr 2024 19:30:27 +0100 Subject: [PATCH 19/56] Resolves #22 --- utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index c35033d..81672de 100644 --- a/utils.js +++ b/utils.js @@ -110,7 +110,8 @@ async function handleResponse( let match; while ((match = regex.exec(responseText)) !== null) { - const id = interaction ? interaction.user.id : message.author.id; + const id = + message && message.author ? message.author.id : interaction.user.id; if (match[0] !== `<@${id}>`) { const ping_error = new EmbedBuilder() From 57f33b2f1a007a7202d844c5228259d0995a5811 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:03:28 +0100 Subject: [PATCH 20/56] Resolves #17 --- config.json.example | 4 ++-- functions/logConsole.js | 8 +++++--- interactions/slash/misc/personalise.js | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/config.json.example b/config.json.example index 9f30171..c52b532 100644 --- a/config.json.example +++ b/config.json.example @@ -2,8 +2,8 @@ "token": "...", "owner": ["719815864135712799","483359783831732255"], "client_id": "...", - "guild_id_logs": "...", - "channel_id_logs": "...", + "webhook_avatar_url": "https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c", + "webhook_url_personality_logs": "...", "webhook_url_console_logs": "...", "Gemini_API_KEY": "...", "XProdiaKey": "...", diff --git a/functions/logConsole.js b/functions/logConsole.js index 0ffb289..d2401cc 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -1,6 +1,9 @@ module.exports = (client) => { const { WebhookClient, EmbedBuilder } = require("discord.js"); - const { webhook_url_console_logs } = require("../config.json"); + const { + webhook_url_console_logs, + webhook_avatar_url, + } = require("../config.json"); const webhookURL = webhook_url_console_logs; let webhookClient; @@ -52,8 +55,7 @@ module.exports = (client) => { webhookClient .send({ username: "Taurus Console", - avatarURL: - "https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c", + avatarURL: webhook_avatar_url, embeds: [embed], }) .catch(console.error); diff --git a/interactions/slash/misc/personalise.js b/interactions/slash/misc/personalise.js index c7900fd..dadd364 100644 --- a/interactions/slash/misc/personalise.js +++ b/interactions/slash/misc/personalise.js @@ -15,19 +15,17 @@ const { ActionRowBuilder, EmbedBuilder, ButtonBuilder, + WebhookClient, } = require("discord.js"); const axios = require("axios"); const fs = require("fs").promises; const path = require("path"); const { - guild_id_logs, - channel_id_logs, + webhook_url_personality_logs, + webhook_avatar_url, owner, } = require("../../../config.json"); -const serverId = guild_id_logs; -const channelId = channel_id_logs; - const no_access = new EmbedBuilder() .setDescription( "**⚠️ Only my developers can update/view my global personality prompt!**\n\n> *If you want to suggest a change, please let us know!*", @@ -239,7 +237,7 @@ module.exports = { const error = new EmbedBuilder() .setDescription( - "⚠️ There was an error while fetching the TaurusAI Log channel, please contact the Developers.", + "**⚠️ There was an error while fetching the TaurusAI Log channel, please contact the Developers.**", ) .setColor("Red"); @@ -318,8 +316,9 @@ module.exports = { await fs.writeFile(personalityFilePath, personalityPrompt); try { - const guild = interaction.client.guilds.cache.get(serverId); - const channel = guild.channels.cache.get(channelId); + const webhookClient = new WebhookClient({ + url: webhook_url_personality_logs, + }); update = new EmbedBuilder() .setDescription( @@ -332,7 +331,9 @@ module.exports = { }) .setTimestamp(); - await channel.send({ + await webhookClient.send({ + username: "Taurus Personality", + avatarURL: webhook_avatar_url, embeds: [update], files: [ { attachment: personalityFilePath, name: "new_personality.txt" }, From 17dd9dd7812508f269fd26e6e6adced422f6ae49 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 14 Apr 2024 10:31:32 +0100 Subject: [PATCH 21/56] Utilise client avatar for webhook --- bot.js | 20 ++++++++++---------- config.json.example | 1 - events/onReady.js | 4 +++- functions/logConsole.js | 9 +++------ interactions/slash/misc/personalise.js | 8 ++------ 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/bot.js b/bot.js index b4b3c8e..7492583 100644 --- a/bot.js +++ b/bot.js @@ -175,17 +175,17 @@ for (const module of modalCommands) { * @description All functions. */ -const functionFiles = fs.readdirSync("./functions"); - -// Loop through all files and store functions in functions collection. - -for (const functionFile of functionFiles) { - if (functionFile.endsWith(".js")) { - const func = require(`./functions/${functionFile}`); - client.functions.set(functionFile.replace(".js", ""), func); - func(client); +client.once("ready", () => { + const functionFiles = fs.readdirSync("./functions"); + + for (const functionFile of functionFiles) { + if (functionFile.endsWith(".js")) { + const func = require(`./functions/${functionFile}`); + client.functions.set(functionFile.replace(".js", ""), func); + func(client); + } } -} +}); /**********************************************************************/ // Registration of Slash-Commands in Discord API diff --git a/config.json.example b/config.json.example index c52b532..7ecdcae 100644 --- a/config.json.example +++ b/config.json.example @@ -2,7 +2,6 @@ "token": "...", "owner": ["719815864135712799","483359783831732255"], "client_id": "...", - "webhook_avatar_url": "https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c", "webhook_url_personality_logs": "...", "webhook_url_console_logs": "...", "Gemini_API_KEY": "...", diff --git a/events/onReady.js b/events/onReady.js index 292979c..a4b7305 100644 --- a/events/onReady.js +++ b/events/onReady.js @@ -26,6 +26,8 @@ module.exports = { ], }); - console.log(`Ready! Logged in as ${client.user.tag}`); + setTimeout(() => { + console.log(`Ready! Logged in as ${client.user.tag}`); + }, 25); }, }; diff --git a/functions/logConsole.js b/functions/logConsole.js index d2401cc..4e6355e 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -1,9 +1,6 @@ module.exports = (client) => { const { WebhookClient, EmbedBuilder } = require("discord.js"); - const { - webhook_url_console_logs, - webhook_avatar_url, - } = require("../config.json"); + const { webhook_url_console_logs } = require("../config.json"); const webhookURL = webhook_url_console_logs; let webhookClient; @@ -47,7 +44,7 @@ module.exports = (client) => { combinedMessage.startsWith("Ready! Logged in as") ) { embed.setColor("Green"); - if (combinedMessage === "Started refreshing application (/) commands.") { + if (combinedMessage === `Ready! Logged in as ${client.user.tag}`) { embed.setTitle("💾 Console Log"); } } @@ -55,7 +52,7 @@ module.exports = (client) => { webhookClient .send({ username: "Taurus Console", - avatarURL: webhook_avatar_url, + avatarURL: client.user.displayAvatarURL(), embeds: [embed], }) .catch(console.error); diff --git a/interactions/slash/misc/personalise.js b/interactions/slash/misc/personalise.js index dadd364..6e4c416 100644 --- a/interactions/slash/misc/personalise.js +++ b/interactions/slash/misc/personalise.js @@ -20,11 +20,7 @@ const { const axios = require("axios"); const fs = require("fs").promises; const path = require("path"); -const { - webhook_url_personality_logs, - webhook_avatar_url, - owner, -} = require("../../../config.json"); +const { webhook_url_personality_logs, owner } = require("../../../config.json"); const no_access = new EmbedBuilder() .setDescription( @@ -333,7 +329,7 @@ module.exports = { await webhookClient.send({ username: "Taurus Personality", - avatarURL: webhook_avatar_url, + avatarURL: interaction.client.user.displayAvatarURL(), embeds: [update], files: [ { attachment: personalityFilePath, name: "new_personality.txt" }, From 512ea043b61f4757e8d92c603fdd2cef4d0ec753 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 14 Apr 2024 12:59:54 +0100 Subject: [PATCH 22/56] Resolves #18 --- events/contextInteraction.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/events/contextInteraction.js b/events/contextInteraction.js index da2355d..40cc8d0 100644 --- a/events/contextInteraction.js +++ b/events/contextInteraction.js @@ -5,6 +5,7 @@ * @version 3.3.2 */ const { Events } = require("discord.js"); +const { botInGuild } = require("../utils"); module.exports = { name: Events.InteractionCreate, @@ -56,6 +57,13 @@ module.exports = { try { return await command.execute(interaction); } catch (err) { + if (!botInGuild(interaction)) { + return await interaction.reply({ + content: + "This command can only be executed in servers in which the bot is in, or in DMs/Group Chats.", + ephemeral: true, + }); + } console.error(err); await interaction.reply({ content: @@ -68,7 +76,7 @@ module.exports = { // Practically not possible, but we are still caching the bug. // Possible Fix is a restart! else { - return console.log( + return console.error( "Something weird happening in context menu. Received a context menu of unknown type. If the issue persists please contact the bot owners.", ); } From f9b3bf632ce875ff16a5c065e5c15e2b32b0152f Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 21 Apr 2024 15:17:41 +0100 Subject: [PATCH 23/56] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d86f3b..0e3fe1b 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,13 @@ The **Taurus Discord Bot** is a small bot, it can be used for several things suc 2. Rename the file to `config.json` -3. Run `npm i` +3. Run `pnpm i` 4. Run `node bot` -**Note** - Alternatively **instead of steps 3 & 4** you can **run one of the startbot/start scripts.** +> [!NOTE] +> - Alternatively **instead of steps 3 & 4** you can **run one of the startbot/start scripts.** *(Reccomended)* +> - If you do not have pnpm installed you will need to run: ``npm install -g pnpm`` - All PR's are welcome for improvements. From 78ec3b5de1addb2cf094ab949db4524b9632bd25 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 21 Apr 2024 21:22:43 +0100 Subject: [PATCH 24/56] Update Packages --- events/taurusai.js | 1 - .../context-menus/message/taurusai.js | 1 - interactions/modals/category/ask.js | 1 - package.json | 4 +- pnpm-lock.yaml | 3185 +++++++++-------- 5 files changed, 1775 insertions(+), 1417 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index f9d80fb..998ada6 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -106,7 +106,6 @@ module.exports = { }, }, { - apiVersion: "v1beta", safetySettings, generationConfig, }, diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 52950af..22d9cbe 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -129,7 +129,6 @@ module.exports = { }, }, { - apiVersion: "v1beta", safetySettings, generationConfig, }, diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index b58a8e1..2aa83cf 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -94,7 +94,6 @@ module.exports = { }, }, { - apiVersion: "v1beta", safetySettings, generationConfig, }, diff --git a/package.json b/package.json index ec8a488..cff26ee 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,9 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.6.0", + "@google/generative-ai": "^0.7.1", "@iamtraction/google-translate": "^2.0.1", - "@tensorflow/tfjs-node": "^4.17.0", + "@tensorflow/tfjs-node": "^4.18.0", "api": "^6.1.1", "axios": "^1.6.8", "blessed": "^0.1.81", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3a64cf..dcde6ab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,97 +1,1428 @@ -lockfileVersion: '6.0' +lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false -dependencies: - '@google/generative-ai': - specifier: ^0.6.0 - version: 0.6.0 - '@iamtraction/google-translate': - specifier: ^2.0.1 - version: 2.0.1 - '@tensorflow/tfjs-node': - specifier: ^4.17.0 - version: 4.17.0(seedrandom@3.0.5) - api: - specifier: ^6.1.1 - version: 6.1.1(openapi-types@12.1.3) - axios: - specifier: ^1.6.8 - version: 1.6.8 - blessed: - specifier: ^0.1.81 - version: 0.1.81 - chalk: - specifier: ^5.3.0 - version: 5.3.0 - discord-api-types: - specifier: ^0.37.79 - version: 0.37.79 - discord.js: - specifier: ^14.14.1 - version: 14.14.1 - figlet: - specifier: ^1.7.0 - version: 1.7.0 - moment: - specifier: ^2.30.1 - version: 2.30.1 - nsfwjs: - specifier: ^4.1.0 - version: 4.1.0(@tensorflow/tfjs@4.17.0) - os: {specifier: ^0.1.2, version: 0.1.2} - -devDependencies: - prettier: - specifier: 3.2.5 - version: 3.2.5 +importers: + + .: + dependencies: + '@google/generative-ai': + specifier: ^0.7.1 + version: 0.7.1 + '@iamtraction/google-translate': + specifier: ^2.0.1 + version: 2.0.1 + '@tensorflow/tfjs-node': + specifier: ^4.18.0 + version: 4.18.0(seedrandom@3.0.5) + api: + specifier: ^6.1.1 + version: 6.1.1(openapi-types@12.1.3) + axios: + specifier: ^1.6.8 + version: 1.6.8 + blessed: + specifier: ^0.1.81 + version: 0.1.81 + chalk: + specifier: ^5.3.0 + version: 5.3.0 + discord-api-types: + specifier: ^0.37.79 + version: 0.37.79 + discord.js: + specifier: ^14.14.1 + version: 14.14.1 + figlet: + specifier: ^1.7.0 + version: 1.7.0 + moment: + specifier: ^2.30.1 + version: 2.30.1 + nsfwjs: + specifier: ^4.1.0 + version: 4.1.0(@tensorflow/tfjs@4.18.0(seedrandom@3.0.5)) + os: {specifier: ^0.1.2, version: 0.1.2} + devDependencies: + prettier: + specifier: 3.2.5 + version: 3.2.5 packages: - /@apidevtools/openapi-schemas@2.1.0: + '@apidevtools/openapi-schemas@2.1.0': resolution: {integrity: sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==} engines: {node: '>=10'} - dev: false - /@apidevtools/swagger-methods@3.0.2: + '@apidevtools/swagger-methods@3.0.2': resolution: {integrity: sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==} - dev: false - /@babel/code-frame@7.24.2: + '@babel/code-frame@7.24.2': resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.22.20': + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + + '@babel/highlight@7.24.2': + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} + engines: {node: '>=6.9.0'} + + '@babel/runtime@7.24.4': + resolution: {integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==} + engines: {node: '>=6.9.0'} + + '@discordjs/builders@1.7.0': + resolution: {integrity: sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==} + engines: {node: '>=16.11.0'} + + '@discordjs/collection@1.5.3': + resolution: {integrity: sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==} + engines: {node: '>=16.11.0'} + + '@discordjs/collection@2.0.0': + resolution: {integrity: sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==} + engines: {node: '>=18'} + + '@discordjs/formatters@0.3.3': + resolution: {integrity: sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==} + engines: {node: '>=16.11.0'} + + '@discordjs/rest@2.2.0': + resolution: {integrity: sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==} + engines: {node: '>=16.11.0'} + + '@discordjs/util@1.0.2': + resolution: {integrity: sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==} + engines: {node: '>=16.11.0'} + + '@discordjs/ws@1.0.2': + resolution: {integrity: sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==} + engines: {node: '>=16.11.0'} + + '@exodus/schemasafe@1.3.0': + resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} + + '@fastify/busboy@2.1.1': + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} + + '@google/generative-ai@0.7.1': + resolution: {integrity: sha512-WTjMLLYL/xfA5BW6xAycRPiAX7FNHKAxrid/ayqC1QMam0KAK0NbMeS9Lubw80gVg5xFMLE+H7pw4wdNzTOlxw==} + engines: {node: '>=18.0.0'} + + '@humanwhocodes/momoa@2.0.4': + resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==} + engines: {node: '>=10.10.0'} + + '@iamtraction/google-translate@2.0.1': + resolution: {integrity: sha512-kOTkt23zflxpgxLIe9tLvDU8IvNscXYbgMSXydNkZGWDtJ75YJiU3v7EBz+t7h/gSiY7sT5r4dlFkMrHCl+N6A==} + engines: {node: '>=16.0.0'} + + '@jsdevtools/ono@7.1.3': + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + + '@mapbox/node-pre-gyp@1.0.9': + resolution: {integrity: sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==} + hasBin: true + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@readme/better-ajv-errors@1.6.0': + resolution: {integrity: sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==} + engines: {node: '>=14'} + peerDependencies: + ajv: 4.11.8 - 8 + + '@readme/data-urls@1.0.1': + resolution: {integrity: sha512-FNP4ntG5rCgmrvQGoNH/Ljivc6jSWaaVeMuXneOyQ6oLuhm/NkysXJN3DnBrIsJUJbSae7qIs2QfPYnaropoHw==} + engines: {node: '>=14'} + + '@readme/http-status-codes@7.2.0': + resolution: {integrity: sha512-/dBh9qw3QhJYqlGwt2I+KUP/lQ6nytdCx3aq+GpMUhibLHF3O7fwoowNcTwlbnwtyJ+TJYTIIrp3oVUlRNx3fA==} + + '@readme/json-schema-ref-parser@1.2.0': + resolution: {integrity: sha512-Bt3QVovFSua4QmHa65EHUmh2xS0XJ3rgTEUPH998f4OW4VVJke3BuS16f+kM0ZLOGdvIrzrPRqwihuv5BAjtrA==} + + '@readme/oas-extensions@17.0.1': + resolution: {integrity: sha512-PCU7WLz8TkbdxsiE4eQGvJYDYZQPiyLhXme3SvLboSmH+8G6AJPJ5OymzSAdlf5sXpSSoD2q3dTIou3Cb2DirQ==} + engines: {node: '>=14'} + deprecated: The functionality for this library has been moved into `oas`. + peerDependencies: + oas: ^20.0.0 + + '@readme/oas-to-har@20.1.1': + resolution: {integrity: sha512-rz8YpdZw+Jqrd8VQhQaYrzctkCAYdBldoQ5qDQyF9vGvq2lpA1yMvQPgKCJXfPGXH8Cm+NjLbunxnYabKQeKeA==} + engines: {node: '>=14'} + + '@readme/openapi-parser@2.5.1': + resolution: {integrity: sha512-p9ndWhwjtP+DEiOOF6jeNMpdmYIPM4nl+JEIdnQNdq7b68esI024x7HiYACZpaYaSvISDSyKc7aiRJx4K4IDhg==} + engines: {node: '>=18'} + peerDependencies: + openapi-types: '>=7' + + '@readme/postman-to-openapi@4.1.0': + resolution: {integrity: sha512-VvV2Hzjskz01m8doSn7Ypt6cSZzgjnypVqXy1ipThbyYD6SGiM74VSePXykOODj/43Y2m6zeYedPk/ZLts/HvQ==} + engines: {node: '>=14'} + + '@sapphire/async-queue@1.5.2': + resolution: {integrity: sha512-7X7FFAA4DngXUl95+hYbUF19bp1LGiffjJtu7ygrZrbdCSsdDDBaSjB7Akw0ZbOu6k0xpXyljnJ6/RZUvLfRdg==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + + '@sapphire/shapeshift@3.9.7': + resolution: {integrity: sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g==} + engines: {node: '>=v16'} + + '@sapphire/snowflake@3.5.1': + resolution: {integrity: sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + + '@tensorflow/tfjs-backend-cpu@4.18.0': + resolution: {integrity: sha512-zk6NyGGsv0mCDnc5xWxLB5Zi8GaHVI2gg7KC0FSw/r5wW9SfA3ZIqUHVZhbIVhNqZSWy6L/+EIJa7l6q1XCkrg==} + engines: {yarn: '>= 1.3.2'} + peerDependencies: + '@tensorflow/tfjs-core': 4.18.0 + + '@tensorflow/tfjs-backend-webgl@4.18.0': + resolution: {integrity: sha512-ZLQ8MnWnIttMDqHepEzPL0Y4HkTePl8+AaYm9AcNnDUK7VF2jn+BXcTHCUOGfiwKu/OMwRc6osDrjxr0cCqNrA==} + engines: {yarn: '>= 1.3.2'} + peerDependencies: + '@tensorflow/tfjs-core': 4.18.0 + + '@tensorflow/tfjs-converter@4.18.0': + resolution: {integrity: sha512-b7utNMvmI986OPaQvDyHoiHKiIyip7ubSjG4KzTcFOWEKTsirtHxRp/6QKY/XSuH3AJK9Switu1/B5QC7xR2Zg==} + peerDependencies: + '@tensorflow/tfjs-core': 4.18.0 + + '@tensorflow/tfjs-core@4.18.0': + resolution: {integrity: sha512-wjyq+F8AZJjhtr5xUBAON4VrNBXr9Poows/LnRh1K7wS+w41sCk0EQfeo6NfgUZXbHE/jgcqU6+fZDUKt3qRrg==} + engines: {yarn: '>= 1.3.2'} + + '@tensorflow/tfjs-data@4.18.0': + resolution: {integrity: sha512-JGfEwq8a0nEXwwU04/PW7O6kZ3FdqAd6ofMboM9qwGTv47QdeO/G1657sy4N21Q/qiz5qFDbGLhim3Nq9gZm9g==} + peerDependencies: + '@tensorflow/tfjs-core': 4.18.0 + seedrandom: ^3.0.5 + + '@tensorflow/tfjs-layers@4.18.0': + resolution: {integrity: sha512-9AyxUdvjMDbDOkNzdkMRToJZF/le5ia8X3lVfGRGxzsuyoWDBGlV9V1ICufD+Z8sODXVyu+cgE8kAMtVK4aHFA==} + peerDependencies: + '@tensorflow/tfjs-core': 4.18.0 + + '@tensorflow/tfjs-node@4.18.0': + resolution: {integrity: sha512-jat7J/K8OEKyO/w20PXN8OBQMwdUMQxfPpNGsyS21lq93dr6g+z4vVH0RT+soPsVX2NvdIrAxHT3RWkinSCikw==} + engines: {node: '>=8.11.0'} + + '@tensorflow/tfjs@4.18.0': + resolution: {integrity: sha512-MjA2M91wSkTkpFSuyQAuZm+DT9Y7DFu3rsTaO1BjCbf1S7o8DgJPKMmh6hk6uEn6/SBBbZVXPu+ZTQ/SyrP2Pw==} + hasBin: true + + '@ts-morph/common@0.18.1': + resolution: {integrity: sha512-RVE+zSRICWRsfrkAw5qCAK+4ZH9kwEFv5h0+/YeHTLieWP7F4wWq4JsKFuNWG+fYh/KF+8rAtgdj5zb2mm+DVA==} + + '@types/har-format@1.2.15': + resolution: {integrity: sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/long@4.0.2': + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + + '@types/node-fetch@2.6.11': + resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} + + '@types/node@20.12.7': + resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + + '@types/offscreencanvas@2019.3.0': + resolution: {integrity: sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==} + + '@types/offscreencanvas@2019.7.3': + resolution: {integrity: sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==} + + '@types/seedrandom@2.4.34': + resolution: {integrity: sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A==} + + '@types/ws@8.5.9': + resolution: {integrity: sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==} + + '@vladfrangu/async_event_emitter@2.2.4': + resolution: {integrity: sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==} + engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + + '@webgpu/types@0.1.38': + resolution: {integrity: sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==} + + abbrev@1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + + adm-zip@0.5.12: + resolution: {integrity: sha512-6TVU49mK6KZb4qG6xWaaM4C7sA/sgUMLy/JYMOzkcp3BvVLpW0fXDFQiIzAuxFCt/2+xD7fNIiPFAoLZPhVNLQ==} + engines: {node: '>=6.0'} + + agent-base@4.3.0: + resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} + engines: {node: '>= 4.0.0'} + + agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + + ajv-draft-04@1.0.0: + resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.12.0: + resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + api@6.1.1: + resolution: {integrity: sha512-we3fnLinpYWlKOHdX4S/Ky9gZvColCnht/qhtv04K2jQbrC/z4SxvZVAT8W8PCC5NLLU4H35r3u4Lt77ZaiY9w==} + engines: {node: '>=16'} + hasBin: true + + aproba@2.0.0: + resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + + are-we-there-yet@2.0.0: + resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} + engines: {node: '>=10'} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + + axios@1.6.8: + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + + blessed@0.1.81: + resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} + engines: {node: '>= 0.8.0'} + hasBin: true + + brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + + braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + + buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + + builtins@5.1.0: + resolution: {integrity: sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==} + + call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + + call-me-maybe@1.0.2: + resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} + + caseless@0.12.0: + resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + + chownr@2.0.0: + resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} + engines: {node: '>=10'} + + cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + + cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + + cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + clone@1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + + code-block-writer@11.0.3: + resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==} + + code-error-fragment@0.0.230: + resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} + engines: {node: '>= 4'} + + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + color-support@1.1.3: + resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} + hasBin: true + + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + + commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + + compute-gcd@1.2.1: + resolution: {integrity: sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==} + + compute-lcm@1.1.2: + resolution: {integrity: sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + console-control-strings@1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + + core-js@3.29.1: + resolution: {integrity: sha512-+jwgnhg6cQxKYIIjGtAHq2nwUOolo9eoFZ4sHfUH09BLXBgxnH4gA0zEd+t+BO2cNB8idaBtZFcFTRjQJRJmAw==} + + cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + + d@1.0.2: + resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} + engines: {node: '>=0.12'} + + datauri@4.1.0: + resolution: {integrity: sha512-y17kh32+I82G+ED9MNWFkZiP/Cq/vO1hN9+tSZsT9C9qn3NrvcBnh7crSepg0AQPge1hXx2Ca44s1FRdv0gFWA==} + engines: {node: '>= 10'} + + debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + defaults@1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + + delegates@1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + + detect-libc@2.0.3: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + + discord-api-types@0.37.61: + resolution: {integrity: sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==} + + discord-api-types@0.37.79: + resolution: {integrity: sha512-jblKMZL5f9t/pfUyhHNey8Lb9yVCcBVIPxz/JTY0raAmfj7CuFXdl9m5o/+iiB7E0vv1Kz9V7Ao5HtLRc2gH1Q==} + + discord.js@14.14.1: + resolution: {integrity: sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==} + engines: {node: '>=16.11.0'} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es5-ext@0.10.64: + resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==} + engines: {node: '>=0.10'} + + es6-iterator@2.0.3: + resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} + + es6-promise@3.3.1: + resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} + + es6-promise@4.2.8: + resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} + + es6-promisify@5.0.0: + resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + + es6-symbol@3.1.4: + resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} + engines: {node: '>=0.12'} + + es6-weak-map@2.0.3: + resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} + + escalade@3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + engines: {node: '>=6'} + + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + esniff@2.0.1: + resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} + engines: {node: '>=0.10'} + + event-emitter@0.3.5: + resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} + + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + + ext@1.7.0: + resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + + fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + + fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + + fetch-har@8.1.5: + resolution: {integrity: sha512-c9WDro4RWC+suOVRJFNW21cgqTOELRZpvFJgfENvOM7Yt/VA4QeFtRax795SyOpTisdpcl5XNQlQZdAE6HERDA==} + engines: {node: '>=14'} + + figlet@1.7.0: + resolution: {integrity: sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==} + engines: {node: '>= 0.4.0'} + hasBin: true + + figures@3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + + fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + + find-cache-dir@3.3.2: + resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} + engines: {node: '>=8'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + + form-data-encoder@1.9.0: + resolution: {integrity: sha512-rahaRMkN8P8d/tgK/BLPX+WBVM27NbvdXBxqQujBtkDAIFspaRqN7Od7lfdGQA6KAD+f82fYCLBq1ipvcu8qLw==} + + form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + + formdata-node@4.4.1: + resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} + engines: {node: '>= 12.20'} + + fs-minipass@1.2.7: + resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} + + fs-minipass@2.1.0: + resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} + engines: {node: '>= 8'} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + gauge@3.0.2: + resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} + engines: {node: '>=10'} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + + google-protobuf@3.21.2: + resolution: {integrity: sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==} + + gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + + grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + + has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + + has-unicode@2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + http2-client@1.3.5: + resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} + + https-proxy-agent@2.2.4: + resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} + engines: {node: '>= 4.5.0'} + + https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + image-size@1.0.0: + resolution: {integrity: sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==} + engines: {node: '>=12.0.0'} + hasBin: true + + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-interactive@1.0.0: + resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} + engines: {node: '>=8'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-promise@2.2.2: + resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} + + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + + is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + isomorphic-fetch@3.0.0: + resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + + json-schema-compare@0.2.2: + resolution: {integrity: sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==} + + json-schema-merge-allof@0.8.1: + resolution: {integrity: sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==} + engines: {node: '>=12.0.0'} + + json-schema-to-ts@2.12.0: + resolution: {integrity: sha512-uTde38yBm5lzJSRPWRaasxZo72pb+JGE4iUksNdNfAkFaLhV4N9akeBxPPUpZy5onINt9Zo0oTLrAoEXyZESiQ==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-to-ast@2.1.0: + resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} + engines: {node: '>= 4'} + + jsonc-parser@3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + + jsonpath-plus@7.2.0: + resolution: {integrity: sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA==} + engines: {node: '>=12.0.0'} + + jsonpointer@5.0.1: + resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} + engines: {node: '>=0.10.0'} + + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + + lodash.deburr@4.1.0: + resolution: {integrity: sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lodash.setwith@4.3.2: + resolution: {integrity: sha512-Cv2pndcuNDaqDMJ0gbLm5qNG5jyfsL6f8+f5PfZVVNhQCv+y+P5gAKkCdZbtiQlux7nsnWF7UmZd8JEFIo/4tg==} + + lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + + lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + + long@4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + + lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + + lru-queue@0.1.0: + resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} + + magic-bytes.js@1.10.0: + resolution: {integrity: sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==} + + make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + + marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} + engines: {node: '>= 12'} + hasBin: true + + memoizee@0.4.15: + resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} + + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + mimer@2.0.2: + resolution: {integrity: sha512-izxvjsB7Ur5HrTbPu6VKTrzxSMBFBqyZQc6dWlZNQ4/wAvf886fD4lrjtFd8IQ8/WmZKdxKjUtqFFNaj3hQ52g==} + engines: {node: '>= 12'} + hasBin: true + + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + minipass@2.9.0: + resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} + + minipass@3.3.6: + resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} + engines: {node: '>=8'} + + minipass@5.0.0: + resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} + engines: {node: '>=8'} + + minipass@7.0.4: + resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@1.3.3: + resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} + + minizlib@2.1.2: + resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} + engines: {node: '>= 8'} + + mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + + mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + + moment@2.30.1: + resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + + ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + mustache@4.2.0: + resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} + hasBin: true + + next-tick@1.1.0: + resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + + node-abort-controller@3.1.1: + resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + + node-domexception@1.0.0: + resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} + engines: {node: '>=10.5.0'} + + node-fetch-h2@2.3.0: + resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==} + engines: {node: 4.x || >=6.0.0} + + node-fetch@2.6.13: + resolution: {integrity: sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-readfiles@0.2.0: + resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==} + + nopt@5.0.0: + resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} + engines: {node: '>=6'} + hasBin: true + + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + + npmlog@5.0.1: + resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + + nsfwjs@4.1.0: + resolution: {integrity: sha512-2V27SoNXUJbAAi+vW8RHJbONs2AHa1odmjlRsVX2mirxR4IGt1OIzZ49IXgPVg6nktwA8Su61YEJql7VreEKyg==} + peerDependencies: + '@tensorflow/tfjs': ^4.0.0 + + oas-kit-common@1.0.8: + resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} + + oas-linter@3.2.2: + resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==} + + oas-normalize@8.4.1: + resolution: {integrity: sha512-cGODg+AntZteJRHBiYDWKtcO2svWGMXuFWYu2I8b4hOrNiwB3hgDs/ScX3O9mYm6RpLsUIftt6rDHGc8eYG8aA==} + engines: {node: '>=14'} + + oas-resolver@2.5.6: + resolution: {integrity: sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==} + hasBin: true + + oas-schema-walker@1.1.5: + resolution: {integrity: sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==} + + oas-validator@5.0.8: + resolution: {integrity: sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==} + + oas@20.10.3: + resolution: {integrity: sha512-dBxDuwn2ssggPMOqEKEzT4sjCqbkol8JozuWrpwD7chcmbKbverj5vpk2kmsczeyguFkLcKUOMcqUUimf9h+IQ==} + engines: {node: '>=14'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + + openapi-types@12.1.3: + resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + + ora@5.4.1: + resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} + engines: {node: '>=10'} + + os@0.1.2: + resolution: {integrity: sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ==} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-to-regexp@6.2.2: + resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} + + picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + + prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + engines: {node: '>=14'} + hasBin: true + + progress@2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + + proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + qs@6.12.1: + resolution: {integrity: sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==} + engines: {node: '>=0.6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + queue@6.0.2: + resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + + reftools@1.1.9: + resolution: {integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==} + + regenerator-runtime@0.13.11: + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + + regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + + remove-undefined-objects@2.0.2: + resolution: {integrity: sha512-b6x4MUtR4YBW1aCoGx3tE4mA2PFjiXSmtSdNmLexQzUdZa4ybnJAItXLKpkcVgCUJIzJtk2DFG402sMSEMlonQ==} + engines: {node: '>=14'} + + remove-undefined-objects@3.0.0: + resolution: {integrity: sha512-nxG1yYfc/Jxi+bNCBiqKhxVJPE+QvziIOKbD+Dxc93Uisz92v/ZYpo4WR0TJuf+dk2xE8lW2WPJsA3mDFzXy8w==} + engines: {node: '>=16'} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + + reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + hasBin: true + + rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + seedrandom@3.0.5: + resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + should-equal@2.0.0: + resolution: {integrity: sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==} + + should-format@3.0.3: + resolution: {integrity: sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==} + + should-type-adaptors@1.1.0: + resolution: {integrity: sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==} + + should-type@1.4.0: + resolution: {integrity: sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==} + + should-util@1.0.1: + resolution: {integrity: sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==} + + should@13.2.3: + resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==} + + side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + swagger2openapi@7.0.8: + resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} + hasBin: true + + tar@4.4.19: + resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} + engines: {node: '>=4.5'} + + tar@6.2.1: + resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} + engines: {node: '>=10'} + + timers-ext@0.1.7: + resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + + ts-algebra@1.2.2: + resolution: {integrity: sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==} + + ts-mixer@6.0.4: + resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} + + ts-morph@17.0.1: + resolution: {integrity: sha512-10PkHyXmrtsTvZSL+cqtJLTgFXkU43Gd0JCc0Rw6GchWbqKe0Rwgt1v3ouobTZwQzF1mGhDeAlWYBMGRV7y+3g==} + + tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + + type@2.7.2: + resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} + + undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + undici@5.27.2: + resolution: {integrity: sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==} + engines: {node: '>=14.0'} + + undici@5.28.4: + resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} + engines: {node: '>=14.0'} + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + validate-npm-package-name@5.0.0: + resolution: {integrity: sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + + validate.io-array@1.0.6: + resolution: {integrity: sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==} + + validate.io-function@1.0.2: + resolution: {integrity: sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==} + + validate.io-integer-array@1.0.0: + resolution: {integrity: sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==} + + validate.io-integer@1.0.5: + resolution: {integrity: sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==} + + validate.io-number@1.0.3: + resolution: {integrity: sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==} + + wcwidth@1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + + web-streams-polyfill@4.0.0-beta.3: + resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} + engines: {node: '>= 14'} + + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + whatwg-fetch@3.6.20: + resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + wide-align@1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + ws@8.14.2: + resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + + yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + +snapshots: + + '@apidevtools/openapi-schemas@2.1.0': {} + + '@apidevtools/swagger-methods@3.0.2': {} + + '@babel/code-frame@7.24.2': dependencies: '@babel/highlight': 7.24.2 picocolors: 1.0.0 - dev: false - /@babel/helper-validator-identifier@7.22.20: - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} - engines: {node: '>=6.9.0'} - dev: false + '@babel/helper-validator-identifier@7.22.20': {} - /@babel/highlight@7.24.2: - resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} - engines: {node: '>=6.9.0'} + '@babel/highlight@7.24.2': dependencies: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.0 - dev: false - /@babel/runtime@7.24.4: - resolution: {integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==} - engines: {node: '>=6.9.0'} + '@babel/runtime@7.24.4': dependencies: regenerator-runtime: 0.14.1 - dev: false - /@discordjs/builders@1.7.0: - resolution: {integrity: sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==} - engines: {node: '>=16.11.0'} + '@discordjs/builders@1.7.0': dependencies: '@discordjs/formatters': 0.3.3 '@discordjs/util': 1.0.2 @@ -100,28 +1431,16 @@ packages: fast-deep-equal: 3.1.3 ts-mixer: 6.0.4 tslib: 2.6.2 - dev: false - /@discordjs/collection@1.5.3: - resolution: {integrity: sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==} - engines: {node: '>=16.11.0'} - dev: false + '@discordjs/collection@1.5.3': {} - /@discordjs/collection@2.0.0: - resolution: {integrity: sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==} - engines: {node: '>=18'} - dev: false + '@discordjs/collection@2.0.0': {} - /@discordjs/formatters@0.3.3: - resolution: {integrity: sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==} - engines: {node: '>=16.11.0'} + '@discordjs/formatters@0.3.3': dependencies: discord-api-types: 0.37.61 - dev: false - /@discordjs/rest@2.2.0: - resolution: {integrity: sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==} - engines: {node: '>=16.11.0'} + '@discordjs/rest@2.2.0': dependencies: '@discordjs/collection': 2.0.0 '@discordjs/util': 1.0.2 @@ -132,16 +1451,10 @@ packages: magic-bytes.js: 1.10.0 tslib: 2.6.2 undici: 5.27.2 - dev: false - /@discordjs/util@1.0.2: - resolution: {integrity: sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==} - engines: {node: '>=16.11.0'} - dev: false + '@discordjs/util@1.0.2': {} - /@discordjs/ws@1.0.2: - resolution: {integrity: sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==} - engines: {node: '>=16.11.0'} + '@discordjs/ws@1.0.2': dependencies: '@discordjs/collection': 2.0.0 '@discordjs/rest': 2.2.0 @@ -155,41 +1468,22 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - dev: false - /@exodus/schemasafe@1.3.0: - resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} - dev: false + '@exodus/schemasafe@1.3.0': {} - /@fastify/busboy@2.1.1: - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} - engines: {node: '>=14'} - dev: false + '@fastify/busboy@2.1.1': {} - /@google/generative-ai@0.6.0: - resolution: {integrity: sha512-jkc7vBOW/yKhNtOkpQI1jYFtAybEc0kjf8I6CpSUBWVdrVh45jIikeTlYaYckH+KtZjteARUhg26mh5XnFT6Yg==} - engines: {node: '>=18.0.0'} - dev: false + '@google/generative-ai@0.7.1': {} - /@humanwhocodes/momoa@2.0.4: - resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==} - engines: {node: '>=10.10.0'} - dev: false + '@humanwhocodes/momoa@2.0.4': {} - /@iamtraction/google-translate@2.0.1: - resolution: {integrity: sha512-kOTkt23zflxpgxLIe9tLvDU8IvNscXYbgMSXydNkZGWDtJ75YJiU3v7EBz+t7h/gSiY7sT5r4dlFkMrHCl+N6A==} - engines: {node: '>=16.0.0'} + '@iamtraction/google-translate@2.0.1': dependencies: undici: 5.28.4 - dev: false - /@jsdevtools/ono@7.1.3: - resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} - dev: false + '@jsdevtools/ono@7.1.3': {} - /@mapbox/node-pre-gyp@1.0.9: - resolution: {integrity: sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==} - hasBin: true + '@mapbox/node-pre-gyp@1.0.9': dependencies: detect-libc: 2.0.3 https-proxy-agent: 5.0.1 @@ -203,34 +1497,20 @@ packages: transitivePeerDependencies: - encoding - supports-color - dev: false - /@nodelib/fs.scandir@2.1.5: - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: false - /@nodelib/fs.stat@2.0.5: - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - dev: false + '@nodelib/fs.stat@2.0.5': {} - /@nodelib/fs.walk@1.2.8: - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} + '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - dev: false - /@readme/better-ajv-errors@1.6.0(ajv@8.12.0): - resolution: {integrity: sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==} - engines: {node: '>=14'} - peerDependencies: - ajv: 4.11.8 - 8 + '@readme/better-ajv-errors@1.6.0(ajv@8.12.0)': dependencies: '@babel/code-frame': 7.24.2 '@babel/runtime': 7.24.4 @@ -240,54 +1520,33 @@ packages: json-to-ast: 2.1.0 jsonpointer: 5.0.1 leven: 3.1.0 - dev: false - /@readme/data-urls@1.0.1: - resolution: {integrity: sha512-FNP4ntG5rCgmrvQGoNH/Ljivc6jSWaaVeMuXneOyQ6oLuhm/NkysXJN3DnBrIsJUJbSae7qIs2QfPYnaropoHw==} - engines: {node: '>=14'} - dev: false + '@readme/data-urls@1.0.1': {} - /@readme/http-status-codes@7.2.0: - resolution: {integrity: sha512-/dBh9qw3QhJYqlGwt2I+KUP/lQ6nytdCx3aq+GpMUhibLHF3O7fwoowNcTwlbnwtyJ+TJYTIIrp3oVUlRNx3fA==} - dev: false + '@readme/http-status-codes@7.2.0': {} - /@readme/json-schema-ref-parser@1.2.0: - resolution: {integrity: sha512-Bt3QVovFSua4QmHa65EHUmh2xS0XJ3rgTEUPH998f4OW4VVJke3BuS16f+kM0ZLOGdvIrzrPRqwihuv5BAjtrA==} + '@readme/json-schema-ref-parser@1.2.0': dependencies: '@jsdevtools/ono': 7.1.3 '@types/json-schema': 7.0.15 call-me-maybe: 1.0.2 js-yaml: 4.1.0 - dev: false - /@readme/oas-extensions@17.0.1(oas@20.10.3): - resolution: {integrity: sha512-PCU7WLz8TkbdxsiE4eQGvJYDYZQPiyLhXme3SvLboSmH+8G6AJPJ5OymzSAdlf5sXpSSoD2q3dTIou3Cb2DirQ==} - engines: {node: '>=14'} - deprecated: The functionality for this library has been moved into `oas`. - peerDependencies: - oas: ^20.0.0 + '@readme/oas-extensions@17.0.1(oas@20.10.3)': dependencies: oas: 20.10.3 - dev: false - /@readme/oas-to-har@20.1.1: - resolution: {integrity: sha512-rz8YpdZw+Jqrd8VQhQaYrzctkCAYdBldoQ5qDQyF9vGvq2lpA1yMvQPgKCJXfPGXH8Cm+NjLbunxnYabKQeKeA==} - engines: {node: '>=14'} + '@readme/oas-to-har@20.1.1': dependencies: '@readme/data-urls': 1.0.1 '@readme/oas-extensions': 17.0.1(oas@20.10.3) oas: 20.10.3 - qs: 6.12.0 + qs: 6.12.1 remove-undefined-objects: 2.0.2 transitivePeerDependencies: - encoding - dev: false - /@readme/openapi-parser@2.5.0(openapi-types@12.1.3): - resolution: {integrity: sha512-IbymbOqRuUzoIgxfAAR7XJt2FWl6n2yqN09fF5adacGm7W03siA3bj1Emql0X9D2T+RpBYz3x9zDsMhuoMP62A==} - engines: {node: '>=14'} - peerDependencies: - openapi-types: '>=7' + '@readme/openapi-parser@2.5.1(openapi-types@12.1.3)': dependencies: '@apidevtools/openapi-schemas': 2.1.0 '@apidevtools/swagger-methods': 3.0.2 @@ -298,11 +1557,8 @@ packages: ajv-draft-04: 1.0.0(ajv@8.12.0) call-me-maybe: 1.0.2 openapi-types: 12.1.3 - dev: false - /@readme/postman-to-openapi@4.1.0: - resolution: {integrity: sha512-VvV2Hzjskz01m8doSn7Ypt6cSZzgjnypVqXy1ipThbyYD6SGiM74VSePXykOODj/43Y2m6zeYedPk/ZLts/HvQ==} - engines: {node: '>=14'} + '@readme/postman-to-openapi@4.1.0': dependencies: '@readme/http-status-codes': 7.2.0 js-yaml: 4.1.0 @@ -310,61 +1566,35 @@ packages: lodash.camelcase: 4.3.0 marked: 4.3.0 mustache: 4.2.0 - dev: false - /@sapphire/async-queue@1.5.2: - resolution: {integrity: sha512-7X7FFAA4DngXUl95+hYbUF19bp1LGiffjJtu7ygrZrbdCSsdDDBaSjB7Akw0ZbOu6k0xpXyljnJ6/RZUvLfRdg==} - engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - dev: false + '@sapphire/async-queue@1.5.2': {} - /@sapphire/shapeshift@3.9.7: - resolution: {integrity: sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g==} - engines: {node: '>=v16'} + '@sapphire/shapeshift@3.9.7': dependencies: fast-deep-equal: 3.1.3 lodash: 4.17.21 - dev: false - /@sapphire/snowflake@3.5.1: - resolution: {integrity: sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==} - engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - dev: false + '@sapphire/snowflake@3.5.1': {} - /@tensorflow/tfjs-backend-cpu@4.17.0(@tensorflow/tfjs-core@4.17.0): - resolution: {integrity: sha512-2VSCHnX9qhYTjw9HiVwTBSnRVlntKXeBlK7aSVsmZfHGwWE2faErTtO7bWmqNqw0U7gyznJbVAjlow/p+0RNGw==} - engines: {yarn: '>= 1.3.2'} - peerDependencies: - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-backend-cpu@4.18.0(@tensorflow/tfjs-core@4.18.0)': dependencies: - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-core': 4.18.0 '@types/seedrandom': 2.4.34 seedrandom: 3.0.5 - dev: false - /@tensorflow/tfjs-backend-webgl@4.17.0(@tensorflow/tfjs-core@4.17.0): - resolution: {integrity: sha512-CC5GsGECCd7eYAUaKq0XJ48FjEZdgXZWPxgUYx4djvfUx5fQPp35hCSP9w/k463jllBMbjl2tKRg8u7Ia/LYzg==} - engines: {yarn: '>= 1.3.2'} - peerDependencies: - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-backend-webgl@4.18.0(@tensorflow/tfjs-core@4.18.0)': dependencies: - '@tensorflow/tfjs-backend-cpu': 4.17.0(@tensorflow/tfjs-core@4.17.0) - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-backend-cpu': 4.18.0(@tensorflow/tfjs-core@4.18.0) + '@tensorflow/tfjs-core': 4.18.0 '@types/offscreencanvas': 2019.3.0 '@types/seedrandom': 2.4.34 seedrandom: 3.0.5 - dev: false - /@tensorflow/tfjs-converter@4.17.0(@tensorflow/tfjs-core@4.17.0): - resolution: {integrity: sha512-qFxIjPfomCuTrYxsFjtKbi3QfdmTTCWo+RvqD64oCMS0sjp7sUDNhJyKDoLx6LZhXlwXpHIVDJctLMRMwet0Zw==} - peerDependencies: - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-converter@4.18.0(@tensorflow/tfjs-core@4.18.0)': dependencies: - '@tensorflow/tfjs-core': 4.17.0 - dev: false + '@tensorflow/tfjs-core': 4.18.0 - /@tensorflow/tfjs-core@4.17.0: - resolution: {integrity: sha512-v9Q5430EnRpyhWNd9LVgXadciKvxLiq+sTrLKRowh26BHyAsams4tZIgX3lFKjB7b90p+FYifVMcqLTTHgjGpQ==} - engines: {yarn: '>= 1.3.2'} + '@tensorflow/tfjs-core@4.18.0': dependencies: '@types/long': 4.0.2 '@types/offscreencanvas': 2019.7.3 @@ -375,38 +1605,25 @@ packages: seedrandom: 3.0.5 transitivePeerDependencies: - encoding - dev: false - /@tensorflow/tfjs-data@4.17.0(@tensorflow/tfjs-core@4.17.0)(seedrandom@3.0.5): - resolution: {integrity: sha512-aPKrDFip+gXicWOFALeNT7KKQjRXFkHd/hNe/zs4mCFcIN00hy1PkZ6xkYsgrsdLDQMBSGeS4B4ZM0k5Cs88QA==} - peerDependencies: - '@tensorflow/tfjs-core': 4.17.0 - seedrandom: ^3.0.5 + '@tensorflow/tfjs-data@4.18.0(@tensorflow/tfjs-core@4.18.0)(seedrandom@3.0.5)': dependencies: - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-core': 4.18.0 '@types/node-fetch': 2.6.11 node-fetch: 2.6.13 seedrandom: 3.0.5 string_decoder: 1.3.0 transitivePeerDependencies: - encoding - dev: false - /@tensorflow/tfjs-layers@4.17.0(@tensorflow/tfjs-core@4.17.0): - resolution: {integrity: sha512-DEE0zRKvf3LJ0EcvG5XouJYOgFGWYAneZ0K1d23969z7LfSyqVmBdLC6BTwdLKuJk3ouUJIKXU1TcpFmjDuh7g==} - peerDependencies: - '@tensorflow/tfjs-core': 4.17.0 + '@tensorflow/tfjs-layers@4.18.0(@tensorflow/tfjs-core@4.18.0)': dependencies: - '@tensorflow/tfjs-core': 4.17.0 - dev: false + '@tensorflow/tfjs-core': 4.18.0 - /@tensorflow/tfjs-node@4.17.0(seedrandom@3.0.5): - resolution: {integrity: sha512-lRe5XPwLzVgpLoxgKWWlqCX9uYybklMai3npgVcvniLQnd6JjkGx+RY2D+7jyQmdo1zJUACfxw3conP88OcBug==} - engines: {node: '>=8.11.0'} - requiresBuild: true + '@tensorflow/tfjs-node@4.18.0(seedrandom@3.0.5)': dependencies: '@mapbox/node-pre-gyp': 1.0.9 - '@tensorflow/tfjs': 4.17.0(seedrandom@3.0.5) + '@tensorflow/tfjs': 4.18.0(seedrandom@3.0.5) adm-zip: 0.5.12 google-protobuf: 3.21.2 https-proxy-agent: 2.2.4 @@ -417,18 +1634,15 @@ packages: - encoding - seedrandom - supports-color - dev: false - /@tensorflow/tfjs@4.17.0(seedrandom@3.0.5): - resolution: {integrity: sha512-yXRBhpM3frlNA/YaPp6HNk9EfIi8han5RYeQA3R8OCa0Od+AfoG1PUmlxV8fE2wCorlGVyHsgpiJ6M9YZPB56w==} - hasBin: true + '@tensorflow/tfjs@4.18.0(seedrandom@3.0.5)': dependencies: - '@tensorflow/tfjs-backend-cpu': 4.17.0(@tensorflow/tfjs-core@4.17.0) - '@tensorflow/tfjs-backend-webgl': 4.17.0(@tensorflow/tfjs-core@4.17.0) - '@tensorflow/tfjs-converter': 4.17.0(@tensorflow/tfjs-core@4.17.0) - '@tensorflow/tfjs-core': 4.17.0 - '@tensorflow/tfjs-data': 4.17.0(@tensorflow/tfjs-core@4.17.0)(seedrandom@3.0.5) - '@tensorflow/tfjs-layers': 4.17.0(@tensorflow/tfjs-core@4.17.0) + '@tensorflow/tfjs-backend-cpu': 4.18.0(@tensorflow/tfjs-core@4.18.0) + '@tensorflow/tfjs-backend-webgl': 4.18.0(@tensorflow/tfjs-core@4.18.0) + '@tensorflow/tfjs-converter': 4.18.0(@tensorflow/tfjs-core@4.18.0) + '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-data': 4.18.0(@tensorflow/tfjs-core@4.18.0)(seedrandom@3.0.5) + '@tensorflow/tfjs-layers': 4.18.0(@tensorflow/tfjs-core@4.18.0) argparse: 1.0.10 chalk: 4.1.2 core-js: 3.29.1 @@ -437,140 +1651,82 @@ packages: transitivePeerDependencies: - encoding - seedrandom - dev: false - /@ts-morph/common@0.18.1: - resolution: {integrity: sha512-RVE+zSRICWRsfrkAw5qCAK+4ZH9kwEFv5h0+/YeHTLieWP7F4wWq4JsKFuNWG+fYh/KF+8rAtgdj5zb2mm+DVA==} + '@ts-morph/common@0.18.1': dependencies: fast-glob: 3.3.2 minimatch: 5.1.6 mkdirp: 1.0.4 path-browserify: 1.0.1 - dev: false - /@types/har-format@1.2.15: - resolution: {integrity: sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==} - dev: false + '@types/har-format@1.2.15': {} - /@types/json-schema@7.0.15: - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - dev: false + '@types/json-schema@7.0.15': {} - /@types/long@4.0.2: - resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} - dev: false + '@types/long@4.0.2': {} - /@types/node-fetch@2.6.11: - resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} + '@types/node-fetch@2.6.11': dependencies: '@types/node': 20.12.7 form-data: 4.0.0 - dev: false - /@types/node@20.12.7: - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + '@types/node@20.12.7': dependencies: undici-types: 5.26.5 - dev: false - /@types/offscreencanvas@2019.3.0: - resolution: {integrity: sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==} - dev: false + '@types/offscreencanvas@2019.3.0': {} - /@types/offscreencanvas@2019.7.3: - resolution: {integrity: sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==} - dev: false + '@types/offscreencanvas@2019.7.3': {} - /@types/seedrandom@2.4.34: - resolution: {integrity: sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A==} - dev: false + '@types/seedrandom@2.4.34': {} - /@types/ws@8.5.9: - resolution: {integrity: sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==} + '@types/ws@8.5.9': dependencies: '@types/node': 20.12.7 - dev: false - - /@vladfrangu/async_event_emitter@2.2.4: - resolution: {integrity: sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==} - engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - dev: false - /@webgpu/types@0.1.38: - resolution: {integrity: sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==} - dev: false + '@vladfrangu/async_event_emitter@2.2.4': {} - /abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - dev: false + '@webgpu/types@0.1.38': {} - /adm-zip@0.5.12: - resolution: {integrity: sha512-6TVU49mK6KZb4qG6xWaaM4C7sA/sgUMLy/JYMOzkcp3BvVLpW0fXDFQiIzAuxFCt/2+xD7fNIiPFAoLZPhVNLQ==} - engines: {node: '>=6.0'} - dev: false + abbrev@1.1.1: {} - /agent-base@4.3.0: - resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} - engines: {node: '>= 4.0.0'} - dependencies: - es6-promisify: 5.0.0 - dev: false + adm-zip@0.5.12: {} - /agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} + agent-base@4.3.0: dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: false - - /ajv-draft-04@1.0.0(ajv@8.12.0): - resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} - peerDependencies: - ajv: ^8.5.0 - peerDependenciesMeta: - ajv: - optional: true + es6-promisify: 5.0.0 + + agent-base@6.0.2: dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + + ajv-draft-04@1.0.0(ajv@8.12.0): + optionalDependencies: ajv: 8.12.0 - dev: false - /ajv@8.12.0: - resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + ajv@8.12.0: dependencies: fast-deep-equal: 3.1.3 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 uri-js: 4.4.1 - dev: false - /ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - dev: false + ansi-regex@5.0.1: {} - /ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} + ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 - dev: false - /ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 - dev: false - /api@6.1.1(openapi-types@12.1.3): - resolution: {integrity: sha512-we3fnLinpYWlKOHdX4S/Ky9gZvColCnht/qhtv04K2jQbrC/z4SxvZVAT8W8PCC5NLLU4H35r3u4Lt77ZaiY9w==} - engines: {node: '>=16'} - hasBin: true + api@6.1.1(openapi-types@12.1.3): dependencies: '@readme/oas-to-har': 20.1.1 - '@readme/openapi-parser': 2.5.0(openapi-types@12.1.3) + '@readme/openapi-parser': 2.5.1(openapi-types@12.1.3) caseless: 0.12.0 chalk: 4.1.2 commander: 10.0.1 @@ -604,352 +1760,203 @@ packages: transitivePeerDependencies: - encoding - openapi-types - dev: false - /aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - dev: false + aproba@2.0.0: {} - /are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} + are-we-there-yet@2.0.0: dependencies: delegates: 1.0.0 readable-stream: 3.6.2 - dev: false - /argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + argparse@1.0.10: dependencies: sprintf-js: 1.0.3 - dev: false - /argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: false + argparse@2.0.1: {} - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: false + asynckit@0.4.0: {} - /axios@1.6.8: - resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} + axios@1.6.8: dependencies: follow-redirects: 1.15.6 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug - dev: false - /balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: false + balanced-match@1.0.2: {} - /base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - dev: false + base64-js@1.5.1: {} - /bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + bl@4.1.0: dependencies: buffer: 5.7.1 inherits: 2.0.4 readable-stream: 3.6.2 - dev: false - /blessed@0.1.81: - resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} - engines: {node: '>= 0.8.0'} - hasBin: true - dev: false + blessed@0.1.81: {} - /brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - dev: false - /brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + brace-expansion@2.0.1: dependencies: balanced-match: 1.0.2 - dev: false - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} + braces@3.0.2: dependencies: fill-range: 7.0.1 - dev: false - /buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + buffer@5.7.1: dependencies: base64-js: 1.5.1 ieee754: 1.2.1 - dev: false - /builtins@5.1.0: - resolution: {integrity: sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==} + builtins@5.1.0: dependencies: semver: 7.6.0 - dev: false - /call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} + call-bind@1.0.7: dependencies: es-define-property: 1.0.0 es-errors: 1.3.0 function-bind: 1.1.2 get-intrinsic: 1.2.4 set-function-length: 1.2.2 - dev: false - /call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - dev: false + call-me-maybe@1.0.2: {} - /caseless@0.12.0: - resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} - dev: false + caseless@0.12.0: {} - /chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} + chalk@2.4.2: dependencies: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 - dev: false - /chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - dev: false - /chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: false + chalk@5.3.0: {} - /chownr@1.1.4: - resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} - dev: false + chownr@1.1.4: {} - /chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - dev: false + chownr@2.0.0: {} - /cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} + cli-cursor@3.1.0: dependencies: restore-cursor: 3.1.0 - dev: false - /cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - dev: false + cli-spinners@2.9.2: {} - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + cliui@7.0.4: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - dev: false - /cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} + cliui@8.0.1: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - dev: false - /clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - dev: false + clone@1.0.4: {} - /code-block-writer@11.0.3: - resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==} - dev: false + code-block-writer@11.0.3: {} - /code-error-fragment@0.0.230: - resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} - engines: {node: '>= 4'} - dev: false + code-error-fragment@0.0.230: {} - /color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + color-convert@1.9.3: dependencies: color-name: 1.1.3 - dev: false - /color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} + color-convert@2.0.1: dependencies: color-name: 1.1.4 - dev: false - /color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: false + color-name@1.1.3: {} - /color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: false + color-name@1.1.4: {} - /color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - dev: false + color-support@1.1.3: {} - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 - dev: false - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - dev: false + commander@10.0.1: {} - /commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - dev: false + commondir@1.0.1: {} - /compute-gcd@1.2.1: - resolution: {integrity: sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==} + compute-gcd@1.2.1: dependencies: validate.io-array: 1.0.6 validate.io-function: 1.0.2 validate.io-integer-array: 1.0.0 - dev: false - /compute-lcm@1.1.2: - resolution: {integrity: sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==} + compute-lcm@1.1.2: dependencies: compute-gcd: 1.2.1 validate.io-array: 1.0.6 validate.io-function: 1.0.2 validate.io-integer-array: 1.0.0 - dev: false - /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: false + concat-map@0.0.1: {} - /console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - dev: false + console-control-strings@1.1.0: {} - /core-js@3.29.1: - resolution: {integrity: sha512-+jwgnhg6cQxKYIIjGtAHq2nwUOolo9eoFZ4sHfUH09BLXBgxnH4gA0zEd+t+BO2cNB8idaBtZFcFTRjQJRJmAw==} - requiresBuild: true - dev: false + core-js@3.29.1: {} - /cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} + cross-spawn@7.0.3: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - dev: false - /d@1.0.2: - resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} - engines: {node: '>=0.12'} + d@1.0.2: dependencies: es5-ext: 0.10.64 type: 2.7.2 - dev: false - /datauri@4.1.0: - resolution: {integrity: sha512-y17kh32+I82G+ED9MNWFkZiP/Cq/vO1hN9+tSZsT9C9qn3NrvcBnh7crSepg0AQPge1hXx2Ca44s1FRdv0gFWA==} - engines: {node: '>= 10'} + datauri@4.1.0: dependencies: image-size: 1.0.0 mimer: 2.0.2 - dev: false - /debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + debug@3.2.7: dependencies: ms: 2.1.3 - dev: false - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + debug@4.3.4: dependencies: ms: 2.1.2 - dev: false - /defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + defaults@1.0.4: dependencies: clone: 1.0.4 - dev: false - /define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} + define-data-property@1.1.4: dependencies: es-define-property: 1.0.0 es-errors: 1.3.0 gopd: 1.0.1 - dev: false - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: false + delayed-stream@1.0.0: {} - /delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - dev: false + delegates@1.0.0: {} - /detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - dev: false + detect-libc@2.0.3: {} - /discord-api-types@0.37.61: - resolution: {integrity: sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==} - dev: false + discord-api-types@0.37.61: {} - /discord-api-types@0.37.79: - resolution: {integrity: sha512-jblKMZL5f9t/pfUyhHNey8Lb9yVCcBVIPxz/JTY0raAmfj7CuFXdl9m5o/+iiB7E0vv1Kz9V7Ao5HtLRc2gH1Q==} - dev: false + discord-api-types@0.37.79: {} - /discord.js@14.14.1: - resolution: {integrity: sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==} - engines: {node: '>=16.11.0'} + discord.js@14.14.1: dependencies: '@discordjs/builders': 1.7.0 '@discordjs/collection': 1.5.3 @@ -968,104 +1975,65 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - dev: false - /emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: false + emoji-regex@8.0.0: {} - /es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} + es-define-property@1.0.0: dependencies: get-intrinsic: 1.2.4 - dev: false - /es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - dev: false + es-errors@1.3.0: {} - /es5-ext@0.10.64: - resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==} - engines: {node: '>=0.10'} - requiresBuild: true + es5-ext@0.10.64: dependencies: es6-iterator: 2.0.3 es6-symbol: 3.1.4 esniff: 2.0.1 next-tick: 1.1.0 - dev: false - /es6-iterator@2.0.3: - resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} + es6-iterator@2.0.3: dependencies: d: 1.0.2 es5-ext: 0.10.64 es6-symbol: 3.1.4 - dev: false - /es6-promise@3.3.1: - resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} - dev: false + es6-promise@3.3.1: {} - /es6-promise@4.2.8: - resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} - dev: false + es6-promise@4.2.8: {} - /es6-promisify@5.0.0: - resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + es6-promisify@5.0.0: dependencies: es6-promise: 4.2.8 - dev: false - /es6-symbol@3.1.4: - resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} - engines: {node: '>=0.12'} + es6-symbol@3.1.4: dependencies: d: 1.0.2 ext: 1.7.0 - dev: false - /es6-weak-map@2.0.3: - resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} + es6-weak-map@2.0.3: dependencies: d: 1.0.2 es5-ext: 0.10.64 es6-iterator: 2.0.3 es6-symbol: 3.1.4 - dev: false - /escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - dev: false + escalade@3.1.2: {} - /escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - dev: false + escape-string-regexp@1.0.5: {} - /esniff@2.0.1: - resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} - engines: {node: '>=0.10'} + esniff@2.0.1: dependencies: d: 1.0.2 es5-ext: 0.10.64 event-emitter: 0.3.5 type: 2.7.2 - dev: false - /event-emitter@0.3.5: - resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} + event-emitter@0.3.5: dependencies: d: 1.0.2 es5-ext: 0.10.64 - dev: false - /execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} + execa@5.1.1: dependencies: cross-spawn: 7.0.3 get-stream: 6.0.1 @@ -1076,142 +2044,84 @@ packages: onetime: 5.1.2 signal-exit: 3.0.7 strip-final-newline: 2.0.0 - dev: false - /ext@1.7.0: - resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + ext@1.7.0: dependencies: type: 2.7.2 - dev: false - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: false + fast-deep-equal@3.1.3: {} - /fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} + fast-glob@3.3.2: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: false - /fast-safe-stringify@2.1.1: - resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} - dev: false + fast-safe-stringify@2.1.1: {} - /fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + fastq@1.17.1: dependencies: reusify: 1.0.4 - dev: false - /fetch-har@8.1.5: - resolution: {integrity: sha512-c9WDro4RWC+suOVRJFNW21cgqTOELRZpvFJgfENvOM7Yt/VA4QeFtRax795SyOpTisdpcl5XNQlQZdAE6HERDA==} - engines: {node: '>=14'} + fetch-har@8.1.5: dependencies: '@readme/data-urls': 1.0.1 '@types/har-format': 1.2.15 readable-stream: 3.6.2 optionalDependencies: formdata-node: 4.4.1 - dev: false - /figlet@1.7.0: - resolution: {integrity: sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==} - engines: {node: '>= 0.4.0'} - hasBin: true - dev: false + figlet@1.7.0: {} - /figures@3.2.0: - resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} - engines: {node: '>=8'} + figures@3.2.0: dependencies: escape-string-regexp: 1.0.5 - dev: false - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} + fill-range@7.0.1: dependencies: to-regex-range: 5.0.1 - dev: false - /find-cache-dir@3.3.2: - resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} - engines: {node: '>=8'} + find-cache-dir@3.3.2: dependencies: commondir: 1.0.1 make-dir: 3.1.0 pkg-dir: 4.2.0 - dev: false - /find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} + find-up@4.1.0: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 - dev: false - /follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: false + follow-redirects@1.15.6: {} - /form-data-encoder@1.9.0: - resolution: {integrity: sha512-rahaRMkN8P8d/tgK/BLPX+WBVM27NbvdXBxqQujBtkDAIFspaRqN7Od7lfdGQA6KAD+f82fYCLBq1ipvcu8qLw==} - dev: false + form-data-encoder@1.9.0: {} - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} + form-data@4.0.0: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - dev: false - /formdata-node@4.4.1: - resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} - engines: {node: '>= 12.20'} + formdata-node@4.4.1: dependencies: node-domexception: 1.0.0 web-streams-polyfill: 4.0.0-beta.3 - dev: false - /fs-minipass@1.2.7: - resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} + fs-minipass@1.2.7: dependencies: minipass: 2.9.0 - dev: false - /fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} + fs-minipass@2.1.0: dependencies: minipass: 3.3.6 - dev: false - /fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: false + fs.realpath@1.0.0: {} - /function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - dev: false + function-bind@1.1.2: {} - /gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} + gauge@3.0.2: dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -1222,38 +2132,24 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wide-align: 1.1.5 - dev: false - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - dev: false + get-caller-file@2.0.5: {} - /get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} + get-intrinsic@1.2.4: dependencies: es-errors: 1.3.0 function-bind: 1.1.2 has-proto: 1.0.3 has-symbols: 1.0.3 hasown: 2.0.2 - dev: false - /get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - dev: false + get-stream@6.0.1: {} - /glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 - dev: false - /glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + glob@7.2.3: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -1261,315 +2157,172 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: false - /google-protobuf@3.21.2: - resolution: {integrity: sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==} - dev: false + google-protobuf@3.21.2: {} - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + gopd@1.0.1: dependencies: get-intrinsic: 1.2.4 - dev: false - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: false + grapheme-splitter@1.0.4: {} - /has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - dev: false + has-flag@3.0.0: {} - /has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - dev: false + has-flag@4.0.0: {} - /has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + has-property-descriptors@1.0.2: dependencies: es-define-property: 1.0.0 - dev: false - /has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - dev: false + has-proto@1.0.3: {} - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: false + has-symbols@1.0.3: {} - /has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - dev: false + has-unicode@2.0.1: {} - /hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} + hasown@2.0.2: dependencies: function-bind: 1.1.2 - dev: false - /http2-client@1.3.5: - resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} - dev: false + http2-client@1.3.5: {} - /https-proxy-agent@2.2.4: - resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} - engines: {node: '>= 4.5.0'} + https-proxy-agent@2.2.4: dependencies: agent-base: 4.3.0 debug: 3.2.7 transitivePeerDependencies: - supports-color - dev: false - /https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} + https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 debug: 4.3.4 transitivePeerDependencies: - supports-color - dev: false - /human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - dev: false + human-signals@2.1.0: {} - /ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - dev: false + ieee754@1.2.1: {} - /image-size@1.0.0: - resolution: {integrity: sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==} - engines: {node: '>=12.0.0'} - hasBin: true + image-size@1.0.0: dependencies: queue: 6.0.2 - dev: false - /inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + inflight@1.0.6: dependencies: once: 1.4.0 wrappy: 1.0.2 - dev: false - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: false + inherits@2.0.4: {} - /is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - dev: false + is-extglob@2.1.1: {} - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - dev: false + is-fullwidth-code-point@3.0.0: {} - /is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 - dev: false - /is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - dev: false + is-interactive@1.0.0: {} - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - dev: false + is-number@7.0.0: {} - /is-promise@2.2.2: - resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} - dev: false + is-promise@2.2.2: {} - /is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - dev: false + is-stream@2.0.1: {} - /is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - dev: false + is-unicode-supported@0.1.0: {} - /isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: false + isexe@2.0.0: {} - /isomorphic-fetch@3.0.0: - resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + isomorphic-fetch@3.0.0: dependencies: node-fetch: 2.7.0 whatwg-fetch: 3.6.20 transitivePeerDependencies: - encoding - dev: false - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: false + js-tokens@4.0.0: {} - /js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true + js-yaml@4.1.0: dependencies: argparse: 2.0.1 - dev: false - /json-schema-compare@0.2.2: - resolution: {integrity: sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==} + json-schema-compare@0.2.2: dependencies: lodash: 4.17.21 - dev: false - /json-schema-merge-allof@0.8.1: - resolution: {integrity: sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==} - engines: {node: '>=12.0.0'} + json-schema-merge-allof@0.8.1: dependencies: compute-lcm: 1.1.2 json-schema-compare: 0.2.2 lodash: 4.17.21 - dev: false - /json-schema-to-ts@2.12.0: - resolution: {integrity: sha512-uTde38yBm5lzJSRPWRaasxZo72pb+JGE4iUksNdNfAkFaLhV4N9akeBxPPUpZy5onINt9Zo0oTLrAoEXyZESiQ==} - engines: {node: '>=16'} + json-schema-to-ts@2.12.0: dependencies: '@babel/runtime': 7.24.4 '@types/json-schema': 7.0.15 ts-algebra: 1.2.2 - dev: false - /json-schema-traverse@1.0.0: - resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - dev: false + json-schema-traverse@1.0.0: {} - /json-to-ast@2.1.0: - resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} - engines: {node: '>= 4'} + json-to-ast@2.1.0: dependencies: code-error-fragment: 0.0.230 grapheme-splitter: 1.0.4 - dev: false - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - dev: false + jsonc-parser@3.2.0: {} - /jsonpath-plus@7.2.0: - resolution: {integrity: sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA==} - engines: {node: '>=12.0.0'} - dev: false + jsonpath-plus@7.2.0: {} - /jsonpointer@5.0.1: - resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} - engines: {node: '>=0.10.0'} - dev: false + jsonpointer@5.0.1: {} - /kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} - dev: false + kleur@3.0.3: {} - /leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} - dev: false + leven@3.1.0: {} - /locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 - dev: false - /lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} - dev: false + lodash.camelcase@4.3.0: {} - /lodash.deburr@4.1.0: - resolution: {integrity: sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==} - dev: false + lodash.deburr@4.1.0: {} - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: false + lodash.merge@4.6.2: {} - /lodash.setwith@4.3.2: - resolution: {integrity: sha512-Cv2pndcuNDaqDMJ0gbLm5qNG5jyfsL6f8+f5PfZVVNhQCv+y+P5gAKkCdZbtiQlux7nsnWF7UmZd8JEFIo/4tg==} - dev: false + lodash.setwith@4.3.2: {} - /lodash.snakecase@4.1.1: - resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} - dev: false + lodash.snakecase@4.1.1: {} - /lodash.startcase@4.4.0: - resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - dev: false + lodash.startcase@4.4.0: {} - /lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - dev: false + lodash@4.17.21: {} - /log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} + log-symbols@4.1.0: dependencies: chalk: 4.1.2 is-unicode-supported: 0.1.0 - dev: false - /long@4.0.0: - resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} - dev: false + long@4.0.0: {} - /lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} + lru-cache@6.0.0: dependencies: yallist: 4.0.0 - dev: false - /lru-queue@0.1.0: - resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} + lru-queue@0.1.0: dependencies: es5-ext: 0.10.64 - dev: false - /magic-bytes.js@1.10.0: - resolution: {integrity: sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==} - dev: false + magic-bytes.js@1.10.0: {} - /make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} + make-dir@3.1.0: dependencies: semver: 6.3.1 - dev: false - /marked@4.3.0: - resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} - engines: {node: '>= 12'} - hasBin: true - dev: false + marked@4.3.0: {} - /memoizee@0.4.15: - resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} + memoizee@0.4.15: dependencies: d: 1.0.2 es5-ext: 0.10.64 @@ -1579,234 +2332,126 @@ packages: lru-queue: 0.1.0 next-tick: 1.1.0 timers-ext: 0.1.7 - dev: false - /merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: false + merge-stream@2.0.0: {} - /merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - dev: false + merge2@1.4.1: {} - /micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} + micromatch@4.0.5: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: false - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: false + mime-db@1.52.0: {} - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} + mime-types@2.1.35: dependencies: mime-db: 1.52.0 - dev: false - /mimer@2.0.2: - resolution: {integrity: sha512-izxvjsB7Ur5HrTbPu6VKTrzxSMBFBqyZQc6dWlZNQ4/wAvf886fD4lrjtFd8IQ8/WmZKdxKjUtqFFNaj3hQ52g==} - engines: {node: '>= 12'} - hasBin: true - dev: false + mimer@2.0.2: {} - /mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - dev: false + mimic-fn@2.1.0: {} - /minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 - dev: false - /minimatch@5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} - engines: {node: '>=10'} + minimatch@5.1.6: dependencies: brace-expansion: 2.0.1 - dev: false - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: false + minimist@1.2.8: {} - /minipass@2.9.0: - resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} + minipass@2.9.0: dependencies: safe-buffer: 5.2.1 yallist: 3.1.1 - dev: false - /minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} + minipass@3.3.6: dependencies: yallist: 4.0.0 - dev: false - /minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - dev: false + minipass@5.0.0: {} - /minipass@7.0.4: - resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} - engines: {node: '>=16 || 14 >=14.17'} - dev: false + minipass@7.0.4: {} - /minizlib@1.3.3: - resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} + minizlib@1.3.3: dependencies: minipass: 2.9.0 - dev: false - /minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} + minizlib@2.1.2: dependencies: minipass: 3.3.6 yallist: 4.0.0 - dev: false - /mkdirp@0.5.6: - resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true + mkdirp@0.5.6: dependencies: minimist: 1.2.8 - dev: false - /mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - dev: false + mkdirp@1.0.4: {} - /moment@2.30.1: - resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} - dev: false + moment@2.30.1: {} - /ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: false + ms@2.1.2: {} - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: false + ms@2.1.3: {} - /mustache@4.2.0: - resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} - hasBin: true - dev: false + mustache@4.2.0: {} - /next-tick@1.1.0: - resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - dev: false + next-tick@1.1.0: {} - /node-abort-controller@3.1.1: - resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} - dev: false + node-abort-controller@3.1.1: {} - /node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - dev: false + node-domexception@1.0.0: {} - /node-fetch-h2@2.3.0: - resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==} - engines: {node: 4.x || >=6.0.0} + node-fetch-h2@2.3.0: dependencies: http2-client: 1.3.5 - dev: false - /node-fetch@2.6.13: - resolution: {integrity: sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true + node-fetch@2.6.13: dependencies: whatwg-url: 5.0.0 - dev: false - /node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true + node-fetch@2.7.0: dependencies: whatwg-url: 5.0.0 - dev: false - /node-readfiles@0.2.0: - resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==} + node-readfiles@0.2.0: dependencies: es6-promise: 3.3.1 - dev: false - /nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true + nopt@5.0.0: dependencies: abbrev: 1.1.1 - dev: false - /npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 - dev: false - /npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + npmlog@5.0.1: dependencies: are-we-there-yet: 2.0.0 console-control-strings: 1.1.0 gauge: 3.0.2 set-blocking: 2.0.0 - dev: false - /nsfwjs@4.1.0(@tensorflow/tfjs@4.17.0): - resolution: {integrity: sha512-2V27SoNXUJbAAi+vW8RHJbONs2AHa1odmjlRsVX2mirxR4IGt1OIzZ49IXgPVg6nktwA8Su61YEJql7VreEKyg==} - peerDependencies: - '@tensorflow/tfjs': ^4.0.0 + nsfwjs@4.1.0(@tensorflow/tfjs@4.18.0(seedrandom@3.0.5)): dependencies: - '@tensorflow/tfjs': 4.17.0(seedrandom@3.0.5) - dev: false + '@tensorflow/tfjs': 4.18.0(seedrandom@3.0.5) - /oas-kit-common@1.0.8: - resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} + oas-kit-common@1.0.8: dependencies: fast-safe-stringify: 2.1.1 - dev: false - /oas-linter@3.2.2: - resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==} + oas-linter@3.2.2: dependencies: '@exodus/schemasafe': 1.3.0 should: 13.2.3 yaml: 1.10.2 - dev: false - /oas-normalize@8.4.1: - resolution: {integrity: sha512-cGODg+AntZteJRHBiYDWKtcO2svWGMXuFWYu2I8b4hOrNiwB3hgDs/ScX3O9mYm6RpLsUIftt6rDHGc8eYG8aA==} - engines: {node: '>=14'} + oas-normalize@8.4.1: dependencies: - '@readme/openapi-parser': 2.5.0(openapi-types@12.1.3) + '@readme/openapi-parser': 2.5.1(openapi-types@12.1.3) '@readme/postman-to-openapi': 4.1.0 js-yaml: 4.1.0 node-fetch: 2.7.0 @@ -1814,25 +2459,18 @@ packages: swagger2openapi: 7.0.8 transitivePeerDependencies: - encoding - dev: false - /oas-resolver@2.5.6: - resolution: {integrity: sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==} - hasBin: true + oas-resolver@2.5.6: dependencies: node-fetch-h2: 2.3.0 oas-kit-common: 1.0.8 reftools: 1.1.9 yaml: 1.10.2 yargs: 17.7.2 - dev: false - /oas-schema-walker@1.1.5: - resolution: {integrity: sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==} - dev: false + oas-schema-walker@1.1.5: {} - /oas-validator@5.0.8: - resolution: {integrity: sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==} + oas-validator@5.0.8: dependencies: call-me-maybe: 1.0.2 oas-kit-common: 1.0.8 @@ -1842,11 +2480,8 @@ packages: reftools: 1.1.9 should: 13.2.3 yaml: 1.10.2 - dev: false - /oas@20.10.3: - resolution: {integrity: sha512-dBxDuwn2ssggPMOqEKEzT4sjCqbkol8JozuWrpwD7chcmbKbverj5vpk2kmsczeyguFkLcKUOMcqUUimf9h+IQ==} - engines: {node: '>=14'} + oas@20.10.3: dependencies: '@readme/json-schema-ref-parser': 1.2.0 '@types/json-schema': 7.0.15 @@ -1860,37 +2495,22 @@ packages: remove-undefined-objects: 3.0.0 transitivePeerDependencies: - encoding - dev: false - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: false + object-assign@4.1.1: {} - /object-inspect@1.13.1: - resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} - dev: false + object-inspect@1.13.1: {} - /once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + once@1.4.0: dependencies: wrappy: 1.0.2 - dev: false - /onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} + onetime@5.1.2: dependencies: mimic-fn: 2.1.0 - dev: false - /openapi-types@12.1.3: - resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} - dev: false + openapi-types@12.1.3: {} - /ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} + ora@5.4.1: dependencies: bl: 4.1.0 chalk: 4.1.2 @@ -1901,217 +2521,112 @@ packages: log-symbols: 4.1.0 strip-ansi: 6.0.1 wcwidth: 1.0.1 - dev: false - /os@0.1.2: - resolution: {integrity: sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ==} - dev: false + os@0.1.2: {} - /p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} + p-limit@2.3.0: dependencies: p-try: 2.2.0 - dev: false - /p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} + p-locate@4.1.0: dependencies: p-limit: 2.3.0 - dev: false - /p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - dev: false + p-try@2.2.0: {} - /path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - dev: false + path-browserify@1.0.1: {} - /path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: false + path-exists@4.0.0: {} - /path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - dev: false + path-is-absolute@1.0.1: {} - /path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - dev: false + path-key@3.1.1: {} - /path-to-regexp@6.2.2: - resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} - dev: false + path-to-regexp@6.2.2: {} - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: false + picocolors@1.0.0: {} - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - dev: false + picomatch@2.3.1: {} - /pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} + pkg-dir@4.2.0: dependencies: find-up: 4.1.0 - dev: false - /prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} - engines: {node: '>=14'} - hasBin: true - dev: true + prettier@3.2.5: {} - /progress@2.0.3: - resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} - engines: {node: '>=0.4.0'} - dev: false + progress@2.0.3: {} - /prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} + prompts@2.4.2: dependencies: kleur: 3.0.3 sisteransi: 1.0.5 - dev: false - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: false + proxy-from-env@1.1.0: {} - /punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - dev: false + punycode@2.3.1: {} - /qs@6.12.0: - resolution: {integrity: sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==} - engines: {node: '>=0.6'} + qs@6.12.1: dependencies: side-channel: 1.0.6 - dev: false - /queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: false + queue-microtask@1.2.3: {} - /queue@6.0.2: - resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + queue@6.0.2: dependencies: inherits: 2.0.4 - dev: false - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} + readable-stream@3.6.2: dependencies: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 - dev: false - /reftools@1.1.9: - resolution: {integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==} - dev: false + reftools@1.1.9: {} - /regenerator-runtime@0.13.11: - resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} - dev: false + regenerator-runtime@0.13.11: {} - /regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - dev: false + regenerator-runtime@0.14.1: {} - /remove-undefined-objects@2.0.2: - resolution: {integrity: sha512-b6x4MUtR4YBW1aCoGx3tE4mA2PFjiXSmtSdNmLexQzUdZa4ybnJAItXLKpkcVgCUJIzJtk2DFG402sMSEMlonQ==} - engines: {node: '>=14'} - dev: false + remove-undefined-objects@2.0.2: {} - /remove-undefined-objects@3.0.0: - resolution: {integrity: sha512-nxG1yYfc/Jxi+bNCBiqKhxVJPE+QvziIOKbD+Dxc93Uisz92v/ZYpo4WR0TJuf+dk2xE8lW2WPJsA3mDFzXy8w==} - engines: {node: '>=16'} - dev: false + remove-undefined-objects@3.0.0: {} - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - dev: false + require-directory@2.1.1: {} - /require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} - dev: false + require-from-string@2.0.2: {} - /restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} + restore-cursor@3.1.0: dependencies: onetime: 5.1.2 signal-exit: 3.0.7 - dev: false - /reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: false + reusify@1.0.4: {} - /rimraf@2.7.1: - resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - hasBin: true + rimraf@2.7.1: dependencies: glob: 7.2.3 - dev: false - /rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true + rimraf@3.0.2: dependencies: glob: 7.2.3 - dev: false - /run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 - dev: false - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: false + safe-buffer@5.2.1: {} - /seedrandom@3.0.5: - resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} - dev: false + seedrandom@3.0.5: {} - /semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - dev: false + semver@6.3.1: {} - /semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true + semver@7.6.0: dependencies: lru-cache: 6.0.0 - dev: false - /set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - dev: false + set-blocking@2.0.0: {} - /set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 es-errors: 1.3.0 @@ -2119,131 +2634,81 @@ packages: get-intrinsic: 1.2.4 gopd: 1.0.1 has-property-descriptors: 1.0.2 - dev: false - /shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - dev: false - /shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - dev: false + shebang-regex@3.0.0: {} - /should-equal@2.0.0: - resolution: {integrity: sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==} + should-equal@2.0.0: dependencies: should-type: 1.4.0 - dev: false - /should-format@3.0.3: - resolution: {integrity: sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==} + should-format@3.0.3: dependencies: should-type: 1.4.0 should-type-adaptors: 1.1.0 - dev: false - /should-type-adaptors@1.1.0: - resolution: {integrity: sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==} + should-type-adaptors@1.1.0: dependencies: should-type: 1.4.0 should-util: 1.0.1 - dev: false - /should-type@1.4.0: - resolution: {integrity: sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==} - dev: false + should-type@1.4.0: {} - /should-util@1.0.1: - resolution: {integrity: sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==} - dev: false + should-util@1.0.1: {} - /should@13.2.3: - resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==} + should@13.2.3: dependencies: should-equal: 2.0.0 should-format: 3.0.3 should-type: 1.4.0 should-type-adaptors: 1.1.0 should-util: 1.0.1 - dev: false - /side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} - engines: {node: '>= 0.4'} + side-channel@1.0.6: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 object-inspect: 1.13.1 - dev: false - /signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: false + signal-exit@3.0.7: {} - /sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - dev: false + sisteransi@1.0.5: {} - /sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: false + sprintf-js@1.0.3: {} - /ssri@10.0.5: - resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ssri@10.0.5: dependencies: minipass: 7.0.4 - dev: false - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: false - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 - dev: false - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 - dev: false - /strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - dev: false + strip-final-newline@2.0.0: {} - /supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} + supports-color@5.5.0: dependencies: has-flag: 3.0.0 - dev: false - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 - dev: false - /swagger2openapi@7.0.8: - resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} - hasBin: true + swagger2openapi@7.0.8: dependencies: call-me-maybe: 1.0.2 node-fetch: 2.7.0 @@ -2258,11 +2723,8 @@ packages: yargs: 17.7.2 transitivePeerDependencies: - encoding - dev: false - /tar@4.4.19: - resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} - engines: {node: '>=4.5'} + tar@4.4.19: dependencies: chownr: 1.1.4 fs-minipass: 1.2.7 @@ -2271,11 +2733,8 @@ packages: mkdirp: 0.5.6 safe-buffer: 5.2.1 yallist: 3.1.1 - dev: false - /tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} + tar@6.2.1: dependencies: chownr: 2.0.0 fs-minipass: 2.1.0 @@ -2283,206 +2742,112 @@ packages: minizlib: 2.1.2 mkdirp: 1.0.4 yallist: 4.0.0 - dev: false - /timers-ext@0.1.7: - resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} + timers-ext@0.1.7: dependencies: es5-ext: 0.10.64 next-tick: 1.1.0 - dev: false - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - dev: false - /tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: false + tr46@0.0.3: {} - /ts-algebra@1.2.2: - resolution: {integrity: sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==} - dev: false + ts-algebra@1.2.2: {} - /ts-mixer@6.0.4: - resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} - dev: false + ts-mixer@6.0.4: {} - /ts-morph@17.0.1: - resolution: {integrity: sha512-10PkHyXmrtsTvZSL+cqtJLTgFXkU43Gd0JCc0Rw6GchWbqKe0Rwgt1v3ouobTZwQzF1mGhDeAlWYBMGRV7y+3g==} + ts-morph@17.0.1: dependencies: '@ts-morph/common': 0.18.1 code-block-writer: 11.0.3 - dev: false - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: false + tslib@2.6.2: {} - /type@2.7.2: - resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} - dev: false + type@2.7.2: {} - /undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - dev: false + undici-types@5.26.5: {} - /undici@5.27.2: - resolution: {integrity: sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==} - engines: {node: '>=14.0'} + undici@5.27.2: dependencies: '@fastify/busboy': 2.1.1 - dev: false - /undici@5.28.4: - resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} - engines: {node: '>=14.0'} + undici@5.28.4: dependencies: '@fastify/busboy': 2.1.1 - dev: false - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + uri-js@4.4.1: dependencies: punycode: 2.3.1 - dev: false - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: false + util-deprecate@1.0.2: {} - /validate-npm-package-name@5.0.0: - resolution: {integrity: sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + validate-npm-package-name@5.0.0: dependencies: builtins: 5.1.0 - dev: false - /validate.io-array@1.0.6: - resolution: {integrity: sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==} - dev: false + validate.io-array@1.0.6: {} - /validate.io-function@1.0.2: - resolution: {integrity: sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==} - dev: false + validate.io-function@1.0.2: {} - /validate.io-integer-array@1.0.0: - resolution: {integrity: sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==} + validate.io-integer-array@1.0.0: dependencies: validate.io-array: 1.0.6 validate.io-integer: 1.0.5 - dev: false - /validate.io-integer@1.0.5: - resolution: {integrity: sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==} + validate.io-integer@1.0.5: dependencies: validate.io-number: 1.0.3 - dev: false - /validate.io-number@1.0.3: - resolution: {integrity: sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==} - dev: false + validate.io-number@1.0.3: {} - /wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + wcwidth@1.0.1: dependencies: defaults: 1.0.4 - dev: false - /web-streams-polyfill@4.0.0-beta.3: - resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} - engines: {node: '>= 14'} - dev: false + web-streams-polyfill@4.0.0-beta.3: {} - /webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: false + webidl-conversions@3.0.1: {} - /whatwg-fetch@3.6.20: - resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} - dev: false + whatwg-fetch@3.6.20: {} - /whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 - dev: false - /which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true + which@2.0.2: dependencies: isexe: 2.0.0 - dev: false - /wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + wide-align@1.1.5: dependencies: string-width: 4.2.3 - dev: false - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: false - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: false + wrappy@1.0.2: {} - /ws@8.14.2: - resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false + ws@8.14.2: {} - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: false + y18n@5.0.8: {} - /yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - dev: false + yallist@3.1.1: {} - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: false + yallist@4.0.0: {} - /yaml@1.10.2: - resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} - engines: {node: '>= 6'} - dev: false + yaml@1.10.2: {} - /yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: false + yargs-parser@20.2.9: {} - /yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - dev: false + yargs-parser@21.1.1: {} - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} + yargs@16.2.0: dependencies: cliui: 7.0.4 escalade: 3.1.2 @@ -2491,11 +2856,8 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 20.2.9 - dev: false - /yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} + yargs@17.7.2: dependencies: cliui: 8.0.1 escalade: 3.1.2 @@ -2504,4 +2866,3 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 - dev: false From 0d515f759884ba14697d9c9e5e974bdad7a2b9a2 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:02:50 +0100 Subject: [PATCH 25/56] Notice for history - context menu --- interactions/context-menus/message/taurusai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 22d9cbe..60cef46 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -158,7 +158,7 @@ module.exports = { interaction, message, loadingMsg, - messageDeleted, + "slashCommand", true, ); } From d747871dc656f55ae3e0b01e806d683652fdf0ab Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Tue, 23 Apr 2024 18:23:07 +0100 Subject: [PATCH 26/56] Resolves #24 --- .../context-menus/message/taurusai.js | 2 +- utils.js | 38 +++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 60cef46..22d9cbe 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -158,7 +158,7 @@ module.exports = { interaction, message, loadingMsg, - "slashCommand", + messageDeleted, true, ); } diff --git a/utils.js b/utils.js index 81672de..1b494cd 100644 --- a/utils.js +++ b/utils.js @@ -190,13 +190,30 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { message.reference.messageId, ); - if (originalMessage.author.id !== message.client.user.id) - return { userQuestion: null, threadMessages: null, messageDeleted }; + if ( + originalMessage.author.id !== message.client.user.id || + (originalMessage.embeds.length > 0 && + !originalMessage.embeds[0].footer.text.startsWith( + "Response to message by", + )) + ) { + return { + userQuestion, + threadMessages: null, + messageDeleted: "threadDeleted", + }; + } if (originalMessage.author.id === message.client.user.id) { let currentMessage = message; - while (currentMessage.reference) { + while ( + currentMessage.reference && + !( + currentMessage.author.id === message.client.user.id && + currentMessage.embeds.length > 0 + ) + ) { currentMessage = await message.channel.messages.fetch( currentMessage.reference.messageId, ); @@ -207,6 +224,21 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { let content = currentMessage.content; if (sender === "user") { content = content.replace(/<@\d+>\s*/, ""); + } else if ( + sender === "model" && + currentMessage.embeds.length > 0 && + currentMessage.embeds[0].footer.text.startsWith( + "Response to message by", + ) + ) { + const footerText = currentMessage.embeds[0].footer.text; + const userMessage = footerText.split("\n")[2]; + threadMessages.unshift({ role: sender, parts: [{ text: content }] }); + threadMessages.unshift({ + role: "user", + parts: [{ text: userMessage }], + }); + continue; } threadMessages.unshift({ role: sender, parts: [{ text: content }] }); } From dec09a726ac41f3911adc5c038f7bc46281a1bc6 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:59:32 +0100 Subject: [PATCH 27/56] Resolves #26 --- interactions/slash/misc/help.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interactions/slash/misc/help.js b/interactions/slash/misc/help.js index 0036559..62b9f6f 100644 --- a/interactions/slash/misc/help.js +++ b/interactions/slash/misc/help.js @@ -13,10 +13,14 @@ module.exports = { .setName("help") .setDescription("Display available slash commands"), async execute(interaction) { - const commands = interaction.client.slashCommands; + const commands = ( + await interaction.client.application.commands.fetch() + ).filter((command) => command.type === 1); + const commandList = commands .map( - (command) => `**/${command.data.name}**: ${command.data.description}`, + (command) => + `****: ${command.description}`, ) .join("\n"); From f674ceda7b22b9cf3b7cd1d123b94eda1aa6c631 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 27 Apr 2024 21:50:05 +0100 Subject: [PATCH 28/56] Update Version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cff26ee..8461df8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taurus", - "version": "3.1", + "version": "3.3", "description": "An AI Discord Bot!", "types": "./typings.d.ts", "main": "bot.js", From 14923067230791b02e8a55bb7c58449bb50cb856 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:47:18 +0100 Subject: [PATCH 29/56] Resolves #30 --- bot.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.js b/bot.js index 7492583..d7a429b 100644 --- a/bot.js +++ b/bot.js @@ -196,13 +196,13 @@ const commandJsonData = [ ...Array.from(client.slashCommands.values()).map((c) => { const commandData = c.data instanceof SlashCommandBuilder ? c.data.toJSON() : c.data; - commandData.integration_types = [1]; + commandData.integration_types = [0, 1]; commandData.contexts = [0, 1, 2]; return commandData; }), ...Array.from(client.contextCommands.values()).map((c) => { const commandData = c.data; - commandData.integration_types = [1]; + commandData.integration_types = [0, 1]; commandData.contexts = [0, 1, 2]; return commandData; }), diff --git a/package.json b/package.json index 8461df8..4ec7d0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taurus", - "version": "3.3", + "version": "3.4", "description": "An AI Discord Bot!", "types": "./typings.d.ts", "main": "bot.js", From 6d61a671b18b31926539be887ce0e7a876e8dbf0 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:53:00 +0100 Subject: [PATCH 30/56] Resolves #29 --- utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 1b494cd..1680dc2 100644 --- a/utils.js +++ b/utils.js @@ -198,7 +198,7 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { )) ) { return { - userQuestion, + userQuestion: null, threadMessages: null, messageDeleted: "threadDeleted", }; From 33226acc54a45aa86d86189da1dae8cfa9d00c3c Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:15:07 +0100 Subject: [PATCH 31/56] Fix error when user replies to bot embeds --- utils.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/utils.js b/utils.js index 1680dc2..a841bf1 100644 --- a/utils.js +++ b/utils.js @@ -190,12 +190,20 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { message.reference.messageId, ); + const startStrings = [ + "Response to message by", + "A message has been deleted", + "Reply thread history", + ]; + if ( originalMessage.author.id !== message.client.user.id || (originalMessage.embeds.length > 0 && - !originalMessage.embeds[0].footer.text.startsWith( - "Response to message by", - )) + (!originalMessage.embeds[0].footer || + !originalMessage.embeds[0].footer.text || + !startStrings.some((str) => + originalMessage.embeds[0].footer.text.startsWith(str), + ))) ) { return { userQuestion: null, From 540b409a885a771f4923508c23fde71d61b95123 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:34:37 +0100 Subject: [PATCH 32/56] Resolves #31 --- events/taurusai.js | 92 ++++++++------- .../context-menus/message/taurusai.js | 106 ++++++++++-------- interactions/modals/category/ask.js | 91 ++++++++------- utils.js | 10 +- 4 files changed, 169 insertions(+), 130 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index 998ada6..c395699 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -54,41 +54,49 @@ module.exports = { message.channel.sendTyping(); }, 5000); - const loadingEmbed = new EmbedBuilder() - .setTitle("**⌛Loading your response**") - .setDescription( - "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", - ) - .setFooter({ - text: "This may take a while", - iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`, - }) - .setTimestamp(); - const loadingMsg = await message.reply({ embeds: [loadingEmbed] }); - const loadingDots = [" ⌛ ", " ⏳ "]; - let i = 0; - const loadingInterval = setInterval(() => { - loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); - loadingMsg.edit({ embeds: [loadingEmbed] }); - i = (i + 1) % loadingDots.length; - }, 2000); - - const user_status = message.member?.presence.clientStatus || {}; - const status_devices = Object.entries(user_status) - .map(([platform, status]) => `${platform}: ${status}`) - .join("\n"); - - const personalityFilePath = path.join(__dirname, "../personality.txt"); - const personalityContent = await fs.readFile(personalityFilePath, "utf-8"); - const personalityLines = personalityContent.split("\n"); - - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; - - if (Object.keys(user_status).length) { - parts1 += ` The user's status/presence is currently:\n${status_devices}`; - } + let loadingInterval; + let loadingMsg; async function run() { + const loadingEmbed = new EmbedBuilder() + .setTitle("**⌛Loading your response**") + .setDescription( + "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", + ) + .setFooter({ + text: "This may take a while", + iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`, + }) + .setTimestamp(); + loadingMsg = loadingMsg + ? await loadingMsg.edit({ embeds: [loadingEmbed] }) + : await message.reply({ embeds: [loadingEmbed] }); + const loadingDots = [" ⌛ ", " ⏳ "]; + let i = 0; + loadingInterval = setInterval(() => { + loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); + loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 2000); + + const user_status = message.member?.presence.clientStatus || {}; + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + const personalityFilePath = path.join(__dirname, "../personality.txt"); + const personalityContent = await fs.readFile( + personalityFilePath, + "utf-8", + ); + const personalityLines = personalityContent.split("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; + + if (Object.keys(user_status).length) { + parts1 += ` The user's status/presence is currently:\n${status_devices}`; + } + const generationConfig = { maxOutputTokens: 750, }; @@ -139,13 +147,17 @@ module.exports = { ); } - try { - await run(); - } catch (err) { - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); + let errorType = null; + do { + try { + await run(); + errorType = null; + } catch (err) { + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); - handleGeminiError(err, loadingMsg); - } + errorType = await handleGeminiError(err, loadingMsg); + } + } while (errorType === "quota_error"); }, }; diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 22d9cbe..ff55b6f 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -70,48 +70,56 @@ module.exports = { const user = message.author; - const loadingEmbed = new EmbedBuilder() - .setTitle("**⌛Loading your response**") - .setDescription( - "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", - ) - .setFooter({ - text: "This may take a while", - iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`, - }) - .setTimestamp(); - const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); - const loadingDots = [" ⌛ ", " ⏳ "]; - let i = 0; - const loadingInterval = setInterval(() => { - loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); - loadingMsg.edit({ embeds: [loadingEmbed] }); - i = (i + 1) % loadingDots.length; - }, 2000); - - const personalityFilePath = path.join( - __dirname + "../../../../personality.txt", - ); - const personalityContent = await fs.readFile(personalityFilePath, "utf-8"); - const personalityLines = personalityContent.split("\n"); - - const botMention = `<@${message.client.user.id}>`; - - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; - userQuestion = message.content.replace(botMention, "").trim(); - - const user_status = message.member?.presence.clientStatus || {}; - const status_devices = Object.entries(user_status) - .map(([platform, status]) => `${platform}: ${status}`) - .join("\n"); - - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; - - if (Object.keys(user_status).length) { - parts1 += ` The user's status/presence is currently:\n${status_devices}`; - } + let loadingInterval; + let loadingMsg; async function run() { + const loadingEmbed = new EmbedBuilder() + .setTitle("**⌛Loading your response**") + .setDescription( + "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", + ) + .setFooter({ + text: "This may take a while", + iconURL: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`, + }) + .setTimestamp(); + loadingMsg = loadingMsg + ? await loadingMsg.edit({ embeds: [loadingEmbed] }) + : await interaction.reply({ embeds: [loadingEmbed] }); + const loadingDots = [" ⌛ ", " ⏳ "]; + let i = 0; + const loadingInterval = setInterval(() => { + loadingEmbed.setTitle(`**${loadingDots[i]} Loading your response**`); + loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 2000); + + const personalityFilePath = path.join( + __dirname + "../../../../personality.txt", + ); + const personalityContent = await fs.readFile( + personalityFilePath, + "utf-8", + ); + const personalityLines = personalityContent.split("\n"); + + const botMention = `<@${message.client.user.id}>`; + + if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; + userQuestion = message.content.replace(botMention, "").trim(); + + const user_status = message.member?.presence.clientStatus || {}; + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; + + if (Object.keys(user_status).length) { + parts1 += ` The user's status/presence is currently:\n${status_devices}`; + } + const generationConfig = { maxOutputTokens: 750, }; @@ -163,13 +171,17 @@ module.exports = { ); } - try { - await run(); - } catch (err) { - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); + let errorType = null; + do { + try { + await run(); + errorType = null; + } catch (err) { + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); - handleGeminiError(err, loadingMsg); - } + errorType = await handleGeminiError(err, loadingMsg); + } + } while (errorType === "quota_error"); }, }; diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 2aa83cf..a730ee8 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -42,41 +42,46 @@ module.exports = { }, 5000) : null; - const loadingEmbed = new EmbedBuilder() - .setTitle("**Loading your response . . .**") - .setDescription( - "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", - ) - .setFooter({ - text: "⏳ This may take a while", - iconURL: interaction.user.displayAvatarURL(), - }) - .setTimestamp(); - const loadingMsg = await interaction.reply({ embeds: [loadingEmbed] }); - const loadingDots = ["", " . ", " . . ", " . . ."]; - let i = 0; - const loadingInterval = setInterval(async () => { - loadingEmbed.setTitle(`**Loading your response ${loadingDots[i]}**`); - await loadingMsg.edit({ embeds: [loadingEmbed] }); - i = (i + 1) % loadingDots.length; - }, 500); - - const user_status = - interaction.inGuild() && botInGuild(interaction) - ? interaction.member?.presence.clientStatus - : {}; - - const status_devices = Object.entries(user_status) - .map(([platform, status]) => `${platform}: ${status}`) - .join("\n"); - - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}> and limit your responses to 2000 characters or less.`; - - if (Object.keys(user_status).length) { - parts1 += ` The user's status/presence is currently:\n${status_devices}`; - } + let loadingInterval; + let loadingMsg; async function run() { + const loadingEmbed = new EmbedBuilder() + .setTitle("**Loading your response . . .**") + .setDescription( + "*TaurusAI may display innacurate/offensive info.*\n\n> *I am powered by Google's Generative AI, [Gemini](https://gemini.google.com) and was integrated by <@719815864135712799>.*", + ) + .setFooter({ + text: "⏳ This may take a while", + iconURL: interaction.user.displayAvatarURL(), + }) + .setTimestamp(); + loadingMsg = loadingMsg + ? await loadingMsg.edit({ embeds: [loadingEmbed] }) + : await interaction.reply({ embeds: [loadingEmbed] }); + const loadingDots = ["", " . ", " . . ", " . . ."]; + let i = 0; + const loadingInterval = setInterval(async () => { + loadingEmbed.setTitle(`**Loading your response ${loadingDots[i]}**`); + await loadingMsg.edit({ embeds: [loadingEmbed] }); + i = (i + 1) % loadingDots.length; + }, 500); + + const user_status = + interaction.inGuild() && botInGuild(interaction) + ? interaction.member?.presence.clientStatus + : {}; + + const status_devices = Object.entries(user_status) + .map(([platform, status]) => `${platform}: ${status}`) + .join("\n"); + + parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}> and limit your responses to 2000 characters or less.`; + + if (Object.keys(user_status).length) { + parts1 += ` The user's status/presence is currently:\n${status_devices}`; + } + const generationConfig = { maxOutputTokens: 750, }; @@ -117,13 +122,17 @@ module.exports = { ); } - try { - await run(); - } catch (err) { - clearInterval(loadingInterval); - sendTypingInterval && clearInterval(sendTypingInterval); - - handleGeminiError(err, loadingMsg); - } + let errorType = null; + do { + try { + await run(); + errorType = null; + } catch (err) { + clearInterval(loadingInterval); + sendTypingInterval && clearInterval(sendTypingInterval); + + errorType = await handleGeminiError(err, loadingMsg); + } + } while (errorType === "quota_error"); }, }; diff --git a/utils.js b/utils.js index a841bf1..4451378 100644 --- a/utils.js +++ b/utils.js @@ -49,11 +49,17 @@ async function handleGeminiError(err, loadingMsg) { const quota_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( - "There are alot of requests at the moment Please try again later, or in a few minutes. \n*If this issue persists after a few minutes, please contact the Developers.*\n - *We are aware of these issues and apologize for the inconvenience.* \n\n> - Token Limit for this minute has been reached.", + "There are a lot of requests at the moment. Please try again later, or in a few minutes. \n*If this issue persists after a few minutes, please contact the Developers.* \n - *We are aware of these issues and apologize for the inconvenience.* \n\n> - Token Limit for this minute has been reached.", ) .setColor("Red"); - return await loadingMsg.edit({ embeds: [quota_error] }); + for (let i = 10; i > 0; i--) { + quota_error.setFooter({ text: `Retrying request in (${i})` }); + await loadingMsg.edit({ embeds: [quota_error] }); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + + return "quota_error"; case "Cannot send an empty message": case "response.text is not a function": const error = new EmbedBuilder() From 50b9651c84f4d9d2d685b75c3acdd4f0ab980a5f Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 2 May 2024 18:31:45 +0100 Subject: [PATCH 33/56] Formatting --- utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils.js b/utils.js index 4451378..cb192c9 100644 --- a/utils.js +++ b/utils.js @@ -49,12 +49,12 @@ async function handleGeminiError(err, loadingMsg) { const quota_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( - "There are a lot of requests at the moment. Please try again later, or in a few minutes. \n*If this issue persists after a few minutes, please contact the Developers.* \n - *We are aware of these issues and apologize for the inconvenience.* \n\n> - Token Limit for this minute has been reached.", + "There are a lot of requests at the moment. Please try again later, or in a few minutes. \n▸ *If this issue persists after a few minutes, please contact the Developers.* \n - *We are aware of these issues and apologize for the inconvenience.* \n> - Token Limit for this minute has been reached.", ) .setColor("Red"); for (let i = 10; i > 0; i--) { - quota_error.setFooter({ text: `Retrying request in (${i})` }); + quota_error.setFooter({ text: `⏱️ Retrying request in (${i})` }); await loadingMsg.edit({ embeds: [quota_error] }); await new Promise((resolve) => setTimeout(resolve, 1000)); } @@ -65,7 +65,7 @@ async function handleGeminiError(err, loadingMsg) { const error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( - "An error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.* \n\n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.", + "An error occurred while processing your request. Please try again later, or in a few minutes. \n▸ *If this issue persists, please contact the Developers.* \n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.", ) .setColor("Red"); @@ -74,7 +74,7 @@ async function handleGeminiError(err, loadingMsg) { const error_internal = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( - "An error occurred while processing your request. This error originated from Google's side, not ours. \n*If this issue persists, please contact the Developers.* \n\n> - Please retry and make another request.", + "An error occurred while processing your request. This error originated from Google's side, not ours. \n▸ *If this issue persists, please contact the Developers.* \n> - Please retry and make another request.", ) .setColor("Red"); @@ -84,7 +84,7 @@ async function handleGeminiError(err, loadingMsg) { const error_unknown = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( - "An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n*If this issue persists, please contact the Developers.*\n> - Token Limit for this minute may have been reached.", + "An unknown error occurred while processing your request. Please try again later, or in a few minutes. \n▸ *If this issue persists, please contact the Developers.*\n> - Token Limit for this minute may have been reached.", ) .setColor("Red"); From e901a31f290c3557651ff3fc7dc9eda8b5cc09eb Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 2 May 2024 19:14:17 +0100 Subject: [PATCH 34/56] Fix response too long error --- utils.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/utils.js b/utils.js index cb192c9..beb02df 100644 --- a/utils.js +++ b/utils.js @@ -61,15 +61,14 @@ async function handleGeminiError(err, loadingMsg) { return "quota_error"; case "Cannot send an empty message": - case "response.text is not a function": - const error = new EmbedBuilder() + const error_empty = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( "An error occurred while processing your request. Please try again later, or in a few minutes. \n▸ *If this issue persists, please contact the Developers.* \n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.", ) .setColor("Red"); - return await loadingMsg.edit({ embeds: [error] }); + return await loadingMsg.edit({ embeds: [error_empty] }); case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [500 Internal Server Error] An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting": const error_internal = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") @@ -103,15 +102,15 @@ async function handleResponse( ) { const result = await chat.sendMessage(userQuestion); const response = await result.response; + let responseText = response.text(); const responseLength = response.text().length; if (responseLength > 2000) { - response.text = - response.text().substring(0, 1928 - "... \n\n".length) + + responseText = + response.text().substring(0, 1936 - "... \n\n".length) + "... \n\n*Response was cut short due to Discords character limit of 2000*"; } - let responseText = response.text(); const regex = /<@&?\d+>/g; let match; From 74880e6592a0b63db90d8f784b02f173dd6be774 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 2 May 2024 19:36:11 +0100 Subject: [PATCH 35/56] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ec7d0e..b1dae6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taurus", - "version": "3.4", + "version": "3.5", "description": "An AI Discord Bot!", "types": "./typings.d.ts", "main": "bot.js", From e433bdf40247113fa62ad40956fde416fa49d20d Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Thu, 2 May 2024 21:21:45 +0100 Subject: [PATCH 36/56] Update Packages --- events/taurusai.js | 13 +- .../context-menus/message/taurusai.js | 13 +- interactions/modals/category/ask.js | 13 +- package.json | 6 +- pnpm-lock.yaml | 170 +++++++++--------- 5 files changed, 97 insertions(+), 118 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index c395699..b1c7287 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -91,10 +91,10 @@ module.exports = { ); const personalityLines = personalityContent.split("\n"); - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; + instruction = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; if (Object.keys(user_status).length) { - parts1 += ` The user's status/presence is currently:\n${status_devices}`; + instruction += ` The user's status/presence is currently:\n${status_devices}`; } const generationConfig = { @@ -104,14 +104,7 @@ module.exports = { const model = genAI.getGenerativeModel( { model: "gemini-1.5-pro-latest", - systemInstruction: { - role: "system", - parts: [ - { - text: parts1, - }, - ], - }, + systemInstruction: instruction, }, { safetySettings, diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index ff55b6f..9ad5848 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -114,10 +114,10 @@ module.exports = { .map(([platform, status]) => `${platform}: ${status}`) .join("\n"); - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; + instruction = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; if (Object.keys(user_status).length) { - parts1 += ` The user's status/presence is currently:\n${status_devices}`; + instruction += ` The user's status/presence is currently:\n${status_devices}`; } const generationConfig = { @@ -127,14 +127,7 @@ module.exports = { const model = genAI.getGenerativeModel( { model: "gemini-1.5-pro-latest", - systemInstruction: { - role: "system", - parts: [ - { - text: parts1, - }, - ], - }, + systemInstruction: instruction, }, { safetySettings, diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index a730ee8..6deb3f2 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -76,10 +76,10 @@ module.exports = { .map(([platform, status]) => `${platform}: ${status}`) .join("\n"); - parts1 = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}> and limit your responses to 2000 characters or less.`; + instruction = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${interaction.user.id}> and limit your responses to 2000 characters or less.`; if (Object.keys(user_status).length) { - parts1 += ` The user's status/presence is currently:\n${status_devices}`; + instruction += ` The user's status/presence is currently:\n${status_devices}`; } const generationConfig = { @@ -89,14 +89,7 @@ module.exports = { const model = genAI.getGenerativeModel( { model: "gemini-1.5-pro-latest", - systemInstruction: { - role: "system", - parts: [ - { - text: parts1, - }, - ], - }, + systemInstruction: instruction, }, { safetySettings, diff --git a/package.json b/package.json index b1dae6f..04598c1 100644 --- a/package.json +++ b/package.json @@ -23,14 +23,14 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.7.1", + "@google/generative-ai": "^0.9.0", "@iamtraction/google-translate": "^2.0.1", - "@tensorflow/tfjs-node": "^4.18.0", + "@tensorflow/tfjs-node": "^4.19.0", "api": "^6.1.1", "axios": "^1.6.8", "blessed": "^0.1.81", "chalk": "^5.3.0", - "discord-api-types": "^0.37.79", + "discord-api-types": "^0.37.83", "discord.js": "^14.14.1", "figlet": "^1.7.0", "moment": "^2.30.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dcde6ab..16e79b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,14 +9,14 @@ importers: .: dependencies: '@google/generative-ai': - specifier: ^0.7.1 - version: 0.7.1 + specifier: ^0.9.0 + version: 0.9.0 '@iamtraction/google-translate': specifier: ^2.0.1 version: 2.0.1 '@tensorflow/tfjs-node': - specifier: ^4.18.0 - version: 4.18.0(seedrandom@3.0.5) + specifier: ^4.19.0 + version: 4.19.0(seedrandom@3.0.5) api: specifier: ^6.1.1 version: 6.1.1(openapi-types@12.1.3) @@ -30,8 +30,8 @@ importers: specifier: ^5.3.0 version: 5.3.0 discord-api-types: - specifier: ^0.37.79 - version: 0.37.79 + specifier: ^0.37.83 + version: 0.37.83 discord.js: specifier: ^14.14.1 version: 14.14.1 @@ -43,7 +43,7 @@ importers: version: 2.30.1 nsfwjs: specifier: ^4.1.0 - version: 4.1.0(@tensorflow/tfjs@4.18.0(seedrandom@3.0.5)) + version: 4.1.0(@tensorflow/tfjs@4.19.0(seedrandom@3.0.5)) os: {specifier: ^0.1.2, version: 0.1.2} devDependencies: prettier: @@ -63,16 +63,16 @@ packages: resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.22.20': - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + '@babel/helper-validator-identifier@7.24.5': + resolution: {integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.2': - resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} + '@babel/highlight@7.24.5': + resolution: {integrity: sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.24.4': - resolution: {integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==} + '@babel/runtime@7.24.5': + resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} engines: {node: '>=6.9.0'} '@discordjs/builders@1.7.0': @@ -110,8 +110,8 @@ packages: resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} - '@google/generative-ai@0.7.1': - resolution: {integrity: sha512-WTjMLLYL/xfA5BW6xAycRPiAX7FNHKAxrid/ayqC1QMam0KAK0NbMeS9Lubw80gVg5xFMLE+H7pw4wdNzTOlxw==} + '@google/generative-ai@0.9.0': + resolution: {integrity: sha512-tJo+4ITV6yDo0EatG9mENOevQp6NyB28LntujzkehXDK5lY/fK7hJdelBJCriVMivS9lfHKjfML9lMQMOWuuCA==} engines: {node: '>=18.0.0'} '@humanwhocodes/momoa@2.0.4': @@ -190,44 +190,44 @@ packages: resolution: {integrity: sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - '@tensorflow/tfjs-backend-cpu@4.18.0': - resolution: {integrity: sha512-zk6NyGGsv0mCDnc5xWxLB5Zi8GaHVI2gg7KC0FSw/r5wW9SfA3ZIqUHVZhbIVhNqZSWy6L/+EIJa7l6q1XCkrg==} + '@tensorflow/tfjs-backend-cpu@4.19.0': + resolution: {integrity: sha512-7pT05Ea6GTXjbqRgkmayZRYvaiNl3LLk1TyfUvC8iIqMw5d7p4Wgte2pfM2gMbIZ/opOxURhFYuI0FiQvUrW6g==} engines: {yarn: '>= 1.3.2'} peerDependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 - '@tensorflow/tfjs-backend-webgl@4.18.0': - resolution: {integrity: sha512-ZLQ8MnWnIttMDqHepEzPL0Y4HkTePl8+AaYm9AcNnDUK7VF2jn+BXcTHCUOGfiwKu/OMwRc6osDrjxr0cCqNrA==} + '@tensorflow/tfjs-backend-webgl@4.19.0': + resolution: {integrity: sha512-R0DC1W65lqTOccCwxMhH+VOKCgSrhd9GEejIIGhjeXt6oZlACFnOx4SuUr/qKLCDsL5I4E9iFLxAJMmsfYvARw==} engines: {yarn: '>= 1.3.2'} peerDependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 - '@tensorflow/tfjs-converter@4.18.0': - resolution: {integrity: sha512-b7utNMvmI986OPaQvDyHoiHKiIyip7ubSjG4KzTcFOWEKTsirtHxRp/6QKY/XSuH3AJK9Switu1/B5QC7xR2Zg==} + '@tensorflow/tfjs-converter@4.19.0': + resolution: {integrity: sha512-xIOE6enaVHPYCXKpHxJnUlN8hzlcQkgFSymHjBmdDnNCresuRwBGz4dqYAQMeQG21Ei3lxCQFdDDH7aSvUEAPw==} peerDependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 - '@tensorflow/tfjs-core@4.18.0': - resolution: {integrity: sha512-wjyq+F8AZJjhtr5xUBAON4VrNBXr9Poows/LnRh1K7wS+w41sCk0EQfeo6NfgUZXbHE/jgcqU6+fZDUKt3qRrg==} + '@tensorflow/tfjs-core@4.19.0': + resolution: {integrity: sha512-GZ0d53PG0HGQCC7hbWv1qDnZctHYe/cafHZrBY5eNeQjQE6fBr3NsR5GfLadT0TELwmX9/nyritGDzvy6xmzHQ==} engines: {yarn: '>= 1.3.2'} - '@tensorflow/tfjs-data@4.18.0': - resolution: {integrity: sha512-JGfEwq8a0nEXwwU04/PW7O6kZ3FdqAd6ofMboM9qwGTv47QdeO/G1657sy4N21Q/qiz5qFDbGLhim3Nq9gZm9g==} + '@tensorflow/tfjs-data@4.19.0': + resolution: {integrity: sha512-n0ZgJp5UhhBatohUt9pXSCCApusK+1Flyk6yDrQYuxOTjhRppd6jYrF7LCDG3hMFi3QLGl0jab1zYrn9BwtC/w==} peerDependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 seedrandom: ^3.0.5 - '@tensorflow/tfjs-layers@4.18.0': - resolution: {integrity: sha512-9AyxUdvjMDbDOkNzdkMRToJZF/le5ia8X3lVfGRGxzsuyoWDBGlV9V1ICufD+Z8sODXVyu+cgE8kAMtVK4aHFA==} + '@tensorflow/tfjs-layers@4.19.0': + resolution: {integrity: sha512-NufvuRaZdIyoG+R13d7oL8G5Bywox+ihPMiMZ3tWU+me8C8Y0pVC69mrnhOS9R8an7GDxKKSTTNEZhUvPvMGiQ==} peerDependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 - '@tensorflow/tfjs-node@4.18.0': - resolution: {integrity: sha512-jat7J/K8OEKyO/w20PXN8OBQMwdUMQxfPpNGsyS21lq93dr6g+z4vVH0RT+soPsVX2NvdIrAxHT3RWkinSCikw==} + '@tensorflow/tfjs-node@4.19.0': + resolution: {integrity: sha512-1HLIAuu5azP8SW7t5EZc1W5VOdjWndJYz1N1agz0It/tMtnuWIdAfcY08VjfuiI/NhAwuPShehqv6CZ3SYh+Vg==} engines: {node: '>=8.11.0'} - '@tensorflow/tfjs@4.18.0': - resolution: {integrity: sha512-MjA2M91wSkTkpFSuyQAuZm+DT9Y7DFu3rsTaO1BjCbf1S7o8DgJPKMmh6hk6uEn6/SBBbZVXPu+ZTQ/SyrP2Pw==} + '@tensorflow/tfjs@4.19.0': + resolution: {integrity: sha512-d2A1lTc6my7GJ5LwqzXa+igJ5+18exwsnaphZ3roi5nJ197uwxVSMIc2vSJnqZz1KajC5/mZgQr67EZrpTFlBg==} hasBin: true '@ts-morph/common@0.18.1': @@ -245,8 +245,8 @@ packages: '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + '@types/node@20.12.8': + resolution: {integrity: sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w==} '@types/offscreencanvas@2019.3.0': resolution: {integrity: sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==} @@ -290,8 +290,8 @@ packages: ajv: optional: true - ajv@8.12.0: - resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + ajv@8.13.0: + resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -507,8 +507,8 @@ packages: discord-api-types@0.37.61: resolution: {integrity: sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==} - discord-api-types@0.37.79: - resolution: {integrity: sha512-jblKMZL5f9t/pfUyhHNey8Lb9yVCcBVIPxz/JTY0raAmfj7CuFXdl9m5o/+iiB7E0vv1Kz9V7Ao5HtLRc2gH1Q==} + discord-api-types@0.37.83: + resolution: {integrity: sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==} discord.js@14.14.1: resolution: {integrity: sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==} @@ -1406,19 +1406,19 @@ snapshots: '@babel/code-frame@7.24.2': dependencies: - '@babel/highlight': 7.24.2 + '@babel/highlight': 7.24.5 picocolors: 1.0.0 - '@babel/helper-validator-identifier@7.22.20': {} + '@babel/helper-validator-identifier@7.24.5': {} - '@babel/highlight@7.24.2': + '@babel/highlight@7.24.5': dependencies: - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.24.5 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.0 - '@babel/runtime@7.24.4': + '@babel/runtime@7.24.5': dependencies: regenerator-runtime: 0.14.1 @@ -1473,7 +1473,7 @@ snapshots: '@fastify/busboy@2.1.1': {} - '@google/generative-ai@0.7.1': {} + '@google/generative-ai@0.9.0': {} '@humanwhocodes/momoa@2.0.4': {} @@ -1510,12 +1510,12 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@readme/better-ajv-errors@1.6.0(ajv@8.12.0)': + '@readme/better-ajv-errors@1.6.0(ajv@8.13.0)': dependencies: '@babel/code-frame': 7.24.2 - '@babel/runtime': 7.24.4 + '@babel/runtime': 7.24.5 '@humanwhocodes/momoa': 2.0.4 - ajv: 8.12.0 + ajv: 8.13.0 chalk: 4.1.2 json-to-ast: 2.1.0 jsonpointer: 5.0.1 @@ -1551,10 +1551,10 @@ snapshots: '@apidevtools/openapi-schemas': 2.1.0 '@apidevtools/swagger-methods': 3.0.2 '@jsdevtools/ono': 7.1.3 - '@readme/better-ajv-errors': 1.6.0(ajv@8.12.0) + '@readme/better-ajv-errors': 1.6.0(ajv@8.13.0) '@readme/json-schema-ref-parser': 1.2.0 - ajv: 8.12.0 - ajv-draft-04: 1.0.0(ajv@8.12.0) + ajv: 8.13.0 + ajv-draft-04: 1.0.0(ajv@8.13.0) call-me-maybe: 1.0.2 openapi-types: 12.1.3 @@ -1576,25 +1576,25 @@ snapshots: '@sapphire/snowflake@3.5.1': {} - '@tensorflow/tfjs-backend-cpu@4.18.0(@tensorflow/tfjs-core@4.18.0)': + '@tensorflow/tfjs-backend-cpu@4.19.0(@tensorflow/tfjs-core@4.19.0)': dependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 '@types/seedrandom': 2.4.34 seedrandom: 3.0.5 - '@tensorflow/tfjs-backend-webgl@4.18.0(@tensorflow/tfjs-core@4.18.0)': + '@tensorflow/tfjs-backend-webgl@4.19.0(@tensorflow/tfjs-core@4.19.0)': dependencies: - '@tensorflow/tfjs-backend-cpu': 4.18.0(@tensorflow/tfjs-core@4.18.0) - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-backend-cpu': 4.19.0(@tensorflow/tfjs-core@4.19.0) + '@tensorflow/tfjs-core': 4.19.0 '@types/offscreencanvas': 2019.3.0 '@types/seedrandom': 2.4.34 seedrandom: 3.0.5 - '@tensorflow/tfjs-converter@4.18.0(@tensorflow/tfjs-core@4.18.0)': + '@tensorflow/tfjs-converter@4.19.0(@tensorflow/tfjs-core@4.19.0)': dependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 - '@tensorflow/tfjs-core@4.18.0': + '@tensorflow/tfjs-core@4.19.0': dependencies: '@types/long': 4.0.2 '@types/offscreencanvas': 2019.7.3 @@ -1606,9 +1606,9 @@ snapshots: transitivePeerDependencies: - encoding - '@tensorflow/tfjs-data@4.18.0(@tensorflow/tfjs-core@4.18.0)(seedrandom@3.0.5)': + '@tensorflow/tfjs-data@4.19.0(@tensorflow/tfjs-core@4.19.0)(seedrandom@3.0.5)': dependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 '@types/node-fetch': 2.6.11 node-fetch: 2.6.13 seedrandom: 3.0.5 @@ -1616,14 +1616,14 @@ snapshots: transitivePeerDependencies: - encoding - '@tensorflow/tfjs-layers@4.18.0(@tensorflow/tfjs-core@4.18.0)': + '@tensorflow/tfjs-layers@4.19.0(@tensorflow/tfjs-core@4.19.0)': dependencies: - '@tensorflow/tfjs-core': 4.18.0 + '@tensorflow/tfjs-core': 4.19.0 - '@tensorflow/tfjs-node@4.18.0(seedrandom@3.0.5)': + '@tensorflow/tfjs-node@4.19.0(seedrandom@3.0.5)': dependencies: '@mapbox/node-pre-gyp': 1.0.9 - '@tensorflow/tfjs': 4.18.0(seedrandom@3.0.5) + '@tensorflow/tfjs': 4.19.0(seedrandom@3.0.5) adm-zip: 0.5.12 google-protobuf: 3.21.2 https-proxy-agent: 2.2.4 @@ -1635,14 +1635,14 @@ snapshots: - seedrandom - supports-color - '@tensorflow/tfjs@4.18.0(seedrandom@3.0.5)': + '@tensorflow/tfjs@4.19.0(seedrandom@3.0.5)': dependencies: - '@tensorflow/tfjs-backend-cpu': 4.18.0(@tensorflow/tfjs-core@4.18.0) - '@tensorflow/tfjs-backend-webgl': 4.18.0(@tensorflow/tfjs-core@4.18.0) - '@tensorflow/tfjs-converter': 4.18.0(@tensorflow/tfjs-core@4.18.0) - '@tensorflow/tfjs-core': 4.18.0 - '@tensorflow/tfjs-data': 4.18.0(@tensorflow/tfjs-core@4.18.0)(seedrandom@3.0.5) - '@tensorflow/tfjs-layers': 4.18.0(@tensorflow/tfjs-core@4.18.0) + '@tensorflow/tfjs-backend-cpu': 4.19.0(@tensorflow/tfjs-core@4.19.0) + '@tensorflow/tfjs-backend-webgl': 4.19.0(@tensorflow/tfjs-core@4.19.0) + '@tensorflow/tfjs-converter': 4.19.0(@tensorflow/tfjs-core@4.19.0) + '@tensorflow/tfjs-core': 4.19.0 + '@tensorflow/tfjs-data': 4.19.0(@tensorflow/tfjs-core@4.19.0)(seedrandom@3.0.5) + '@tensorflow/tfjs-layers': 4.19.0(@tensorflow/tfjs-core@4.19.0) argparse: 1.0.10 chalk: 4.1.2 core-js: 3.29.1 @@ -1667,10 +1667,10 @@ snapshots: '@types/node-fetch@2.6.11': dependencies: - '@types/node': 20.12.7 + '@types/node': 20.12.8 form-data: 4.0.0 - '@types/node@20.12.7': + '@types/node@20.12.8': dependencies: undici-types: 5.26.5 @@ -1682,7 +1682,7 @@ snapshots: '@types/ws@8.5.9': dependencies: - '@types/node': 20.12.7 + '@types/node': 20.12.8 '@vladfrangu/async_event_emitter@2.2.4': {} @@ -1702,11 +1702,11 @@ snapshots: transitivePeerDependencies: - supports-color - ajv-draft-04@1.0.0(ajv@8.12.0): + ajv-draft-04@1.0.0(ajv@8.13.0): optionalDependencies: - ajv: 8.12.0 + ajv: 8.13.0 - ajv@8.12.0: + ajv@8.13.0: dependencies: fast-deep-equal: 3.1.3 json-schema-traverse: 1.0.0 @@ -1954,7 +1954,7 @@ snapshots: discord-api-types@0.37.61: {} - discord-api-types@0.37.79: {} + discord-api-types@0.37.83: {} discord.js@14.14.1: dependencies: @@ -2260,7 +2260,7 @@ snapshots: json-schema-to-ts@2.12.0: dependencies: - '@babel/runtime': 7.24.4 + '@babel/runtime': 7.24.5 '@types/json-schema': 7.0.15 ts-algebra: 1.2.2 @@ -2435,9 +2435,9 @@ snapshots: gauge: 3.0.2 set-blocking: 2.0.0 - nsfwjs@4.1.0(@tensorflow/tfjs@4.18.0(seedrandom@3.0.5)): + nsfwjs@4.1.0(@tensorflow/tfjs@4.19.0(seedrandom@3.0.5)): dependencies: - '@tensorflow/tfjs': 4.18.0(seedrandom@3.0.5) + '@tensorflow/tfjs': 4.19.0(seedrandom@3.0.5) oas-kit-common@1.0.8: dependencies: From ba696c9e5921f8f2a29784980fb369a807458c6d Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 6 May 2024 20:05:46 +0100 Subject: [PATCH 37/56] Resolves #35 --- utils.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils.js b/utils.js index beb02df..917db8c 100644 --- a/utils.js +++ b/utils.js @@ -201,6 +201,9 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { "Reply thread history", ]; + const linkRegex = + /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/; + if ( originalMessage.author.id !== message.client.user.id || (originalMessage.embeds.length > 0 && @@ -208,7 +211,8 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { !originalMessage.embeds[0].footer.text || !startStrings.some((str) => originalMessage.embeds[0].footer.text.startsWith(str), - ))) + )) && + !linkRegex.test(originalMessage.content)) ) { return { userQuestion: null, @@ -224,7 +228,8 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { currentMessage.reference && !( currentMessage.author.id === message.client.user.id && - currentMessage.embeds.length > 0 + currentMessage.embeds.length > 0 && + !linkRegex.test(currentMessage.content) ) ) { currentMessage = await message.channel.messages.fetch( @@ -240,6 +245,8 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { } else if ( sender === "model" && currentMessage.embeds.length > 0 && + currentMessage.embeds[0].footer && + currentMessage.embeds[0].footer.text && currentMessage.embeds[0].footer.text.startsWith( "Response to message by", ) From 27a6ebeb25e2cb42249157b8160a6516ce55145f Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 11 May 2024 16:36:00 +0100 Subject: [PATCH 38/56] Update Packages Fix spelling --- interactions/slash/misc/image.js | 2 +- package.json | 6 +- pnpm-lock.yaml | 204 +++++++++++++------------------ 3 files changed, 92 insertions(+), 120 deletions(-) diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index f19e219..a7ad282 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -53,7 +53,7 @@ module.exports = { .addStringOption((option) => option .setName("style-preset") - .setDescription("The Image Style Prese") + .setDescription("The Image Style Preset") .addChoices( { name: "3d Model", value: "3d-model" }, { name: "Analog Film", value: "analog-film" }, diff --git a/package.json b/package.json index 04598c1..0aa16c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taurus", - "version": "3.5", + "version": "3.6", "description": "An AI Discord Bot!", "types": "./typings.d.ts", "main": "bot.js", @@ -23,7 +23,7 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.9.0", + "@google/generative-ai": "^0.11.1", "@iamtraction/google-translate": "^2.0.1", "@tensorflow/tfjs-node": "^4.19.0", "api": "^6.1.1", @@ -31,7 +31,7 @@ "blessed": "^0.1.81", "chalk": "^5.3.0", "discord-api-types": "^0.37.83", - "discord.js": "^14.14.1", + "discord.js": "^14.15.2", "figlet": "^1.7.0", "moment": "^2.30.1", "nsfwjs": "^4.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 16e79b3..4f1d297 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@google/generative-ai': - specifier: ^0.9.0 - version: 0.9.0 + specifier: ^0.11.1 + version: 0.11.1 '@iamtraction/google-translate': specifier: ^2.0.1 version: 2.0.1 @@ -33,8 +33,8 @@ importers: specifier: ^0.37.83 version: 0.37.83 discord.js: - specifier: ^14.14.1 - version: 14.14.1 + specifier: ^14.15.2 + version: 14.15.2 figlet: specifier: ^1.7.0 version: 1.7.0 @@ -75,32 +75,32 @@ packages: resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} engines: {node: '>=6.9.0'} - '@discordjs/builders@1.7.0': - resolution: {integrity: sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==} + '@discordjs/builders@1.8.1': + resolution: {integrity: sha512-GkF+HM01FHy+NSoTaUPR8z44otfQgJ1AIsRxclYGUZDyUbdZEFyD/5QVv2Y1Flx6M+B0bQLzg2M9CJv5lGTqpA==} engines: {node: '>=16.11.0'} '@discordjs/collection@1.5.3': resolution: {integrity: sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==} engines: {node: '>=16.11.0'} - '@discordjs/collection@2.0.0': - resolution: {integrity: sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==} + '@discordjs/collection@2.1.0': + resolution: {integrity: sha512-mLcTACtXUuVgutoznkh6hS3UFqYirDYAg5Dc1m8xn6OvPjetnUlf/xjtqnnc47OwWdaoCQnHmHh9KofhD6uRqw==} engines: {node: '>=18'} - '@discordjs/formatters@0.3.3': - resolution: {integrity: sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==} + '@discordjs/formatters@0.4.0': + resolution: {integrity: sha512-fJ06TLC1NiruF35470q3Nr1bi95BdvKFAF+T5bNfZJ4bNdqZ3VZ+Ttg6SThqTxm6qumSG3choxLBHMC69WXNXQ==} engines: {node: '>=16.11.0'} - '@discordjs/rest@2.2.0': - resolution: {integrity: sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==} + '@discordjs/rest@2.3.0': + resolution: {integrity: sha512-C1kAJK8aSYRv3ZwMG8cvrrW4GN0g5eMdP8AuN8ODH5DyOCbHgJspze1my3xHOAgwLJdKUbWNVyAeJ9cEdduqIg==} engines: {node: '>=16.11.0'} - '@discordjs/util@1.0.2': - resolution: {integrity: sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==} + '@discordjs/util@1.1.0': + resolution: {integrity: sha512-IndcI5hzlNZ7GS96RV3Xw1R2kaDuXEp7tRIy/KlhidpN/BQ1qh1NZt3377dMLTa44xDUNKT7hnXkA/oUAzD/lg==} engines: {node: '>=16.11.0'} - '@discordjs/ws@1.0.2': - resolution: {integrity: sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==} + '@discordjs/ws@1.1.0': + resolution: {integrity: sha512-O97DIeSvfNTn5wz5vaER6ciyUsr7nOqSEtsLoMhhIgeFkhnxLRqSr00/Fpq2/ppLgjDGLbQCDzIK7ilGoB/M7A==} engines: {node: '>=16.11.0'} '@exodus/schemasafe@1.3.0': @@ -110,8 +110,8 @@ packages: resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} - '@google/generative-ai@0.9.0': - resolution: {integrity: sha512-tJo+4ITV6yDo0EatG9mENOevQp6NyB28LntujzkehXDK5lY/fK7hJdelBJCriVMivS9lfHKjfML9lMQMOWuuCA==} + '@google/generative-ai@0.11.1': + resolution: {integrity: sha512-ZiUiJJbl55TXcvu73+Kf/bUhzcRTH/bsGBeYZ9ULqU0imXg3POcd+NVYM9j+TGq4MA73UYwHPmJHwmy+QZEzyQ==} engines: {node: '>=18.0.0'} '@humanwhocodes/momoa@2.0.4': @@ -186,8 +186,8 @@ packages: resolution: {integrity: sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g==} engines: {node: '>=v16'} - '@sapphire/snowflake@3.5.1': - resolution: {integrity: sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==} + '@sapphire/snowflake@3.5.3': + resolution: {integrity: sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} '@tensorflow/tfjs-backend-cpu@4.19.0': @@ -245,8 +245,8 @@ packages: '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node@20.12.8': - resolution: {integrity: sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w==} + '@types/node@20.12.11': + resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==} '@types/offscreencanvas@2019.3.0': resolution: {integrity: sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==} @@ -257,8 +257,8 @@ packages: '@types/seedrandom@2.4.34': resolution: {integrity: sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A==} - '@types/ws@8.5.9': - resolution: {integrity: sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==} + '@types/ws@8.5.10': + resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} '@vladfrangu/async_event_emitter@2.2.4': resolution: {integrity: sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==} @@ -356,9 +356,6 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - builtins@5.1.0: - resolution: {integrity: sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==} - call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -504,14 +501,11 @@ packages: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} - discord-api-types@0.37.61: - resolution: {integrity: sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==} - discord-api-types@0.37.83: resolution: {integrity: sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==} - discord.js@14.14.1: - resolution: {integrity: sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==} + discord.js@14.15.2: + resolution: {integrity: sha512-wGD37YCaTUNprtpqMIRuNiswwsvSWXrHykBSm2SAosoTYut0VUDj9yo9t4iLtMKvuhI49zYkvKc2TNdzdvpJhg==} engines: {node: '>=16.11.0'} emoji-regex@8.0.0: @@ -841,10 +835,6 @@ packages: long@4.0.0: resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - lru-queue@0.1.0: resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} @@ -912,8 +902,8 @@ packages: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} - minipass@7.0.4: - resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} + minipass@7.1.1: + resolution: {integrity: sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==} engines: {node: '>=16 || 14 >=14.17'} minizlib@1.3.3: @@ -1174,8 +1164,8 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} hasBin: true @@ -1225,8 +1215,8 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - ssri@10.0.5: - resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + ssri@10.0.6: + resolution: {integrity: sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} string-width@4.2.3: @@ -1292,22 +1282,22 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - undici@5.27.2: - resolution: {integrity: sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==} - engines: {node: '>=14.0'} - undici@5.28.4: resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} engines: {node: '>=14.0'} + undici@6.13.0: + resolution: {integrity: sha512-Q2rtqmZWrbP8nePMq7mOJIN98M0fYvSgV89vwl/BQRT4mDOeY2GXZngfGpcBBhtky3woM7G24wZV3Q304Bv6cw==} + engines: {node: '>=18.0'} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - validate-npm-package-name@5.0.0: - resolution: {integrity: sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==} + validate-npm-package-name@5.0.1: + resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} validate.io-array@1.0.6: @@ -1356,8 +1346,8 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - ws@8.14.2: - resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} + ws@8.17.0: + resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -1422,49 +1412,49 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@discordjs/builders@1.7.0': + '@discordjs/builders@1.8.1': dependencies: - '@discordjs/formatters': 0.3.3 - '@discordjs/util': 1.0.2 + '@discordjs/formatters': 0.4.0 + '@discordjs/util': 1.1.0 '@sapphire/shapeshift': 3.9.7 - discord-api-types: 0.37.61 + discord-api-types: 0.37.83 fast-deep-equal: 3.1.3 ts-mixer: 6.0.4 tslib: 2.6.2 '@discordjs/collection@1.5.3': {} - '@discordjs/collection@2.0.0': {} + '@discordjs/collection@2.1.0': {} - '@discordjs/formatters@0.3.3': + '@discordjs/formatters@0.4.0': dependencies: - discord-api-types: 0.37.61 + discord-api-types: 0.37.83 - '@discordjs/rest@2.2.0': + '@discordjs/rest@2.3.0': dependencies: - '@discordjs/collection': 2.0.0 - '@discordjs/util': 1.0.2 + '@discordjs/collection': 2.1.0 + '@discordjs/util': 1.1.0 '@sapphire/async-queue': 1.5.2 - '@sapphire/snowflake': 3.5.1 + '@sapphire/snowflake': 3.5.3 '@vladfrangu/async_event_emitter': 2.2.4 - discord-api-types: 0.37.61 + discord-api-types: 0.37.83 magic-bytes.js: 1.10.0 tslib: 2.6.2 - undici: 5.27.2 + undici: 6.13.0 - '@discordjs/util@1.0.2': {} + '@discordjs/util@1.1.0': {} - '@discordjs/ws@1.0.2': + '@discordjs/ws@1.1.0': dependencies: - '@discordjs/collection': 2.0.0 - '@discordjs/rest': 2.2.0 - '@discordjs/util': 1.0.2 + '@discordjs/collection': 2.1.0 + '@discordjs/rest': 2.3.0 + '@discordjs/util': 1.1.0 '@sapphire/async-queue': 1.5.2 - '@types/ws': 8.5.9 + '@types/ws': 8.5.10 '@vladfrangu/async_event_emitter': 2.2.4 - discord-api-types: 0.37.61 + discord-api-types: 0.37.83 tslib: 2.6.2 - ws: 8.14.2 + ws: 8.17.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -1473,7 +1463,7 @@ snapshots: '@fastify/busboy@2.1.1': {} - '@google/generative-ai@0.9.0': {} + '@google/generative-ai@0.11.1': {} '@humanwhocodes/momoa@2.0.4': {} @@ -1492,7 +1482,7 @@ snapshots: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.6.0 + semver: 7.6.2 tar: 6.2.1 transitivePeerDependencies: - encoding @@ -1574,7 +1564,7 @@ snapshots: fast-deep-equal: 3.1.3 lodash: 4.17.21 - '@sapphire/snowflake@3.5.1': {} + '@sapphire/snowflake@3.5.3': {} '@tensorflow/tfjs-backend-cpu@4.19.0(@tensorflow/tfjs-core@4.19.0)': dependencies: @@ -1667,10 +1657,10 @@ snapshots: '@types/node-fetch@2.6.11': dependencies: - '@types/node': 20.12.8 + '@types/node': 20.12.11 form-data: 4.0.0 - '@types/node@20.12.8': + '@types/node@20.12.11': dependencies: undici-types: 5.26.5 @@ -1680,9 +1670,9 @@ snapshots: '@types/seedrandom@2.4.34': {} - '@types/ws@8.5.9': + '@types/ws@8.5.10': dependencies: - '@types/node': 20.12.8 + '@types/node': 20.12.11 '@vladfrangu/async_event_emitter@2.2.4': {} @@ -1753,10 +1743,10 @@ snapshots: ora: 5.4.1 prompts: 2.4.2 remove-undefined-objects: 2.0.2 - semver: 7.6.0 - ssri: 10.0.5 + semver: 7.6.2 + ssri: 10.0.6 ts-morph: 17.0.1 - validate-npm-package-name: 5.0.0 + validate-npm-package-name: 5.0.1 transitivePeerDependencies: - encoding - openapi-types @@ -1814,10 +1804,6 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - builtins@5.1.0: - dependencies: - semver: 7.6.0 - call-bind@1.0.7: dependencies: es-define-property: 1.0.0 @@ -1952,26 +1938,22 @@ snapshots: detect-libc@2.0.3: {} - discord-api-types@0.37.61: {} - discord-api-types@0.37.83: {} - discord.js@14.14.1: + discord.js@14.15.2: dependencies: - '@discordjs/builders': 1.7.0 + '@discordjs/builders': 1.8.1 '@discordjs/collection': 1.5.3 - '@discordjs/formatters': 0.3.3 - '@discordjs/rest': 2.2.0 - '@discordjs/util': 1.0.2 - '@discordjs/ws': 1.0.2 - '@sapphire/snowflake': 3.5.1 - '@types/ws': 8.5.9 - discord-api-types: 0.37.61 + '@discordjs/formatters': 0.4.0 + '@discordjs/rest': 2.3.0 + '@discordjs/util': 1.1.0 + '@discordjs/ws': 1.1.0 + '@sapphire/snowflake': 3.5.3 + discord-api-types: 0.37.83 fast-deep-equal: 3.1.3 lodash.snakecase: 4.1.1 tslib: 2.6.2 - undici: 5.27.2 - ws: 8.14.2 + undici: 6.13.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -2306,10 +2288,6 @@ snapshots: long@4.0.0: {} - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - lru-queue@0.1.0: dependencies: es5-ext: 0.10.64 @@ -2373,7 +2351,7 @@ snapshots: minipass@5.0.0: {} - minipass@7.0.4: {} + minipass@7.1.1: {} minizlib@1.3.3: dependencies: @@ -2620,9 +2598,7 @@ snapshots: semver@6.3.1: {} - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 + semver@7.6.2: {} set-blocking@2.0.0: {} @@ -2680,9 +2656,9 @@ snapshots: sprintf-js@1.0.3: {} - ssri@10.0.5: + ssri@10.0.6: dependencies: - minipass: 7.0.4 + minipass: 7.1.1 string-width@4.2.3: dependencies: @@ -2769,23 +2745,19 @@ snapshots: undici-types@5.26.5: {} - undici@5.27.2: - dependencies: - '@fastify/busboy': 2.1.1 - undici@5.28.4: dependencies: '@fastify/busboy': 2.1.1 + undici@6.13.0: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 util-deprecate@1.0.2: {} - validate-npm-package-name@5.0.0: - dependencies: - builtins: 5.1.0 + validate-npm-package-name@5.0.1: {} validate.io-array@1.0.6: {} @@ -2833,7 +2805,7 @@ snapshots: wrappy@1.0.2: {} - ws@8.14.2: {} + ws@8.17.0: {} y18n@5.0.8: {} From c89fc9c34b200b9fd5f66f3be881545b43340691 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 11 May 2024 17:55:51 +0100 Subject: [PATCH 39/56] Update README.md --- README.md | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0e3fe1b..613f8e9 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,44 @@ image

-## 🤔 What is this bot? +# 🤔 What is the Taurus Discord Bot? -The **Taurus Discord Bot** is a small bot, it can be used for several things such as: +The Taurus Discord Bot is a small bot with a big impact. It offers several features, including advanced image generation, AI chats, and more. -- Image Generation -- AI GPT chats and personality customisations +
+💬 AI Chats + +- Powered by Google's [Gemini 1.5 Model](https://deepmind.google/technologies/gemini/#gemini-1.5) +- Has a configurable global personality via the ``/personalise`` slash command +- Remembers past messages + +**Ways to interact:** +- Context Menus +- Mention the Bot with your message +- Utilise the ``/taurus`` slash command + +
+ +
+🖼️ Advanced Image Generation + +- 70+ Models +- 17 Style Presets +- Negative Prompt Customisation +- A toggleable NSFW image blocker +- Supports different languages +- And much more! + +
+ +
+🔧 Additional Features + +- Live Console Logging in Discord +- Personality update logs in Discord +- User Commands - Use the bot anywhere on Discord +- An optional CLI via the start scripts +
## 💾 Install From 7149bf09ffba8ee43d1167d6b11a53e1b63704d9 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sat, 11 May 2024 17:58:32 +0100 Subject: [PATCH 40/56] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 613f8e9..6e9f85e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ image

-# 🤔 What is the Taurus Discord Bot? +# 🤔 What is Taurus? The Taurus Discord Bot is a small bot with a big impact. It offers several features, including advanced image generation, AI chats, and more. From 8d9ab9f1ad556fcb6f43c5bd5d1aba52c8c624d6 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 13 May 2024 14:07:27 +0100 Subject: [PATCH 41/56] Upgrade Image Command - Add image dimension support - Add Upscaling | Resolves #34 --- interactions/slash/misc/image.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index a7ad282..e719248 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -38,14 +38,14 @@ module.exports = { .setName("steps") .setDescription("The Number of Steps to Use") .setMinValue(1) - .setMaxValue(30), + .setMaxValue(50), ) .addIntegerOption((option) => option .setName("cfg-scale") .setDescription("The CFG Scale") .setMinValue(1) - .setMaxValue(30), + .setMaxValue(20), ) .addIntegerOption((option) => option.setName("seed").setDescription("The Seed").setMinValue(-1), @@ -108,6 +108,23 @@ module.exports = { { name: "PLMS", value: "PLMS" }, { name: "UniPC", value: "UniPC" }, ), + ) + .addBooleanOption((o) => + o.setName("upscale").setDescription("Enable 2x Upscale"), + ) + .addIntegerOption((option) => + option + .setName("width") + .setDescription("The Width of the Image") + .setMinValue(1) + .setMaxValue(1024), + ) + .addIntegerOption((option) => + option + .setName("height") + .setDescription("The Height of the Image") + .setMinValue(1) + .setMaxValue(1024), ), async execute(interaction) { @@ -135,6 +152,9 @@ module.exports = { const cfg_scale = interaction.options.getInteger("cfg-scale"); const seed = interaction.options.getInteger("seed"); const sampler = interaction.options.getString("sampler"); + const upscale = interaction.options.getBoolean("upscale"); + const width = interaction.options.getInteger("width"); + const height = interaction.options.getInteger("height"); let prompt = interaction.options.getString("prompt"); let negative_prompt = interaction.options.getString("negative-prompt"); @@ -231,6 +251,9 @@ module.exports = { ...(sampler && { sampler: sampler }), ...(cfg_scale && { cfg_scale: cfg_scale }), ...(seed && { seed: seed }), + ...(upscale && { upscale: upscale }), + ...(width && { width: width }), + ...(height && { height: height }), }; try { From ba005bf5d22e720edcd4d6c25270f61d421505f6 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Tue, 14 May 2024 17:49:14 +0100 Subject: [PATCH 42/56] Resolves #33 --- events/contextInteraction.js | 2 +- events/slashCreate.js | 2 +- events/taurusai.js | 2 +- utils.js => functions/other/utils.js | 0 interactions/context-menus/message/taurusai.js | 2 +- interactions/modals/category/ask.js | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename utils.js => functions/other/utils.js (100%) diff --git a/events/contextInteraction.js b/events/contextInteraction.js index 40cc8d0..772af8f 100644 --- a/events/contextInteraction.js +++ b/events/contextInteraction.js @@ -5,7 +5,7 @@ * @version 3.3.2 */ const { Events } = require("discord.js"); -const { botInGuild } = require("../utils"); +const { botInGuild } = require("../functions/other/utils"); module.exports = { name: Events.InteractionCreate, diff --git a/events/slashCreate.js b/events/slashCreate.js index 05d66d4..b55663e 100644 --- a/events/slashCreate.js +++ b/events/slashCreate.js @@ -7,7 +7,7 @@ */ const { Collection, EmbedBuilder, Events } = require("discord.js"), - { botInGuild } = require("../utils"), + { botInGuild } = require("../functions/other/utils"), { owner } = require("../config.json"); module.exports = { diff --git a/events/taurusai.js b/events/taurusai.js index b1c7287..c1c0554 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -14,7 +14,7 @@ const { handleResponse, checkGeminiApiKey, fetchThreadMessages, -} = require("../utils"); +} = require("../functions/other/utils"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); module.exports = { diff --git a/utils.js b/functions/other/utils.js similarity index 100% rename from utils.js rename to functions/other/utils.js diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 9ad5848..a85f4a0 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -17,7 +17,7 @@ const { handleResponse, checkGeminiApiKey, fetchThreadMessages, -} = require("../../../utils"); +} = require("../../../functions/other/utils"); const { Gemini_API_KEY } = require("../../../config.json"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index 6deb3f2..bc0791d 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -17,7 +17,7 @@ const { handleGeminiError, handleResponse, checkGeminiApiKey, -} = require("../../../utils"); +} = require("../../../functions/other/utils"); const genAI = new GoogleGenerativeAI(Gemini_API_KEY); module.exports = { From 11fe1c71680dc92340d064002a4fef9c45c0950d Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Tue, 14 May 2024 22:13:25 +0100 Subject: [PATCH 43/56] Utilise Gemini 1.5 Flash! --- events/taurusai.js | 2 +- interactions/context-menus/message/taurusai.js | 2 +- interactions/modals/category/ask.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index c1c0554..b0bd5ad 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -103,7 +103,7 @@ module.exports = { const model = genAI.getGenerativeModel( { - model: "gemini-1.5-pro-latest", + model: "gemini-1.5-flash-latest", systemInstruction: instruction, }, { diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index a85f4a0..274c2e5 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -126,7 +126,7 @@ module.exports = { const model = genAI.getGenerativeModel( { - model: "gemini-1.5-pro-latest", + model: "gemini-1.5-flash-latest", systemInstruction: instruction, }, { diff --git a/interactions/modals/category/ask.js b/interactions/modals/category/ask.js index bc0791d..8d5fce6 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/category/ask.js @@ -88,7 +88,7 @@ module.exports = { const model = genAI.getGenerativeModel( { - model: "gemini-1.5-pro-latest", + model: "gemini-1.5-flash-latest", systemInstruction: instruction, }, { diff --git a/package.json b/package.json index 0aa16c2..b184f6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taurus", - "version": "3.6", + "version": "4.0", "description": "An AI Discord Bot!", "types": "./typings.d.ts", "main": "bot.js", From 89c82a7abe61c366843d3674a476b4487d01888a Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Tue, 14 May 2024 23:23:39 +0100 Subject: [PATCH 44/56] Update Error Handling --- functions/other/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/other/utils.js b/functions/other/utils.js index 917db8c..325356d 100644 --- a/functions/other/utils.js +++ b/functions/other/utils.js @@ -36,7 +36,7 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [safety_error] }); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [400 Bad Request] User location is not supported for the API use.": + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [400 Bad Request] User location is not supported for the API use.": const location_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( @@ -45,7 +45,7 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [location_error] }); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [429 Too Many Requests] Resource has been exhausted (e.g. check quota).": + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [429 Too Many Requests] Resource has been exhausted (e.g. check quota).": const quota_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( @@ -53,7 +53,7 @@ async function handleGeminiError(err, loadingMsg) { ) .setColor("Red"); - for (let i = 10; i > 0; i--) { + for (let i = 5; i > 0; i--) { quota_error.setFooter({ text: `⏱️ Retrying request in (${i})` }); await loadingMsg.edit({ embeds: [quota_error] }); await new Promise((resolve) => setTimeout(resolve, 1000)); @@ -69,7 +69,7 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [error_empty] }); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [500 Internal Server Error] An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting": + case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [500 Internal Server Error] An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting": const error_internal = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( From 185af8425a8b6de2d474c7700cf4f9b150876bee Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 17 May 2024 14:44:04 +0100 Subject: [PATCH 45/56] Implement Settings Menu + Other Changes --- bot.js | 34 +++- config.json.example | 16 +- events/buttonInteraction.js | 50 +++++ events/taurusai.js | 18 +- functions/logConsole.js | 125 ++++++------ functions/other/settings.sqlite | Bin 0 -> 12288 bytes functions/other/utils.js | 108 +++++++--- interactions/buttons/settings/apiKeys.js | 38 ++++ interactions/buttons/settings/other.js | 66 ++++++ interactions/buttons/settings/webhooks.js | 38 ++++ .../context-menus/message/taurusai.js | 20 +- interactions/modals/{category => AI}/ask.js | 15 +- interactions/modals/Settings/apiKeys.js | 92 +++++++++ interactions/modals/Settings/webhooks.js | 107 ++++++++++ interactions/slash/misc/image.js | 40 +++- interactions/slash/misc/models.js | 11 +- interactions/slash/misc/personalise.js | 22 +- interactions/slash/misc/settings.js | 192 ++++++++++++++++++ messages/defaultButtonError.js | 23 +++ package.json | 4 +- pnpm-lock.yaml | 187 +++++++++++++++++ 21 files changed, 1063 insertions(+), 143 deletions(-) create mode 100644 events/buttonInteraction.js create mode 100644 functions/other/settings.sqlite create mode 100644 interactions/buttons/settings/apiKeys.js create mode 100644 interactions/buttons/settings/other.js create mode 100644 interactions/buttons/settings/webhooks.js rename interactions/modals/{category => AI}/ask.js (90%) create mode 100644 interactions/modals/Settings/apiKeys.js create mode 100644 interactions/modals/Settings/webhooks.js create mode 100644 interactions/slash/misc/settings.js create mode 100644 messages/defaultButtonError.js diff --git a/bot.js b/bot.js index d7a429b..c3b4af5 100644 --- a/bot.js +++ b/bot.js @@ -67,6 +67,7 @@ for (const file of eventFiles) { // Define Collection of Slash/Modal Commands and Cooldowns client.slashCommands = new Collection(); +client.buttonCommands = new Collection(); client.modalCommands = new Collection(); client.contextCommands = new Collection(); client.cooldowns = new Collection(); @@ -144,6 +145,31 @@ for (const folder of contextMenus) { } } +/**********************************************************************/ +// Registration of Button-Command Interactions. + +/** + * @type {String[]} + * @description All button commands. + */ + +const buttonCommands = fs.readdirSync("./interactions/buttons"); + +// Loop through all files and store button-commands in buttonCommands collection. + +for (const module of buttonCommands) { + const commandFiles = fs + .readdirSync(`./interactions/buttons/${module}`) + .filter((file) => file.endsWith(".js")); + + for (const commandFile of commandFiles) { + const command = require(`./interactions/buttons/${module}/${commandFile}`); + for (const id of command.id) { + client.buttonCommands.set(id, command); + } + } +} + /**********************************************************************/ // Registration of Modal-Command Interactions. @@ -163,7 +189,13 @@ for (const module of modalCommands) { for (const commandFile of commandFiles) { const command = require(`./interactions/modals/${module}/${commandFile}`); - client.modalCommands.set(command.id, command); + if (Array.isArray(command.id)) { + for (const id of command.id) { + client.modalCommands.set(id, command); + } + } else { + client.modalCommands.set(command.id, command); + } } } diff --git a/config.json.example b/config.json.example index 7ecdcae..8508fc4 100644 --- a/config.json.example +++ b/config.json.example @@ -1,10 +1,10 @@ { - "token": "...", - "owner": ["719815864135712799","483359783831732255"], - "client_id": "...", - "webhook_url_personality_logs": "...", - "webhook_url_console_logs": "...", - "Gemini_API_KEY": "...", - "XProdiaKey": "...", - "Block_NSFW_Images": true + "token": "...", + "owner": ["719815864135712799","483359783831732255", "OWNER USER IDS HERE"], + "client_id": "...", + "emojis": { + "loading": "⭕", + "working": "🟢", + "failed": "🔴" + } } \ No newline at end of file diff --git a/events/buttonInteraction.js b/events/buttonInteraction.js new file mode 100644 index 0000000..36311b0 --- /dev/null +++ b/events/buttonInteraction.js @@ -0,0 +1,50 @@ +/** + * @file Button Interaction Handler + * @author Naman Vrati + * @since 3.0.0 + * @version 3.3.2 + */ + +const { Events } = require("discord.js"); + +module.exports = { + name: Events.InteractionCreate, + + /** + * @description Executes when an interaction is created and handle it. + * @author Naman Vrati + * @param {import('discord.js').ButtonInteraction & { client: import('../typings').Client }} interaction The interaction which was created + */ + + async execute(interaction) { + // Deconstructed client from interaction object. + const { client } = interaction; + + // Checks if the interaction is a button interaction (to prevent weird bugs) + + if (!interaction.isButton()) return; + + const command = client.buttonCommands.get(interaction.customId); + + // If the interaction is not a command in cache, return error message. + // You can modify the error message at ./messages/defaultButtonError.js file! + + if (!command) { + return await require("../messages/defaultButtonError").execute( + interaction, + ); + } + + // A try to execute the interaction. + + try { + return await command.execute(interaction); + } catch (err) { + console.error(err); + await interaction.reply({ + content: "There was an issue while executing that button!", + ephemeral: true, + }); + } + }, +}; diff --git a/events/taurusai.js b/events/taurusai.js index b0bd5ad..6684233 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -7,15 +7,16 @@ const { Events, EmbedBuilder } = require("discord.js"); const fs = require("fs").promises; const path = require("path"); const { GoogleGenerativeAI } = require("@google/generative-ai"); -const { Gemini_API_KEY } = require("../config.json"); const { safetySettings, handleGeminiError, handleResponse, - checkGeminiApiKey, fetchThreadMessages, } = require("../functions/other/utils"); -const genAI = new GoogleGenerativeAI(Gemini_API_KEY); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../functions/other/settings.sqlite"), +}); module.exports = { name: Events.MessageCreate, @@ -25,6 +26,12 @@ module.exports = { return; if ([18, 21].includes(message.type)) return; + const apiKeys = await db.get("apiKeys"); + const geminiApiKey = apiKeys.gemini; + const other = await db.get("other"); + const modelId = other.model; + const genAI = new GoogleGenerativeAI(geminiApiKey); + let userQuestion; let messageDeleted; let threadMessages = []; @@ -34,7 +41,7 @@ module.exports = { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages, messageDeleted: fetchedMessageDeleted, - } = await fetchThreadMessages(Gemini_API_KEY, message); + } = await fetchThreadMessages(geminiApiKey, message); if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; threadMessages = fetchedThreadMessages; @@ -45,7 +52,6 @@ module.exports = { const regex = new RegExp(`^${botMention}\\s+.+`); if (!regex.test(message.content)) return; - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; userQuestion = message.content.replace(botMention, "").trim(); } @@ -103,7 +109,7 @@ module.exports = { const model = genAI.getGenerativeModel( { - model: "gemini-1.5-flash-latest", + model: modelId, systemInstruction: instruction, }, { diff --git a/functions/logConsole.js b/functions/logConsole.js index 4e6355e..b7da873 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -1,74 +1,83 @@ module.exports = (client) => { const { WebhookClient, EmbedBuilder } = require("discord.js"); - const { webhook_url_console_logs } = require("../config.json"); - const webhookURL = webhook_url_console_logs; + const { QuickDB } = require("quick.db"); + const path = require("path"); + const db = new QuickDB({ + filePath: path.join(__dirname, "./other/settings.sqlite"), + }); + (async () => { + const webhooks = await db.get("webhooks"); + webhookUrlConsoleLogs = webhooks.console; + webhookURL = webhookUrlConsoleLogs; - let webhookClient; - try { - webhookClient = new WebhookClient({ url: webhookURL }); - } catch (error) { - console.log( - "\x1b[31m\x1b[1m%s\x1b[0m", - "CONSOLE LOGGING IN DISCORD DISABLED. WEBHOOK URL NOT PROVIDED OR INVALID.", - ); - return; - } + let webhookClient; + try { + webhookClient = new WebhookClient({ url: webhookURL }); + } catch (error) { + console.log( + "\x1b[31m\x1b[1m%s\x1b[0m", + "CONSOLE LOGGING IN DISCORD DISABLED. SET WEBHOOK URL WITH /SETTINGS.", + ); + return; + } - function customLogger(type, ...messages) { - const combinedMessage = messages - .map((m) => (typeof m === "object" ? JSON.stringify(m, null, 2) : m)) - .join(" "); + function customLogger(type, ...messages) { + const combinedMessage = messages + .map((m) => (typeof m === "object" ? JSON.stringify(m, null, 2) : m)) + .join(" "); - if ( - combinedMessage === - "%cBy not specifying 'modelOrUrl' parameter, you're using the default model: 'MobileNetV2'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model). color: lightblue" - ) - return; + const blockedMessages = [ + "By not specifying 'modelOrUrl' parameter, you're using the default model: 'MobileNetV2'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model).", + "%cBy not specifying 'modelOrUrl' parameter, you're using the default model: 'MobileNetV2'. See NSFWJS docs for instructions on hosting your own model (https://github.com/infinitered/nsfwjs?tab=readme-ov-file#host-your-own-model). color: lightblue", + ]; - let messageToSend = combinedMessage; - if (combinedMessage.length > 4070) { - messageToSend = `${combinedMessage.slice(0, 4067)}...`; - } + if (blockedMessages.includes(combinedMessage)) return; - const embed = new EmbedBuilder() - .setDescription(`\`\`\`console\n${messageToSend}\`\`\``) - .setColor(0x3498db); + let messageToSend = combinedMessage; + if (combinedMessage.length > 4070) { + messageToSend = `${combinedMessage.slice(0, 4067)}...`; + } + + const embed = new EmbedBuilder() + .setDescription(`\`\`\`console\n${messageToSend}\`\`\``) + .setColor(0x3498db); - if (type === "error") { - embed.setColor("Red"); - } else if (type === "warn") { - embed.setColor("Orange"); - } else if ( - combinedMessage === "Started refreshing application (/) commands." || - combinedMessage === "Successfully reloaded application (/) commands." || - combinedMessage.startsWith("Ready! Logged in as") - ) { - embed.setColor("Green"); - if (combinedMessage === `Ready! Logged in as ${client.user.tag}`) { - embed.setTitle("💾 Console Log"); + if (type === "error") { + embed.setColor("Red"); + } else if (type === "warn") { + embed.setColor("Orange"); + } else if ( + combinedMessage === "Started refreshing application (/) commands." || + combinedMessage === "Successfully reloaded application (/) commands." || + combinedMessage.startsWith("Ready! Logged in as") + ) { + embed.setColor("Green"); + if (combinedMessage === `Ready! Logged in as ${client.user.tag}`) { + embed.setTitle("💾 Console Log"); + } } - } - webhookClient - .send({ - username: "Taurus Console", - avatarURL: client.user.displayAvatarURL(), - embeds: [embed], - }) - .catch(console.error); + webhookClient + .send({ + username: "Taurus Console", + avatarURL: client.user.displayAvatarURL(), + embeds: [embed], + }) + .catch(console.error); - console.originalLog(combinedMessage); - } + console.originalLog(combinedMessage); + } - console.originalLog = console.log; - console.log = customLogger.bind(null, "log"); + console.originalLog = console.log; + console.log = customLogger.bind(null, "log"); - console.originalError = console.error; - console.error = customLogger.bind(null, "error"); + console.originalError = console.error; + console.error = customLogger.bind(null, "error"); - console.originalWarn = console.warn; - console.warn = customLogger.bind(null, "warn"); + console.originalWarn = console.warn; + console.warn = customLogger.bind(null, "warn"); - console.originalInfo = console.info; - console.info = customLogger.bind(null, "info"); + console.originalInfo = console.info; + console.info = customLogger.bind(null, "info"); + })(); }; diff --git a/functions/other/settings.sqlite b/functions/other/settings.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d0b20bb29d5f1d24fc61c7b087efa8599cd81101 GIT binary patch literal 12288 zcmeI$OK;jR8~|{KRMonw@-7vJiYm$ud#E%75}J0JMk%4AfvyGCK`$r)11SNAB*045 z!>UO=?7pwH4=}0ceSjTyoYTjoO`1AsxAt$zi5`5M%Y9{4zJ<9{z2%ufOim&ml0mZ zU-9QVEDTcv0T2KI5C8!X009sH0T2Lz`yz057UO1OAEgPgx|H_(6VW9e+XX$1D`tN z-$o&)G+A5Il1fTWsIsP|rNi3mX|>WTyG=_uNEth7n$Ud5?yBRxN_M#2tBqBfGd#`q z+@M!dN+j=_1#=C=5m=zq8M zIKnTzVoPX{W478?U9!H}uw9R~Y%@%sK4jD8@dd))@CE*UUw#IdCkTK52!H?xfB*=9 k00@8p2!H?x+$DiIK6-T`!O!zc-1S*NWS)=B-5hHC1nY$9OaK4? literal 0 HcmV?d00001 diff --git a/functions/other/utils.js b/functions/other/utils.js index 325356d..216cbab 100644 --- a/functions/other/utils.js +++ b/functions/other/utils.js @@ -1,5 +1,7 @@ const { HarmCategory, HarmBlockThreshold } = require("@google/generative-ai"); -const { EmbedBuilder, DiscordAPIError } = require("discord.js"); +const { EmbedBuilder, DiscordAPIError, WebhookClient } = require("discord.js"); +const { owner } = require("../../config.json"); +const axios = require("axios"); function botInGuild(interaction) { const botGuilds = interaction.client.guilds.cache; @@ -36,7 +38,19 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [safety_error] }); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [400 Bad Request] User location is not supported for the API use.": + case "Cannot send an empty message": + const error_empty = new EmbedBuilder() + .setTitle("⚠️ An Error Occurred") + .setDescription( + "An error occurred while processing your request. Please try again later, or in a few minutes. \n▸ *If this issue persists, please contact the Developers.* \n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.", + ) + .setColor("Red"); + + return await loadingMsg.edit({ embeds: [error_empty] }); + } + + switch (err.status) { + case 400: const location_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( @@ -45,7 +59,7 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [location_error] }); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [429 Too Many Requests] Resource has been exhausted (e.g. check quota).": + case 429: const quota_error = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( @@ -58,18 +72,8 @@ async function handleGeminiError(err, loadingMsg) { await loadingMsg.edit({ embeds: [quota_error] }); await new Promise((resolve) => setTimeout(resolve, 1000)); } - return "quota_error"; - case "Cannot send an empty message": - const error_empty = new EmbedBuilder() - .setTitle("⚠️ An Error Occurred") - .setDescription( - "An error occurred while processing your request. Please try again later, or in a few minutes. \n▸ *If this issue persists, please contact the Developers.* \n> - Generated response may be too long. *(Fix this by specifying for the generated response to be smaller, e.g. 10 Lines)*\n> - Token Limit for this minute may have been reached.", - ) - .setColor("Red"); - - return await loadingMsg.edit({ embeds: [error_empty] }); - case "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: [500 Internal Server Error] An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting": + case 500: const error_internal = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") .setDescription( @@ -78,6 +82,14 @@ async function handleGeminiError(err, loadingMsg) { .setColor("Red"); return await loadingMsg.edit({ embeds: [error_internal] }); + case 403: + const invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription( + "> **The API Key for Gemini is invalid or not provided.**", + ) + .setColor("Red"); + return await loadingMsg.edit({ embeds: [invalid_api] }); default: console.error(err.message); const error_unknown = new EmbedBuilder() @@ -169,27 +181,11 @@ async function handleResponse( return await loadingMsg.edit({ content: responseText, embeds: info_embed }); } -async function checkGeminiApiKey(Gemini_API_KEY, interaction, message) { - if (!Gemini_API_KEY || Gemini_API_KEY.length < 4) { - const invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription( - "> **The API Key for Gemini is invalid or not provided.**", - ) - .setColor("Red"); - - return interaction - ? interaction.reply({ embeds: [invalid_api] }) - : message.reply({ embeds: [invalid_api] }); - } -} - async function fetchThreadMessages(Gemini_API_KEY, message) { let threadMessages = []; let messageDeleted; userQuestion = message.content; - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; try { const originalMessage = await message.channel.messages.fetch( message.reference.messageId, @@ -275,11 +271,61 @@ async function fetchThreadMessages(Gemini_API_KEY, message) { return { userQuestion, threadMessages, messageDeleted }; } +async function checkWebhook(webhookURL) { + try { + const webhookClient = new WebhookClient({ url: webhookURL }); + return true; + } catch (error) { + return false; + } +} + +const checkAPIKey = async (type, apiKey) => { + let url, headers; + + switch (type.toLowerCase()) { + case "prodia": + url = "https://api.prodia.com/v1/sd/loras"; + headers = { "X-Prodia-Key": apiKey, accept: "application/json" }; + break; + case "gemini": + url = `https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey}`; + headers = {}; + break; + default: + throw new Error(`Invalid API type: ${type}`); + } + + try { + const response = await axios.get(url, { headers }); + return response.status === 200; + } catch (error) { + return false; + } +}; + +function checkOwnerAndReply(interaction) { + const no_access = new EmbedBuilder() + .setDescription("**⚠️ This is limited to Developers Only!**") + .setColor("Red"); + + if (!owner.includes(interaction.user.id)) { + interaction.reply({ + embeds: [no_access], + ephemeral: true, + }); + return false; + } + return true; +} + module.exports = { botInGuild, safetySettings, handleGeminiError, handleResponse, - checkGeminiApiKey, fetchThreadMessages, + checkWebhook, + checkAPIKey, + checkOwnerAndReply, }; diff --git a/interactions/buttons/settings/apiKeys.js b/interactions/buttons/settings/apiKeys.js new file mode 100644 index 0000000..e602013 --- /dev/null +++ b/interactions/buttons/settings/apiKeys.js @@ -0,0 +1,38 @@ +/** + * @file Settings API Key button interaction + * @author TechyGiraffe999 + */ + +/** + * @type {import('../../../typings').ButtonInteractionCommand} + */ +const { + ActionRowBuilder, + ModalBuilder, + TextInputBuilder, + TextInputStyle, +} = require("discord.js"); +const { checkOwnerAndReply } = require("../../../functions/other/utils"); +module.exports = { + id: ["gemini", "prodia"], + + async execute(interaction) { + if (!checkOwnerAndReply(interaction)) { + return; + } + const modal = new ModalBuilder() + .setCustomId(`${interaction.customId}`) + .setTitle("API Key Configuration"); + + const apiKeyForm = new TextInputBuilder() + .setCustomId("apiKey") + .setLabel("Your API Key") + .setPlaceholder("Your API Key Here") + .setMinLength(35) + .setMaxLength(50) + .setStyle(TextInputStyle.Short); + + modal.addComponents(new ActionRowBuilder().addComponents(apiKeyForm)); + return await interaction.showModal(modal); + }, +}; diff --git a/interactions/buttons/settings/other.js b/interactions/buttons/settings/other.js new file mode 100644 index 0000000..c499ce0 --- /dev/null +++ b/interactions/buttons/settings/other.js @@ -0,0 +1,66 @@ +/** + * @file Settings Other Button interaction + * @author TechyGiraffe999 + */ + +/** + * @type {import('../../../typings').ButtonInteractionCommand} + */ +const { EmbedBuilder } = require("discord.js"); +const path = require("path"); +const { QuickDB } = require("quick.db"); +const { emojis } = require("../../../config.json"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); +const { checkOwnerAndReply } = require("../../../functions/other/utils"); + +module.exports = { + id: ["blockNSFWImages", "model"], + + async execute(interaction) { + if (!checkOwnerAndReply(interaction)) { + return; + } + const otherSettings = await db.get("other"); + let updatedSetting; + + switch (interaction.customId) { + case "blockNSFWImages": + otherSettings.blockNSFWImages = !otherSettings.blockNSFWImages; + updatedSetting = `**🔞 NSFW Image Blocking ${otherSettings.blockNSFWImages ? "Enabled" : "Disabled"}**`; + break; + case "model": + otherSettings.model = + otherSettings.model === "gemini-1.5-flash-latest" + ? "gemini-1.5-pro-latest" + : "gemini-1.5-flash-latest"; + updatedSetting = `**🧠 Model switched to \`\`${otherSettings.model === "gemini-1.5-flash-latest" ? "Gemini 1.5 Flash" : "Gemini 1.5 Pro"}\`\`**`; + break; + } + + await db.set("other", otherSettings); + const embed = new EmbedBuilder() + .setDescription(updatedSetting) + .setColor("Green"); + + const message = await interaction.message.fetch(); + const embedData = message.embeds[0]; + const otherFieldIndex = embedData.data.fields.find( + (field) => field.name === "⚙️ Other:", + ); + otherFieldIndex.value = `${otherSettings.blockNSFWImages ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${otherSettings.model === "gemini-1.5-flash-latest" ? "⚡" : "💪"} **${otherSettings.model + .replace(/-latest$/, "") + .replace(/-/g, " ") + .split(" ") + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" ")}**`; + + message.edit({ embeds: [embedData] }); + + return await interaction.reply({ + embeds: [embed], + ephemeral: true, + }); + }, +}; diff --git a/interactions/buttons/settings/webhooks.js b/interactions/buttons/settings/webhooks.js new file mode 100644 index 0000000..5d0f142 --- /dev/null +++ b/interactions/buttons/settings/webhooks.js @@ -0,0 +1,38 @@ +/** + * @file Settings Webhook button interaction + * @author TechyGiraffe999 + */ + +/** + * @type {import('../../../typings').ButtonInteractionCommand} + */ + +const { + ActionRowBuilder, + ModalBuilder, + TextInputBuilder, + TextInputStyle, +} = require("discord.js"); +const { checkOwnerAndReply } = require("../../../functions/other/utils"); + +module.exports = { + id: ["personality", "console"], + + async execute(interaction) { + if (!checkOwnerAndReply(interaction)) { + return; + } + const modal = new ModalBuilder() + .setCustomId(`${interaction.customId}`) + .setTitle("Webhook Configuration"); + + const webhookForm = new TextInputBuilder() + .setCustomId("webhook") + .setLabel("Your Webhook") + .setPlaceholder("Your Webhook URL Here") + .setStyle(TextInputStyle.Paragraph); + + modal.addComponents(new ActionRowBuilder().addComponents(webhookForm)); + return await interaction.showModal(modal); + }, +}; diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index 274c2e5..d805d0c 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -15,11 +15,12 @@ const { safetySettings, handleGeminiError, handleResponse, - checkGeminiApiKey, fetchThreadMessages, } = require("../../../functions/other/utils"); -const { Gemini_API_KEY } = require("../../../config.json"); -const genAI = new GoogleGenerativeAI(Gemini_API_KEY); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); module.exports = { data: { @@ -29,11 +30,14 @@ module.exports = { async execute(interaction) { const { channel, targetId } = interaction; + const apiKeys = await db.get("apiKeys"); + const geminiApiKey = apiKeys.gemini; + const other = await db.get("other"); + const modelId = other.model; + const genAI = new GoogleGenerativeAI(geminiApiKey); const message = await channel.messages.fetch(targetId); - if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; - if (message.author.bot || message.author.id === message.client.user.id) { return interaction.reply({ content: "I cant reply to myself or another bot!", @@ -50,7 +54,7 @@ module.exports = { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages, messageDeleted: fetchedMessageDeleted, - } = await fetchThreadMessages(Gemini_API_KEY, message); + } = await fetchThreadMessages(geminiApiKey, message); if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; threadMessages = fetchedThreadMessages; @@ -60,7 +64,6 @@ module.exports = { const botMention = `<@${message.client.user.id}>`; const regex = new RegExp(`^${botMention}\\s+.+`); - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; userQuestion = message.content.replace(botMention, "").trim(); } @@ -106,7 +109,6 @@ module.exports = { const botMention = `<@${message.client.user.id}>`; - if (await checkGeminiApiKey(Gemini_API_KEY, false, message)) return; userQuestion = message.content.replace(botMention, "").trim(); const user_status = message.member?.presence.clientStatus || {}; @@ -126,7 +128,7 @@ module.exports = { const model = genAI.getGenerativeModel( { - model: "gemini-1.5-flash-latest", + model: modelId, systemInstruction: instruction, }, { diff --git a/interactions/modals/category/ask.js b/interactions/modals/AI/ask.js similarity index 90% rename from interactions/modals/category/ask.js rename to interactions/modals/AI/ask.js index 8d5fce6..cd0aaf7 100644 --- a/interactions/modals/category/ask.js +++ b/interactions/modals/AI/ask.js @@ -10,21 +10,26 @@ const fs = require("fs").promises; const path = require("path"); const { EmbedBuilder } = require("discord.js"); const { GoogleGenerativeAI } = require("@google/generative-ai"); -const { Gemini_API_KEY } = require("../../../config.json"); const { botInGuild, safetySettings, handleGeminiError, handleResponse, - checkGeminiApiKey, } = require("../../../functions/other/utils"); -const genAI = new GoogleGenerativeAI(Gemini_API_KEY); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); module.exports = { id: "taurus_ai", async execute(interaction) { - if (await checkGeminiApiKey(Gemini_API_KEY, interaction, false)) return; + const apiKeys = await db.get("apiKeys"); + const geminiApiKey = apiKeys.gemini; + const other = await db.get("other"); + const modelId = other.model; + const genAI = new GoogleGenerativeAI(geminiApiKey); const personalityFilePath = path.join( __dirname + "../../../../personality.txt", @@ -88,7 +93,7 @@ module.exports = { const model = genAI.getGenerativeModel( { - model: "gemini-1.5-flash-latest", + model: modelId, systemInstruction: instruction, }, { diff --git a/interactions/modals/Settings/apiKeys.js b/interactions/modals/Settings/apiKeys.js new file mode 100644 index 0000000..459539c --- /dev/null +++ b/interactions/modals/Settings/apiKeys.js @@ -0,0 +1,92 @@ +/** + * @file APIKey Settings Modal. + * @author TechyGiraffe999 + */ + +/** + * @type {import("../../../../typings").ModalInteractionCommand} + */ +const fs = require("fs").promises; +const path = require("path"); +const { EmbedBuilder } = require("discord.js"); +const { checkAPIKey } = require("../../../functions/other/utils"); +const { emojis } = require("../../../config.json"); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); + +module.exports = { + id: ["gemini", "prodia"], + + async execute(interaction) { + const apiKeyName = + interaction.customId.charAt(0).toUpperCase() + + interaction.customId.slice(1); + embed = new EmbedBuilder() + .setDescription(`**${emojis.loading} Checking ${apiKeyName} API Key**`) + .setColor("Green"); + + await interaction.reply({ embeds: [embed], ephemeral: true }); + const apiKey = interaction.fields.getTextInputValue("apiKey"); + const apiKeys = await db.get("apiKeys"); + + if (apiKeys[interaction.customId] === apiKey) { + const alreadyRegistered = new EmbedBuilder() + .setDescription( + `**🔑 ${apiKeyName} API Key is already registered. (Duplicate Key)**`, + ) + .setColor("Yellow"); + await interaction.editReply({ + embeds: [alreadyRegistered], + ephemeral: true, + }); + return; + } + + let isValidKey; + isValidKey = await checkAPIKey(interaction.customId, apiKey); + + if (!isValidKey) { + const invalidKey = new EmbedBuilder() + .setDescription( + `**🔑 ${apiKeyName} API Key Checking Failed, Key invalid**`, + ) + .setColor("Red"); + await interaction.editReply({ embeds: [invalidKey] }); + return; + } + + const successEmbed = new EmbedBuilder() + .setDescription( + `**🔑 ${apiKeyName} API Key Checking Successful, the Key was updated!**`, + ) + .setColor("Green"); + await interaction.editReply({ embeds: [successEmbed] }); + + const message = await interaction.message.fetch(); + const embedData = message.embeds[0]; + + const apiKeysFieldIndex = embedData.data.fields.findIndex( + (field) => field.name === "🔑 API Keys:", + ); + const apiKeysFieldValue = embedData.data.fields[apiKeysFieldIndex].value; + const prodiaKeyStatus = apiKeysFieldValue.split("\n")[0]; + const geminiKeyStatus = apiKeysFieldValue.split("\n")[1]; + + switch (interaction.customId) { + case "prodia": + apiKeys.prodia = apiKey; + embedData.data.fields[apiKeysFieldIndex].value = + `${isValidKey ? emojis.working : emojis.failed} **Prodia**\n${geminiKeyStatus}`; + break; + case "gemini": + apiKeys.gemini = apiKey; + embedData.data.fields[apiKeysFieldIndex].value = + `${prodiaKeyStatus}\n${isValidKey ? emojis.working : emojis.failed} **Gemini**`; + } + + await db.set("apiKeys", apiKeys); + await message.edit({ embeds: [embedData] }); + }, +}; diff --git a/interactions/modals/Settings/webhooks.js b/interactions/modals/Settings/webhooks.js new file mode 100644 index 0000000..e37249e --- /dev/null +++ b/interactions/modals/Settings/webhooks.js @@ -0,0 +1,107 @@ +/** + * @file Webhook Settings Modal. + * @author TechyGiraffe999 + */ + +/** + * @type {import("../../../../typings").ModalInteractionCommand} + */ +const fs = require("fs").promises; +const path = require("path"); +const { EmbedBuilder, WebhookClient } = require("discord.js"); +const { checkWebhook } = require("../../../functions/other/utils"); +const { emojis } = require("../../../config.json"); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); + +module.exports = { + id: ["personality", "console"], + + async execute(interaction) { + const webhookName = + interaction.customId.charAt(0).toUpperCase() + + interaction.customId.slice(1); + embed = new EmbedBuilder() + .setDescription(`**${emojis.loading} Checking ${webhookName} Webhook**`) + .setColor("Green"); + + await interaction.reply({ embeds: [embed], ephemeral: true }); + const webhook = interaction.fields.getTextInputValue("webhook"); + const webhooks = await db.get("webhooks"); + + let isValidWebhook; + isValidWebhook = await checkWebhook(webhook); + + if (webhooks[interaction.customId] === webhook) { + const alreadyRegistered = new EmbedBuilder() + .setDescription( + `**🔑 ${webhookName} Webhook is already registered. (Duplicate Webhook)**`, + ) + .setColor("Yellow"); + await interaction.editReply({ + embeds: [alreadyRegistered], + ephemeral: true, + }); + return; + } + + if (!isValidWebhook) { + const invalidWebhook = new EmbedBuilder() + .setDescription( + `**🔑 ${webhookName} Webhook Checking Failed, Webhook invalid**`, + ) + .setColor("Red"); + await interaction.editReply({ embeds: [invalidWebhook] }); + return; + } + + webhookClient = new WebhookClient({ url: webhook }); + const emoji = interaction.customId === "console" ? "💾" : "✨"; + const webhookEmbed = new EmbedBuilder() + .setDescription( + `**${emoji} Taurus ${webhookName} Webhook Registered, Updates will be logged here**`, + ) + .setColor("Green"); + webhookClient + .send({ + username: `Taurus ${webhookName}`, + avatarURL: interaction.client.user.displayAvatarURL(), + embeds: [webhookEmbed], + }) + .catch(console.error); + + const successEmbed = new EmbedBuilder() + .setDescription( + `**🔑 ${webhookName} Webhook Checking Successful, the Webhook was updated!**`, + ) + .setColor("Green"); + await interaction.editReply({ embeds: [successEmbed] }); + + const message = await interaction.message.fetch(); + const embedData = message.embeds[0]; + + const webhookFieldIndex = embedData.data.fields.findIndex( + (field) => field.name === "🔗 Webhooks:", + ); + const webhooksFieldValue = embedData.data.fields[webhookFieldIndex].value; + const personalityWebhookStatus = webhooksFieldValue.split("\n")[0]; + const consoleWebhookStatus = webhooksFieldValue.split("\n")[1]; + + switch (interaction.customId) { + case "personality": + webhooks.personality = webhook; + embedData.data.fields[webhookFieldIndex].value = + `${isValidWebhook ? emojis.working : emojis.failed} **Personality**\n${consoleWebhookStatus}`; + break; + case "console": + webhooks.console = webhook; + embedData.data.fields[webhookFieldIndex].value = + `${personalityWebhookStatus}\n${isValidWebhook ? emojis.working : emojis.failed} **Console**`; + } + + await db.set("webhooks", webhooks); + await message.edit({ embeds: [embedData] }); + }, +}; diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index e719248..81bd432 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -8,11 +8,17 @@ */ const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); -const { XProdiaKey, Block_NSFW_Images } = require("../../../config.json"); +const { Block_NSFW_Images } = require("../../../config.json"); +const { checkAPIKey } = require("../../../functions/other/utils"); const translate = require("@iamtraction/google-translate"); const axios = require("axios"); const tf = require("@tensorflow/tfjs-node"); const nsfw = require("nsfwjs"); +const { QuickDB } = require("quick.db"); +const path = require("path"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); module.exports = { data: new SlashCommandBuilder() @@ -128,13 +134,27 @@ module.exports = { ), async execute(interaction) { + const apiKeys = await db.get("apiKeys"); + const XProdiaKey = apiKeys.prodia; + + const other = await db.get("other"); + const blockNSFWImages = other.blockNSFWImages; + + const invalid_api = new EmbedBuilder() + .setTitle("⚠️ Invalid API Key") + .setDescription( + "> *The API Key for Prodia is invalid or not provided*\n> **Please contact the developers**", + ) + .setColor("Red"); + if (!XProdiaKey || XProdiaKey.length < 4) { - invalid_api = new EmbedBuilder() - .setTitle("⚠️ Invalid API Key") - .setDescription( - "> *The API Key for Prodia is invalid or not provided*\n> **Please contact the developers**", - ) - .setColor("Red"); + return interaction.reply({ embeds: [invalid_api] }); + } + + await interaction.deferReply(); + + const isValidKey = await checkAPIKey("prodia", XProdiaKey); + if (!isValidKey) { return interaction.reply({ embeds: [invalid_api] }); } @@ -145,8 +165,6 @@ module.exports = { ) .setColor("Red"); - await interaction.deferReply(); - const style_preset = interaction.options.getString("style-preset"); const steps = interaction.options.getInteger("steps"); const cfg_scale = interaction.options.getInteger("cfg-scale"); @@ -167,7 +185,7 @@ module.exports = { .setDescription(`**⚠️ NSFW content detected!**`) .setColor("Red"); - if (Block_NSFW_Images) { + if (blockNSFWImages) { try { const response = await fetch( "https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en", @@ -273,7 +291,7 @@ module.exports = { let image = data.imageUrl; (async () => { - if (Block_NSFW_Images) { + if (blockNSFWImages) { const newImage = await nsfw_getPic(image); image = newImage; if (image === true) { diff --git a/interactions/slash/misc/models.js b/interactions/slash/misc/models.js index bb8296b..a51942d 100644 --- a/interactions/slash/misc/models.js +++ b/interactions/slash/misc/models.js @@ -8,14 +8,21 @@ */ const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); -const { XProdiaKey } = require("../../../config.json"); +const { QuickDB } = require("quick.db"); +const path = require("path"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); module.exports = { data: new SlashCommandBuilder() .setName("models") .setDescription("List the available models for image generation!"), - async execute(interaction, client) { + async execute(interaction) { + const apiKeys = await db.get("apiKeys"); + const XProdiaKey = apiKeys.prodia; + if (!XProdiaKey || XProdiaKey.length < 4) { invalid_api = new EmbedBuilder() .setTitle("⚠️ Invalid API Key") diff --git a/interactions/slash/misc/personalise.js b/interactions/slash/misc/personalise.js index 6e4c416..26c2f31 100644 --- a/interactions/slash/misc/personalise.js +++ b/interactions/slash/misc/personalise.js @@ -20,13 +20,11 @@ const { const axios = require("axios"); const fs = require("fs").promises; const path = require("path"); -const { webhook_url_personality_logs, owner } = require("../../../config.json"); - -const no_access = new EmbedBuilder() - .setDescription( - "**⚠️ Only my developers can update/view my global personality prompt!**\n\n> *If you want to suggest a change, please let us know!*", - ) - .setColor("Red"); +const { checkOwnerAndReply } = require("../../../functions/other/utils"); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); const link_error = new EmbedBuilder() .setDescription("**The file link is not a valid URL!**") @@ -75,14 +73,16 @@ module.exports = { ), async execute(interaction) { + const webhooks = await db.get("webhooks"); + const personalityWebhook = webhooks.personality; + const file = interaction.options.getAttachment("file"); const file_link = interaction.options.getString("file-link"); const other = interaction.options.getString("other"); - if (!owner.includes(interaction.user.id)) { - return await interaction.reply({ embeds: [no_access], ephemeral: true }); + if (!checkOwnerAndReply(interaction)) { + return; } - const selectedOptions = [file, file_link, other].filter( (option) => option != null, ).length; @@ -313,7 +313,7 @@ module.exports = { try { const webhookClient = new WebhookClient({ - url: webhook_url_personality_logs, + url: personalityWebhook, }); update = new EmbedBuilder() diff --git a/interactions/slash/misc/settings.js b/interactions/slash/misc/settings.js new file mode 100644 index 0000000..e5fa21c --- /dev/null +++ b/interactions/slash/misc/settings.js @@ -0,0 +1,192 @@ +/** + * @file Settings Command + * @author TechyGiraffe999 + */ + +const { + EmbedBuilder, + SlashCommandBuilder, + ActionRowBuilder, + ButtonBuilder, + ButtonStyle, + Embed, +} = require("discord.js"); +const path = require("path"); +const { + checkWebhook, + checkAPIKey, + checkOwnerAndReply, +} = require("../../../functions/other/utils"); +const { emojis } = require("../../../config.json"); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); + +async function updateFieldValueAndReply( + interaction, + settings, + fieldName, + fieldValue, +) { + const field = settings.data.fields.find((field) => field.name === fieldName); + field.value = fieldValue; + await interaction.editReply({ embeds: [settings] }); +} + +/** + * @type {import('../../../typings').SlashInteractionCommand} + */ +module.exports = { + data: new SlashCommandBuilder() + .setName("settings") + .setDescription("View the settings for Taurus"), + async execute(interaction) { + try { + const settings = new EmbedBuilder() + .setTitle("Taurus Settings") + .setColor("6414eb") + .addFields( + { + name: "🔗 Webhooks:", + value: `${emojis.loading} **Personality**\n${emojis.loading} **Console**`, + inline: true, + }, + { + name: "🔑 API Keys:", + value: `${emojis.loading} **Prodia**\n${emojis.loading} **Gemini**`, + inline: true, + }, + { + name: "⚙️ Other:", + value: `${emojis.loading} **NSFW Image Blocking**\n${emojis.loading} **Model**`, + inline: true, + }, + ) + .setThumbnail( + "https://github.com/TecEash1/TecEash1/assets/92249532/bd4aca7e-daab-4eeb-9265-e53cc1925e8c", + ); + + if (!checkOwnerAndReply(interaction)) { + return; + } + await interaction.reply({ embeds: [settings] }); + + const webhooks = await db.get("webhooks"); + const apiKeys = await db.get("apiKeys"); + const otherSettings = await db.get("other"); + + // WEBHOOK CHECKING + let isPersonalityWebhookValid = await checkWebhook(webhooks.personality); + await updateFieldValueAndReply( + interaction, + settings, + "🔗 Webhooks:", + `${isPersonalityWebhookValid ? emojis.working : emojis.failed} **Personality**\n${emojis.loading} **Console**`, + ); + + let isConsoleWebhookValid = await checkWebhook(webhooks.console); + await updateFieldValueAndReply( + interaction, + settings, + "🔗 Webhooks:", + `${isPersonalityWebhookValid ? emojis.working : emojis.failed} **Personality**\n${isConsoleWebhookValid ? emojis.working : emojis.failed} **Console**`, + ); + + // API KEY CHECKING + let isProdiaKeyValid = await checkAPIKey("prodia", apiKeys.prodia); + await updateFieldValueAndReply( + interaction, + settings, + "🔑 API Keys:", + `${isProdiaKeyValid ? emojis.working : emojis.failed} **Prodia**\n${emojis.loading} **Gemini**`, + ); + + let isGeminiKeyValid = await checkAPIKey("gemini", apiKeys.gemini); + await updateFieldValueAndReply( + interaction, + settings, + "🔑 API Keys:", + `${isProdiaKeyValid ? emojis.working : emojis.failed} **Prodia**\n${isGeminiKeyValid ? emojis.working : emojis.failed} **Gemini**`, + ); + + // OTHER SETTINGS CHECKING + let isNSFWBlockingEnabled = otherSettings.blockNSFWImages; + await updateFieldValueAndReply( + interaction, + settings, + "⚙️ Other:", + `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${emojis.loading} **Model**`, + ); + + let modelName = otherSettings.model; + let modelEmoji = modelName === "gemini-1.5-flash-latest" ? "⚡" : "💪"; + let modelNameFormatted = modelName + .replace(/-latest$/, "") + .replace(/-/g, " ") + .split(" ") + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" "); + await updateFieldValueAndReply( + interaction, + settings, + "⚙️ Other:", + `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${modelEmoji} **${modelNameFormatted}**`, + ); + + // BUTTONS + const personality = new ButtonBuilder() + .setCustomId("personality") + .setLabel("Personality") + .setEmoji("✨") + .setStyle(ButtonStyle.Secondary); + const console = new ButtonBuilder() + .setCustomId("console") + .setLabel("Console") + .setEmoji("💾") + .setStyle(ButtonStyle.Secondary); + const webhooksRow = new ActionRowBuilder().addComponents( + personality, + console, + ); + + const prodia = new ButtonBuilder() + .setCustomId("prodia") + .setLabel("Prodia") + .setEmoji("🖼️") + .setStyle(ButtonStyle.Secondary); + const gemini = new ButtonBuilder() + .setCustomId("gemini") + .setLabel("Gemini") + .setEmoji("🤖") + .setStyle(ButtonStyle.Secondary); + const apiKeysRow = new ActionRowBuilder().addComponents(prodia, gemini); + + const nsfw = new ButtonBuilder() + .setCustomId("blockNSFWImages") + .setLabel("NSFW Image Blocking") + .setEmoji("🔞") + .setStyle(ButtonStyle.Secondary); + const model = new ButtonBuilder() + .setCustomId("model") + .setLabel("Model") + .setEmoji("🔁") + .setStyle(ButtonStyle.Secondary); + const otherRow = new ActionRowBuilder().addComponents(nsfw, model); + + await interaction.editReply({ + components: [webhooksRow, apiKeysRow, otherRow], + }); + } catch (error) { + console.error(error); + // console.dir(error, { showHidden: true, depth: null }); + error = new EmbedBuilder() + .setDescription("⚠️ **An Error occurred**") + .setColor("Red"); + await interaction.followUp({ + embeds: [errors], + ephemeral: true, + }); + } + }, +}; diff --git a/messages/defaultButtonError.js b/messages/defaultButtonError.js new file mode 100644 index 0000000..b06df1b --- /dev/null +++ b/messages/defaultButtonError.js @@ -0,0 +1,23 @@ +/** + * @file Default Error Message On Error Button Interaction + * @author Naman Vrati + * @since 3.0.0 + */ +const excluded_ids = ["yes_botai_personality", "no_botai_personality"]; + +module.exports = { + /** + * @description Executes when the button interaction could not be fetched. + * @author Naman Vrati + * @param {import('discord.js').ButtonInteraction} interaction The Interaction Object of the command. + */ + + async execute(interaction) { + if (excluded_ids.includes(interaction.customId)) return; + await interaction.reply({ + content: "There was an issue while fetching this button!", + ephemeral: true, + }); + return; + }, +}; diff --git a/package.json b/package.json index b184f6d..fb8e600 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@tensorflow/tfjs-node": "^4.19.0", "api": "^6.1.1", "axios": "^1.6.8", + "better-sqlite3": "^10.0.0", "blessed": "^0.1.81", "chalk": "^5.3.0", "discord-api-types": "^0.37.83", @@ -35,7 +36,8 @@ "figlet": "^1.7.0", "moment": "^2.30.1", "nsfwjs": "^4.1.0", - "os": "^0.1.2" + "os": "^0.1.2", + "quick.db": "^9.1.7" }, "devDependencies": { "prettier": "3.2.5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f1d297..16e1e64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: axios: specifier: ^1.6.8 version: 1.6.8 + better-sqlite3: + specifier: ^10.0.0 + version: 10.0.0 blessed: specifier: ^0.1.81 version: 0.1.81 @@ -45,6 +48,9 @@ importers: specifier: ^4.1.0 version: 4.1.0(@tensorflow/tfjs@4.19.0(seedrandom@3.0.5)) os: {specifier: ^0.1.2, version: 0.1.2} + quick.db: + specifier: ^9.1.7 + version: 9.1.7 devDependencies: prettier: specifier: 3.2.5 @@ -335,6 +341,12 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + better-sqlite3@10.0.0: + resolution: {integrity: sha512-rOz0JY8bt9oMgrFssP7GnvA5R3yln73y/NizzWqy3WlFth8Ux8+g4r/N9fjX97nn4X1YX6MTER2doNpTu5pqiA==} + + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -483,6 +495,14 @@ packages: supports-color: optional: true + decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} @@ -511,6 +531,9 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + es-define-property@1.0.0: resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} engines: {node: '>= 0.4'} @@ -561,6 +584,10 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + expand-template@2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + ext@1.7.0: resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} @@ -590,6 +617,9 @@ packages: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -622,6 +652,9 @@ packages: resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} engines: {node: '>= 12.20'} + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + fs-minipass@1.2.7: resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} @@ -651,6 +684,9 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + github-from-package@0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -722,6 +758,9 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -881,6 +920,10 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -913,6 +956,9 @@ packages: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} + mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -935,9 +981,16 @@ packages: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true + napi-build-utils@1.0.2: + resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + node-abi@3.62.0: + resolution: {integrity: sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==} + engines: {node: '>=10'} + node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} @@ -1076,6 +1129,11 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + prebuild-install@7.1.2: + resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} + engines: {node: '>=10'} + hasBin: true + prettier@3.2.5: resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} engines: {node: '>=14'} @@ -1092,6 +1150,9 @@ packages: proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + pump@3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -1106,6 +1167,13 @@ packages: queue@6.0.2: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + quick.db@9.1.7: + resolution: {integrity: sha512-ZLPVLVFZtvFRLHqIK99iyrLDUznOTpnp5tB+QpGErT+reDSvgBELuVsMkGSSiqKT9R2YSOhO+096Wb0xTaOHMA==} + + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} @@ -1209,6 +1277,12 @@ packages: signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + simple-get@4.0.1: + resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -1234,6 +1308,10 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -1246,6 +1324,13 @@ packages: resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} hasBin: true + tar-fs@2.1.1: + resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + tar@4.4.19: resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} engines: {node: '>=4.5'} @@ -1276,6 +1361,9 @@ packages: tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + type@2.7.2: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} @@ -1778,6 +1866,15 @@ snapshots: base64-js@1.5.1: {} + better-sqlite3@10.0.0: + dependencies: + bindings: 1.5.0 + prebuild-install: 7.1.2 + + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -1922,6 +2019,12 @@ snapshots: dependencies: ms: 2.1.2 + decompress-response@6.0.0: + dependencies: + mimic-response: 3.1.0 + + deep-extend@0.6.0: {} + defaults@1.0.4: dependencies: clone: 1.0.4 @@ -1960,6 +2063,10 @@ snapshots: emoji-regex@8.0.0: {} + end-of-stream@1.4.4: + dependencies: + once: 1.4.0 + es-define-property@1.0.0: dependencies: get-intrinsic: 1.2.4 @@ -2027,6 +2134,8 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + expand-template@2.0.3: {} + ext@1.7.0: dependencies: type: 2.7.2 @@ -2061,6 +2170,8 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 + file-uri-to-path@1.0.0: {} + fill-range@7.0.1: dependencies: to-regex-range: 5.0.1 @@ -2091,6 +2202,8 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 4.0.0-beta.3 + fs-constants@1.0.0: {} + fs-minipass@1.2.7: dependencies: minipass: 2.9.0 @@ -2127,6 +2240,8 @@ snapshots: get-stream@6.0.1: {} + github-from-package@0.0.0: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -2197,6 +2312,8 @@ snapshots: inherits@2.0.4: {} + ini@1.3.8: {} + is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -2330,6 +2447,8 @@ snapshots: mimic-fn@2.1.0: {} + mimic-response@3.1.0: {} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -2362,6 +2481,8 @@ snapshots: minipass: 3.3.6 yallist: 4.0.0 + mkdirp-classic@0.5.3: {} + mkdirp@0.5.6: dependencies: minimist: 1.2.8 @@ -2376,8 +2497,14 @@ snapshots: mustache@4.2.0: {} + napi-build-utils@1.0.2: {} + next-tick@1.1.0: {} + node-abi@3.62.0: + dependencies: + semver: 7.6.2 + node-abort-controller@3.1.1: {} node-domexception@1.0.0: {} @@ -2530,6 +2657,21 @@ snapshots: dependencies: find-up: 4.1.0 + prebuild-install@7.1.2: + dependencies: + detect-libc: 2.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 1.0.2 + node-abi: 3.62.0 + pump: 3.0.0 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.1 + tunnel-agent: 0.6.0 + prettier@3.2.5: {} progress@2.0.3: {} @@ -2541,6 +2683,11 @@ snapshots: proxy-from-env@1.1.0: {} + pump@3.0.0: + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + punycode@2.3.1: {} qs@6.12.1: @@ -2553,6 +2700,17 @@ snapshots: dependencies: inherits: 2.0.4 + quick.db@9.1.7: + dependencies: + lodash: 4.17.21 + + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + readable-stream@3.6.2: dependencies: inherits: 2.0.4 @@ -2652,6 +2810,14 @@ snapshots: signal-exit@3.0.7: {} + simple-concat@1.0.1: {} + + simple-get@4.0.1: + dependencies: + decompress-response: 6.0.0 + once: 1.4.0 + simple-concat: 1.0.1 + sisteransi@1.0.5: {} sprintf-js@1.0.3: {} @@ -2676,6 +2842,8 @@ snapshots: strip-final-newline@2.0.0: {} + strip-json-comments@2.0.1: {} + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -2700,6 +2868,21 @@ snapshots: transitivePeerDependencies: - encoding + tar-fs@2.1.1: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 2.2.0 + + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + tar@4.4.19: dependencies: chownr: 1.1.4 @@ -2741,6 +2924,10 @@ snapshots: tslib@2.6.2: {} + tunnel-agent@0.6.0: + dependencies: + safe-buffer: 5.2.1 + type@2.7.2: {} undici-types@5.26.5: {} From cdfc9a1d7777ccac7a8bbd4753c45d13d931e3c2 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 17 May 2024 19:42:23 +0100 Subject: [PATCH 46/56] Implement Load Balancing --- events/taurusai.js | 10 +++++-- functions/other/settings.sqlite | Bin 12288 -> 12288 bytes functions/other/utils.js | 21 +++++++++++---- interactions/buttons/settings/other.js | 8 ++++-- .../context-menus/message/taurusai.js | 11 ++++++-- interactions/modals/AI/ask.js | 11 ++++++-- interactions/slash/misc/settings.js | 25 +++++++++++++++--- 7 files changed, 69 insertions(+), 17 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index 6684233..ccfcfb1 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -29,7 +29,7 @@ module.exports = { const apiKeys = await db.get("apiKeys"); const geminiApiKey = apiKeys.gemini; const other = await db.get("other"); - const modelId = other.model; + let modelId = other.model; const genAI = new GoogleGenerativeAI(geminiApiKey); let userQuestion; @@ -156,7 +156,13 @@ module.exports = { sendTypingInterval && clearInterval(sendTypingInterval); errorType = await handleGeminiError(err, loadingMsg); + if (errorType === "quotaErrorBalance") { + modelId = + modelId === "gemini-1.5-pro-latest" + ? "gemini-1.5-flash-latest" + : "gemini-1.5-pro-latest"; + } } - } while (errorType === "quota_error"); + } while (errorType === "quota_error" || errorType === "quotaErrorBalance"); }, }; diff --git a/functions/other/settings.sqlite b/functions/other/settings.sqlite index d0b20bb29d5f1d24fc61c7b087efa8599cd81101..a88c674c5c46b3d21192ef0b4e23f9d4c8919da4 100644 GIT binary patch delta 177 zcmZojXh@hK&FDT+#+lK5W5Q~F=0g6Z8w+pqPJSu-!q=OLMY@qUu^`hswX(QcDLpke zGcQxgO3Bf)DlxdyDc{o2xU$H+G$f-k*(ts#slvd(Bi+f=Jh(E$GOEDSS4l^ypeR2j zGZCmosdloQybcThGzRs_e)7tbZ_BHSGB7akH!|jzWTX~VD<$PbGP8&`>P`-jmlMv( dPfT%2%t_2k&df_!vPw(LDW04yud+x%004J)III8w delta 151 zcmZojXh@hK&FC;u#+lJ!W5Q~F=G*+!HWuFIo%~Yvg|D%n2yVo-95Yod>-dytD|W~8TqlTs}M1A~KYeo01ZQMFQ1 uPJVK>U$EO`Ie8rxpoGt4KY8WJkL2aJL7c`=7iVS`ahTZTLV49i3IYIHh%ev( diff --git a/functions/other/utils.js b/functions/other/utils.js index 216cbab..fe77e0e 100644 --- a/functions/other/utils.js +++ b/functions/other/utils.js @@ -1,6 +1,11 @@ const { HarmCategory, HarmBlockThreshold } = require("@google/generative-ai"); const { EmbedBuilder, DiscordAPIError, WebhookClient } = require("discord.js"); const { owner } = require("../../config.json"); +const path = require("path"); +const { QuickDB } = require("quick.db"); +const db = new QuickDB({ + filePath: path.join(__dirname, "./settings.sqlite"), +}); const axios = require("axios"); function botInGuild(interaction) { @@ -67,12 +72,18 @@ async function handleGeminiError(err, loadingMsg) { ) .setColor("Red"); - for (let i = 5; i > 0; i--) { - quota_error.setFooter({ text: `⏱️ Retrying request in (${i})` }); - await loadingMsg.edit({ embeds: [quota_error] }); - await new Promise((resolve) => setTimeout(resolve, 1000)); + const other = await db.get("other"); + const loadBalance = other.loadBalancing; + if (loadBalance) { + return "quotaErrorBalance"; + } else { + for (let i = 5; i > 0; i--) { + quota_error.setFooter({ text: `⏱️ Retrying request in (${i})` }); + await loadingMsg.edit({ embeds: [quota_error] }); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + return "quota_error"; } - return "quota_error"; case 500: const error_internal = new EmbedBuilder() .setTitle("⚠️ An Error Occurred") diff --git a/interactions/buttons/settings/other.js b/interactions/buttons/settings/other.js index c499ce0..879843a 100644 --- a/interactions/buttons/settings/other.js +++ b/interactions/buttons/settings/other.js @@ -16,7 +16,7 @@ const db = new QuickDB({ const { checkOwnerAndReply } = require("../../../functions/other/utils"); module.exports = { - id: ["blockNSFWImages", "model"], + id: ["blockNSFWImages", "loadBalancing", "model"], async execute(interaction) { if (!checkOwnerAndReply(interaction)) { @@ -30,6 +30,10 @@ module.exports = { otherSettings.blockNSFWImages = !otherSettings.blockNSFWImages; updatedSetting = `**🔞 NSFW Image Blocking ${otherSettings.blockNSFWImages ? "Enabled" : "Disabled"}**`; break; + case "loadBalancing": + otherSettings.loadBalancing = !otherSettings.loadBalancing; + updatedSetting = `**⚖️ Load Balancing ${otherSettings.loadBalancing ? "Enabled" : "Disabled"}**`; + break; case "model": otherSettings.model = otherSettings.model === "gemini-1.5-flash-latest" @@ -49,7 +53,7 @@ module.exports = { const otherFieldIndex = embedData.data.fields.find( (field) => field.name === "⚙️ Other:", ); - otherFieldIndex.value = `${otherSettings.blockNSFWImages ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${otherSettings.model === "gemini-1.5-flash-latest" ? "⚡" : "💪"} **${otherSettings.model + otherFieldIndex.value = `${otherSettings.blockNSFWImages ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${otherSettings.loadBalancing ? emojis.working : emojis.failed} **Load Balancing**\n${otherSettings.model === "gemini-1.5-flash-latest" ? "⚡" : "💪"} **${otherSettings.model .replace(/-latest$/, "") .replace(/-/g, " ") .split(" ") diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index d805d0c..c404735 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -33,7 +33,7 @@ module.exports = { const apiKeys = await db.get("apiKeys"); const geminiApiKey = apiKeys.gemini; const other = await db.get("other"); - const modelId = other.model; + let modelId = other.model; const genAI = new GoogleGenerativeAI(geminiApiKey); const message = await channel.messages.fetch(targetId); @@ -176,7 +176,14 @@ module.exports = { sendTypingInterval && clearInterval(sendTypingInterval); errorType = await handleGeminiError(err, loadingMsg); + + if (errorType === "quotaErrorBalance") { + modelId = + modelId === "gemini-1.5-pro-latest" + ? "gemini-1.5-flash-latest" + : "gemini-1.5-pro-latest"; + } } - } while (errorType === "quota_error"); + } while (errorType === "quota_error" || errorType === "quotaErrorBalance"); }, }; diff --git a/interactions/modals/AI/ask.js b/interactions/modals/AI/ask.js index cd0aaf7..ee674e6 100644 --- a/interactions/modals/AI/ask.js +++ b/interactions/modals/AI/ask.js @@ -28,7 +28,7 @@ module.exports = { const apiKeys = await db.get("apiKeys"); const geminiApiKey = apiKeys.gemini; const other = await db.get("other"); - const modelId = other.model; + let modelId = other.model; const genAI = new GoogleGenerativeAI(geminiApiKey); const personalityFilePath = path.join( @@ -130,7 +130,14 @@ module.exports = { sendTypingInterval && clearInterval(sendTypingInterval); errorType = await handleGeminiError(err, loadingMsg); + + if (errorType === "quotaErrorBalance") { + modelId = + modelId === "gemini-1.5-pro-latest" + ? "gemini-1.5-flash-latest" + : "gemini-1.5-pro-latest"; + } } - } while (errorType === "quota_error"); + } while (errorType === "quota_error" || errorType === "quotaErrorBalance"); }, }; diff --git a/interactions/slash/misc/settings.js b/interactions/slash/misc/settings.js index e5fa21c..ff439c2 100644 --- a/interactions/slash/misc/settings.js +++ b/interactions/slash/misc/settings.js @@ -59,7 +59,7 @@ module.exports = { }, { name: "⚙️ Other:", - value: `${emojis.loading} **NSFW Image Blocking**\n${emojis.loading} **Model**`, + value: `${emojis.loading} **NSFW Image Blocking**\n${emojis.loading} **Load Balancing**\n${emojis.loading} **Model**`, inline: true, }, ) @@ -116,7 +116,15 @@ module.exports = { interaction, settings, "⚙️ Other:", - `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${emojis.loading} **Model**`, + `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${emojis.loading} **Load Balancing**\n${emojis.loading} **Model**`, + ); + + let isLoadBalancingEnabled = otherSettings.loadBalancing; + await updateFieldValueAndReply( + interaction, + settings, + "⚙️ Other:", + `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${isLoadBalancingEnabled ? emojis.working : emojis.failed} **Load Balancing**\n${emojis.loading} **Model**`, ); let modelName = otherSettings.model; @@ -131,7 +139,7 @@ module.exports = { interaction, settings, "⚙️ Other:", - `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${modelEmoji} **${modelNameFormatted}**`, + `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${isLoadBalancingEnabled ? emojis.working : emojis.failed} **Load Balancing**\n${modelEmoji} **${modelNameFormatted}**`, ); // BUTTONS @@ -167,12 +175,21 @@ module.exports = { .setLabel("NSFW Image Blocking") .setEmoji("🔞") .setStyle(ButtonStyle.Secondary); + const loadBalance = new ButtonBuilder() + .setCustomId("loadBalancing") + .setLabel("Load Balancing") + .setEmoji("⚖️") + .setStyle(ButtonStyle.Secondary); const model = new ButtonBuilder() .setCustomId("model") .setLabel("Model") .setEmoji("🔁") .setStyle(ButtonStyle.Secondary); - const otherRow = new ActionRowBuilder().addComponents(nsfw, model); + const otherRow = new ActionRowBuilder().addComponents( + nsfw, + loadBalance, + model, + ); await interaction.editReply({ components: [webhooksRow, apiKeysRow, otherRow], From 5e076924f9dc7b68310a59b9218c1ac7f6cb0606 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 17 May 2024 20:37:43 +0100 Subject: [PATCH 47/56] Update Packages --- package.json | 4 ++-- pnpm-lock.yaml | 39 ++++++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index fb8e600..88bfd9e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "url": "https://github.com/TecEash1/Taurus/issues" }, "dependencies": { - "@google/generative-ai": "^0.11.1", + "@google/generative-ai": "^0.11.3", "@iamtraction/google-translate": "^2.0.1", "@tensorflow/tfjs-node": "^4.19.0", "api": "^6.1.1", @@ -31,7 +31,7 @@ "better-sqlite3": "^10.0.0", "blessed": "^0.1.81", "chalk": "^5.3.0", - "discord-api-types": "^0.37.83", + "discord-api-types": "^0.37.84", "discord.js": "^14.15.2", "figlet": "^1.7.0", "moment": "^2.30.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 16e1e64..580bba2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@google/generative-ai': - specifier: ^0.11.1 - version: 0.11.1 + specifier: ^0.11.3 + version: 0.11.3 '@iamtraction/google-translate': specifier: ^2.0.1 version: 2.0.1 @@ -33,8 +33,8 @@ importers: specifier: ^5.3.0 version: 5.3.0 discord-api-types: - specifier: ^0.37.83 - version: 0.37.83 + specifier: ^0.37.84 + version: 0.37.84 discord.js: specifier: ^14.15.2 version: 14.15.2 @@ -116,8 +116,8 @@ packages: resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} - '@google/generative-ai@0.11.1': - resolution: {integrity: sha512-ZiUiJJbl55TXcvu73+Kf/bUhzcRTH/bsGBeYZ9ULqU0imXg3POcd+NVYM9j+TGq4MA73UYwHPmJHwmy+QZEzyQ==} + '@google/generative-ai@0.11.3': + resolution: {integrity: sha512-QtQ1hz6rcybbw35uxXlFF26KNnaTVr2oWwnmDkC1M35KdzN4tVc4wakgJp8uXbY9KDCNHksyp11DbFg0HPckZQ==} engines: {node: '>=18.0.0'} '@humanwhocodes/momoa@2.0.4': @@ -251,8 +251,8 @@ packages: '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node@20.12.11': - resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==} + '@types/node@20.12.12': + resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} '@types/offscreencanvas@2019.3.0': resolution: {integrity: sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==} @@ -524,6 +524,9 @@ packages: discord-api-types@0.37.83: resolution: {integrity: sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==} + discord-api-types@0.37.84: + resolution: {integrity: sha512-NngmTBW8vermlbO0qNtaS7SHCWB/R96ICqflTwM/cV7zsxyQGd38E2bBlwaxLbXgb2YTF3+Yx6+qGs/3sXedCw==} + discord.js@14.15.2: resolution: {integrity: sha512-wGD37YCaTUNprtpqMIRuNiswwsvSWXrHykBSm2SAosoTYut0VUDj9yo9t4iLtMKvuhI49zYkvKc2TNdzdvpJhg==} engines: {node: '>=16.11.0'} @@ -1118,8 +1121,8 @@ packages: path-to-regexp@6.2.2: resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} - picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + picocolors@1.0.1: + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -1485,7 +1488,7 @@ snapshots: '@babel/code-frame@7.24.2': dependencies: '@babel/highlight': 7.24.5 - picocolors: 1.0.0 + picocolors: 1.0.1 '@babel/helper-validator-identifier@7.24.5': {} @@ -1494,7 +1497,7 @@ snapshots: '@babel/helper-validator-identifier': 7.24.5 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.0 + picocolors: 1.0.1 '@babel/runtime@7.24.5': dependencies: @@ -1551,7 +1554,7 @@ snapshots: '@fastify/busboy@2.1.1': {} - '@google/generative-ai@0.11.1': {} + '@google/generative-ai@0.11.3': {} '@humanwhocodes/momoa@2.0.4': {} @@ -1745,10 +1748,10 @@ snapshots: '@types/node-fetch@2.6.11': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 form-data: 4.0.0 - '@types/node@20.12.11': + '@types/node@20.12.12': dependencies: undici-types: 5.26.5 @@ -1760,7 +1763,7 @@ snapshots: '@types/ws@8.5.10': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@vladfrangu/async_event_emitter@2.2.4': {} @@ -2043,6 +2046,8 @@ snapshots: discord-api-types@0.37.83: {} + discord-api-types@0.37.84: {} + discord.js@14.15.2: dependencies: '@discordjs/builders': 1.8.1 @@ -2649,7 +2654,7 @@ snapshots: path-to-regexp@6.2.2: {} - picocolors@1.0.0: {} + picocolors@1.0.1: {} picomatch@2.3.1: {} From d92b1abeb9e9f193fa448f1650c70e3a10d76b48 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Fri, 17 May 2024 21:23:35 +0100 Subject: [PATCH 48/56] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e9f85e..bf39a90 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ The Taurus Discord Bot is a small bot with a big impact. It offers several featu - Personality update logs in Discord - User Commands - Use the bot anywhere on Discord - An optional CLI via the start scripts +- A Settings Menu in Discord ## 💾 Install @@ -49,7 +50,9 @@ The Taurus Discord Bot is a small bot with a big impact. It offers several featu 3. Run `pnpm i` -4. Run `node bot` +4. Run `node .` + +5. In Discord run ``/settings`` and fill in the values > [!NOTE] > - Alternatively **instead of steps 3 & 4** you can **run one of the startbot/start scripts.** *(Reccomended)* From e8cb4892ef4f7bfaf6f191bbb3accd12f6e13681 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Sun, 19 May 2024 19:13:48 +0100 Subject: [PATCH 49/56] Fix Console Webhook Live Update --- .gitignore | 4 ++- functions/logConsole.js | 31 +++++++++++++++++------- interactions/modals/Settings/webhooks.js | 4 +++ 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 494fcca..fbc6e95 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ .vscode/ .idea/ .node-version +/functions/other/settings.sqlite +/personality.txt # Logs logs @@ -108,4 +110,4 @@ dist .dynamodb/ # TernJS port file -.tern-port \ No newline at end of file +.tern-port diff --git a/functions/logConsole.js b/functions/logConsole.js index b7da873..f7819ac 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -1,6 +1,9 @@ module.exports = (client) => { const { WebhookClient, EmbedBuilder } = require("discord.js"); const { QuickDB } = require("quick.db"); + const { + webhookUpdateEvent, + } = require("../interactions/modals/Settings/webhooks"); const path = require("path"); const db = new QuickDB({ filePath: path.join(__dirname, "./other/settings.sqlite"), @@ -11,15 +14,25 @@ module.exports = (client) => { webhookURL = webhookUrlConsoleLogs; let webhookClient; - try { - webhookClient = new WebhookClient({ url: webhookURL }); - } catch (error) { - console.log( - "\x1b[31m\x1b[1m%s\x1b[0m", - "CONSOLE LOGGING IN DISCORD DISABLED. SET WEBHOOK URL WITH /SETTINGS.", - ); - return; - } + const setupWebhookClient = async () => { + const webhooks = await db.get("webhooks"); + webhookURL = webhooks.console; + + try { + webhookClient = new WebhookClient({ url: webhookURL }); + } catch (error) { + console.log( + "\x1b[31m\x1b[1m%s\x1b[0m", + "CONSOLE LOGGING IN DISCORD DISABLED. SET WEBHOOK URL WITH /SETTINGS.", + ); + } + }; + setupWebhookClient(); + + webhookUpdateEvent.on("update", (newWebhookUrl) => { + webhookURL = newWebhookUrl; + setupWebhookClient(); + }); function customLogger(type, ...messages) { const combinedMessage = messages diff --git a/interactions/modals/Settings/webhooks.js b/interactions/modals/Settings/webhooks.js index e37249e..7ca2947 100644 --- a/interactions/modals/Settings/webhooks.js +++ b/interactions/modals/Settings/webhooks.js @@ -8,6 +8,8 @@ */ const fs = require("fs").promises; const path = require("path"); +const { EventEmitter } = require("events"); +const webhookUpdateEvent = new EventEmitter(); const { EmbedBuilder, WebhookClient } = require("discord.js"); const { checkWebhook } = require("../../../functions/other/utils"); const { emojis } = require("../../../config.json"); @@ -18,6 +20,7 @@ const db = new QuickDB({ module.exports = { id: ["personality", "console"], + webhookUpdateEvent, async execute(interaction) { const webhookName = @@ -99,6 +102,7 @@ module.exports = { webhooks.console = webhook; embedData.data.fields[webhookFieldIndex].value = `${personalityWebhookStatus}\n${isValidWebhook ? emojis.working : emojis.failed} **Console**`; + webhookUpdateEvent.emit("update", webhooks.console); } await db.set("webhooks", webhooks); From 227abce3713ffd4b2db1db8b65dfc01855f0e41b Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 20 May 2024 16:39:27 +0100 Subject: [PATCH 50/56] Fix Critical Console Error --- events/slashCreate.js | 1 + functions/logConsole.js | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/events/slashCreate.js b/events/slashCreate.js index b55663e..63ea47e 100644 --- a/events/slashCreate.js +++ b/events/slashCreate.js @@ -87,6 +87,7 @@ module.exports = { try { await command.execute(interaction); } catch (err) { + console.error(err); await interaction.reply({ embeds: [error], ephemeral: true, diff --git a/functions/logConsole.js b/functions/logConsole.js index f7819ac..de7e0f5 100644 --- a/functions/logConsole.js +++ b/functions/logConsole.js @@ -12,26 +12,26 @@ module.exports = (client) => { const webhooks = await db.get("webhooks"); webhookUrlConsoleLogs = webhooks.console; webhookURL = webhookUrlConsoleLogs; + let isWebhookSetupSuccessful = false; let webhookClient; const setupWebhookClient = async () => { - const webhooks = await db.get("webhooks"); - webhookURL = webhooks.console; - try { webhookClient = new WebhookClient({ url: webhookURL }); + isWebhookSetupSuccessful = true; } catch (error) { console.log( "\x1b[31m\x1b[1m%s\x1b[0m", "CONSOLE LOGGING IN DISCORD DISABLED. SET WEBHOOK URL WITH /SETTINGS.", ); + isWebhookSetupSuccessful = false; } }; - setupWebhookClient(); + await setupWebhookClient(); - webhookUpdateEvent.on("update", (newWebhookUrl) => { + webhookUpdateEvent.on("update", async (newWebhookUrl) => { webhookURL = newWebhookUrl; - setupWebhookClient(); + await setupWebhookClient(); }); function customLogger(type, ...messages) { @@ -70,13 +70,15 @@ module.exports = (client) => { } } - webhookClient - .send({ - username: "Taurus Console", - avatarURL: client.user.displayAvatarURL(), - embeds: [embed], - }) - .catch(console.error); + if (isWebhookSetupSuccessful) { + webhookClient + .send({ + username: "Taurus Console", + avatarURL: client.user.displayAvatarURL(), + embeds: [embed], + }) + .catch(console.error); + } console.originalLog(combinedMessage); } From b10ffa2d0ca5b359356fdfcaca53612ae2c55b2f Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Wed, 22 May 2024 15:33:42 +0100 Subject: [PATCH 51/56] Improve Image Gen Performance + Fixes --- .../{image_model.js => imageModel.js} | 18 ++- interactions/slash/misc/image.js | 119 ++++++++++++------ interactions/slash/misc/models.js | 6 +- 3 files changed, 99 insertions(+), 44 deletions(-) rename interactions/autocomplete/category/{image_model.js => imageModel.js} (66%) diff --git a/interactions/autocomplete/category/image_model.js b/interactions/autocomplete/category/imageModel.js similarity index 66% rename from interactions/autocomplete/category/image_model.js rename to interactions/autocomplete/category/imageModel.js index ad59571..68b07af 100644 --- a/interactions/autocomplete/category/image_model.js +++ b/interactions/autocomplete/category/imageModel.js @@ -7,13 +7,19 @@ * @type {import("../../../typings").AutocompleteInteraction} */ -const { XProdiaKey } = require("../../../config.json"); - +const { QuickDB } = require("quick.db"); +const path = require("path"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); module.exports = { name: "image", async execute(interaction) { const focusedOption = interaction.options.getFocused(); + const apiKeys = await db.get("apiKeys"); + const XProdiaKey = apiKeys.prodia; + const sdk = require("api")("@prodia/v1.3.0#6fdmny2flsvwyf65"); sdk.auth(XProdiaKey); @@ -27,10 +33,12 @@ module.exports = { } } - const sdModels = await fetchAndFormatModels(sdk.listModels); - const sdxlModels = await fetchAndFormatModels(sdk.listSdxlModels); + const [sdModels, sdxlModels] = await Promise.all([ + fetchAndFormatModels(sdk.listModels), + fetchAndFormatModels(sdk.listSdxlModels), + ]); - const allModels = sdModels.concat(sdxlModels); + const allModels = [...sdModels, ...sdxlModels]; const filteredModels = allModels.filter((model) => model.toLowerCase().startsWith(focusedOption.toLowerCase()), ); diff --git a/interactions/slash/misc/image.js b/interactions/slash/misc/image.js index 81bd432..c8f48d3 100644 --- a/interactions/slash/misc/image.js +++ b/interactions/slash/misc/image.js @@ -8,17 +8,83 @@ */ const { SlashCommandBuilder, EmbedBuilder } = require("discord.js"); -const { Block_NSFW_Images } = require("../../../config.json"); const { checkAPIKey } = require("../../../functions/other/utils"); const translate = require("@iamtraction/google-translate"); -const axios = require("axios"); -const tf = require("@tensorflow/tfjs-node"); -const nsfw = require("nsfwjs"); const { QuickDB } = require("quick.db"); const path = require("path"); const db = new QuickDB({ filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), }); +const axios = require("axios"); +const tf = require("@tensorflow/tfjs-node"); +const nsfw = require("nsfwjs"); + +let nsfwModelPromise = null; + +async function loadNsfwModel() { + if (!nsfwModelPromise) { + nsfwModelPromise = nsfw.load(); + } + return nsfwModelPromise; +} + +function resizeImage(imageTensor) { + const [height, width] = imageTensor.shape.slice(0, 2); + const aspectRatio = width / height; + + let newWidth, newHeight; + + if (aspectRatio > 1) { + newHeight = 224; + newWidth = Math.round(aspectRatio * 224); + } else { + newWidth = 224; + newHeight = Math.round(224 / aspectRatio); + } + + const resizedImage = tf.image.resizeBilinear(imageTensor, [ + newHeight, + newWidth, + ]); + return resizedImage; +} + +async function nsfwGetPic(image, nsfw_embed, interaction) { + const model = await loadNsfwModel(); + const pic = await axios.get(image, { responseType: "arraybuffer" }); + const imageTensor = tf.node.decodeImage(pic.data, 3); + + const resizedImage = resizeImage(imageTensor); + imageTensor.dispose(); + + const predictions = await model.classify(resizedImage); + resizedImage.dispose(); + + if ( + (predictions[0].probability > 0.5 && predictions[0].className === "Porn") || + predictions[0].className === "Hentai" || + predictions[0].className === "Sexy" + ) { + await interaction.followUp({ embeds: [nsfw_embed] }); + return true; + } + return image; +} + +let nsfwWordsCache = null; + +async function getNsfwWords() { + if (!nsfwWordsCache) { + const response = await fetch( + "https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en", + ); + const data = await response.text(); + nsfwWordsCache = data + .split("\n") + .filter((word) => word !== "suck" && word !== "sucks"); + } + return nsfwWordsCache; +} module.exports = { data: new SlashCommandBuilder() @@ -187,17 +253,8 @@ module.exports = { if (blockNSFWImages) { try { - const response = await fetch( - "https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en", - ); - const data = await response.text(); - let nsfw_words = data.split("\n"); - nsfw_words = nsfw_words.filter( - (word) => word !== "suck" && word !== "sucks", - ); - + const nsfw_words = await getNsfwWords(); let promptWords = prompt.split(" "); - for (let word of nsfw_words) { if (promptWords.includes(word)) { await interaction.followUp({ embeds: [nsfw_embed] }); @@ -209,25 +266,6 @@ module.exports = { } } - async function nsfw_getPic(image) { - const pic = await axios.get(image, { responseType: "arraybuffer" }); - const model = await nsfw.load(); - image_analyse = await tf.node.decodeImage(pic.data, 3); - const predictions = await model.classify(image_analyse); - image_analyse.dispose(); - - if ( - (predictions[0].probability > 0.5 && - predictions[0].className === "Porn") || - predictions[0].className === "Hentai" || - predictions[0].className === "Sexy" - ) { - await interaction.followUp({ embeds: [nsfw_embed] }); - return true; - } - return image; - } - const sdk = require("api")("@prodia/v1.3.0#6fdmny2flsvwyf65"); sdk.auth(XProdiaKey); @@ -237,12 +275,15 @@ module.exports = { const { data } = await apiMethod(); return JSON.parse(data); } catch (e) { + console.error(e); return interaction.followUp({ embeds: [error] }); } } - const choices = await fetchModels(sdk.listModels); - const sdxlChoices = await fetchModels(sdk.listSdxlModels); + const [choices, sdxlChoices] = await Promise.all([ + fetchModels(sdk.listModels), + fetchModels(sdk.listSdxlModels), + ]); const allModels = [...choices, ...sdxlChoices]; @@ -292,7 +333,11 @@ module.exports = { (async () => { if (blockNSFWImages) { - const newImage = await nsfw_getPic(image); + const newImage = await nsfwGetPic( + image, + nsfw_embed, + interaction, + ); image = newImage; if (image === true) { return; @@ -317,7 +362,7 @@ module.exports = { } }) .catch((err) => console.error(err)); - }, 2000); + }, 5000); }) .catch((err) => console.error(err)); } catch (err) { diff --git a/interactions/slash/misc/models.js b/interactions/slash/misc/models.js index a51942d..def790e 100644 --- a/interactions/slash/misc/models.js +++ b/interactions/slash/misc/models.js @@ -56,8 +56,10 @@ module.exports = { } } - const choices_string = await fetchAndFormatModels(sdk.listModels); - const sdxlChoices_string = await fetchAndFormatModels(sdk.listSdxlModels); + const [choices_string, sdxlChoices_string] = await Promise.all([ + fetchAndFormatModels(sdk.listModels), + fetchAndFormatModels(sdk.listSdxlModels), + ]); const models = new EmbedBuilder() .setTitle("🖼️ Available Models") From 75eee97ec0ba8c60447ddef1141332bf040efc88 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Wed, 22 May 2024 21:40:36 +0100 Subject: [PATCH 52/56] SafetySettings Disabled/Enabler --- events/buttonInteraction.js | 1 + events/taurusai.js | 23 +++--- functions/other/settings.sqlite | Bin 12288 -> 12288 bytes functions/other/utils.js | 49 +++++++----- interactions/buttons/settings/model.js | 70 ++++++++++++++++++ interactions/buttons/settings/other.js | 20 +---- .../context-menus/message/taurusai.js | 22 +++--- interactions/modals/AI/ask.js | 22 +++--- interactions/slash/misc/settings.js | 67 +++++++++++------ 9 files changed, 176 insertions(+), 98 deletions(-) create mode 100644 interactions/buttons/settings/model.js diff --git a/events/buttonInteraction.js b/events/buttonInteraction.js index 36311b0..361892c 100644 --- a/events/buttonInteraction.js +++ b/events/buttonInteraction.js @@ -41,6 +41,7 @@ module.exports = { return await command.execute(interaction); } catch (err) { console.error(err); + // console.dir(err, { showHidden: true, depth: null }); await interaction.reply({ content: "There was an issue while executing that button!", ephemeral: true, diff --git a/events/taurusai.js b/events/taurusai.js index ccfcfb1..4e3bdb6 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -8,12 +8,13 @@ const fs = require("fs").promises; const path = require("path"); const { GoogleGenerativeAI } = require("@google/generative-ai"); const { - safetySettings, + getSafetySettings, handleGeminiError, handleResponse, fetchThreadMessages, } = require("../functions/other/utils"); const { QuickDB } = require("quick.db"); +const { get } = require("http"); const db = new QuickDB({ filePath: path.join(__dirname, "../functions/other/settings.sqlite"), }); @@ -28,8 +29,8 @@ module.exports = { const apiKeys = await db.get("apiKeys"); const geminiApiKey = apiKeys.gemini; - const other = await db.get("other"); - let modelId = other.model; + const modelSettings = await db.get("model"); + let modelId = modelSettings.model; const genAI = new GoogleGenerativeAI(geminiApiKey); let userQuestion; @@ -107,16 +108,12 @@ module.exports = { maxOutputTokens: 750, }; - const model = genAI.getGenerativeModel( - { - model: modelId, - systemInstruction: instruction, - }, - { - safetySettings, - generationConfig, - }, - ); + const model = genAI.getGenerativeModel({ + model: modelId, + systemInstruction: instruction, + safetySettings: await getSafetySettings(), + generationConfig, + }); if ( threadMessages && diff --git a/functions/other/settings.sqlite b/functions/other/settings.sqlite index a88c674c5c46b3d21192ef0b4e23f9d4c8919da4..01388ec79072059aec6382f6b89458c527021a1e 100644 GIT binary patch delta 177 zcmZojXh@hK&Db(g#+k8YW5N=C9u~ff4E%C@7x~-xS8Oc2$-DWbY$78U0|SGNq5?Cs zxb5Tsc^T1l$e|y zTv=R_nyX}0QdF9%qg0%jmReGYBsTeuyao>o{}l%Q7yMWF@9}@xEU0jVpNo@OoDpmg J%jA3dN&vaTH`xFH delta 165 zcmZojXh@hK&FDT+#+lK5W5N=CE@pl?27WpILjI*23vcsoekq&C$i_d7LA{Z2a<{yU zy^d0Deu^>^v$TC;L8fl95_e zt(24#$;=|&s0%VfR7WW%KQYBAF()xEIWsR^$to=|r+D%mc@3cD_ZawJ@ZaPAvRP2! NF#p5=-pTj$l>p8AGXDSo diff --git a/functions/other/utils.js b/functions/other/utils.js index fe77e0e..bbd566a 100644 --- a/functions/other/utils.js +++ b/functions/other/utils.js @@ -13,24 +13,35 @@ function botInGuild(interaction) { return botGuilds.has(interaction.guildId); } -const safetySettings = [ - { - category: HarmCategory.HARM_CATEGORY_HARASSMENT, - threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH, - }, - { - category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, - threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE, - }, - { - category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, - threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, - }, -]; +async function getSafetySettings() { + const model = await db.get("model"); + const safetyEnabled = model.safetySystem; + + const safetySettings = [ + { + category: HarmCategory.HARM_CATEGORY_HARASSMENT, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + { + category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, + threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE, + }, + ].map((setting) => { + if (!safetyEnabled) { + setting.threshold = HarmBlockThreshold.BLOCK_NONE; + } + return setting; + }); + return safetySettings; +} async function handleGeminiError(err, loadingMsg) { switch (err.message) { @@ -332,7 +343,7 @@ function checkOwnerAndReply(interaction) { module.exports = { botInGuild, - safetySettings, + getSafetySettings, handleGeminiError, handleResponse, fetchThreadMessages, diff --git a/interactions/buttons/settings/model.js b/interactions/buttons/settings/model.js new file mode 100644 index 0000000..c452eec --- /dev/null +++ b/interactions/buttons/settings/model.js @@ -0,0 +1,70 @@ +/** + * @file Settings Other/Model Button interaction + * @author TechyGiraffe999 + */ + +/** + * @type {import('../../../typings').ButtonInteractionCommand} + */ +const { EmbedBuilder } = require("discord.js"); +const path = require("path"); +const { QuickDB } = require("quick.db"); +const { emojis } = require("../../../config.json"); +const db = new QuickDB({ + filePath: path.join(__dirname, "../../../functions/other/settings.sqlite"), +}); +const { checkOwnerAndReply } = require("../../../functions/other/utils"); + +module.exports = { + id: ["fallbackSystem", "safetySystem", "model"], + + async execute(interaction) { + if (!checkOwnerAndReply(interaction)) { + return; + } + const modelSettings = await db.get("model"); + let updatedSetting; + + switch (interaction.customId) { + case "fallbackSystem": + modelSettings.fallbackSystem = !modelSettings.fallbackSystem; + updatedSetting = `**🛡️ Fallback System ${modelSettings.fallbackSystem ? "Enabled" : "Disabled"}**`; + break; + case "safetySystem": + modelSettings.safetySystem = !modelSettings.safetySystem; + updatedSetting = `**${modelSettings.safetySystem ? "🔒" : "🔓"} Safety System ${modelSettings.safetySystem ? "Enabled" : "Disabled"}**`; + break; + case "model": + modelSettings.model = + modelSettings.model === "gemini-1.5-flash-latest" + ? "gemini-1.5-pro-latest" + : "gemini-1.5-flash-latest"; + updatedSetting = `**🧠 Model switched to \`\`${modelSettings.model === "gemini-1.5-flash-latest" ? "Gemini 1.5 Flash" : "Gemini 1.5 Pro"}\`\`**`; + break; + } + + await db.set("model", modelSettings); + const embed = new EmbedBuilder() + .setDescription(updatedSetting) + .setColor("Green"); + + const message = await interaction.message.fetch(); + const embedData = message.embeds[0]; + const otherFieldIndex = embedData.data.fields.find( + (field) => field.name === "🧠 Model:", + ); + otherFieldIndex.value = `${modelSettings.fallbackSystem ? emojis.working : emojis.failed} **Fallback System**\n${modelSettings.safetySystem ? emojis.working : emojis.failed} **Safety System**\n${modelSettings.model === "gemini-1.5-flash-latest" ? "⚡" : "💪"} **${modelSettings.model + .replace(/-latest$/, "") + .replace(/-/g, " ") + .split(" ") + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" ")}**`; + + message.edit({ embeds: [embedData] }); + + return await interaction.reply({ + embeds: [embed], + ephemeral: true, + }); + }, +}; diff --git a/interactions/buttons/settings/other.js b/interactions/buttons/settings/other.js index 879843a..5658684 100644 --- a/interactions/buttons/settings/other.js +++ b/interactions/buttons/settings/other.js @@ -16,7 +16,7 @@ const db = new QuickDB({ const { checkOwnerAndReply } = require("../../../functions/other/utils"); module.exports = { - id: ["blockNSFWImages", "loadBalancing", "model"], + id: ["blockNSFWImages"], async execute(interaction) { if (!checkOwnerAndReply(interaction)) { @@ -30,17 +30,6 @@ module.exports = { otherSettings.blockNSFWImages = !otherSettings.blockNSFWImages; updatedSetting = `**🔞 NSFW Image Blocking ${otherSettings.blockNSFWImages ? "Enabled" : "Disabled"}**`; break; - case "loadBalancing": - otherSettings.loadBalancing = !otherSettings.loadBalancing; - updatedSetting = `**⚖️ Load Balancing ${otherSettings.loadBalancing ? "Enabled" : "Disabled"}**`; - break; - case "model": - otherSettings.model = - otherSettings.model === "gemini-1.5-flash-latest" - ? "gemini-1.5-pro-latest" - : "gemini-1.5-flash-latest"; - updatedSetting = `**🧠 Model switched to \`\`${otherSettings.model === "gemini-1.5-flash-latest" ? "Gemini 1.5 Flash" : "Gemini 1.5 Pro"}\`\`**`; - break; } await db.set("other", otherSettings); @@ -53,12 +42,7 @@ module.exports = { const otherFieldIndex = embedData.data.fields.find( (field) => field.name === "⚙️ Other:", ); - otherFieldIndex.value = `${otherSettings.blockNSFWImages ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${otherSettings.loadBalancing ? emojis.working : emojis.failed} **Load Balancing**\n${otherSettings.model === "gemini-1.5-flash-latest" ? "⚡" : "💪"} **${otherSettings.model - .replace(/-latest$/, "") - .replace(/-/g, " ") - .split(" ") - .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(" ")}**`; + otherFieldIndex.value = `${otherSettings.blockNSFWImages ? emojis.working : emojis.failed} **NSFW Image Blocking**`; message.edit({ embeds: [embedData] }); diff --git a/interactions/context-menus/message/taurusai.js b/interactions/context-menus/message/taurusai.js index c404735..d64b276 100644 --- a/interactions/context-menus/message/taurusai.js +++ b/interactions/context-menus/message/taurusai.js @@ -12,7 +12,7 @@ const fs = require("fs").promises; const path = require("path"); const { GoogleGenerativeAI } = require("@google/generative-ai"); const { - safetySettings, + getSafetySettings, handleGeminiError, handleResponse, fetchThreadMessages, @@ -32,8 +32,8 @@ module.exports = { const { channel, targetId } = interaction; const apiKeys = await db.get("apiKeys"); const geminiApiKey = apiKeys.gemini; - const other = await db.get("other"); - let modelId = other.model; + const modelSettings = await db.get("model"); + let modelId = modelSettings.model; const genAI = new GoogleGenerativeAI(geminiApiKey); const message = await channel.messages.fetch(targetId); @@ -126,16 +126,12 @@ module.exports = { maxOutputTokens: 750, }; - const model = genAI.getGenerativeModel( - { - model: modelId, - systemInstruction: instruction, - }, - { - safetySettings, - generationConfig, - }, - ); + const model = genAI.getGenerativeModel({ + model: modelId, + systemInstruction: instruction, + safetySettings: await getSafetySettings(), + generationConfig, + }); if ( threadMessages && diff --git a/interactions/modals/AI/ask.js b/interactions/modals/AI/ask.js index ee674e6..b08b4bc 100644 --- a/interactions/modals/AI/ask.js +++ b/interactions/modals/AI/ask.js @@ -12,7 +12,7 @@ const { EmbedBuilder } = require("discord.js"); const { GoogleGenerativeAI } = require("@google/generative-ai"); const { botInGuild, - safetySettings, + getSafetySettings, handleGeminiError, handleResponse, } = require("../../../functions/other/utils"); @@ -27,8 +27,8 @@ module.exports = { async execute(interaction) { const apiKeys = await db.get("apiKeys"); const geminiApiKey = apiKeys.gemini; - const other = await db.get("other"); - let modelId = other.model; + const modelSettings = await db.get("model"); + let modelId = modelSettings.model; const genAI = new GoogleGenerativeAI(geminiApiKey); const personalityFilePath = path.join( @@ -91,16 +91,12 @@ module.exports = { maxOutputTokens: 750, }; - const model = genAI.getGenerativeModel( - { - model: modelId, - systemInstruction: instruction, - }, - { - safetySettings, - generationConfig, - }, - ); + const model = genAI.getGenerativeModel({ + model: modelId, + systemInstruction: instruction, + safetySettings: await getSafetySettings(), + generationConfig, + }); const chat = model.startChat({ generationConfig: { diff --git a/interactions/slash/misc/settings.js b/interactions/slash/misc/settings.js index ff439c2..58bef2d 100644 --- a/interactions/slash/misc/settings.js +++ b/interactions/slash/misc/settings.js @@ -57,9 +57,14 @@ module.exports = { value: `${emojis.loading} **Prodia**\n${emojis.loading} **Gemini**`, inline: true, }, + { + name: "🧠 Model:", + value: `${emojis.loading} **Fallback System**\n${emojis.loading} **Safety System**\n${emojis.loading} **Model**`, + inline: true, + }, { name: "⚙️ Other:", - value: `${emojis.loading} **NSFW Image Blocking**\n${emojis.loading} **Load Balancing**\n${emojis.loading} **Model**`, + value: `${emojis.loading} **NSFW Image Blocking**`, inline: true, }, ) @@ -74,6 +79,7 @@ module.exports = { const webhooks = await db.get("webhooks"); const apiKeys = await db.get("apiKeys"); + const modelSettings = await db.get("model"); const otherSettings = await db.get("other"); // WEBHOOK CHECKING @@ -110,24 +116,25 @@ module.exports = { `${isProdiaKeyValid ? emojis.working : emojis.failed} **Prodia**\n${isGeminiKeyValid ? emojis.working : emojis.failed} **Gemini**`, ); - // OTHER SETTINGS CHECKING - let isNSFWBlockingEnabled = otherSettings.blockNSFWImages; + // MODEL SETTINGS CHECKING + + let isFallbackSystemEnabled = modelSettings.fallbackSystem; await updateFieldValueAndReply( interaction, settings, - "⚙️ Other:", - `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${emojis.loading} **Load Balancing**\n${emojis.loading} **Model**`, + "🧠 Model:", + `${isFallbackSystemEnabled ? emojis.working : emojis.failed} **Fallback System**\n${emojis.loading} **Safety System**\n${emojis.loading} **Model**`, ); - let isLoadBalancingEnabled = otherSettings.loadBalancing; + let isSafetySystemEnabled = modelSettings.safetySystem; await updateFieldValueAndReply( interaction, settings, - "⚙️ Other:", - `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${isLoadBalancingEnabled ? emojis.working : emojis.failed} **Load Balancing**\n${emojis.loading} **Model**`, + "🧠 Model:", + `${isFallbackSystemEnabled ? emojis.working : emojis.failed} **Fallback System**\n${isSafetySystemEnabled ? emojis.working : emojis.failed} **Safety System**\n${emojis.loading} **Model**`, ); - let modelName = otherSettings.model; + let modelName = modelSettings.model; let modelEmoji = modelName === "gemini-1.5-flash-latest" ? "⚡" : "💪"; let modelNameFormatted = modelName .replace(/-latest$/, "") @@ -135,11 +142,20 @@ module.exports = { .split(" ") .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) .join(" "); + await updateFieldValueAndReply( + interaction, + settings, + "🧠 Model:", + `${isFallbackSystemEnabled ? emojis.working : emojis.failed} **Fallback System**\n${isSafetySystemEnabled ? emojis.working : emojis.failed} **Safety System**\n${modelEmoji} **${modelNameFormatted}**`, + ); + + // OTHER SETTINGS CHECKING + let isNSFWBlockingEnabled = otherSettings.blockNSFWImages; await updateFieldValueAndReply( interaction, settings, "⚙️ Other:", - `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**\n${isLoadBalancingEnabled ? emojis.working : emojis.failed} **Load Balancing**\n${modelEmoji} **${modelNameFormatted}**`, + `${isNSFWBlockingEnabled ? emojis.working : emojis.failed} **NSFW Image Blocking**`, ); // BUTTONS @@ -170,29 +186,36 @@ module.exports = { .setStyle(ButtonStyle.Secondary); const apiKeysRow = new ActionRowBuilder().addComponents(prodia, gemini); - const nsfw = new ButtonBuilder() - .setCustomId("blockNSFWImages") - .setLabel("NSFW Image Blocking") - .setEmoji("🔞") + const fallbackSystem = new ButtonBuilder() + .setCustomId("fallbackSystem") + .setLabel("Fallback System") + .setEmoji("🛡️") .setStyle(ButtonStyle.Secondary); - const loadBalance = new ButtonBuilder() - .setCustomId("loadBalancing") - .setLabel("Load Balancing") - .setEmoji("⚖️") + const safetySystem = new ButtonBuilder() + .setCustomId("safetySystem") + .setLabel("Safety System") + .setEmoji("🔒") .setStyle(ButtonStyle.Secondary); const model = new ButtonBuilder() .setCustomId("model") .setLabel("Model") .setEmoji("🔁") .setStyle(ButtonStyle.Secondary); - const otherRow = new ActionRowBuilder().addComponents( - nsfw, - loadBalance, + const modelRow = new ActionRowBuilder().addComponents( + fallbackSystem, + safetySystem, model, ); + const nsfw = new ButtonBuilder() + .setCustomId("blockNSFWImages") + .setLabel("NSFW Image Blocking") + .setEmoji("🔞") + .setStyle(ButtonStyle.Secondary); + const otherRow = new ActionRowBuilder().addComponents(nsfw); + await interaction.editReply({ - components: [webhooksRow, apiKeysRow, otherRow], + components: [webhooksRow, apiKeysRow, modelRow, otherRow], }); } catch (error) { console.error(error); From c1367457056d48a133a117f61ed89dcdc4ddf9ef Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Wed, 22 May 2024 21:48:21 +0100 Subject: [PATCH 53/56] Remove API Key --- functions/other/settings.sqlite | Bin 12288 -> 12288 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/functions/other/settings.sqlite b/functions/other/settings.sqlite index 01388ec79072059aec6382f6b89458c527021a1e..d2f4bb0c14618432db758f0f3fc79c43b9842f7c 100644 GIT binary patch delta 147 zcmZojXh@hK&6qz?#+fmHW5QB?ZhkoiemVX^et-TI8w+ppPJSu-N#2o#S-d_sKP5G% zS}7+#F~un{CowNMGcR4qDlIXmc=8>2mC17QIxPIt7+5F!$t#;HGcilsCl+LSr&bnM yE2XFAX69uoSt%*$C>0dtr(`CA*tHA{3_^{J`6U^tMb%14Ig!lan^(w32mk0#9Eh9i@Vz{FKZ@ mpq9xp@_H-`3=B4t{p6KJfDCi{#DYw3By&L$n^(w32mk Date: Sun, 26 May 2024 12:28:43 +0100 Subject: [PATCH 54/56] Fix Fallback System --- functions/other/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/other/utils.js b/functions/other/utils.js index bbd566a..c61623a 100644 --- a/functions/other/utils.js +++ b/functions/other/utils.js @@ -83,9 +83,9 @@ async function handleGeminiError(err, loadingMsg) { ) .setColor("Red"); - const other = await db.get("other"); - const loadBalance = other.loadBalancing; - if (loadBalance) { + const model = await db.get("model"); + const fallbackSystem = model.fallbackSystem; + if (fallbackSystem) { return "quotaErrorBalance"; } else { for (let i = 5; i > 0; i--) { From 3713e21d0e2038b474dd1b8aab15ca179627d2f1 Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Mon, 27 May 2024 21:32:02 +0100 Subject: [PATCH 55/56] Remove unused gemini key, fix ai ping error potentially --- events/taurusai.js | 4 ++-- functions/other/utils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/events/taurusai.js b/events/taurusai.js index 4e3bdb6..b825333 100644 --- a/events/taurusai.js +++ b/events/taurusai.js @@ -42,7 +42,7 @@ module.exports = { userQuestion: fetchedUserQuestion, threadMessages: fetchedThreadMessages, messageDeleted: fetchedMessageDeleted, - } = await fetchThreadMessages(geminiApiKey, message); + } = await fetchThreadMessages(message); if (fetchedUserQuestion === null && fetchedThreadMessages === null) return; threadMessages = fetchedThreadMessages; @@ -98,7 +98,7 @@ module.exports = { ); const personalityLines = personalityContent.split("\n"); - instruction = `${personalityLines}\n Please greet the user with a greeting and then their name which is: <@${message.author.id}> and limit your responses to 2000 characters or less.`; + instruction = `${personalityLines}\n Please greet the user with a greeting and then the current users name, which is: <@${message.author.id}> and limit your responses to 2000 characters or less. Please note the current user may change.`; if (Object.keys(user_status).length) { instruction += ` The user's status/presence is currently:\n${status_devices}`; diff --git a/functions/other/utils.js b/functions/other/utils.js index c61623a..68830fc 100644 --- a/functions/other/utils.js +++ b/functions/other/utils.js @@ -203,7 +203,7 @@ async function handleResponse( return await loadingMsg.edit({ content: responseText, embeds: info_embed }); } -async function fetchThreadMessages(Gemini_API_KEY, message) { +async function fetchThreadMessages(message) { let threadMessages = []; let messageDeleted; userQuestion = message.content; From a842afb1218912a84d8b2971a78425047011f4fb Mon Sep 17 00:00:00 2001 From: TechyGiraffe999 <92249532+TecEash1@users.noreply.github.com> Date: Wed, 29 May 2024 23:46:00 +0100 Subject: [PATCH 56/56] Update Status --- events/onReady.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/onReady.js b/events/onReady.js index a4b7305..d71718f 100644 --- a/events/onReady.js +++ b/events/onReady.js @@ -21,7 +21,7 @@ module.exports = { { type: ActivityType.Custom, name: "Status", - state: "💾 Chilling on my owners computer!", + state: "💾 Chilling in the Cloud!", }, ], });