From ce61a4945ee411f0fb729e159d366c112344c2aa Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sat, 23 Apr 2022 23:56:23 -0400 Subject: [PATCH 01/68] Begin to create v3 --- .gitignore | 2 + ab-core/events/buttonInteraction.js | 53 -- ab-core/events/contextInteraction.js | 77 -- ab-core/events/guildCreate.js | 17 - ab-core/events/guildDelete.js | 17 - ab-core/events/initGlobal.js | 37 - ab-core/events/initModulesParts.js | 52 -- ab-core/events/messageCreate.js | 153 ---- ab-core/events/onReadyMessage.js | 18 - ab-core/events/pterodactylStart.js | 10 - ab-core/events/selectInteraction.js | 44 - ab-core/events/slashCreate.js | 42 - ab-core/events/triggerCreate.js | 45 -- ab-core/events/updateBotName.js | 22 - ab-core/interactionManager.js | 60 -- ab-core/locales.json | 207 ----- ab-core/logger.js | 38 - ab-core/messages/onMention.js | 16 - ab-modules/core/index.js | 113 --- ab-modules/core/src/commands/help.js | 96 --- .../core/src => core}/buttons/delete.js | 0 .../buttons/registerinteractions.js | 0 core/commands/help.js | 82 ++ .../core/src => core}/commands/info.js | 0 .../core/src => core}/commands/ping.js | 0 .../core/src => core}/commands/reload.js | 0 .../commands/resetinteractions.js | 0 .../core/src => core}/commands/update.js | 0 core/index.js | 128 +++ .../core/src => core}/message-menu/react.js | 0 .../core/src => core}/slash-commands/embed.js | 0 .../core/src => core}/slash-commands/help.js | 0 .../core/src => core}/slash-commands/info.js | 0 .../core/src => core}/slash-commands/ping.js | 0 .../core/src => core}/user-menu/avatar.js | 0 .../src => core}/user-menu/informations.js | 0 events/buttonInteraction.js | 48 ++ events/contextInteraction.js | 72 ++ events/guildCreate.js | 13 + events/guildDelete.js | 13 + events/initModulesParts.js | 18 + events/messageCreate.js | 129 +++ events/onReadyMessage.js | 15 + events/pterodactylStart.js | 11 + events/selectInteraction.js | 41 + events/slashCreate.js | 38 + events/triggerCreate.js | 45 ++ events/updateBotName.js | 18 + ab-core/index.js => index-old.js | 0 index.js | 255 ++++++ interactionManager.js | 77 ++ ab-core/loader.js => loader.js | 0 ab-modules/core/locales.json => locales.json | 204 ++++- logger.js | 35 + .../defaultButtonError.js | 0 .../defaultSelectError.js | 0 messages/onMention.js | 14 + package-lock.json | 762 +++++++----------- package.json | 38 +- private-example.json | 3 - testing.js | 10 + ab-core/updater.js => updater.js | 0 62 files changed, 1581 insertions(+), 1607 deletions(-) delete mode 100644 ab-core/events/buttonInteraction.js delete mode 100644 ab-core/events/contextInteraction.js delete mode 100644 ab-core/events/guildCreate.js delete mode 100644 ab-core/events/guildDelete.js delete mode 100644 ab-core/events/initGlobal.js delete mode 100644 ab-core/events/initModulesParts.js delete mode 100644 ab-core/events/messageCreate.js delete mode 100644 ab-core/events/onReadyMessage.js delete mode 100644 ab-core/events/pterodactylStart.js delete mode 100644 ab-core/events/selectInteraction.js delete mode 100644 ab-core/events/slashCreate.js delete mode 100644 ab-core/events/triggerCreate.js delete mode 100644 ab-core/events/updateBotName.js delete mode 100644 ab-core/interactionManager.js delete mode 100644 ab-core/locales.json delete mode 100644 ab-core/logger.js delete mode 100644 ab-core/messages/onMention.js delete mode 100644 ab-modules/core/index.js delete mode 100644 ab-modules/core/src/commands/help.js rename {ab-modules/core/src => core}/buttons/delete.js (100%) rename {ab-modules/core/src => core}/buttons/registerinteractions.js (100%) create mode 100644 core/commands/help.js rename {ab-modules/core/src => core}/commands/info.js (100%) rename {ab-modules/core/src => core}/commands/ping.js (100%) rename {ab-modules/core/src => core}/commands/reload.js (100%) rename {ab-modules/core/src => core}/commands/resetinteractions.js (100%) rename {ab-modules/core/src => core}/commands/update.js (100%) create mode 100644 core/index.js rename {ab-modules/core/src => core}/message-menu/react.js (100%) rename {ab-modules/core/src => core}/slash-commands/embed.js (100%) rename {ab-modules/core/src => core}/slash-commands/help.js (100%) rename {ab-modules/core/src => core}/slash-commands/info.js (100%) rename {ab-modules/core/src => core}/slash-commands/ping.js (100%) rename {ab-modules/core/src => core}/user-menu/avatar.js (100%) rename {ab-modules/core/src => core}/user-menu/informations.js (100%) create mode 100644 events/buttonInteraction.js create mode 100644 events/contextInteraction.js create mode 100644 events/guildCreate.js create mode 100644 events/guildDelete.js create mode 100644 events/initModulesParts.js create mode 100644 events/messageCreate.js create mode 100644 events/onReadyMessage.js create mode 100644 events/pterodactylStart.js create mode 100644 events/selectInteraction.js create mode 100644 events/slashCreate.js create mode 100644 events/triggerCreate.js create mode 100644 events/updateBotName.js rename ab-core/index.js => index-old.js (100%) create mode 100644 index.js create mode 100644 interactionManager.js rename ab-core/loader.js => loader.js (100%) rename ab-modules/core/locales.json => locales.json (65%) create mode 100644 logger.js rename {ab-core/messages => messages}/defaultButtonError.js (100%) rename {ab-core/messages => messages}/defaultSelectError.js (100%) create mode 100644 messages/onMention.js delete mode 100644 private-example.json create mode 100644 testing.js rename ab-core/updater.js => updater.js (100%) diff --git a/.gitignore b/.gitignore index 3ba267e..6a7b50d 100644 --- a/.gitignore +++ b/.gitignore @@ -104,5 +104,7 @@ dist .tern-port **/private.json +**/private.js **/config.json +**/config.js updaterFiles \ No newline at end of file diff --git a/ab-core/events/buttonInteraction.js b/ab-core/events/buttonInteraction.js deleted file mode 100644 index f369fcf..0000000 --- a/ab-core/events/buttonInteraction.js +++ /dev/null @@ -1,53 +0,0 @@ -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); -const { log } = commons; - -const localizer = new Localizer({ - lang: commons.config.locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "interactionCreate", - - 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; - - let data = client.buttonCommands.get(interaction.customId); - - if (!data) data = client.buttonCommands.find((v, id) => { - /** @type {string[]} */ - const parts = id.split("*"); - return interaction.customId.startsWith(parts[0]); - }); - - // If the interaction is not a registered button, return error message. - - if (!data) { - await require("../messages/defaultButtonError").execute(interaction); - return; - }; - - const { command } = data; - - // A try to execute the button. - - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("ButtonManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured when executing this button..."), - ephemeral: true, - }); - return; - } - }, -}; diff --git a/ab-core/events/contextInteraction.js b/ab-core/events/contextInteraction.js deleted file mode 100644 index adfb845..0000000 --- a/ab-core/events/contextInteraction.js +++ /dev/null @@ -1,77 +0,0 @@ -const { log } = require("../logger"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); - -const localizer = new Localizer({ - lang: commons.config.locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "interactionCreate", - - execute: async (interaction) => { - // Deconstructed client from interaction object. - const { client } = interaction; - - // Checks if the interaction is a button interaction (to prevent weird bugs) - - if (!interaction.isContextMenu()) return; - - // Don't execute interactions in DM channels - - if (!interaction.channel) return interaction.reply({ - content: localizer._("This is disabled in DM channels."), - ephemeral: true - }); - - /**********************************************************************/ - - // Checks if the interaction target was a user - - if (interaction.targetType === "USER") { - - const { command } = client.contextCommands.get("USER " + interaction.commandName); - - // A try to execute the interaction. - - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("InteractionManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured when executing this interaction..."), - ephemeral: true, - }); - return; - } - } - // Checks if the interaction target was a message - else if (interaction.targetType === "MESSAGE") { - - const { command } = client.contextCommands.get("MESSAGE " + interaction.commandName); - - // A try to execute the interaction. - - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("InteractionManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured when executing this interaction..."), - ephemeral: true, - }); - return; - } - } - - // Practically not possible, but we are still catching the bug. - // Possible Fix is a restart! - else { - return log("InteractionManager", localizer._("Something weird happened with the menu. Received an unknown menu type."), "warn", true); - }; - } -}; diff --git a/ab-core/events/guildCreate.js b/ab-core/events/guildCreate.js deleted file mode 100644 index 624ddec..0000000 --- a/ab-core/events/guildCreate.js +++ /dev/null @@ -1,17 +0,0 @@ -const { log } = require("../logger"); -const { locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "guildCreate", - - async execute(guild) { - log("Artibot", localizer._("Added to a new server: ") + guild.name, "log", true); - } -}; \ No newline at end of file diff --git a/ab-core/events/guildDelete.js b/ab-core/events/guildDelete.js deleted file mode 100644 index 6dd3595..0000000 --- a/ab-core/events/guildDelete.js +++ /dev/null @@ -1,17 +0,0 @@ -const { log } = require("../logger"); -const { locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "guildDelete", - - async execute(guild) { - log("Artibot", localizer._("Removed from server: ") + guild.name, "log", true); - } -}; \ No newline at end of file diff --git a/ab-core/events/initGlobal.js b/ab-core/events/initGlobal.js deleted file mode 100644 index 40b2a84..0000000 --- a/ab-core/events/initGlobal.js +++ /dev/null @@ -1,37 +0,0 @@ -const logPrefix = "GlobalManager"; -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); -const { log } = commons; - -const localizer = new Localizer({ - lang: commons.config.locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "ready", - once: true, - - execute(client) { - log(logPrefix, localizer._("Initializing modules..."), "info", true); - const length = client.globals.size; - - if (length == 0) { - log(logPrefix, localizer._("No module to load."), "log", true); - return - }; - - log(logPrefix, localizer.__("Loading [[0]] module[[1]]:", { placeholders: [length, (length == 1) ? "" : "s"] }), "log", true); - - client.globals.forEach(({ global, part, module }) => { - log(logPrefix, " - " + global.name + " (v" + (part.version ? part.version : module.moduleVersion) + ")", "log", true); - if (!module.supportedLocales.includes(commons.config.locale)) { - log(logPrefix, localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [commons.config.locale] }), "warn", true); - }; - setTimeout(() => { - global.execute({ client, ...commons }); - }, 1000); - }); - } -}; \ No newline at end of file diff --git a/ab-core/events/initModulesParts.js b/ab-core/events/initModulesParts.js deleted file mode 100644 index 9baaf0f..0000000 --- a/ab-core/events/initModulesParts.js +++ /dev/null @@ -1,52 +0,0 @@ -const { commons } = require("../loader"); - -module.exports = { - name: "ready", - once: true, - - execute(client) { - - // Execute init function of each slash command if it's defined - client.slashCommands.forEach(({ command }) => { - if (typeof command.init === "function") { - command.init({ client, ...commons }); - }; - }); - - // Execute init function of each command if it's defined - client.commands.forEach(({ command }) => { - if (typeof command.init === "function") { - command.init({ client, ...commons }); - }; - }); - - // Execute init function of each context menu option if it's defined - client.contextCommands.forEach(({ command }) => { - if (typeof command.init === "function") { - command.init({ client, ...commons }); - }; - }); - - // Execute init function of each button if it's defined - client.buttonCommands.forEach(({ command }) => { - if (typeof command.init === "function") { - command.init({ client, ...commons }); - }; - }); - - // Execute init function of each dropdown if it's defined - client.selectCommands.forEach(({ command }) => { - if (typeof command.init === "function") { - command.init({ client, ...commons }); - }; - }); - - // Execute init function of each trigger if it's defined - client.triggers.forEach(({ command }) => { - if (typeof command.init === "function") { - command.init({ client, ...commons }); - }; - }); - - } -}; \ No newline at end of file diff --git a/ab-core/events/messageCreate.js b/ab-core/events/messageCreate.js deleted file mode 100644 index 99a6621..0000000 --- a/ab-core/events/messageCreate.js +++ /dev/null @@ -1,153 +0,0 @@ -const { Collection, MessageEmbed } = require("discord.js"); -const { prefix, ownerId } = require("../../config.json"); -const { log } = require("../logger"); -const { params, locale } = require("../../config.json"); -const config = params; -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -// Prefix regex, we will use to match in mention prefix. - -const escapeRegex = (string) => { - return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -}; - -module.exports = { - name: "messageCreate", - - async execute(message) { - // Declares const to be used. - - const { client, guild, channel, content, author } = message; - - // Checks if the bot is mentioned in the message all alone and triggers onMention trigger. - - if (message.content == `<@${client.user.id}>` || message.content == `<@!${client.user.id}>`) { - require("../messages/onMention").execute(message); - return; - } - - const checkPrefix = prefix.toLowerCase(); - - // Regex expression for mention prefix - - const prefixRegex = new RegExp( - `^(<@!?${client.user.id}>|${escapeRegex(checkPrefix)})\\s*` - ); - - // Checks if message content in lower case starts with bot's mention. - - if (!prefixRegex.test(content.toLowerCase())) return; - - // Checks and returned matched prefix, either mention or prefix in config. - - const [matchedPrefix] = content.toLowerCase().match(prefixRegex); - - // The Message Content of the received message seperated by spaces (' ') in an array, this excludes prefix and command/alias itself. - - const args = content.slice(matchedPrefix.length).trim().split(/ +/); - - // Name of the command received from first argument of the args array. - - const commandName = args.shift().toLowerCase(); - - // Check if mesage does not starts with prefix, or message author is bot. If yes, return. - - if (!message.content.startsWith(matchedPrefix) || message.author.bot) - return; - - const data = - client.commands.get(commandName) || - client.commands.find(({ command }) => command.aliases && command.aliases.includes(commandName)); - - // It it's not a command, don't try to execute anything - - if (!data) return; - - const { command } = data; - - // Owner Only Property, add in your command properties if true. - - if (command.ownerOnly && message.author.id !== ownerId) { - let embedOwner = new MessageEmbed() - .setColor("RED") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setTitle(localizer._("Help on this command")) - .setDescription(localizer.__("This command can only be executed by [[0]].", { placeholders: [`<@${ownerId}>`] })); - return message.reply({ embeds: [embedOwner] }); - } - - // Guild Only Property, add in your command properties if true. - - if (command.guildOnly && message.channel.type === "dm") { - return message.reply({ - content: localizer._("I can't execute this command in a DM channel!"), - }); - } - - // Author perms property - - if (command.permissions) { - const authorPerms = message.channel.permissionsFor(message.author); - if (!authorPerms || !authorPerms.has(command.permissions)) { - return message.reply({ content: localizer._("You do not have the permission to execute this command!") }); - } - } - - // Args missing - - if (command.args && !args.length) { - let reply = localizer.__("You did not give any argument, [[0]]!", { placeholders: [message.author] }); - - if (command.usage) { - reply += localizer.__("\nCorrect usage is `[[0]][[1]] [[2]]`", { placeholders: [prefix, command.name, command.usage] }) - } - - return message.channel.send({ content: reply }); - } - - // Cooldowns - - const { cooldowns } = client; - - if (!cooldowns.has(command.name)) { - cooldowns.set(command.name, new Collection()); - } - - const now = Date.now(); - const timestamps = cooldowns.get(command.name); - const cooldownAmount = (command.cooldown || 3) * 1000; - - if (timestamps.has(message.author.id)) { - const expirationTime = timestamps.get(message.author.id) + cooldownAmount; - - if (now < expirationTime) { - const timeLeft = (expirationTime - now) / 1000; - return message.reply({ - content: localizer.__("You must wait [[0]] seconds before using the `[[1]]` command again.", { placeholders: [timeLeft.toFixed(1), command.name] }) - }); - } - } - - timestamps.set(message.author.id, now); - setTimeout(() => timestamps.delete(message.author.id), cooldownAmount); - - // execute the final command. Put everything above this. - - try { - command.execute(message, args, commons); - } catch (error) { - log("CommandManager", error, "warn", true); - message.reply({ - content: localizer._("An error occured while trying to run this command.") - }); - } - } -}; \ No newline at end of file diff --git a/ab-core/events/onReadyMessage.js b/ab-core/events/onReadyMessage.js deleted file mode 100644 index 3fafa3e..0000000 --- a/ab-core/events/onReadyMessage.js +++ /dev/null @@ -1,18 +0,0 @@ -const { log } = require("../logger"); -const { locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "ready", - once: true, - - execute(client) { - log("Artibot", localizer.__("Ready! Connected as [[0]].", { placeholders: [client.user.tag] }), "info", true); - } -}; \ No newline at end of file diff --git a/ab-core/events/pterodactylStart.js b/ab-core/events/pterodactylStart.js deleted file mode 100644 index 0155523..0000000 --- a/ab-core/events/pterodactylStart.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - name: "ready", - once: true, - - execute() { - if (process.env.RUNS_IN_PTERODACTYL) { - console.log("Pterodactyl start trigger"); - }; - } -}; \ No newline at end of file diff --git a/ab-core/events/selectInteraction.js b/ab-core/events/selectInteraction.js deleted file mode 100644 index e27ae4f..0000000 --- a/ab-core/events/selectInteraction.js +++ /dev/null @@ -1,44 +0,0 @@ -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); -const { log } = commons; - -const localizer = new Localizer({ - lang: commons.config.locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "interactionCreate", - - async execute(interaction) { - const { client } = interaction; - - // Checks if the interaction is a select menu interaction - if (!interaction.isSelectMenu()) return; - - const data = client.selectCommands.get(interaction.customId); - - // If the interaction is not a registered dropdown, return error message. - if (!data) { - await require("../messages/defaultSelectError").execute(interaction); - return - }; - - const { command } = data; - - // A try to execute the interaction. - - try { - await command.execute(interaction, commons); - return - } catch (err) { - log("ButtonManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured while executing this menu option."), - ephemeral: true, - }); - return - }; - } -}; diff --git a/ab-core/events/slashCreate.js b/ab-core/events/slashCreate.js deleted file mode 100644 index b2d421b..0000000 --- a/ab-core/events/slashCreate.js +++ /dev/null @@ -1,42 +0,0 @@ -const { log } = require("../logger"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); - -const localizer = new Localizer({ - lang: commons.config.locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "interactionCreate", - - async execute(interaction) { - // Deconstructed client from interaction object. - const { client } = interaction; - - // Checks if the interaction is a command (to prevent weird bugs) - - if (!interaction.isCommand()) return; - - const data = client.slashCommands.get(interaction.commandName); - - // If the interaction is not a command in cache. - - if (!data) return; - - const { command } = data; - - // A try to executes the interaction. - - try { - await command.execute(interaction, commons); - } catch (err) { - log("SlashManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured while executing this command."), - ephemeral: true - }); - }; - } -}; diff --git a/ab-core/events/triggerCreate.js b/ab-core/events/triggerCreate.js deleted file mode 100644 index fcaa5fe..0000000 --- a/ab-core/events/triggerCreate.js +++ /dev/null @@ -1,45 +0,0 @@ -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { commons } = require("../loader"); -const { log } = commons; - -const localizer = new Localizer({ - lang: commons.config.locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "messageCreate", - - async execute(message) { - // Ignore bots - if (message.author.bot) return; - - // Checking ALL triggers using every function and breaking out if a trigger was found. - let check = false; - - await message.client.triggers.every(async ({ command }) => { - if (check) return false; - await command.triggers.every(async (trigger) => { - if (check) return false; - - // If validated, it will try to execute the trigger. - if (message.content.includes(trigger)) { - try { - command.execute(message, commons); - } catch (error) { - // If checks fail, reply back! - - log("TriggerManager", error, "warn", true); - message.reply({ - content: localizer._("An error occured while trying to execute a trigger."), - }); - }; - - check = true; - return false - }; - }); - }); - } -}; diff --git a/ab-core/events/updateBotName.js b/ab-core/events/updateBotName.js deleted file mode 100644 index 8e7eb84..0000000 --- a/ab-core/events/updateBotName.js +++ /dev/null @@ -1,22 +0,0 @@ -const { log } = require("../logger"); -const { locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - name: "ready", - once: true, - - execute(client) { - const config = require("../../config.json"); - if (client.user.username != config.botName) { - client.user.setUsername(config.botName) - .then(log("Artibot", localizer.__("Bot name updated to [[0]].", { placeholders: [config.botName] }), "log", true)); - }; - } -}; \ No newline at end of file diff --git a/ab-core/interactionManager.js b/ab-core/interactionManager.js deleted file mode 100644 index 08d9b84..0000000 --- a/ab-core/interactionManager.js +++ /dev/null @@ -1,60 +0,0 @@ -const { REST } = require("@discordjs/rest"); -const { Routes } = require("discord-api-types/v9"); -const { clientId, testGuildId, devMode, locale } = require("../config.json"); -const { log } = require("./logger"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -var rest = new REST({ version: "9" }); -var commandJsonData = []; - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - init(token) { - rest.setToken(token); - }, - - generateData(client) { - commandJsonData = [ - ...Array.from(client.slashCommands.values()).map(({ command }) => command.data.toJSON()), - ...Array.from(client.contextCommands.values()).map(({ command }) => command.data), - ]; - }, - - async register() { - try { - log("InteractionManager", localizer._("Initializing interactions and slash commands on Discord..."), "info", true); - - /* - Send slash commands and other interactions to Discord API. - There is 2 types of interactions, "guild" and "global". - "Guild" for interactions in only one server and "gloabl" for interactions - in all the servers where the bot has perms. - In dev or in bots with only one server, use only "guild" interactions - since they can be refreshed more often and there is a shorter cache. - */ - - if (devMode) { - await rest.put( - Routes.applicationGuildCommands(clientId, testGuildId), - { body: commandJsonData } - ); - } else { - await rest.put( - Routes.applicationCommands(clientId), - { body: commandJsonData } - ); - }; - - log("InteractionManager", localizer._("Interaction and slash commands initialized successfully."), "log", true); - return true - } catch (error) { - log("InteractionManager", localizer._("An error occured when initializing interactions and slash commands, here are the details: ") + error, "warn", true); - return false - }; - } -}; \ No newline at end of file diff --git a/ab-core/locales.json b/ab-core/locales.json deleted file mode 100644 index 48ed6cb..0000000 --- a/ab-core/locales.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - - "Configuration error: The [[0]] file does not exist.": { - "fr": "Erreur de configuration: Le fichier [[0]] est introuvable." - }, - - "Configuration error: The [[0]] file is invalid.": { - "fr": "Erreur de configuration: Le fichier [[0]] est invalide." - }, - - "Activating commands:": { - "fr": "Activation des commandes:" - }, - - "Activating slash commands:": { - "fr": "Activation des commandes slash:" - }, - - "Activating context menu on messages:": { - "fr": "Activation du menu contextuel sur les messages:" - }, - - "Activating context menu on users:": { - "fr": "Activation du menu contextuel sur les utilisateurs:" - }, - - "Activating buttons:": { - "fr": "Activation des boutons:" - }, - - "Activating select menus:": { - "fr": "Activation des menus déroulants:" - }, - - "Activating triggers:": { - "fr": "Activation des triggers:" - }, - - "Activating module": { - "fr": "Activation du module" - }, - - "No module to activate.": { - "fr": "Aucun module à charger." - }, - - "Artibot is up to date (v[[0]]).": { - "fr": "Artibot est à jour (v[[0]])." - }, - - "An update for Artibot is available!": { - "fr": "Une mise à jour est disponible pour Artibot!" - }, - - " - Installed version: [[0]]": { - "fr": " - Version actuelle: [[0]]" - }, - - " - Latest version: [[0]]": { - "fr": " - Dernière version: [[0]]" - }, - - "Configuration error!": { - "fr": "Erreur de configuration!" - }, - - "Check for updates is disabled in config": { - "fr": "Vérification des mises à jours désactivée dans la configuration" - }, - - "Initializing interactions and slash commands on Discord...": { - "fr": "Initialisation des interactions et des commandes slash auprès de Discord..." - }, - - "Interaction and slash commands initialized successfully.": { - "fr": "Interactions et commandes slash initialisées avec succès." - }, - - "An error occured when initializing interactions and slash commands, here are the details: ": { - "fr": "Une erreur est survenue avec l'initialisation des interactions et commandes slash, voici les détais: " - }, - - "An error occured when executing this button...": { - "fr": "Il y a eu un problème lors de l'exécution de ce bouton..." - }, - - "This is disabled in DM channels.": { - "fr": "Ceci est désactivé dans les messages privés." - }, - - "An error occured when executing this interaction...": { - "fr": "Il y a eu un problème avec l'exécution de l'interaction..." - }, - - "Something weird happened with the menu. Received an unknown menu type.": { - "fr": "Quelque chose de suspect est survenue avec le menu. Réception d'un type de menu inconnu." - }, - - "Added to a new server: ": { - "fr": "Ajouté à un nouveau serveur: " - }, - - "Removed from server: ": { - "fr": "Retiré du serveur: " - }, - - "Initializing modules...": { - "fr": "Initialisation des modules..." - }, - - "No module to load.": { - "fr": "Aucun module à charger." - }, - - "Loading [[0]] module[[1]]:": { - "fr": "Lancement de [[0]] module[[1]]:" - }, - - "Help on this command": { - "fr": "Aide sur cette commande" - }, - - "This command can only be executed by [[0]].": { - "fr": "Cette commande ne peut être exécutée que par [[0]]." - }, - - "I can't execute this command in a DM channel!": { - "fr": "Je ne peux pas exécuter cette commande dans une conversation privée!" - }, - - "You do not have the permission to execute this command!": { - "fr": "Tu n'as pas la permission d'utiliser cette commande!" - }, - - "You did not give any argument, [[0]]!": { - "fr": "Tu n'as pas fourni d'argument, [[0]]!" - }, - - "\nCorrect usage is `[[0]][[1]] [[2]]`": { - "fr": "\nL'utilisation appropriée est: `[[0]][[1]] [[2]]`" - }, - - "You must wait [[0]] seconds before using the `[[1]]` command again.": { - "fr": "Tu dois attendre encore [[0]] seconde(s) avant de réutiliser la commande `[[1]]`." - }, - - "An error occured while trying to run this command.": { - "fr": "Il y a eu une erreur lors de l'exécution de cette commande." - }, - - "Ready! Connected as [[0]].": { - "fr": "Prêt! Connecté en tant que [[0]]." - }, - - "An error occured while executing this menu option.": { - "fr": "Il y a eu une erreur avec l'exécution de cette option du menu." - }, - - "An error occured while executing this command.": { - "fr": "Il y a eu une erreur avec l'exécution de cette commande." - }, - - "An error occured while trying to execute a trigger.": { - "fr": "Il y a eu une erreur avec l'exécution d'un trigger." - }, - - "Bot name updated to [[0]].": { - "fr": "Nom du bot mis à jour pour [[0]]." - }, - - "There was an error with this button!": { - "fr": "Il y a eu une erreur avec ce bouton!" - }, - - "There was an error with this menu option!": { - "fr": "Il y a eu une erreur avec cette option du menu!" - }, - - "Hello [[0]]! My prefix is `[[1]]`, you can get help with the `[[1]]help` command.": { - "fr": "Bonjour [[0]]! Mon préfixe est `[[1]]`, tu peux obtenir de l'aide en faisait `[[1]]help`." - }, - - "An error occured while trying to load manifest file of module [[0]].": { - "fr": "Une erreur est survenue lors du chargement du fichier manifeste du module [[0]]." - }, - - "Loading manifests...": { - "fr": "Chargement des manifestes..." - }, - - "Found [[0]] modules.": { - "fr": "[[0]] modules trouvés." - }, - - " -> This module does not support the [[0]] language!": { - "fr": " -> Ce module ne supporte pas la langue [[0]]!" - } - - } -} \ No newline at end of file diff --git a/ab-core/logger.js b/ab-core/logger.js deleted file mode 100644 index 42be98a..0000000 --- a/ab-core/logger.js +++ /dev/null @@ -1,38 +0,0 @@ -const chalk = require("chalk"); - -module.exports = { - /** - * Log message to console, with proper coloring and prefix. - * - * @author Artivain - * @since v1.5.3 - * @param {string} name Name of the module sending the log. - * @param {string} msg Message to send. - * @param {("log"|"warn"|"err"|"debug"|"info")} type Type of message. - * @param {boolean} isCore Is this message sent from the core? Probably not. - */ - - log(name, msg, type = "log", isCore = false) { - type = type.toLowerCase(); - if (isCore) { - var prefix = chalk.green(`[${name}]`); - } else { - var prefix = chalk.blue(`[${name}]`); - }; - - if (type == "err" || type == "error") { - var content = chalk.red(msg); - } else if (type == "warn" || type == "warning") { - var content = chalk.yellow(msg); - } else if (type == "debug") { - var content = chalk.white(msg); - prefix += chalk.magenta(" (debug)"); - } else if (type == "log") { - var content = chalk.gray(msg); - } else if (type == "info" || type == "infos") { - var content = chalk.cyan(msg); - } else throw new Error(`[Logger] log: "${type}" is not a valid type. Valid values are: "log", "warn", "err", "debug", "info".`); - - console.log(prefix, content); - } -}; \ No newline at end of file diff --git a/ab-core/messages/onMention.js b/ab-core/messages/onMention.js deleted file mode 100644 index b841393..0000000 --- a/ab-core/messages/onMention.js +++ /dev/null @@ -1,16 +0,0 @@ -const { prefix, locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - async execute(message) { - return message.channel.send( - localizer.__("Hello [[0]]! My prefix is `[[1]]`, you can get help with the `[[1]]help` command.", { placeholders: [message.author, prefix] }) - ); - } -}; diff --git a/ab-modules/core/index.js b/ab-modules/core/index.js deleted file mode 100644 index 1568bd3..0000000 --- a/ab-modules/core/index.js +++ /dev/null @@ -1,113 +0,0 @@ -// Manifest file for core module -// Also manage localizer - -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - filePath: path.resolve(__dirname, "locales.json"), - lang: locale -}); - -module.exports = { - localizer, - - manifest: { - - manifestVersion: 1, - moduleVersion: require("../../package.json").version, - name: "Artibot Core", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - - // Commands - { - id: "help", - type: "command", - path: "src/commands/help.js" - }, - { - id: "info", - type: "command", - path: "src/commands/info.js" - }, - { - id: "ping", - type: "command", - path: "src/commands/ping.js" - }, - { - id: "update", - type: "command", - path: "src/commands/update.js" - }, - { - id: "reload", - type: "command", - path: "src/commands/reload.js" - }, - { - id: "resetinteractions", - type: "command", - path: "src/commands/resetinteractions.js" - }, - - // Slash commands - { - id: "embed", - type: "slashcommand", - path: "src/slash-commands/embed.js" - }, - { - id: "help", - type: "slashcommand", - path: "src/slash-commands/help.js" - }, - { - id: "info", - type: "slashcommand", - path: "src/slash-commands/info.js" - }, - { - id: "ping", - type: "slashcommand", - path: "src/slash-commands/ping.js" - }, - - // User menu - { - id: "avatar", - type: "usermenu", - path: "src/user-menu/avatar.js" - }, - { - id: "informations", - type: "usermenu", - path: "src/user-menu/informations.js" - }, - - // Message menu - { - id: "react", - type: "messagemenu", - path: "src/message-menu/react.js" - }, - - // Buttons - { - id: "delete", - type: "button", - path: "src/buttons/delete.js" - }, - { - id: "registerinteractions", - type: "button", - path: "src/buttons/registerinteractions.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/core/src/commands/help.js b/ab-modules/core/src/commands/help.js deleted file mode 100644 index 888ab04..0000000 --- a/ab-modules/core/src/commands/help.js +++ /dev/null @@ -1,96 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const { localizer } = require("../../index"); - -module.exports = { - name: "help", - description: localizer._("Gives a list of available commands."), - aliases: ["commands", "aide"], - usage: localizer._("[name of the command]"), - cooldown: 5, - - /** - * Called when the command is executed - * @param {Message} message - The message from Discord - * @param {string[]} args - List of the arguments from the message - * @param {Object} commons - Commons from Artibot - */ - execute(message, args, { log, config }) { - const { commands } = message.client; - - // If there are no args, it means it needs whole help command. - - if (!args.length) { - - let helpEmbed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(localizer._("List of all available commands")) - .setDescription("`" + commands.map(({ command }) => command.name).join("`, `") + "`") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .addField( - localizer._("Usage"), - localizer.__("You can send `[[0]]help [name of the command]` to get more info on a specific command!", { placeholders: [config.prefix] }) - ); - - // Attempts to send embed in DMs. - - return message.author - .send({ embeds: [helpEmbed] }) - - .then(() => { - if (message.channel.type === "dm") return; - - // On validation, reply back. - - message.reply({ content: localizer._("I sent you a DM with the list of all my commands") }); - }) - .catch((error) => { - // On failing, throw error. - - log("Core", `${localizer.__("Impossible to send the list of commands in DM to [[0]]. Details of the error:", { placeholders: [message.author.tag] })} ${error}`, "warn", true); - - message.reply({ content: localizer._("Looks like it's impossible for me to send you a DM!") }); - }); - } - - // If argument is provided, check if it's a command. - - const name = args[0].toLowerCase(); - - const data = - commands.get(name) || - commands.find((c) => c.aliases && c.aliases.includes(name)); - - // If it's an invalid command. - - if (!data) { - return message.reply({ content: "`" + args[0] + "` " + localizer._("is not a valid command...") }); - }; - - const { command } = data; - - let commandEmbed = new MessageEmbed() - .setColor(config.embedColor) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setTitle(localizer._("Help on a command")); - - if (command.description) - commandEmbed.setDescription(`${command.description}`); - - if (command.aliases) - commandEmbed - .addField(localizer._("Alias"), `\`${command.aliases.join(", ")}\``, true) - .addField(localizer._("Cooldown"), `${command.cooldown || 3} ${localizer._("second(s)")}`, true); - if (command.usage) - commandEmbed.addField( - localizer._("Usage"), - `\`${config.prefix}${command.name} ${command.usage}\``, - true - ); - - // Finally send the embed. - - message.channel.send({ embeds: [commandEmbed] }); - }, -}; diff --git a/ab-modules/core/src/buttons/delete.js b/core/buttons/delete.js similarity index 100% rename from ab-modules/core/src/buttons/delete.js rename to core/buttons/delete.js diff --git a/ab-modules/core/src/buttons/registerinteractions.js b/core/buttons/registerinteractions.js similarity index 100% rename from ab-modules/core/src/buttons/registerinteractions.js rename to core/buttons/registerinteractions.js diff --git a/core/commands/help.js b/core/commands/help.js new file mode 100644 index 0000000..ef178fa --- /dev/null +++ b/core/commands/help.js @@ -0,0 +1,82 @@ +import { Embed } from "../../index.js"; + +/** + * @param {Message} message + * @param {string[]} args + * @param {Artibot} artibot + */ +export default async function helpCommand(message, args, artibot) { + const { localizer } = artibot; + const { commands } = artibot.modules; + + // If there are no args, it means it needs whole help command. + + if (!args.length) { + + let helpEmbed = new Embed() + .setTitle(localizer._("List of all available commands")) + .setDescription("`" + commands.map(({ command }) => command.name).join("`, `") + "`") + .addField( + localizer._("Usage"), + localizer.__("You can send `[[0]]help [name of the command]` to get more info on a specific command!", { placeholders: [config.prefix] }) + ); + + // Attempts to send embed in DMs. + + return message.author + .send({ embeds: [helpEmbed] }) + + .then(() => { + if (message.channel.type === "dm") return; + + // On validation, reply back. + + message.reply({ content: localizer._("I sent you a DM with the list of all my commands") }); + }) + .catch((error) => { + // On failing, throw error. + + log("Core", `${localizer.__("Impossible to send the list of commands in DM to [[0]]. Details of the error:", { placeholders: [message.author.tag] })} ${error}`, "warn", true); + + message.reply({ content: localizer._("Looks like it's impossible for me to send you a DM!") }); + }); + } + + // If argument is provided, check if it's a command. + + const name = args[0].toLowerCase(); + + const data = + commands.get(name) || + commands.find((c) => c.aliases && c.aliases.includes(name)); + + // If it's an invalid command. + + if (!data) { + return message.reply({ content: "`" + args[0] + "` " + localizer._("is not a valid command...") }); + }; + + const { command } = data; + + let commandEmbed = new Embed().setTitle(localizer._("Help on a command")); + + if (command.description) commandEmbed.setDescription(`${command.description}`); + + if (command.aliases) { + commandEmbed + .addField(localizer._("Alias"), `\`${command.aliases.join(", ")}\``, true) + .addField(localizer._("Cooldown"), `${command.cooldown || 3} ${localizer._("second(s)")}`, true); + } + + if (command.usage) { + commandEmbed.addField( + localizer._("Usage"), + `\`${config.prefix}${command.name} ${command.usage}\``, + true + ); + } + + // Finally send the embed. + + message.channel.send({ embeds: [commandEmbed] }); +} \ No newline at end of file diff --git a/ab-modules/core/src/commands/info.js b/core/commands/info.js similarity index 100% rename from ab-modules/core/src/commands/info.js rename to core/commands/info.js diff --git a/ab-modules/core/src/commands/ping.js b/core/commands/ping.js similarity index 100% rename from ab-modules/core/src/commands/ping.js rename to core/commands/ping.js diff --git a/ab-modules/core/src/commands/reload.js b/core/commands/reload.js similarity index 100% rename from ab-modules/core/src/commands/reload.js rename to core/commands/reload.js diff --git a/ab-modules/core/src/commands/resetinteractions.js b/core/commands/resetinteractions.js similarity index 100% rename from ab-modules/core/src/commands/resetinteractions.js rename to core/commands/resetinteractions.js diff --git a/ab-modules/core/src/commands/update.js b/core/commands/update.js similarity index 100% rename from ab-modules/core/src/commands/update.js rename to core/commands/update.js diff --git a/core/index.js b/core/index.js new file mode 100644 index 0000000..03154f1 --- /dev/null +++ b/core/index.js @@ -0,0 +1,128 @@ +import { Command, Module } from "../index.js"; +import helpCommand from "./commands/help.js"; + +/** + * Create the Core module + * @param {Artibot} artibot + * @returns {Module} Artibot Core Module + */ +export default function coreModule(artibot) { + const { localizer } = artibot; + + return new Module({ + name: "Artibot Core", + langs: ["en", "fr"], + parts: [ + // Commands + new Command({ + id: "help", + name: "help", + description: localizer._("Gives a list of available commands."), + aliases: ["commands", "aide"], + usage: localizer._("[name of the command]"), + cooldown: 5, + mainFunction: helpCommand + }) + ] + }); + + asd = { + manifest: { + + manifestVersion: 1, + moduleVersion: require("../../package.json").version, + name: "Artibot Core", + supportedLocales: [ + "en", + "fr" + ], + parts: [ + + // Commands + { + id: "help", + type: "command", + path: "src/commands/help.js" + }, + { + id: "info", + type: "command", + path: "src/commands/info.js" + }, + { + id: "ping", + type: "command", + path: "src/commands/ping.js" + }, + { + id: "update", + type: "command", + path: "src/commands/update.js" + }, + { + id: "reload", + type: "command", + path: "src/commands/reload.js" + }, + { + id: "resetinteractions", + type: "command", + path: "src/commands/resetinteractions.js" + }, + + // Slash commands + { + id: "embed", + type: "slashcommand", + path: "src/slash-commands/embed.js" + }, + { + id: "help", + type: "slashcommand", + path: "src/slash-commands/help.js" + }, + { + id: "info", + type: "slashcommand", + path: "src/slash-commands/info.js" + }, + { + id: "ping", + type: "slashcommand", + path: "src/slash-commands/ping.js" + }, + + // User menu + { + id: "avatar", + type: "usermenu", + path: "src/user-menu/avatar.js" + }, + { + id: "informations", + type: "usermenu", + path: "src/user-menu/informations.js" + }, + + // Message menu + { + id: "react", + type: "messagemenu", + path: "src/message-menu/react.js" + }, + + // Buttons + { + id: "delete", + type: "button", + path: "src/buttons/delete.js" + }, + { + id: "registerinteractions", + type: "button", + path: "src/buttons/registerinteractions.js" + } + ] + } + }; +} \ No newline at end of file diff --git a/ab-modules/core/src/message-menu/react.js b/core/message-menu/react.js similarity index 100% rename from ab-modules/core/src/message-menu/react.js rename to core/message-menu/react.js diff --git a/ab-modules/core/src/slash-commands/embed.js b/core/slash-commands/embed.js similarity index 100% rename from ab-modules/core/src/slash-commands/embed.js rename to core/slash-commands/embed.js diff --git a/ab-modules/core/src/slash-commands/help.js b/core/slash-commands/help.js similarity index 100% rename from ab-modules/core/src/slash-commands/help.js rename to core/slash-commands/help.js diff --git a/ab-modules/core/src/slash-commands/info.js b/core/slash-commands/info.js similarity index 100% rename from ab-modules/core/src/slash-commands/info.js rename to core/slash-commands/info.js diff --git a/ab-modules/core/src/slash-commands/ping.js b/core/slash-commands/ping.js similarity index 100% rename from ab-modules/core/src/slash-commands/ping.js rename to core/slash-commands/ping.js diff --git a/ab-modules/core/src/user-menu/avatar.js b/core/user-menu/avatar.js similarity index 100% rename from ab-modules/core/src/user-menu/avatar.js rename to core/user-menu/avatar.js diff --git a/ab-modules/core/src/user-menu/informations.js b/core/user-menu/informations.js similarity index 100% rename from ab-modules/core/src/user-menu/informations.js rename to core/user-menu/informations.js diff --git a/events/buttonInteraction.js b/events/buttonInteraction.js new file mode 100644 index 0000000..3a81021 --- /dev/null +++ b/events/buttonInteraction.js @@ -0,0 +1,48 @@ +import log from "../logger.js"; +import Artibot from "../index.js"; +import { Interaction } from "discord.js"; + +export const name = "interactionCreate"; + +/** + * Event listener for button interactions + * @param {Interaction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + // Deconstructed client from interaction object. + const { client } = interaction; + + // Checks if the interaction is a button interaction (to prevent weird bugs) + if (!interaction.isButton()) return; + + let data = artibot.modules.find(module => module.parts.find(part => part.id = interaction.customId)); + + if (!data) + data = client.buttonCommands.find((v, id) => { + /** @type {string[]} */ + const parts = id.split("*"); + return interaction.customId.startsWith(parts[0]); + }); + + // If the interaction is not a registered button, return error message. + if (!data) { + await require("../messages/defaultButtonError").execute(interaction); + return; + }; + + const { command } = data; + + // A try to execute the button. + try { + await command.execute(interaction, commons); + return; + } catch (err) { + log("ButtonManager", err, "warn", true); + await interaction.reply({ + content: localizer._("An error occured when executing this button..."), + ephemeral: true, + }); + return; + } +} diff --git a/events/contextInteraction.js b/events/contextInteraction.js new file mode 100644 index 0000000..a6925d5 --- /dev/null +++ b/events/contextInteraction.js @@ -0,0 +1,72 @@ +import { Interaction } from "discord.js"; +import Artibot, { log } from "../index.js"; + +export const name = "interactionCreate"; + +/** + * Context interaction listener + * @param {Interaction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + // Deconstructed client from interaction object. + const { client } = interaction; + + // Checks if the interaction is a button interaction (to prevent weird bugs) + if (!interaction.isContextMenu()) + return; + + // Don't execute interactions in DM channels + if (!interaction.channel) + return interaction.reply({ + content: localizer._("This is disabled in DM channels."), + ephemeral: true + }); + + /**********************************************************************/ + // Checks if the interaction target was a user + if (interaction.targetType === "USER") { + + const { command } = client.contextCommands.get("USER " + interaction.commandName); + + // A try to execute the interaction. + try { + await command.execute(interaction, commons); + return; + } catch (err) { + log("InteractionManager", err, "warn", true); + await interaction.reply({ + content: localizer._("An error occured when executing this interaction..."), + ephemeral: true, + }); + return; + } + } + + // Checks if the interaction target was a message + else if (interaction.targetType === "MESSAGE") { + + const { command } = client.contextCommands.get("MESSAGE " + interaction.commandName); + + // A try to execute the interaction. + try { + await command.execute(interaction, commons); + return; + } catch (err) { + log("InteractionManager", err, "warn", true); + await interaction.reply({ + content: localizer._("An error occured when executing this interaction..."), + ephemeral: true, + }); + return; + } + } + + + + // Practically not possible, but we are still catching the bug. + // Possible Fix is a restart! + else { + return log("InteractionManager", localizer._("Something weird happened with the menu. Received an unknown menu type."), "warn", true); + }; +} diff --git a/events/guildCreate.js b/events/guildCreate.js new file mode 100644 index 0000000..a02efa6 --- /dev/null +++ b/events/guildCreate.js @@ -0,0 +1,13 @@ +import { Guild } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "guildCreate"; + +/** + * Added to guild event listener + * @param {Guild} guild + * @param {Artibot} artibot + */ +export async function execute(guild, artibot) { + artibot.log("Artibot", artibot.localizer._("Added to a new server: ") + guild.name, "log", true); +} \ No newline at end of file diff --git a/events/guildDelete.js b/events/guildDelete.js new file mode 100644 index 0000000..81d1f0e --- /dev/null +++ b/events/guildDelete.js @@ -0,0 +1,13 @@ +import { Guild } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "guildDelete"; + +/** + * + * @param {Guild} guild + * @param {Artibot} artibot + */ +export async function execute(guild, artibot) { + artibot.log("Artibot", artibot.localizer._("Removed from server: ") + guild.name, "log", true); +} \ No newline at end of file diff --git a/events/initModulesParts.js b/events/initModulesParts.js new file mode 100644 index 0000000..93f863a --- /dev/null +++ b/events/initModulesParts.js @@ -0,0 +1,18 @@ +import { Client } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "ready"; +export const once = true; + +/** + * Modules initializer + * @param {Client} client + * @param {Artibot} artibot + */ +export function execute(client, artibot) { + artibot.modules.forEach(module => { + module.parts.forEach(part => { + if (part.init && typeof part.init == "function") part.init(artibot); + }); + }); +} \ No newline at end of file diff --git a/events/messageCreate.js b/events/messageCreate.js new file mode 100644 index 0000000..5128bee --- /dev/null +++ b/events/messageCreate.js @@ -0,0 +1,129 @@ +import { Collection, Message, MessageEmbed } from "discord.js"; +import Artibot from "../index.js"; +import onMention from "../messages/onMention.js" + +// Prefix regex, we will use to match in mention prefix. +const escapeRegex = (string) => { + return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +}; + +export const name = "messageCreate"; + +/** + * Message event listener + * @param {Message} message + * @param {Artibot} artibot + */ +export async function execute(message, artibot) { + // Declares const to be used. + const { client, guild, channel, content, author } = message; + const { log, localizer, config } = artibot; + + // Checks if the bot is mentioned in the message all alone and triggers onMention trigger. + if (message.content == `<@${client.user.id}>` || message.content == `<@!${client.user.id}>`) { + return onMention(message, artibot); + } + + const checkPrefix = config.prefix.toLowerCase(); + + // Regex expression for mention prefix + const prefixRegex = new RegExp( + `^(<@!?${client.user.id}>|${escapeRegex(checkPrefix)})\\s*` + ); + + // Checks if message content in lower case starts with bot's mention. + if (!prefixRegex.test(content.toLowerCase())) return; + + // Checks and returned matched prefix, either mention or prefix in config. + const [matchedPrefix] = content.toLowerCase().match(prefixRegex); + + // The Message Content of the received message seperated by spaces (' ') in an array, this excludes prefix and command/alias itself. + const args = content.slice(matchedPrefix.length).trim().split(/ +/); + + // Name of the command received from first argument of the args array. + const commandName = args.shift().toLowerCase(); + + // Check if mesage does not starts with prefix, or message author is bot. If yes, return. + if (!message.content.startsWith(matchedPrefix) || message.author.bot) + return; + + const data = client.commands.get(commandName) || client.commands.find(({ command }) => command.aliases && command.aliases.includes(commandName)); + + // It it's not a command, don't try to execute anything + if (!data) + return; + + const { command } = data; + + // Owner Only Property, add in your command properties if true. + if (command.ownerOnly && message.author.id !== ownerId) { + let embedOwner = new MessageEmbed() + .setColor("RED") + .setFooter({ text: config.botName, iconURL: config.botIcon }) + .setTimestamp() + .setTitle(localizer._("Help on this command")) + .setDescription(localizer.__("This command can only be executed by [[0]].", { placeholders: [`<@${ownerId}>`] })); + return message.reply({ embeds: [embedOwner] }); + } + + // Guild Only Property, add in your command properties if true. + if (command.guildOnly && message.channel.type === "dm") { + return message.reply({ + content: localizer._("I can't execute this command in a DM channel!"), + }); + } + + // Author perms property + if (command.permissions) { + const authorPerms = message.channel.permissionsFor(message.author); + if (!authorPerms || !authorPerms.has(command.permissions)) { + return message.reply({ content: localizer._("You do not have the permission to execute this command!") }); + } + } + + // Args missing + if (command.args && !args.length) { + let reply = localizer.__("You did not give any argument, [[0]]!", { placeholders: [message.author] }); + + if (command.usage) { + reply += localizer.__("\nCorrect usage is `[[0]][[1]] [[2]]`", { placeholders: [prefix, command.name, command.usage] }); + } + + return message.channel.send({ content: reply }); + } + + // Cooldowns + const { cooldowns } = client; + + if (!cooldowns.has(command.name)) { + cooldowns.set(command.name, new Collection()); + } + + const now = Date.now(); + const timestamps = cooldowns.get(command.name); + const cooldownAmount = (command.cooldown || 3) * 1000; + + if (timestamps.has(message.author.id)) { + const expirationTime = timestamps.get(message.author.id) + cooldownAmount; + + if (now < expirationTime) { + const timeLeft = (expirationTime - now) / 1000; + return message.reply({ + content: localizer.__("You must wait [[0]] seconds before using the `[[1]]` command again.", { placeholders: [timeLeft.toFixed(1), command.name] }) + }); + } + } + + timestamps.set(message.author.id, now); + setTimeout(() => timestamps.delete(message.author.id), cooldownAmount); + + // execute the final command. Put everything above this. + try { + command.execute(message, args, commons); + } catch (error) { + log("CommandManager", error, "warn", true); + message.reply({ + content: localizer._("An error occured while trying to run this command.") + }); + } +} \ No newline at end of file diff --git a/events/onReadyMessage.js b/events/onReadyMessage.js new file mode 100644 index 0000000..18dc614 --- /dev/null +++ b/events/onReadyMessage.js @@ -0,0 +1,15 @@ +import { Client } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "ready"; +export const once = true; + +/** + * Send ready message + * @param {Client} client + * @param {Artibot} artibot + */ +export function execute(client, artibot) { + const { log, localizer } = artibot; + log("Artibot", localizer.__("Ready! Connected as [[0]].", { placeholders: [client.user.tag] }), "info", true); +} \ No newline at end of file diff --git a/events/pterodactylStart.js b/events/pterodactylStart.js new file mode 100644 index 0000000..cf1e617 --- /dev/null +++ b/events/pterodactylStart.js @@ -0,0 +1,11 @@ +export const name = "ready"; +export const once = true; + +/** + * Send pterodactyl started trigger + */ +export function execute() { + if (process.env.RUNS_IN_PTERODACTYL) { + console.log("Pterodactyl start trigger"); + }; +} \ No newline at end of file diff --git a/events/selectInteraction.js b/events/selectInteraction.js new file mode 100644 index 0000000..ff6aeb9 --- /dev/null +++ b/events/selectInteraction.js @@ -0,0 +1,41 @@ +import { Interaction } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "interactionCreate"; + +/** + * + * @param {Interaction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + const { client } = interaction; + const { log, localizer } = artibot; + + // Checks if the interaction is a select menu interaction + if (!interaction.isSelectMenu()) + return; + + const data = client.selectCommands.get(interaction.customId); + + // If the interaction is not a registered dropdown, return error message. + if (!data) { + await require("../messages/defaultSelectError").execute(interaction); + return; + }; + + const { command } = data; + + // A try to execute the interaction. + try { + await command.execute(interaction, commons); + return; + } catch (err) { + log("ButtonManager", err, "warn", true); + await interaction.reply({ + content: localizer._("An error occured while executing this menu option."), + ephemeral: true, + }); + return; + }; +} diff --git a/events/slashCreate.js b/events/slashCreate.js new file mode 100644 index 0000000..a24ef01 --- /dev/null +++ b/events/slashCreate.js @@ -0,0 +1,38 @@ +import { Interaction } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "interactionCreate"; + +/** + * Slash command listener + * @param {Interaction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + // Deconstructed client from interaction object. + const { client } = interaction; + const { log, localizer } = artibot; + + // Checks if the interaction is a command (to prevent weird bugs) + if (!interaction.isCommand()) + return; + + const data = client.slashCommands.get(interaction.commandName); + + // If the interaction is not a command in cache. + if (!data) + return; + + const { command } = data; + + // A try to executes the interaction. + try { + await command.execute(interaction, commons); + } catch (err) { + log("SlashManager", err, "warn", true); + await interaction.reply({ + content: localizer._("An error occured while executing this command."), + ephemeral: true + }); + }; +} diff --git a/events/triggerCreate.js b/events/triggerCreate.js new file mode 100644 index 0000000..10dd097 --- /dev/null +++ b/events/triggerCreate.js @@ -0,0 +1,45 @@ +import { Message } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "messageCreate"; + +/** + * Trigger event listener + * @param {Message} message + * @param {Artibot} artibot + */ +export async function execute(message, artibot) { + // Ignore bots + if (message.author.bot) return; + + const { log, localizer } = artibot; + + // Checking ALL triggers using every function and breaking out if a trigger was found. + let check = false; + + artibot.modules.forEach(async (module) => { + if (check) return false; + module.parts.forEach(async (part) => { + if (check) return false; + if (part.type != "trigger") return false; + + part.triggers.forEach(async(trigger) => { + // If validated, it will try to execute the trigger. + if (message.content.includes(trigger)) { + try { + command.execute(message, commons); + } catch (error) { + // If checks fail, reply back! + log("TriggerManager", error, "warn", true); + message.reply({ + content: localizer._("An error occured while trying to execute a trigger."), + }); + }; + + check = true; + return false; + }; + }); + }); + }); +} diff --git a/events/updateBotName.js b/events/updateBotName.js new file mode 100644 index 0000000..a17bf03 --- /dev/null +++ b/events/updateBotName.js @@ -0,0 +1,18 @@ +import { Client } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "ready"; +export const once = true; + +/** + * Make sure the bot has the good name on startup + * @param {Client} client + * @param {Artibot} artibot + */ +export function execute(client, artibot) { + const { log, localizer, config } = artibot; + if (client.user.username != config.botName) { + client.user.setUsername(config.botName) + .then(log("Artibot", localizer.__("Bot name updated to [[0]].", { placeholders: [config.botName] }), "log", true)); + }; +} \ No newline at end of file diff --git a/ab-core/index.js b/index-old.js similarity index 100% rename from ab-core/index.js rename to index-old.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..3ffa4b5 --- /dev/null +++ b/index.js @@ -0,0 +1,255 @@ +import InteractionManager from "./interactionManager.js"; +import logger from "./logger.js"; +import Localizer from "artibot-localizer"; +import chalk from "chalk"; +import figlet from "figlet"; +import { Client, Intents, MessageEmbed } from "discord.js"; +import { createRequire } from 'module'; +const require = createRequire(import.meta.url); +const { version } = require('./package.json'); + +import coreModule from "./core/index.js"; +import { readdirSync } from "fs"; + +/** + * Powerful Discord bot system. + * @author Artivain + * @author Thomas Fournier + * @see https://github.com/Artivain/artibot + * @license GPL-3.0-or-later + */ +export default class Artibot { + /** + * @param {Object} config - Configuration for Artibot + * @param {Snowflake} config.ownerId - Discord ID of the owner of the bot + * @param {Snowflake} [config.testGuildId] - Discord ID of the testing guild. Not required if devMode is set to false. + * @param {string} [config.botName] - Name of the Discord bot. Used almost everywhere. + * @param {string} [config.botIcon] - URL of the profile picture of the bot + * @param {string} [config.prefix] - Prefix for the commands + * @param {boolean} [config.devMode] - Set to false if the bot must be used in more than one server. Interactions could take more time to refresh. + * @param {string} [config.lang] - Set the lang of the bot + * @param {string} [config.embedColor] - Color for the embeds sent by the bot + * @param {boolean} [config.advancedCorePing] - Set to false if you want to hide advanced infos from ping commands + * @param {boolean} [config.checkForUpdates] - Set to false if you don't want the bot to check for new updates + */ + constructor({ + ownerId, + testGuildId, + botName = "Artibot", + botIcon = "https://assets.artivain.com/fav/bots/artibot-512.jpg", + prefix = "ab ", + devMode = true, + lang = "en", + embedColor = "#06476d", + advancedCorePing = true, + checkForUpdates = true + }) { + // Verify that the owner ID is set + if (!ownerId) throw new Error("You must set the owner ID."); + + // Verify that if dev mode is false, the test guild ID is set + if (!devMode && !testGuildId) throw new Error("You must set the testGuildId if devMode is false."); + + // Create a localizer for the core + this.localizer = new Localizer({ + filePath: "locales.json", + lang + }); + + // Save all configs to the bot config + this.config = { + ownerId, + testGuildId, + botName, + botIcon, + prefix, + devMode, + lang, + embedColor, + advancedCorePing, + checkForUpdates + } + + this.version = version; + + // Send artwork to console + console.log(chalk.blue(figlet.textSync('Artibot', { + font: 'ANSI Shadow', + horizontalLayout: 'fitted' + }))); + log("Artibot", "Initialized! v" + version, "info", true); + + /** + * List of registered modules + * @type {Module[]} + */ + this.modules = []; + + // Register the Core module + this.registerModule(coreModule(this)); + } + + log = log; + + /** + * @param {Object} config - Advanced config for the bot + * @param {string} config.token - The login token for the Discord bot + * @param {IntentsResolvable[]} [config.additionalIntents] - Additional intents to register in the Discord client + */ + async login({ token, additionalIntents = [] }) { + this.modules.forEach(module => additionalIntents = additionalIntents.concat(module.additionalIntents)); + this.client = new Client({ + intents: [ + Intents.FLAGS.GUILDS, + Intents.FLAGS.GUILD_MESSAGES, + Intents.FLAGS.GUILD_MESSAGE_REACTIONS, + Intents.FLAGS.GUILD_VOICE_STATES, + Intents.FLAGS.GUILD_MEMBERS, + Intents.FLAGS.GUILD_PRESENCES, + ...additionalIntents + ] + }); + + this.listeners = []; + + const eventFiles = readdirSync("./events").filter(file => file.endsWith(".js")); + + for (const file of eventFiles) { + const { name, execute, once } = await import(`./events/${file}`); + if (once) { + this.client.once(name, (...args) => execute(...args, this)); + } else { + this.client.on(name, async (...args) => await execute(...args, this)); + }; + }; + + this.client.login(token); + } + + /** + * Register a module in Artibot + * @param {Module} module - The module to register + */ + registerModule(module) { + this.modules.push(module); + log("Artibot", "Registered module: " + module.name, "info", true); + module.parts.forEach(part => log("Artibot", `- [${part.type}] ${part.id}`, "log", true)); + } +} + +/** + * Base class for Artibot modules + */ +export class Module { + /** + * Any module part type. + * @typedef {Command|SlashCommand} ModulePartResolvable + */ + + /** + * @param {Object} config - Configuration for the module + * @param {string} config.name - Name of the module + * @param {string} config.version - Version of the module (ex.: "1.2.3") + * @param {string[]} config.langs - List of supported languages (ex.: "en", "fr") + * @param {ModulePartResolvable[]} config.parts - List of parts of the module + * @param {IntentsResolvable[]} [config.intents] - List of required intents + */ + constructor({ name, version, langs, parts, intents = [] }) { + this.name = name; + this.version = version; + this.langs = langs; + this.parts = parts; + this.additionalIntents = intents; + } +} + +/** + * Base class for module parts + */ +class BasePart { + /** + * @param {Object} config - Config for this part + * @param {string} config.id - ID of the part + * @param {string} config.type - Type of the part + * @param {function(): void} config.mainFunction - The function when the part is executed + * @param {function(): void} [config.initFunction] - The function executed on bot startup + */ + constructor({ id, type, mainFunction, initFunction }) { + if (!id || !type || !mainFunction) throw new Error("Missing parameter(s)"); + + this.id = id; + this.type = type; + this.execute = mainFunction; + this.init = initFunction; + } +} + +/** + * Command part for a module + * @extends BasePart + */ +export class Command extends BasePart { + /** + * @param {Object} config - Config for the command + * @param {string} config.id - ID of the command + * @param {string} config.name - Name of the command + * @param {string} [config.description] - Description of the command + * @param {string[]} [config.aliases] - List of alternative names + * @param {string} [config.usage] - Help text for the usage + * @param {number} [config.cooldown] - Cooldown for this command usage, in seconds + * @param {function(Message, string[], Artibot): void} config.mainFunction - Function to execute when the command is ran + * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup + */ + constructor({ id, name, description, aliases = [], usage, cooldown, mainFunction, initFunction }) { + super({ id, type: "command", mainFunction, initFunction }); + this.name = name; + this.description = description; + this.aliases = aliases; + this.usage = usage; + this.cooldown = cooldown; + } +} + +/** + * Slash command part for a module + * @extends BasePart + */ +export class SlashCommand extends BasePart { + /** + * @param {Object} config - Config for this command + * @param {string} config.id - ID of the command + * @param {SlashCommandBuilder} config.data - Data to register into the Discord API + * @param {function(Interaction, Artibot): void} config.mainFunction - Function to execute when the command is ran + * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup + */ + constructor({ id, data, mainFunction, initFunction }) { + if (!data) throw new Error("Missing data parameter"); + super({ id, type: "slashcommand", mainFunction, initFunction }); + this.data = data; + } +} + +export class Embed extends MessageEmbed { + /** + * @param {Artibot} artibot + * @param {MessageEmbed|MessageEmbedOptions|APIEmbed} [data] + */ + constructor(artibot, data) { + super(data); + this.setColor(artibot.config.embedColor); + this.setFooter({ text: artibot.config.botName, iconURL: artibot.config.botIcon }); + this.setTimestamp(); + } +} + +/** + * Log message to console, with proper coloring and prefix. + * + * @author Artivain + * @since v1.5.3 + * @param {string} name Name of the module sending the log. + * @param {string} msg Message to send. + * @param {("log"|"warn"|"err"|"debug"|"info")} [type="log"] Type of message. + * @param {boolean} [isCore=false] Is this message sent from the core? Probably not. + */ +export const log = (name, msg, type, isCore) => logger(name, msg, type, isCore); \ No newline at end of file diff --git a/interactionManager.js b/interactionManager.js new file mode 100644 index 0000000..a1b9827 --- /dev/null +++ b/interactionManager.js @@ -0,0 +1,77 @@ +import { REST } from "@discordjs/rest"; +import { Routes } from "discord-api-types/v9"; +import log from "./logger.js"; +import Localizer from "artibot-localizer"; +import { resolve } from "path"; +import { Client } from "discord.js"; + +/** + * Interaction management utility for Artibot + */ +export default class InteractionManager { + /** + * @param {Object} parameters - Parameters for this InteractionManager + * @param {string} parameters.token - Token for the Discord bot + * @param {Snowflake} parameters.clientId - Client ID of the bot + * @param {Localizer} parameters.localizer - Lang that messages should be in + * @param {Snowflake} [parameters.testGuildId] - ID of the test Discord server (required only if devMode is true) + * @param {boolean} [parameters.devMode=true] - If set to true, it will register interactions only for the test guild + */ + constructor({ token, clientId, testGuildId, devMode = true, localizer }) { + this.rest = new REST({ version: "9" }); + this.commandJsonData = []; + this.rest.setToken(token); + + this.clientId = clientId; + this.testGuildId = testGuildId; + this.devMode = devMode; + this.localizer = localizer; + } + + /** + * Generate data to send to Discord API to register interactions + * @param {Client} client - The Discord client for the bot + */ + generateData(client) { + this.commandJsonData = [ + ...Array.from(client.slashCommands.values()).map(({ command }) => command.data.toJSON()), + ...Array.from(client.contextCommands.values()).map(({ command }) => command.data), + ]; + } + + /** + * Register interactions in Discord API + * @returns {boolean} True if everything went good, false if there was a problem. + */ + async register() { + try { + log("InteractionManager", this.localizer._("Initializing interactions and slash commands on Discord..."), "info", true); + + /* + Send slash commands and other interactions to Discord API. + There is 2 types of interactions, "guild" and "global". + "Guild" for interactions in only one server and "global" for interactions + in all the servers where the bot has perms. + In dev or in bots with only one server, use only "guild" interactions + since they can be refreshed more often and there is a shorter cache. + */ + if (this.devMode) { + await this.rest.put( + Routes.applicationGuildCommands(this.clientId, this.testGuildId), + { body: this.commandJsonData } + ); + } else { + await this.rest.put( + Routes.applicationCommands(this.clientId), + { body: this.commandJsonData } + ); + }; + + log("InteractionManager", this.localizer._("Interaction and slash commands initialized successfully."), "log", true); + return true; + } catch (error) { + log("InteractionManager", this.localizer._("An error occured when initializing interactions and slash commands, here are the details: ") + error, "warn", true); + return false; + }; + } +} \ No newline at end of file diff --git a/ab-core/loader.js b/loader.js similarity index 100% rename from ab-core/loader.js rename to loader.js diff --git a/ab-modules/core/locales.json b/locales.json similarity index 65% rename from ab-modules/core/locales.json rename to locales.json index 4232e49..803ab45 100644 --- a/ab-modules/core/locales.json +++ b/locales.json @@ -1,11 +1,208 @@ { - "version": "1.0.0", + "version": "3.0.0", "localizerVersion": 1, "default": "en", "contributors": [ "GoudronViande24" ], "strings": { + + "Configuration error: The [[0]] file does not exist.": { + "fr": "Erreur de configuration: Le fichier [[0]] est introuvable." + }, + + "Configuration error: The [[0]] file is invalid.": { + "fr": "Erreur de configuration: Le fichier [[0]] est invalide." + }, + + "Activating commands:": { + "fr": "Activation des commandes:" + }, + + "Activating slash commands:": { + "fr": "Activation des commandes slash:" + }, + + "Activating context menu on messages:": { + "fr": "Activation du menu contextuel sur les messages:" + }, + + "Activating context menu on users:": { + "fr": "Activation du menu contextuel sur les utilisateurs:" + }, + + "Activating buttons:": { + "fr": "Activation des boutons:" + }, + + "Activating select menus:": { + "fr": "Activation des menus déroulants:" + }, + + "Activating triggers:": { + "fr": "Activation des triggers:" + }, + + "Activating module": { + "fr": "Activation du module" + }, + + "No module to activate.": { + "fr": "Aucun module à charger." + }, + + "Artibot is up to date (v[[0]]).": { + "fr": "Artibot est à jour (v[[0]])." + }, + + "An update for Artibot is available!": { + "fr": "Une mise à jour est disponible pour Artibot!" + }, + + " - Installed version: [[0]]": { + "fr": " - Version actuelle: [[0]]" + }, + + " - Latest version: [[0]]": { + "fr": " - Dernière version: [[0]]" + }, + + "Configuration error!": { + "fr": "Erreur de configuration!" + }, + + "Check for updates is disabled in config": { + "fr": "Vérification des mises à jours désactivée dans la configuration" + }, + + "Initializing interactions and slash commands on Discord...": { + "fr": "Initialisation des interactions et des commandes slash auprès de Discord..." + }, + + "Interaction and slash commands initialized successfully.": { + "fr": "Interactions et commandes slash initialisées avec succès." + }, + + "An error occured when initializing interactions and slash commands, here are the details: ": { + "fr": "Une erreur est survenue avec l'initialisation des interactions et commandes slash, voici les détais: " + }, + + "An error occured when executing this button...": { + "fr": "Il y a eu un problème lors de l'exécution de ce bouton..." + }, + + "This is disabled in DM channels.": { + "fr": "Ceci est désactivé dans les messages privés." + }, + + "An error occured when executing this interaction...": { + "fr": "Il y a eu un problème avec l'exécution de l'interaction..." + }, + + "Something weird happened with the menu. Received an unknown menu type.": { + "fr": "Quelque chose de suspect est survenue avec le menu. Réception d'un type de menu inconnu." + }, + + "Added to a new server: ": { + "fr": "Ajouté à un nouveau serveur: " + }, + + "Removed from server: ": { + "fr": "Retiré du serveur: " + }, + + "Initializing modules...": { + "fr": "Initialisation des modules..." + }, + + "No module to load.": { + "fr": "Aucun module à charger." + }, + + "Loading [[0]] module[[1]]:": { + "fr": "Lancement de [[0]] module[[1]]:" + }, + + "Help on this command": { + "fr": "Aide sur cette commande" + }, + + "This command can only be executed by [[0]].": { + "fr": "Cette commande ne peut être exécutée que par [[0]]." + }, + + "I can't execute this command in a DM channel!": { + "fr": "Je ne peux pas exécuter cette commande dans une conversation privée!" + }, + + "You do not have the permission to execute this command!": { + "fr": "Tu n'as pas la permission d'utiliser cette commande!" + }, + + "You did not give any argument, [[0]]!": { + "fr": "Tu n'as pas fourni d'argument, [[0]]!" + }, + + "\nCorrect usage is `[[0]][[1]] [[2]]`": { + "fr": "\nL'utilisation appropriée est: `[[0]][[1]] [[2]]`" + }, + + "You must wait [[0]] seconds before using the `[[1]]` command again.": { + "fr": "Tu dois attendre encore [[0]] seconde(s) avant de réutiliser la commande `[[1]]`." + }, + + "An error occured while trying to run this command.": { + "fr": "Il y a eu une erreur lors de l'exécution de cette commande." + }, + + "Ready! Connected as [[0]].": { + "fr": "Prêt! Connecté en tant que [[0]]." + }, + + "An error occured while executing this menu option.": { + "fr": "Il y a eu une erreur avec l'exécution de cette option du menu." + }, + + "An error occured while executing this command.": { + "fr": "Il y a eu une erreur avec l'exécution de cette commande." + }, + + "An error occured while trying to execute a trigger.": { + "fr": "Il y a eu une erreur avec l'exécution d'un trigger." + }, + + "Bot name updated to [[0]].": { + "fr": "Nom du bot mis à jour pour [[0]]." + }, + + "There was an error with this button!": { + "fr": "Il y a eu une erreur avec ce bouton!" + }, + + "There was an error with this menu option!": { + "fr": "Il y a eu une erreur avec cette option du menu!" + }, + + "Hello [[0]]! My prefix is `[[1]]`, you can get help with the `[[1]]help` command.": { + "fr": "Bonjour [[0]]! Mon préfixe est `[[1]]`, tu peux obtenir de l'aide en faisait `[[1]]help`." + }, + + "An error occured while trying to load manifest file of module [[0]].": { + "fr": "Une erreur est survenue lors du chargement du fichier manifeste du module [[0]]." + }, + + "Loading manifests...": { + "fr": "Chargement des manifestes..." + }, + + "Found [[0]] modules.": { + "fr": "[[0]] modules trouvés." + }, + + " -> This module does not support the [[0]] language!": { + "fr": " -> Ce module ne supporte pas la langue [[0]]!" + }, + "Gives a list of available commands.": { "fr": "Donne une liste des commandes disponibles." }, @@ -210,10 +407,6 @@ "fr": "Problème avec la mise à jour: " }, - "Artibot is up to date (v[[0]]).": { - "fr": "Artibot est à jours (v[[0]])." - }, - "An update is available: v[[0]] --> v[[1]].\n**Read carefully the documentation before updating!**\nTo install the update, execute the `update force` command.": { "fr": "Une mise à jour est disponible: v[[0]] --> v[[1]].\n**Bien lire la documentation avant de faire la mise à jour!**\nPour faire la mise à jour, faire la commande `update force`." }, @@ -385,5 +578,6 @@ "Learn more": { "fr": "En savoir plus" } + } } \ No newline at end of file diff --git a/logger.js b/logger.js new file mode 100644 index 0000000..e5eaba4 --- /dev/null +++ b/logger.js @@ -0,0 +1,35 @@ +import chalk from "chalk"; + +/** + * Log message to console, with proper coloring and prefix. + * + * @author Artivain + * @since v1.5.3 + * @param {string} name Name of the module sending the log. + * @param {string} msg Message to send. + * @param {("log"|"warn"|"err"|"debug"|"info")} [type="log"] Type of message. + * @param {boolean} [isCore=false] Is this message sent from the core? Probably not. + */ +export default function log(name, msg, type = "log", isCore = false) { + type = type.toLowerCase(); + if (isCore) { + var prefix = chalk.green(`[${name}]`); + } else { + var prefix = chalk.blue(`[${name}]`); + } + + if (type == "err" || type == "error") { + var content = chalk.red(msg); + } else if (type == "warn" || type == "warning") { + var content = chalk.yellow(msg); + } else if (type == "debug") { + var content = chalk.white(msg); + prefix += chalk.magenta(" (debug)"); + } else if (type == "log") { + var content = chalk.gray(msg); + } else if (type == "info" || type == "infos") { + var content = chalk.cyan(msg); + } else throw new Error(`[Logger] log: "${type}" is not a valid type. Valid values are: "log", "warn", "err", "debug", "info".`); + + console.log(prefix, content); +} \ No newline at end of file diff --git a/ab-core/messages/defaultButtonError.js b/messages/defaultButtonError.js similarity index 100% rename from ab-core/messages/defaultButtonError.js rename to messages/defaultButtonError.js diff --git a/ab-core/messages/defaultSelectError.js b/messages/defaultSelectError.js similarity index 100% rename from ab-core/messages/defaultSelectError.js rename to messages/defaultSelectError.js diff --git a/messages/onMention.js b/messages/onMention.js new file mode 100644 index 0000000..e3efcb8 --- /dev/null +++ b/messages/onMention.js @@ -0,0 +1,14 @@ +import { Message } from "discord.js"; +import Artibot from "../index.js"; + +/** + * Send the message when mentionned + * @param {Message} message + * @param {Artibot} artibot + */ +export default async function execute(message, artibot) { + const { localizer, config } = artibot; + return message.channel.send( + localizer.__("Hello [[0]]! My prefix is `[[1]]`, you can get help with the `[[1]]help` command.", { placeholders: [message.author, config.prefix] }) + ); +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 178c8d9..36132bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,59 +1,51 @@ { "name": "artibot", - "version": "2.1.2", + "version": "3.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "2.1.2", + "version": "3.0.0", "license": "GPL-3.0-or-later", "dependencies": { - "@discordjs/builders": "^0.12.0", - "@discordjs/rest": "^0.3.0", + "@discordjs/builders": "^0.13.0", + "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "auto-git-update": "^2.1.2", - "axios": "^0.26.0", - "chalk": "^4.1.2", - "discord-api-types": "^0.25.2", - "discord-giveaways": "^5.1.0", + "axios": "^0.26.1", + "chalk": "^5.0.1", + "discord-api-types": "^0.31.2", + "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", - "discordjs-reaction-role": "^2.1.0", + "discordjs-reaction-role": "^2.1.1", "figlet": "^1.5.2", "humanize-duration": "^3.27.1", - "moment": "^2.29.1", - "moment-timezone": "^0.5.31", + "moment": "^2.29.3", + "moment-timezone": "^0.5.34", "ms": "^2.1.3", "path": "^0.12.7", - "whois": "^2.13.7" + "whois": "^2.13.9" }, "devDependencies": { - "nodemon": "^2.0.12" + "nodemon": "^2.0.15" } }, "node_modules/@discordjs/builders": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.12.0.tgz", - "integrity": "sha512-Vx2MjUZd6QVo1uS2uWt708Fd6cHWGFblAvbpL5EBO+kLl0BADmPwwvts+YJ/VfSywed6Vsk6K2cEooR/Ytjhjw==", - "dependencies": { - "@sindresorhus/is": "^4.3.0", - "discord-api-types": "^0.26.1", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.13.0.tgz", + "integrity": "sha512-4L9y26KRNNU8Y7J78SRUN1Uhava9D8jfit/YqEaKi8gQRc7PdqKqk2poybo6RXaiyt/BgKYPfcjxT7WvzGfYCA==", + "dependencies": { + "@sapphire/shapeshift": "^2.0.0", + "@sindresorhus/is": "^4.6.0", + "discord-api-types": "^0.31.1", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.1", + "tslib": "^2.3.1" }, "engines": { "node": ">=16.9.0" } }, - "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", - "engines": { - "node": ">=12" - } - }, "node_modules/@discordjs/collection": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", @@ -64,86 +56,67 @@ } }, "node_modules/@discordjs/rest": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.3.0.tgz", - "integrity": "sha512-F9aeP3odlAlllM1ciBZLdd+adiAyBj4VaZBejj4UMj4afE2wfCkNTGvYYiRxrXUE9fN7e/BuDP2ePl0tVA2m7Q==", - "dependencies": { - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@sapphire/snowflake": "^3.0.1", - "discord-api-types": "^0.26.1", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.4.1.tgz", + "integrity": "sha512-rtWy+AIfNlfjGkAgA2TJLASdqli07aTNQceVGT6RQQiQaEqV0nsfBO4WtDlDzk7PmO3w+InP3dpwEolJI5jz0A==", + "dependencies": { + "@discordjs/collection": "^0.7.0-dev", + "@sapphire/async-queue": "^1.3.1", + "@sapphire/snowflake": "^3.2.1", + "@types/node-fetch": "^2.6.1", + "discord-api-types": "^0.29.0", "form-data": "^4.0.0", - "node-fetch": "^2.6.5", + "node-fetch": "^2.6.7", "tslib": "^2.3.1" }, "engines": { "node": ">=16.9.0" } }, - "node_modules/@discordjs/rest/node_modules/discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", + "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { + "version": "0.7.0-dev.1650672508-3617093", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", + "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==", "engines": { - "node": ">=12" + "node": ">=16.9.0" } }, - "node_modules/@kwsites/file-exists": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", - "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", - "dependencies": { - "debug": "^4.1.1" - } + "node_modules/@discordjs/rest/node_modules/discord-api-types": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.29.0.tgz", + "integrity": "sha512-Ekq1ICNpOTVajXKZguNFrsDeTmam+ZeA38txsNLZnANdXUjU6QBPIZLUQTC6MzigFGb0Tt8vk4xLnXmzv0shNg==" }, - "node_modules/@kwsites/file-exists/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, + "node_modules/@sapphire/async-queue": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", + "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==", "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=v14.0.0", + "npm": ">=7.0.0" } }, - "node_modules/@kwsites/file-exists/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/@kwsites/promise-deferred": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", - "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" - }, - "node_modules/@sapphire/async-queue": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.9.tgz", - "integrity": "sha512-CbXaGwwlEMq+l1TRu01FJCvySJ1CEFKFclHT48nIfNeZXaAAmmwwy7scUKmYHPUa3GhoMp6Qr1B3eAJux6XgOQ==", + "node_modules/@sapphire/shapeshift": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.0.0.tgz", + "integrity": "sha512-SKq4mKZXW2xB6O2Im4lBCDYy8pnuAMC3Zziw5Ub7WvZMt0fgwebDnqh+9MhoMYUSjkLyQcEO8ZS9d3ES7aRhBw==", "engines": { - "node": ">=v14.0.0", + "node": ">=v15.0.0", "npm": ">=7.0.0" } }, "node_modules/@sapphire/snowflake": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.0.1.tgz", - "integrity": "sha512-v+wCC2q9DK3OhG7Vcdt/8A/INAYiyhlMD5snakmXGBN1usLBwSGJVJBjDHv4VGI5C9YYl4UdW5Ovr3arvYsJXQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.1.tgz", + "integrity": "sha512-vmZq1I6J6iNRQVXP+N9HzOMOY4ORB3MunoFeWCw/aBnZTf1cDgDvP0RZFQS53B1TN95AIgFY9T+ItQ/fWAUYWQ==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" } }, "node_modules/@sindresorhus/is": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz", - "integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "engines": { "node": ">=10" }, @@ -164,14 +137,14 @@ } }, "node_modules/@types/node": { - "version": "17.0.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.12.tgz", - "integrity": "sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA==" + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" }, "node_modules/@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", "dependencies": { "@types/node": "*", "form-data": "^3.0.0" @@ -191,9 +164,9 @@ } }, "node_modules/@types/ws": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", - "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", "dependencies": { "@types/node": "*" } @@ -248,14 +221,6 @@ "node": ">= 8" } }, - "node_modules/app-root-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz", - "integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==", - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/artibot-localizer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/artibot-localizer/-/artibot-localizer-1.0.2.tgz", @@ -269,21 +234,10 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "node_modules/auto-git-update": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/auto-git-update/-/auto-git-update-2.1.2.tgz", - "integrity": "sha512-JsWxJGwAZbo38cwljbo1ivvNyrvi+rZOOswLfGwPihHY+7NvnyWJ3JGJISqIOv7V9yQFDt/Juk5Jv3OhuwHBkw==", - "dependencies": { - "app-root-path": "^3.0.0", - "chegs-simple-logger": "^1.1.0", - "fs-extra": "^8.1.0", - "simple-git": "^3.0.0" - } - }, "node_modules/axios": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", - "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "dependencies": { "follow-redirects": "^1.14.8" } @@ -325,6 +279,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/boxen/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -402,28 +372,16 @@ } }, "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chegs-simple-logger": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/chegs-simple-logger/-/chegs-simple-logger-1.1.0.tgz", - "integrity": "sha512-GR7VaKpWw3oAQV9vmjQdNlIVjxCmx15dQpj9b4m9IrGDg4unKykx74pGp8taOxnFEIU0/uqi9XGy5CHNuYwfcA==", - "dependencies": { - "rotating-file-stream": "^1.4.2" - } - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -621,17 +579,14 @@ } }, "node_modules/discord-api-types": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.25.2.tgz", - "integrity": "sha512-O243LXxb5gLLxubu5zgoppYQuolapGVWPw3ll0acN0+O8TnPUE2kFp9Bt3sTRYodw8xFIknOVxjSeyWYBpVcEQ==", - "engines": { - "node": ">=12" - } + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", + "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" }, "node_modules/discord-giveaways": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-5.1.0.tgz", - "integrity": "sha512-x4nnXJmBkphS/i6E7WSc7l4TN4SgMNQlH4ajEwB0fQu+NBQyJ4cSqzFvegOBxS9oWq/onQmN/KwqZZjIb8pnxA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-5.1.1.tgz", + "integrity": "sha512-TogRQrnyDVtu+/juWwK22ykBKO1K8p7yPfXEZ67xao70bkNj+FLw0lOaBQqdomNWa3JypaE9FNXLgY0LaRyJIg==", "dependencies": { "deepmerge": "^4.2.2", "serialize-javascript": "^6.0.0" @@ -739,6 +694,11 @@ "node": ">=8" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, "node_modules/figlet": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", @@ -772,9 +732,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", - "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", "funding": [ { "type": "individual", @@ -803,19 +763,6 @@ "node": ">= 6" } }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -909,14 +856,16 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -1110,14 +1059,6 @@ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -1196,19 +1137,19 @@ } }, "node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -1224,9 +1165,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -1242,9 +1183,9 @@ "dev": true }, "node_modules/moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz", + "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==", "engines": { "node": "*" } @@ -1603,15 +1544,6 @@ "lowercase-keys": "^1.0.0" } }, - "node_modules/rotating-file-stream": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/rotating-file-stream/-/rotating-file-stream-1.4.6.tgz", - "integrity": "sha512-QS7vGxBK6sGc1mCqlmAuwV4J0fmmVCKaUgMvKbkTueZr4jdkXN3bSpTEOQxtdtAVEzi1aUqdHzwIQ0ejNn+CQg==", - "deprecated": "please use version 2.x", - "engines": { - "node": ">=6.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1675,46 +1607,11 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "node_modules/signal-exit": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", - "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/simple-git": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.3.0.tgz", - "integrity": "sha512-K9qcbbZwPHhk7MLi0k0ekvSFXJIrRoXgHhqMXAFM75qS68vdHTcuzmul1ilKI02F/4lXshVgBoDll2t++JK0PQ==", - "dependencies": { - "@kwsites/file-exists": "^1.1.1", - "@kwsites/promise-deferred": "^1.1.1", - "debug": "^4.3.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/steveukx/" - } - }, - "node_modules/simple-git/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/simple-git/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -1725,12 +1622,12 @@ } }, "node_modules/socks": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", - "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", + "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", "dependencies": { "ip": "^1.1.5", - "smart-buffer": "^4.1.0" + "smart-buffer": "^4.2.0" }, "engines": { "node": ">= 10.13.0", @@ -1774,6 +1671,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -1820,14 +1718,14 @@ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, "node_modules/ts-mixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", - "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", + "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" }, "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/type-fest": { "version": "0.20.2", @@ -1873,14 +1771,6 @@ "node": ">=8" } }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/update-notifier": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", @@ -1909,10 +1799,26 @@ "url": "https://github.com/yeoman/update-notifier?sponsor=1" } }, + "node_modules/update-notifier/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/update-notifier/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2024,9 +1930,9 @@ } }, "node_modules/ws": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz", - "integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "engines": { "node": ">=10.0.0" }, @@ -2105,9 +2011,9 @@ } }, "node_modules/zod": { - "version": "3.11.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz", - "integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==", + "version": "3.14.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", + "integrity": "sha512-U9BFLb2GO34Sfo9IUYp0w3wJLlmcyGoMd75qU9yf+DrdGA4kEx6e+l9KOkAlyUO0PSQzZCa3TR4qVlcmwqSDuw==", "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -2115,22 +2021,16 @@ }, "dependencies": { "@discordjs/builders": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.12.0.tgz", - "integrity": "sha512-Vx2MjUZd6QVo1uS2uWt708Fd6cHWGFblAvbpL5EBO+kLl0BADmPwwvts+YJ/VfSywed6Vsk6K2cEooR/Ytjhjw==", - "requires": { - "@sindresorhus/is": "^4.3.0", - "discord-api-types": "^0.26.1", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" - }, - "dependencies": { - "discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" - } + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.13.0.tgz", + "integrity": "sha512-4L9y26KRNNU8Y7J78SRUN1Uhava9D8jfit/YqEaKi8gQRc7PdqKqk2poybo6RXaiyt/BgKYPfcjxT7WvzGfYCA==", + "requires": { + "@sapphire/shapeshift": "^2.0.0", + "@sindresorhus/is": "^4.6.0", + "discord-api-types": "^0.31.1", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.1", + "tslib": "^2.3.1" } }, "@discordjs/collection": { @@ -2139,68 +2039,51 @@ "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" }, "@discordjs/rest": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.3.0.tgz", - "integrity": "sha512-F9aeP3odlAlllM1ciBZLdd+adiAyBj4VaZBejj4UMj4afE2wfCkNTGvYYiRxrXUE9fN7e/BuDP2ePl0tVA2m7Q==", - "requires": { - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@sapphire/snowflake": "^3.0.1", - "discord-api-types": "^0.26.1", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.4.1.tgz", + "integrity": "sha512-rtWy+AIfNlfjGkAgA2TJLASdqli07aTNQceVGT6RQQiQaEqV0nsfBO4WtDlDzk7PmO3w+InP3dpwEolJI5jz0A==", + "requires": { + "@discordjs/collection": "^0.7.0-dev", + "@sapphire/async-queue": "^1.3.1", + "@sapphire/snowflake": "^3.2.1", + "@types/node-fetch": "^2.6.1", + "discord-api-types": "^0.29.0", "form-data": "^4.0.0", - "node-fetch": "^2.6.5", + "node-fetch": "^2.6.7", "tslib": "^2.3.1" }, "dependencies": { - "discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" - } - } - }, - "@kwsites/file-exists": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", - "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", - "requires": { - "debug": "^4.1.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } + "@discordjs/collection": { + "version": "0.7.0-dev.1650672508-3617093", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", + "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==" }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "discord-api-types": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.29.0.tgz", + "integrity": "sha512-Ekq1ICNpOTVajXKZguNFrsDeTmam+ZeA38txsNLZnANdXUjU6QBPIZLUQTC6MzigFGb0Tt8vk4xLnXmzv0shNg==" } } }, - "@kwsites/promise-deferred": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", - "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" - }, "@sapphire/async-queue": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.9.tgz", - "integrity": "sha512-CbXaGwwlEMq+l1TRu01FJCvySJ1CEFKFclHT48nIfNeZXaAAmmwwy7scUKmYHPUa3GhoMp6Qr1B3eAJux6XgOQ==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", + "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" + }, + "@sapphire/shapeshift": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.0.0.tgz", + "integrity": "sha512-SKq4mKZXW2xB6O2Im4lBCDYy8pnuAMC3Zziw5Ub7WvZMt0fgwebDnqh+9MhoMYUSjkLyQcEO8ZS9d3ES7aRhBw==" }, "@sapphire/snowflake": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.0.1.tgz", - "integrity": "sha512-v+wCC2q9DK3OhG7Vcdt/8A/INAYiyhlMD5snakmXGBN1usLBwSGJVJBjDHv4VGI5C9YYl4UdW5Ovr3arvYsJXQ==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.1.tgz", + "integrity": "sha512-vmZq1I6J6iNRQVXP+N9HzOMOY4ORB3MunoFeWCw/aBnZTf1cDgDvP0RZFQS53B1TN95AIgFY9T+ItQ/fWAUYWQ==" }, "@sindresorhus/is": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz", - "integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==" + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" }, "@szmarczak/http-timer": { "version": "1.1.2", @@ -2212,14 +2095,14 @@ } }, "@types/node": { - "version": "17.0.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.12.tgz", - "integrity": "sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA==" + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" }, "@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", "requires": { "@types/node": "*", "form-data": "^3.0.0" @@ -2238,9 +2121,9 @@ } }, "@types/ws": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", - "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", "requires": { "@types/node": "*" } @@ -2283,11 +2166,6 @@ "picomatch": "^2.0.4" } }, - "app-root-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz", - "integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==" - }, "artibot-localizer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/artibot-localizer/-/artibot-localizer-1.0.2.tgz", @@ -2298,21 +2176,10 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "auto-git-update": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/auto-git-update/-/auto-git-update-2.1.2.tgz", - "integrity": "sha512-JsWxJGwAZbo38cwljbo1ivvNyrvi+rZOOswLfGwPihHY+7NvnyWJ3JGJISqIOv7V9yQFDt/Juk5Jv3OhuwHBkw==", - "requires": { - "app-root-path": "^3.0.0", - "chegs-simple-logger": "^1.1.0", - "fs-extra": "^8.1.0", - "simple-git": "^3.0.0" - } - }, "axios": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", - "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "requires": { "follow-redirects": "^1.14.8" } @@ -2343,6 +2210,18 @@ "type-fest": "^0.20.2", "widest-line": "^3.1.0", "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } } }, "brace-expansion": { @@ -2403,21 +2282,9 @@ "dev": true }, "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chegs-simple-logger": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/chegs-simple-logger/-/chegs-simple-logger-1.1.0.tgz", - "integrity": "sha512-GR7VaKpWw3oAQV9vmjQdNlIVjxCmx15dQpj9b4m9IrGDg4unKykx74pGp8taOxnFEIU0/uqi9XGy5CHNuYwfcA==", - "requires": { - "rotating-file-stream": "^1.4.2" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" }, "chokidar": { "version": "3.5.3", @@ -2571,14 +2438,14 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "discord-api-types": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.25.2.tgz", - "integrity": "sha512-O243LXxb5gLLxubu5zgoppYQuolapGVWPw3ll0acN0+O8TnPUE2kFp9Bt3sTRYodw8xFIknOVxjSeyWYBpVcEQ==" + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", + "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" }, "discord-giveaways": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-5.1.0.tgz", - "integrity": "sha512-x4nnXJmBkphS/i6E7WSc7l4TN4SgMNQlH4ajEwB0fQu+NBQyJ4cSqzFvegOBxS9oWq/onQmN/KwqZZjIb8pnxA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-5.1.1.tgz", + "integrity": "sha512-TogRQrnyDVtu+/juWwK22ykBKO1K8p7yPfXEZ67xao70bkNj+FLw0lOaBQqdomNWa3JypaE9FNXLgY0LaRyJIg==", "requires": { "deepmerge": "^4.2.2", "serialize-javascript": "^6.0.0" @@ -2660,6 +2527,11 @@ "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", "dev": true }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, "figlet": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", @@ -2684,9 +2556,9 @@ } }, "follow-redirects": { - "version": "1.14.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", - "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==" + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" }, "form-data": { "version": "4.0.0", @@ -2698,16 +2570,6 @@ "mime-types": "^2.1.12" } }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -2775,14 +2637,16 @@ } }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "has-yarn": { "version": "2.1.0", @@ -2925,14 +2789,6 @@ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -2992,16 +2848,16 @@ } }, "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" } }, "mimic-response": { @@ -3011,9 +2867,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -3026,9 +2882,9 @@ "dev": true }, "moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz", + "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==" }, "moment-timezone": { "version": "0.5.34", @@ -3293,11 +3149,6 @@ "lowercase-keys": "^1.0.0" } }, - "rotating-file-stream": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/rotating-file-stream/-/rotating-file-stream-1.4.6.tgz", - "integrity": "sha512-QS7vGxBK6sGc1mCqlmAuwV4J0fmmVCKaUgMvKbkTueZr4jdkXN3bSpTEOQxtdtAVEzi1aUqdHzwIQ0ejNn+CQg==" - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3340,48 +3191,23 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "signal-exit": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", - "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "simple-git": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.3.0.tgz", - "integrity": "sha512-K9qcbbZwPHhk7MLi0k0ekvSFXJIrRoXgHhqMXAFM75qS68vdHTcuzmul1ilKI02F/4lXshVgBoDll2t++JK0PQ==", - "requires": { - "@kwsites/file-exists": "^1.1.1", - "@kwsites/promise-deferred": "^1.1.1", - "debug": "^4.3.3" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" }, "socks": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", - "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", + "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", "requires": { "ip": "^1.1.5", - "smart-buffer": "^4.1.0" + "smart-buffer": "^4.2.0" } }, "string-width": { @@ -3412,6 +3238,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -3446,14 +3273,14 @@ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, "ts-mixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", - "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", + "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" }, "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "type-fest": { "version": "0.20.2", @@ -3490,11 +3317,6 @@ "crypto-random-string": "^2.0.0" } }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" - }, "update-notifier": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", @@ -3517,10 +3339,20 @@ "xdg-basedir": "^4.0.0" }, "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -3613,9 +3445,9 @@ } }, "ws": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz", - "integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "requires": {} }, "xdg-basedir": { @@ -3670,9 +3502,9 @@ } }, "zod": { - "version": "3.11.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz", - "integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==" + "version": "3.14.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", + "integrity": "sha512-U9BFLb2GO34Sfo9IUYp0w3wJLlmcyGoMd75qU9yf+DrdGA4kEx6e+l9KOkAlyUO0PSQzZCa3TR4qVlcmwqSDuw==" } } } diff --git a/package.json b/package.json index b9cceca..0b8fb75 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,49 @@ { "name": "artibot", - "version": "2.1.2", + "version": "3.0.0", "description": "Bot open-source fait par Artivain et les contributeurs. ", "main": "index.js", "scripts": { - "start": "node ab-core/index.js", - "test": "nodemon ab-core/index.js", - "updater": "node ab-core/updater.js" + "start": "node index.js", + "test": "nodemon testing.js" }, + "type": "module", "repository": "github:Artivain/artibot", "keywords": [ "Discord", "javascript", - "Artivain" + "Artivain", + "framework", + "bot", + "free", + "api" ], "author": "Artivain", "license": "GPL-3.0-or-later", "bugs": { "url": "https://github.com/Artivain/artibot/issues" }, + "funding": "https://paypal.me/Artivain", "homepage": "https://github.com/Artivain/artibot#readme", "dependencies": { - "@discordjs/builders": "^0.12.0", - "@discordjs/rest": "^0.3.0", + "@discordjs/builders": "^0.13.0", + "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "auto-git-update": "^2.1.2", - "axios": "^0.26.0", - "chalk": "^4.1.2", - "discord-api-types": "^0.25.2", - "discord-giveaways": "^5.1.0", + "axios": "^0.26.1", + "chalk": "^5.0.1", + "discord-api-types": "^0.31.2", + "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", - "discordjs-reaction-role": "^2.1.0", + "discordjs-reaction-role": "^2.1.1", "figlet": "^1.5.2", "humanize-duration": "^3.27.1", - "moment": "^2.29.1", - "moment-timezone": "^0.5.31", + "moment": "^2.29.3", + "moment-timezone": "^0.5.34", "ms": "^2.1.3", "path": "^0.12.7", - "whois": "^2.13.7" + "whois": "^2.13.9" }, "devDependencies": { - "nodemon": "^2.0.12" + "nodemon": "^2.0.15" } } diff --git a/private-example.json b/private-example.json deleted file mode 100644 index 4a686aa..0000000 --- a/private-example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "botToken": "Get your bot token from Discord" -} \ No newline at end of file diff --git a/testing.js b/testing.js new file mode 100644 index 0000000..448bb11 --- /dev/null +++ b/testing.js @@ -0,0 +1,10 @@ +import Artibot from "./index.js"; +import token from "./private.js"; + +const artibot = new Artibot({ + ownerId: "382869186042658818", + botName: "Artibot [DEV]", + prefix: "abd " +}); + +artibot.login({ token }); \ No newline at end of file diff --git a/ab-core/updater.js b/updater.js similarity index 100% rename from ab-core/updater.js rename to updater.js From 78a70243f12f45023646eaa385c487b5c346c53c Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 01:13:35 -0400 Subject: [PATCH 02/68] Improve commands --- core/commands/help.js | 32 +++++++----- core/commands/info.js | 112 +++++++++++++++++++--------------------- core/index.js | 16 +++--- events/messageCreate.js | 41 ++++++++------- index.js | 30 ++++++++++- 5 files changed, 135 insertions(+), 96 deletions(-) diff --git a/core/commands/help.js b/core/commands/help.js index ef178fa..4e5dce7 100644 --- a/core/commands/help.js +++ b/core/commands/help.js @@ -1,4 +1,4 @@ -import { Embed } from "../../index.js"; +import Artibot from "../../index.js"; /** * @param {Message} message @@ -6,16 +6,20 @@ import { Embed } from "../../index.js"; * @param {Artibot} artibot */ export default async function helpCommand(message, args, artibot) { - const { localizer } = artibot; + const { localizer, log, createEmbed, config } = artibot; const { commands } = artibot.modules; // If there are no args, it means it needs whole help command. if (!args.length) { + const commandList = []; + artibot.modules.forEach(module => module.parts.forEach(part => { + if (part.type == "command") commandList.push(part.name); + })); - let helpEmbed = new Embed() + let helpEmbed = createEmbed() .setTitle(localizer._("List of all available commands")) - .setDescription("`" + commands.map(({ command }) => command.name).join("`, `") + "`") + .setDescription("`" + commandList.join("`, `") + "`") .addField( localizer._("Usage"), localizer.__("You can send `[[0]]help [name of the command]` to get more info on a specific command!", { placeholders: [config.prefix] }) @@ -46,19 +50,23 @@ export default async function helpCommand(message, args, artibot) { const name = args[0].toLowerCase(); - const data = - commands.get(name) || - commands.find((c) => c.aliases && c.aliases.includes(name)); + let command; - // If it's an invalid command. + artibot.modules.forEach(module => { + if (command) return; + module.parts.forEach(part => { + if (command) return; + if (part.type != "command") return; + if (part.name == name || part.aliases.includes(name)) command = part; + }); + }); - if (!data) { + // Check if command does not exist + if (!command) { return message.reply({ content: "`" + args[0] + "` " + localizer._("is not a valid command...") }); }; - const { command } = data; - - let commandEmbed = new Embed().setTitle(localizer._("Help on a command")); + let commandEmbed = createEmbed().setTitle(localizer._("Help on a command")); if (command.description) commandEmbed.setDescription(`${command.description}`); diff --git a/core/commands/info.js b/core/commands/info.js index 2f99f91..63d33ea 100644 --- a/core/commands/info.js +++ b/core/commands/info.js @@ -8,67 +8,63 @@ * https://github.com/Artivain/artibot#licence */ -const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js"); -const { localizer } = require("../../index"); +import { MessageActionRow, MessageButton, Message } from "discord.js"; +import Artibot from "../../index.js"; -module.exports = { - name: "info", - description: localizer._("Learn more about this bot."), - aliases: ["infos", "about"], - cooldown: 5, - - execute(message, args, { config, contributors, version }) { - var devs = "", donators = ""; - contributors.devs.forEach(dev => { - if (dev.discordTag) { - devs += `[${dev.name}](${dev.github}) (${dev.discordTag})\n`; - } else { - devs += `[${dev.name}](${dev.github})\n`; - } - }); - contributors.donators.forEach(donator => { - if (donator.discordTag) { - donators += `[${donator.name}](${donator.github}) (${donator.discordTag})\n`; - } else { - donators += `[${donator.name}](${donator.github})\n`; - } - }); - - if (config.botName == "Artibot" || config.botName == "Artibot [dev]") { - var description = localizer._("Artibot is a modern and open-source Discord bot maintained by Artivain and it's community.\n") + - "[GitHub](https://github.com/Artivain/artibot)"; +/** + * + * @param {Message} message + * @param {string[]} args + * @param {Artibot} artibot + */ +export default function execute(message, args, { localizer, contributors, config, createEmbed, version }) { + var devs = "", donators = ""; + contributors.devs.forEach(dev => { + if (dev.discordTag) { + devs += `[${dev.name}](${dev.github}) (${dev.discordTag})\n`; } else { - var description = localizer.__("[[0]] is based on Artibot, a modern and open-source Discord bot maintained by Artivain and it's community.\n", { placeholders: [config.botName] }) + "[GitHub](https://github.com/Artivain/artibot)"; - }; + devs += `[${dev.name}](${dev.github})\n`; + } + }); + contributors.donators.forEach(donator => { + if (donator.discordTag) { + donators += `[${donator.name}](${donator.github}) (${donator.discordTag})\n`; + } else { + donators += `[${donator.name}](${donator.github})\n`; + } + }); + + if (config.botName == "Artibot" || config.botName == "Artibot [DEV]") { + var description = localizer._("Artibot is a modern and open-source Discord bot maintained by Artivain and it's community.\n") + + "[GitHub](https://github.com/Artivain/artibot)"; + } else { + var description = localizer.__("[[0]] is based on Artibot, a modern and open-source Discord bot maintained by Artivain and it's community.\n", { placeholders: [config.botName] }) + "[GitHub](https://github.com/Artivain/artibot)"; + }; - var memberCount = 0; - message.client.guilds.cache.forEach((guild) => { - memberCount += guild.memberCount; - }); + var memberCount = 0; + message.client.guilds.cache.forEach((guild) => { + memberCount += guild.memberCount; + }); - let embed = new MessageEmbed() - .setColor(config.embedColor) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setTitle(localizer.__("About [[0]]", { placeholders: [config.botName] })) - .setDescription(description) - .addField(localizer._("Number of servers"), message.client.guilds.cache.size + " " + localizer._("servers"), true) - .addField(localizer._("Number of users"), memberCount + " " + localizer._("users"), true) - .addField(localizer._("Version"), version) - .addField(localizer._("Developers"), devs, true) - .addField(localizer._("Donators"), donators, true); + let embed = createEmbed() + .setTitle(localizer.__("About [[0]]", { placeholders: [config.botName] })) + .setDescription(description) + .addField(localizer._("Number of servers"), message.client.guilds.cache.size + " " + localizer._("servers"), true) + .addField(localizer._("Number of users"), memberCount + " " + localizer._("users"), true) + .addField(localizer._("Version"), version) + .addField(localizer._("Developers"), devs, true) + .addField(localizer._("Donators"), donators, true); - const row = new MessageActionRow() - .addComponents( - new MessageButton() - .setLabel(localizer._("Learn more")) - .setStyle("LINK") - .setURL("https://github.com/Artivain/artibot") - ); + const row = new MessageActionRow() + .addComponents( + new MessageButton() + .setLabel(localizer._("Learn more")) + .setStyle("LINK") + .setURL("https://github.com/Artivain/artibot") + ); - message.channel.send({ - embeds: [embed], - components: [row] - }); - }, -}; \ No newline at end of file + message.channel.send({ + embeds: [embed], + components: [row] + }); +} \ No newline at end of file diff --git a/core/index.js b/core/index.js index 03154f1..0e7f50f 100644 --- a/core/index.js +++ b/core/index.js @@ -1,5 +1,6 @@ -import { Command, Module } from "../index.js"; +import Artibot, { Command, Module } from "../index.js"; import helpCommand from "./commands/help.js"; +import infoCommand from "./commands/info.js"; /** * Create the Core module @@ -22,6 +23,14 @@ export default function coreModule(artibot) { usage: localizer._("[name of the command]"), cooldown: 5, mainFunction: helpCommand + }), + new Command({ + id: "info", + name: "info", + description: localizer._("Learn more about this bot."), + aliases: ["infos", "about"], + cooldown: 5, + mainFunction: infoCommand }) ] }); @@ -39,11 +48,6 @@ export default function coreModule(artibot) { parts: [ // Commands - { - id: "help", - type: "command", - path: "src/commands/help.js" - }, { id: "info", type: "command", diff --git a/events/messageCreate.js b/events/messageCreate.js index 5128bee..93ca265 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -1,5 +1,5 @@ -import { Collection, Message, MessageEmbed } from "discord.js"; -import Artibot from "../index.js"; +import { Collection, Message } from "discord.js"; +import Artibot, { Command } from "../index.js"; import onMention from "../messages/onMention.js" // Prefix regex, we will use to match in mention prefix. @@ -44,23 +44,28 @@ export async function execute(message, artibot) { const commandName = args.shift().toLowerCase(); // Check if mesage does not starts with prefix, or message author is bot. If yes, return. - if (!message.content.startsWith(matchedPrefix) || message.author.bot) - return; - - const data = client.commands.get(commandName) || client.commands.find(({ command }) => command.aliases && command.aliases.includes(commandName)); + if (!message.content.startsWith(matchedPrefix) || message.author.bot) return; + + /** @type {Command} */ + let command; + + artibot.modules.forEach(module => { + if (command) return; + module.parts.forEach(part => { + if (command) return; + if (part.type != "command") return; + if (part.name == commandName) command = part; + if (part.aliases.includes(commandName)) command = part; + }); + }); // It it's not a command, don't try to execute anything - if (!data) - return; - - const { command } = data; + if (!command) return; // Owner Only Property, add in your command properties if true. if (command.ownerOnly && message.author.id !== ownerId) { - let embedOwner = new MessageEmbed() + let embedOwner = artibot.createEmbed() .setColor("RED") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() .setTitle(localizer._("Help on this command")) .setDescription(localizer.__("This command can only be executed by [[0]].", { placeholders: [`<@${ownerId}>`] })); return message.reply({ embeds: [embedOwner] }); @@ -73,7 +78,7 @@ export async function execute(message, artibot) { }); } - // Author perms property + // Check for permissions if (command.permissions) { const authorPerms = message.channel.permissionsFor(message.author); if (!authorPerms || !authorPerms.has(command.permissions)) { @@ -86,14 +91,14 @@ export async function execute(message, artibot) { let reply = localizer.__("You did not give any argument, [[0]]!", { placeholders: [message.author] }); if (command.usage) { - reply += localizer.__("\nCorrect usage is `[[0]][[1]] [[2]]`", { placeholders: [prefix, command.name, command.usage] }); + reply += localizer.__("\nCorrect usage is `[[0]][[1]] [[2]]`", { placeholders: [config.prefix, command.name, command.usage] }); } return message.channel.send({ content: reply }); } // Cooldowns - const { cooldowns } = client; + const { cooldowns } = artibot; if (!cooldowns.has(command.name)) { cooldowns.set(command.name, new Collection()); @@ -117,9 +122,9 @@ export async function execute(message, artibot) { timestamps.set(message.author.id, now); setTimeout(() => timestamps.delete(message.author.id), cooldownAmount); - // execute the final command. Put everything above this. + // Execute the final command. Put everything above this. try { - command.execute(message, args, commons); + command.execute(message, args, artibot); } catch (error) { log("CommandManager", error, "warn", true); message.reply({ diff --git a/index.js b/index.js index 3ffa4b5..e5cbe43 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ import logger from "./logger.js"; import Localizer from "artibot-localizer"; import chalk from "chalk"; import figlet from "figlet"; -import { Client, Intents, MessageEmbed } from "discord.js"; +import { Client, Collection, Intents, MessageEmbed, Permissions } from "discord.js"; import { createRequire } from 'module'; const require = createRequire(import.meta.url); const { version } = require('./package.json'); @@ -72,6 +72,12 @@ export default class Artibot { this.version = version; + /** + * Store cooldowns for commands + * @type {Collection>} + */ + this.cooldowns = new Collection(); + // Send artwork to console console.log(chalk.blue(figlet.textSync('Artibot', { font: 'ANSI Shadow', @@ -91,6 +97,18 @@ export default class Artibot { log = log; + /** + * Create an embed + * @param {MessageEmbed|MessageEmbedOptions|APIEmbed} [data] + * @returns {Embed} Preconfigured embed + */ + createEmbed = (data) => { + return new Embed(this, data); + } + + /** Lists of people who contributed to the Artibot */ + contributors = require("./contributors.json"); + /** * @param {Object} config - Advanced config for the bot * @param {string} config.token - The login token for the Discord bot @@ -197,16 +215,24 @@ export class Command extends BasePart { * @param {string[]} [config.aliases] - List of alternative names * @param {string} [config.usage] - Help text for the usage * @param {number} [config.cooldown] - Cooldown for this command usage, in seconds + * @param {boolean} [config.ownerOnly=false] - If the command can only be executed by the owner + * @param {boolean} [config.guildOnly=false] - If the command can only be executed in a guild + * @param {Permissions} [config.permissions] - Required permissions + * @param {boolean} [config.requireArgs=false] - Set to true if the command needs at least one argument * @param {function(Message, string[], Artibot): void} config.mainFunction - Function to execute when the command is ran * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup */ - constructor({ id, name, description, aliases = [], usage, cooldown, mainFunction, initFunction }) { + constructor({ id, name, description, aliases = [], usage, cooldown, ownerOnly = false, guildOnly = false, permissions, requireArgs = false, mainFunction, initFunction }) { super({ id, type: "command", mainFunction, initFunction }); this.name = name; this.description = description; this.aliases = aliases; this.usage = usage; this.cooldown = cooldown; + this.ownerOnly = ownerOnly; + this.guildOnly = guildOnly; + this.permissions = permissions; + this.args = requireArgs; } } From d9c911f7c6c9f476199b1675729c8195c164d2b6 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 01:20:20 -0400 Subject: [PATCH 03/68] Rework ping command --- core/commands/ping.js | 61 +++++++++++++++++++------------------------ core/index.js | 14 ++++++---- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/core/commands/ping.js b/core/commands/ping.js index efb1e94..71ed65f 100644 --- a/core/commands/ping.js +++ b/core/commands/ping.js @@ -1,36 +1,29 @@ -const { MessageEmbed } = require("discord.js"); -const { localizer } = require("../../index"); +import { Message } from "discord.js"; +import Artibot from "../../index.js"; -module.exports = { - name: "ping", - description: localizer._("Check if the bot is alive."), - aliases: ["latence", "latency"], - cooldown: 3, +/** + * Ping command + * @param {Message} message + * @param {string[]} args + * @param {Artibot} artibot + */ +export default function execute(message, args, { config, createEmbed, localizer }) { + if (config.advancedCorePing) { + var embed = createEmbed() + .setTitle("Ping") + .setDescription( + localizer.__("Pong!\n\nThe bot's latency is [[0]]ms.\nThe API's latency is [[1]]ms.", { + placeholders: [ + message.createdTimestamp - Date.now(), + Math.round(message.client.ws.ping) + ] + }) + ); + } else { + var embed = createEmbed() + .setTitle("Ping") + .setDescription(`Pong!`); + }; - execute(message, args, { config }) { - if (config.advancedCorePing) { - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Ping") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription( - localizer.__("Pong!\n\nThe bot's latency is [[0]]ms.\nThe API's latency is [[1]]ms.", { - placeholders: [ - Date.now() - message.createdTimestamp, - Math.round(message.client.ws.ping) - ] - }) - ); - } else { - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Ping") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(`Pong!`); - }; - - message.channel.send({ embeds: [embed] }); - }, -}; \ No newline at end of file + message.channel.send({ embeds: [embed] }); +} \ No newline at end of file diff --git a/core/index.js b/core/index.js index 0e7f50f..1c7a73c 100644 --- a/core/index.js +++ b/core/index.js @@ -1,6 +1,7 @@ import Artibot, { Command, Module } from "../index.js"; import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; +import pingCommand from "./commands/ping.js"; /** * Create the Core module @@ -31,6 +32,14 @@ export default function coreModule(artibot) { aliases: ["infos", "about"], cooldown: 5, mainFunction: infoCommand + }), + new Command({ + id: "ping", + name: "ping", + description: localizer._("Check if the bot is alive."), + aliases: ["latence", "latency"], + cooldown: 3, + mainFunction: pingCommand }) ] }); @@ -48,11 +57,6 @@ export default function coreModule(artibot) { parts: [ // Commands - { - id: "info", - type: "command", - path: "src/commands/info.js" - }, { id: "ping", type: "command", From 6619a79344925bff67b9124a6eff8004010ba130 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 11:45:26 -0400 Subject: [PATCH 04/68] Some improvements and rework check updates command --- core/commands/checkupdates.js | 49 +++++++++++++++ core/commands/update.js | 60 ------------------- core/index.js | 18 ++++-- .../{messageCreate.js => commandHandler.js} | 4 +- index.js | 40 +++++++++++-- locales.json | 12 ++-- 6 files changed, 106 insertions(+), 77 deletions(-) create mode 100644 core/commands/checkupdates.js delete mode 100644 core/commands/update.js rename events/{messageCreate.js => commandHandler.js} (97%) diff --git a/core/commands/checkupdates.js b/core/commands/checkupdates.js new file mode 100644 index 0000000..d749a75 --- /dev/null +++ b/core/commands/checkupdates.js @@ -0,0 +1,49 @@ +import axios from "axios"; +import { Message } from "discord.js"; +import Artibot from "../../index.js"; + +/** + * Check for updates command + * @param {Message} message + * @param {string[]} args + * @param {Artibot} artibot + */ +export default async function execute(message, args, { config, localizer, version, checkForUpdates, modules }) { + // Check if config is valid + if (!config.checkForUpdates) { + message.reply(localizer._("Checking for updates is disabled in config!")); + return; + }; + + const latest = await checkForUpdates(); + + let reply = "**Available updates**\n\n"; + + if (!latest) { + reply = "**Artibot:** " + localizer._("Impossible to get latest version!") + "\n"; + } else if (version == latest) { + reply = "**Artibot:** " + localizer.__("Already up to date (v[[0]]).", { placeholders: [version] }) + "\n"; + } else { + reply = "**Artibot:** " + localizer.__("An update is available: v[[0]] --> v[[1]].", { + placeholders: [version, latest] + }) + "\n"; + } + + for (const module of modules) { + if (!module.repo) return; + const { name, version, repo } = module; + const latest = await checkForUpdates(repo); + + if (!latest) { + reply += name + ": " + localizer._("Impossible to get latest version!") + "\n"; + } else if (version == latest) { + reply += name + ": " + localizer.__("Already up to date (v[[0]]).", { placeholders: [version] }) + "\n"; + } else { + reply += name + ": " + localizer.__("An update is available: v[[0]] --> v[[1]].", { + placeholders: [version, latest] + }) + "\n"; + } + } + + message.reply(reply.trim()); +} diff --git a/core/commands/update.js b/core/commands/update.js deleted file mode 100644 index 9ee4e4c..0000000 --- a/core/commands/update.js +++ /dev/null @@ -1,60 +0,0 @@ -const updater = require("../../../../ab-core/updater"); -const { localizer } = require("../../index"); - -module.exports = { - name: "update", - description: localizer._("Intalls the updates for the bot"), - ownerOnly: true, - - execute(message, args, { config, log }) { - // Check if config is valid - if (!config.checkForUpdates) { - message.reply(localizer._("Checking for updates is disabled in config!")); - return - }; - - // If the owner really wants to do the update, let's do it - if (args[0] == "force") { - updater.checkUpdates().then(response => { - if (response.upToDate) { - message.reply(localizer.__("Artibot is already up to date (v[[0]]).", { placeholders: [response.currentVersion] })); - return - }; - - message.reply(localizer._("Starting updates... Check the console for more details.")) - - const options = { - repository: 'https://github.com/Artivain/artibot', - tempLocation: '../updaterFiles', - exitOnComplete: false, - branch: (config.checkForUpdates == "stable" ? "main" : "unstable") - }; - - updater.doUpdates(options) - .then(response => { - if (!response) { - message.reply(localizer._("An error occured while updating. Check the console for more details.")); - return - }; - message.reply( - localizer._("The update has been installed successfully.\nThe bot will now shutdown by himself.\nIf your hosting provider supports it, the bot will restart automatically.") - ).then(() => { - process.exit(1); - }); - }) - .catch(e => { - message.reply(localizer._("An error occured while updating. Check the console for more details.")); - log("Updater", localizer._("Error with the update: ") + e, "warn", true); - }); - }); - } else { - updater.checkUpdates().then(response => { - if (response.upToDate) { - message.reply(localizer.__("Artibot is up to date (v[[0]]).", { placeholders: [response.currentVersion] })); - } else { - message.reply(localizer.__("An update is available: v[[0]] --> v[[1]].\n**Read carefully the documentation before updating!**\nTo install the update, execute the `update force` command.", {placeholders: [response.currentVersion, response.remoteVersion]})); - }; - }); - }; - } -}; diff --git a/core/index.js b/core/index.js index 1c7a73c..3ef1443 100644 --- a/core/index.js +++ b/core/index.js @@ -2,6 +2,7 @@ import Artibot, { Command, Module } from "../index.js"; import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; import pingCommand from "./commands/ping.js"; +import checkupdatesCommand from "./commands/checkupdates.js"; /** * Create the Core module @@ -9,10 +10,13 @@ import pingCommand from "./commands/ping.js"; * @returns {Module} Artibot Core Module */ export default function coreModule(artibot) { - const { localizer } = artibot; + const { localizer, version } = artibot; return new Module({ name: "Artibot Core", + id: "core", + repo: "Artivain/artibot", + version, langs: ["en", "fr"], parts: [ // Commands @@ -40,6 +44,13 @@ export default function coreModule(artibot) { aliases: ["latence", "latency"], cooldown: 3, mainFunction: pingCommand + }), + new Command({ + id: "checkupdates", + name: "checkupdates", + description: localizer._("Intalls the updates for the bot"), + ownerOnly: true, + mainFunction: checkupdatesCommand }) ] }); @@ -57,11 +68,6 @@ export default function coreModule(artibot) { parts: [ // Commands - { - id: "ping", - type: "command", - path: "src/commands/ping.js" - }, { id: "update", type: "command", diff --git a/events/messageCreate.js b/events/commandHandler.js similarity index 97% rename from events/messageCreate.js rename to events/commandHandler.js index 93ca265..3f44c4f 100644 --- a/events/messageCreate.js +++ b/events/commandHandler.js @@ -63,11 +63,11 @@ export async function execute(message, artibot) { if (!command) return; // Owner Only Property, add in your command properties if true. - if (command.ownerOnly && message.author.id !== ownerId) { + if (command.ownerOnly && message.author.id !== config.ownerId) { let embedOwner = artibot.createEmbed() .setColor("RED") .setTitle(localizer._("Help on this command")) - .setDescription(localizer.__("This command can only be executed by [[0]].", { placeholders: [`<@${ownerId}>`] })); + .setDescription(localizer.__("This command can only be executed by [[0]].", { placeholders: [`<@${config.ownerId}>`] })); return message.reply({ embeds: [embedOwner] }); } diff --git a/index.js b/index.js index e5cbe43..0dbbfca 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,7 @@ const { version } = require('./package.json'); import coreModule from "./core/index.js"; import { readdirSync } from "fs"; +import axios from "axios"; /** * Powerful Discord bot system. @@ -92,7 +93,7 @@ export default class Artibot { this.modules = []; // Register the Core module - this.registerModule(coreModule(this)); + this.registerModule(coreModule); } log = log; @@ -146,13 +147,37 @@ export default class Artibot { /** * Register a module in Artibot - * @param {Module} module - The module to register + * @param {Module|function(Artibot): Module} module - The module to register or a function to initialize the module */ - registerModule(module) { + registerModule = (module) => { + if (typeof module == "function") module = module(this); this.modules.push(module); log("Artibot", "Registered module: " + module.name, "info", true); module.parts.forEach(part => log("Artibot", `- [${part.type}] ${part.id}`, "log", true)); } + + /** + * Get latest release version of a GitHub repository + * @param {string} [repo="Artivain/artibot"] - GitHub repository to get latest version + * @returns {string|false} Version number, or false if repo not found or an error happens + * @async + */ + checkForUpdates = async (repo = "Artivain/artibot") => { + const request = await axios({ + method: "GET", + url: `https://api.github.com/repos/${repo}/releases/latest`, + responseType: "json", + headers: { + "User-Agent": "Artibot " + this.version + }, + validateStatus: () => { return true } + }); + + if (request.status != 200) return false; + + const { data } = request; + return data.name.replace("v", ""); + } } /** @@ -167,17 +192,22 @@ export class Module { /** * @param {Object} config - Configuration for the module * @param {string} config.name - Name of the module + * @param {string} config.id - ID of this module * @param {string} config.version - Version of the module (ex.: "1.2.3") - * @param {string[]} config.langs - List of supported languages (ex.: "en", "fr") + * @param {string[]} config.langs - List of supported languages (ex.: ["en", "fr"]) * @param {ModulePartResolvable[]} config.parts - List of parts of the module * @param {IntentsResolvable[]} [config.intents] - List of required intents + * @param {string} [config.repo] - GitHub repository of the module (ex.: "Artivain/artibot") */ - constructor({ name, version, langs, parts, intents = [] }) { + constructor({ name, id, version, langs, parts, intents = [], repo }) { + if (!name || !id || !version || !langs || !parts) throw new Error("Missing module informations!"); this.name = name; + this.id = id; this.version = version; this.langs = langs; this.parts = parts; this.additionalIntents = intents; + this.repo = repo; } } diff --git a/locales.json b/locales.json index 803ab45..d623737 100644 --- a/locales.json +++ b/locales.json @@ -387,8 +387,8 @@ "fr": "La vérification des mises à jour est désactivée dans la config!" }, - "Artibot is already up to date (v[[0]]).": { - "fr": "Artibot est déjà à jours (v[[0]])." + "Already up to date (v[[0]]).": { + "fr": "Déjà à jours (v[[0]])." }, "Starting updates... Check the console for more details.": { @@ -407,8 +407,12 @@ "fr": "Problème avec la mise à jour: " }, - "An update is available: v[[0]] --> v[[1]].\n**Read carefully the documentation before updating!**\nTo install the update, execute the `update force` command.": { - "fr": "Une mise à jour est disponible: v[[0]] --> v[[1]].\n**Bien lire la documentation avant de faire la mise à jour!**\nPour faire la mise à jour, faire la commande `update force`." + "An update is available: v[[0]] --> v[[1]].": { + "fr": "Une mise à jour est disponible: v[[0]] --> v[[1]]." + }, + + "Impossible to get latest version!": { + "fr": "Impossible d'obtenir la dernière version!" }, "Make an embed and send it in the channel.": { From 82965df8600b0087ff788bec6c3f0095123a89ce Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 12:48:45 -0400 Subject: [PATCH 05/68] Remove "reload" command Unfortunately, I have no idea how to make it work with the new system... --- core/commands/reload.js | 49 ----------------------------------------- core/index.js | 10 --------- index.js | 6 ++--- 3 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 core/commands/reload.js diff --git a/core/commands/reload.js b/core/commands/reload.js deleted file mode 100644 index 9fbeabf..0000000 --- a/core/commands/reload.js +++ /dev/null @@ -1,49 +0,0 @@ -const { localizer } = require("../../index"); - -module.exports = { - name: "reload", - description: localizer._("Reloads a command"), - args: localizer._(""), - ownerOnly: true, - - execute(message, args, { log }) { - - const commandName = args[0].toLowerCase(); - - const data = - message.client.commands.get(commandName) || - message.client.commands.find(({ command }) => command.aliases && command.aliases.includes(commandName)); - - // Command returns if there is no such command with the specific command name or alias. - if (!data) { - return message.channel.send({ - content: localizer.__("There is no command with the name or alias `[[0]]`, [[1]]!", { placeholders: [commandName, message.author] }), - }); - }; - - // Deletes current cache of that specified command. - const filePath = `../../../${data.module.id}/${data.part.path}`; - delete require.cache[ - require.resolve(filePath) - ]; - - // Tries Registering command again with new code. - - try { - - const newCommand = require(filePath); - - // Now registers the command in commands Collection. If it fails, the catch block will be executed. - message.client.commands.set(newCommand.name, { command: newCommand, part: data.part, module: data.module }); - - // 🎉 Confirmation sent if reloading was successful! - message.channel.send({ content: localizer.__("The command `[[0]]` has been reloaded!", { placeholders: [newCommand.name] }) }); - log("CommandManager", localizer.__("Reloaded command [[0]]", { placeholders: [newCommand.name] }), "log", true); - } catch (error) { - // Catch block executes if there is any error in your code. It logs the error in console and also sends back in discord GUI. - - log("CommandManager", error, "warn", true); - message.channel.send({ content: localizer.__("An error occured while reloading the `[[0]]` command:\n`[[1]]`", { placeholders: [data.command.name, error.message] }) }); - }; - } -}; diff --git a/core/index.js b/core/index.js index 3ef1443..cf6aad3 100644 --- a/core/index.js +++ b/core/index.js @@ -68,16 +68,6 @@ export default function coreModule(artibot) { parts: [ // Commands - { - id: "update", - type: "command", - path: "src/commands/update.js" - }, - { - id: "reload", - type: "command", - path: "src/commands/reload.js" - }, { id: "resetinteractions", type: "command", diff --git a/index.js b/index.js index 0dbbfca..f3f1aa1 100644 --- a/index.js +++ b/index.js @@ -248,11 +248,11 @@ export class Command extends BasePart { * @param {boolean} [config.ownerOnly=false] - If the command can only be executed by the owner * @param {boolean} [config.guildOnly=false] - If the command can only be executed in a guild * @param {Permissions} [config.permissions] - Required permissions - * @param {boolean} [config.requireArgs=false] - Set to true if the command needs at least one argument + * @param {boolean} [config.requiresArgs=false] - Set to true if the command needs at least one argument * @param {function(Message, string[], Artibot): void} config.mainFunction - Function to execute when the command is ran * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup */ - constructor({ id, name, description, aliases = [], usage, cooldown, ownerOnly = false, guildOnly = false, permissions, requireArgs = false, mainFunction, initFunction }) { + constructor({ id, name, description, aliases = [], usage, cooldown, ownerOnly = false, guildOnly = false, permissions, requiresArgs = false, mainFunction, initFunction }) { super({ id, type: "command", mainFunction, initFunction }); this.name = name; this.description = description; @@ -262,7 +262,7 @@ export class Command extends BasePart { this.ownerOnly = ownerOnly; this.guildOnly = guildOnly; this.permissions = permissions; - this.args = requireArgs; + this.args = requiresArgs; } } From ff488796b8b7d73776fc158f51dc04c6988b6b87 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 14:13:52 -0400 Subject: [PATCH 06/68] Add uptime command Start to work on slash commands --- core/commands/help.js | 4 ++-- core/commands/uptime.js | 19 +++++++++++++++++++ core/index.js | 7 +++++++ index.js | 28 ++++++++++++++++++++-------- interactionManager.js | 4 +--- locales.json | 20 ++++++++++++++++++++ testing.js | 3 ++- 7 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 core/commands/uptime.js diff --git a/core/commands/help.js b/core/commands/help.js index 4e5dce7..439456b 100644 --- a/core/commands/help.js +++ b/core/commands/help.js @@ -70,9 +70,9 @@ export default async function helpCommand(message, args, artibot) { if (command.description) commandEmbed.setDescription(`${command.description}`); - if (command.aliases) { + if (command.aliases.length) { commandEmbed - .addField(localizer._("Alias"), `\`${command.aliases.join(", ")}\``, true) + .addField(localizer._("Alias"), `\`${command.aliases.join("`, `")}\``, true) .addField(localizer._("Cooldown"), `${command.cooldown || 3} ${localizer._("second(s)")}`, true); } diff --git a/core/commands/uptime.js b/core/commands/uptime.js new file mode 100644 index 0000000..5253a3a --- /dev/null +++ b/core/commands/uptime.js @@ -0,0 +1,19 @@ +import { Message } from "discord.js"; +import Artibot from "../../index.js"; + +/** + * Uptime command + * @param {Message} message + * @param {string[]} args + * @param {Artibot} artibot + */ +export default function execute(message, args, { createEmbed, localizer }) { + const uptime = parseInt((Date.now() - message.client.uptime) / 1000); + message.reply({ + embeds: [ + createEmbed() + .setTitle("Uptime") + .setDescription(localizer.__("Online since ()", { placeholders: [uptime] })) + ] + }) +} \ No newline at end of file diff --git a/core/index.js b/core/index.js index cf6aad3..af45930 100644 --- a/core/index.js +++ b/core/index.js @@ -3,6 +3,7 @@ import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; import pingCommand from "./commands/ping.js"; import checkupdatesCommand from "./commands/checkupdates.js"; +import uptimeCommand from "./commands/uptime.js"; /** * Create the Core module @@ -51,6 +52,12 @@ export default function coreModule(artibot) { description: localizer._("Intalls the updates for the bot"), ownerOnly: true, mainFunction: checkupdatesCommand + }), + new Command({ + id: "uptime", + name: "uptime", + description: localizer._("Get the bot uptime"), + mainFunction: uptimeCommand }) ] }); diff --git a/index.js b/index.js index f3f1aa1..ca89fa1 100644 --- a/index.js +++ b/index.js @@ -5,12 +5,13 @@ import chalk from "chalk"; import figlet from "figlet"; import { Client, Collection, Intents, MessageEmbed, Permissions } from "discord.js"; import { createRequire } from 'module'; -const require = createRequire(import.meta.url); -const { version } = require('./package.json'); - import coreModule from "./core/index.js"; import { readdirSync } from "fs"; import axios from "axios"; +import { SlashCommandBuilder } from "@discordjs/builders"; + +const require = createRequire(import.meta.url); +const { version } = require('./package.json'); /** * Powerful Discord bot system. @@ -84,7 +85,7 @@ export default class Artibot { font: 'ANSI Shadow', horizontalLayout: 'fitted' }))); - log("Artibot", "Initialized! v" + version, "info", true); + log("Artibot", this.localizer._("Initialized!") + " v" + version, "info", true); /** * List of registered modules @@ -110,12 +111,20 @@ export default class Artibot { /** Lists of people who contributed to the Artibot */ contributors = require("./contributors.json"); + /** + * The token to login into Discord + * @type {string} + */ + #token; + /** * @param {Object} config - Advanced config for the bot - * @param {string} config.token - The login token for the Discord bot + * @param {string} [config.token] - The login token for the Discord bot * @param {IntentsResolvable[]} [config.additionalIntents] - Additional intents to register in the Discord client */ - async login({ token, additionalIntents = [] }) { + async login({ token = this.#token, additionalIntents = [] }) { + if (!token) throw new Error("Token not set!"); + this.#token = token; this.modules.forEach(module => additionalIntents = additionalIntents.concat(module.additionalIntents)); this.client = new Client({ intents: [ @@ -131,6 +140,7 @@ export default class Artibot { this.listeners = []; + log("Artibot", this.localizer._("Loading event listeners..."), "log", true); const eventFiles = readdirSync("./events").filter(file => file.endsWith(".js")); for (const file of eventFiles) { @@ -152,7 +162,7 @@ export default class Artibot { registerModule = (module) => { if (typeof module == "function") module = module(this); this.modules.push(module); - log("Artibot", "Registered module: " + module.name, "info", true); + log("Artibot", this.localizer._("Registered module: ") + module.name, "info", true); module.parts.forEach(part => log("Artibot", `- [${part.type}] ${part.id}`, "log", true)); } @@ -275,13 +285,15 @@ export class SlashCommand extends BasePart { * @param {Object} config - Config for this command * @param {string} config.id - ID of the command * @param {SlashCommandBuilder} config.data - Data to register into the Discord API + * @param {number} [config.cooldown=1] - Cooldown per user for this command, in seconds * @param {function(Interaction, Artibot): void} config.mainFunction - Function to execute when the command is ran * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup */ - constructor({ id, data, mainFunction, initFunction }) { + constructor({ id, data, cooldown = 1, mainFunction, initFunction }) { if (!data) throw new Error("Missing data parameter"); super({ id, type: "slashcommand", mainFunction, initFunction }); this.data = data; + this.cooldown = cooldown; } } diff --git a/interactionManager.js b/interactionManager.js index a1b9827..9cb4ba6 100644 --- a/interactionManager.js +++ b/interactionManager.js @@ -13,11 +13,9 @@ export default class InteractionManager { * @param {Object} parameters - Parameters for this InteractionManager * @param {string} parameters.token - Token for the Discord bot * @param {Snowflake} parameters.clientId - Client ID of the bot - * @param {Localizer} parameters.localizer - Lang that messages should be in * @param {Snowflake} [parameters.testGuildId] - ID of the test Discord server (required only if devMode is true) - * @param {boolean} [parameters.devMode=true] - If set to true, it will register interactions only for the test guild */ - constructor({ token, clientId, testGuildId, devMode = true, localizer }) { + constructor({ token, clientId, testGuildId, devMode = true }) { this.rest = new REST({ version: "9" }); this.commandJsonData = []; this.rest.setToken(token); diff --git a/locales.json b/locales.json index d623737..6c3d817 100644 --- a/locales.json +++ b/locales.json @@ -581,6 +581,26 @@ "Learn more": { "fr": "En savoir plus" + }, + + "Registered module: ": { + "fr": "Initialisation du module: " + }, + + "Loading event listeners...": { + "fr": "Chargement des event listeners" + }, + + "Initialized!": { + "fr": "Initialisé!" + }, + + "Online since ()": { + "fr": "En ligne depuis ()" + }, + + "Get the bot uptime": { + "fr": "Savoir depuis combien de temps le bot est en ligne" } } diff --git a/testing.js b/testing.js index 448bb11..339f3af 100644 --- a/testing.js +++ b/testing.js @@ -4,7 +4,8 @@ import token from "./private.js"; const artibot = new Artibot({ ownerId: "382869186042658818", botName: "Artibot [DEV]", - prefix: "abd " + prefix: "abd ", + lang: "fr" }); artibot.login({ token }); \ No newline at end of file From c104c16f6244fd937b94225e39b49e819669c697 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 14:47:06 -0400 Subject: [PATCH 07/68] Verify that module support the config language --- index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ca89fa1..4357ab4 100644 --- a/index.js +++ b/index.js @@ -163,7 +163,14 @@ export default class Artibot { if (typeof module == "function") module = module(this); this.modules.push(module); log("Artibot", this.localizer._("Registered module: ") + module.name, "info", true); - module.parts.forEach(part => log("Artibot", `- [${part.type}] ${part.id}`, "log", true)); + + if (module.langs != "any" && !module.langs.includes(this.config.lang)) { + log("Artibot", this.localizer.__(" -> This module does not support the [[0]] language!", {placeholders: [this.config.lang]}), "warn", true); + } + + for (const part of module.parts) { + log("Artibot", `- [${part.type}] ${part.id}`, "log", true); + } } /** @@ -204,12 +211,12 @@ export class Module { * @param {string} config.name - Name of the module * @param {string} config.id - ID of this module * @param {string} config.version - Version of the module (ex.: "1.2.3") - * @param {string[]} config.langs - List of supported languages (ex.: ["en", "fr"]) + * @param {string[]|"any"} [config.langs] - List of supported languages (ex.: ["en", "fr"]). If this does not apply, set to "any". * @param {ModulePartResolvable[]} config.parts - List of parts of the module * @param {IntentsResolvable[]} [config.intents] - List of required intents * @param {string} [config.repo] - GitHub repository of the module (ex.: "Artivain/artibot") */ - constructor({ name, id, version, langs, parts, intents = [], repo }) { + constructor({ name, id, version, langs = "any", parts, intents = [], repo }) { if (!name || !id || !version || !langs || !parts) throw new Error("Missing module informations!"); this.name = name; this.id = id; From f2b30517e1a427f8c636cb7332091a7c535c6a48 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 16:27:12 -0400 Subject: [PATCH 08/68] Slash commands now work Rework embed slash command Improve embed slash command (support newlines) --- core/index.js | 38 ++++++- core/slash-commands/embed.js | 118 ++++++++------------- events/registerInteractions.js | 20 ++++ events/{slashCreate.js => slashHandler.js} | 30 +++--- index.js | 5 +- interactionManager.js | 53 ++++++--- locales.json | 10 +- testing.js | 3 +- 8 files changed, 170 insertions(+), 107 deletions(-) create mode 100644 events/registerInteractions.js rename events/{slashCreate.js => slashHandler.js} (54%) diff --git a/core/index.js b/core/index.js index af45930..2a55667 100644 --- a/core/index.js +++ b/core/index.js @@ -1,9 +1,11 @@ -import Artibot, { Command, Module } from "../index.js"; +import Artibot, { Command, Module, SlashCommand } from "../index.js"; import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; import pingCommand from "./commands/ping.js"; import checkupdatesCommand from "./commands/checkupdates.js"; import uptimeCommand from "./commands/uptime.js"; +import { SlashCommandBuilder } from "@discordjs/builders"; +import embedSlashCommand from "./slash-commands/embed.js"; /** * Create the Core module @@ -58,6 +60,40 @@ export default function coreModule(artibot) { name: "uptime", description: localizer._("Get the bot uptime"), mainFunction: uptimeCommand + }), + + // Slash commands + new SlashCommand({ + id: "embed", + data: new SlashCommandBuilder() + .setName("embed") + .setDescription(localizer._("Make an embed and send it in the channel.")) + .addStringOption(option => + option.setName("title") + .setDescription(localizer._("The title for the embed")) + .setRequired(true) + ) + .addStringOption(option => + option.setName("content") + .setDescription(localizer._("The content for the embed (message, rules, infos, etc...)")) + .setRequired(true) + ) + .addBooleanOption(option => + option.setName("date") + .setDescription(localizer._("To show or not the date in the footer")) + .setRequired(true) + ) + .addStringOption(option => + option.setName("footer") + .setDescription(localizer._("The text for the footer of the embed")) + .setRequired(false) + ) + .addStringOption(option => + option.setName("color") + .setDescription(localizer._("The color at the left of the embed (in hexadecimal notation, ex.: #ffffff)")) + .setRequired(false) + ), + mainFunction: embedSlashCommand }) ] }); diff --git a/core/slash-commands/embed.js b/core/slash-commands/embed.js index 0bc46dc..4f217f9 100644 --- a/core/slash-commands/embed.js +++ b/core/slash-commands/embed.js @@ -1,75 +1,45 @@ -const { MessageEmbed, Permissions } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const { localizer } = require("../../index"); - -module.exports = { - data: new SlashCommandBuilder() - .setName("embed") - .setDescription(localizer._("Make an embed and send it in the channel.")) - .addStringOption(option => - option.setName("title") - .setDescription(localizer._("The title for the embed")) - .setRequired(true) - ) - .addStringOption(option => - option.setName("content") - .setDescription(localizer._("The content for the embed (message, rules, infos, etc...)")) - .setRequired(true) - ) - .addBooleanOption(option => - option.setName("date") - .setDescription(localizer._("To show or not the date in the footer")) - .setRequired(true) - ) - .addStringOption(option => - option.setName("footer") - .setDescription(localizer._("The text for the footer of the embed")) - .setRequired(false) - ) - .addStringOption(option => - option.setName("color") - .setDescription(localizer._("The color at the left of the embed (in hexadecimal notation, ex.: #ffffff)")) - .setRequired(false) - ), - - async execute(interaction, { config }) { - - if (interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR)) { - - const title = interaction.options.getString("title"), - color = interaction.options.getString("color"), - content = interaction.options.getString("content"), - footerText = interaction.options.getString("footer"), - date = interaction.options.getBoolean("date"); - - var embed = new MessageEmbed() - .setColor((color ? color : config.embedColor)) - .setTitle(title) - .setDescription(content); - - if (footerText) embed.setFooter({ text: footerText }); - if (date) embed.setTimestamp(); - - interaction.channel.send({ embeds: [embed] }); - - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(localizer._("Create an embed")) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("The embed *[[0]]* should have been created.", { placeholders: [title] })); - } else { - var embed = new MessageEmbed() - .setColor("RED") - .setTitle(localizer._("Create an embed")) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("Error: you don't have admin perms!")); - } - - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); +import { CommandInteraction, MessageEmbed, Permissions } from "discord.js"; +import Artibot from "../../index.js"; + +/** + * Slash command to create an embed + * @param {CommandInteraction} interaction + * @param {Artibot} artibot + */ +export default async function execute(interaction, { config, localizer, createEmbed }) { + + if (interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR)) { + + const title = interaction.options.getString("title"), + color = interaction.options.getString("color"), + content = interaction.options.getString("content").replace(/\\r\\n|\\n|
/g, "\n"), + footerText = interaction.options.getString("footer"), + date = interaction.options.getBoolean("date"); + + var embed = new MessageEmbed() + .setColor((color ? color : config.embedColor)) + .setTitle(title) + .setDescription(content); + + if (footerText) + embed.setFooter({ text: footerText }); + if (date) + embed.setTimestamp(); + + interaction.channel.send({ embeds: [embed] }); + + var embed = createEmbed() + .setTitle(localizer._("Create an embed")) + .setDescription(localizer.__("The embed *[[0]]* should have been created.", { placeholders: [title] })); + } else { + var embed = createEmbed() + .setColor("RED") + .setTitle(localizer._("Create an embed")) + .setDescription(localizer._("Error: you don't have admin perms!")); } -}; + + await interaction.reply({ + embeds: [embed], + ephemeral: true + }); +} diff --git a/events/registerInteractions.js b/events/registerInteractions.js new file mode 100644 index 0000000..27fa125 --- /dev/null +++ b/events/registerInteractions.js @@ -0,0 +1,20 @@ +import { Client } from "discord.js"; +import Artibot from "../index.js"; +import InteractionManager from "../interactionManager.js"; + +export const name = "ready"; + +/** + * Register interactions into Discord API + * @param {Client} client + * @param {Artibot} artibot + */ +export async function execute(client, artibot) { + artibot.interactionManager = new InteractionManager({ + token: client.token, + artibot + }); + + artibot.interactionManager.generateData(artibot.modules); + await artibot.interactionManager.register(); +} \ No newline at end of file diff --git a/events/slashCreate.js b/events/slashHandler.js similarity index 54% rename from events/slashCreate.js rename to events/slashHandler.js index a24ef01..5a222be 100644 --- a/events/slashCreate.js +++ b/events/slashHandler.js @@ -9,27 +9,31 @@ export const name = "interactionCreate"; * @param {Artibot} artibot */ export async function execute(interaction, artibot) { - // Deconstructed client from interaction object. - const { client } = interaction; - const { log, localizer } = artibot; + const { log, localizer, modules } = artibot; - // Checks if the interaction is a command (to prevent weird bugs) - if (!interaction.isCommand()) - return; + // Checks if the interaction is a command + if (!interaction.isCommand()) return; - const data = client.slashCommands.get(interaction.commandName); + let command; - // If the interaction is not a command in cache. - if (!data) - return; + for (const module of modules) { + if (command) break; + for (const part of module.parts) { + if (part.type == "slashcommand") { + command = part; + break; + } + } + } - const { command } = data; + // If the interaction is not a command in cache. + if (!command) return; // A try to executes the interaction. try { - await command.execute(interaction, commons); + await command.execute(interaction, artibot); } catch (err) { - log("SlashManager", err, "warn", true); + log("SlashHandler", err, "warn", true); await interaction.reply({ content: localizer._("An error occured while executing this command."), ephemeral: true diff --git a/index.js b/index.js index 4357ab4..3016c04 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ export default class Artibot { /** * @param {Object} config - Configuration for Artibot * @param {Snowflake} config.ownerId - Discord ID of the owner of the bot - * @param {Snowflake} [config.testGuildId] - Discord ID of the testing guild. Not required if devMode is set to false. + * @param {Snowflake} config.testGuildId - Discord ID of the testing guild * @param {string} [config.botName] - Name of the Discord bot. Used almost everywhere. * @param {string} [config.botIcon] - URL of the profile picture of the bot * @param {string} [config.prefix] - Prefix for the commands @@ -49,6 +49,9 @@ export default class Artibot { // Verify that the owner ID is set if (!ownerId) throw new Error("You must set the owner ID."); + // Verify that the test guild ID is set + if (!testGuildId) throw new Error("You must set the test guild ID."); + // Verify that if dev mode is false, the test guild ID is set if (!devMode && !testGuildId) throw new Error("You must set the testGuildId if devMode is false."); diff --git a/interactionManager.js b/interactionManager.js index 9cb4ba6..bf99e71 100644 --- a/interactionManager.js +++ b/interactionManager.js @@ -1,9 +1,7 @@ import { REST } from "@discordjs/rest"; import { Routes } from "discord-api-types/v9"; -import log from "./logger.js"; -import Localizer from "artibot-localizer"; -import { resolve } from "path"; import { Client } from "discord.js"; +import Artibot, { log, Module } from "./index.js"; /** * Interaction management utility for Artibot @@ -12,29 +10,50 @@ export default class InteractionManager { /** * @param {Object} parameters - Parameters for this InteractionManager * @param {string} parameters.token - Token for the Discord bot - * @param {Snowflake} parameters.clientId - Client ID of the bot - * @param {Snowflake} [parameters.testGuildId] - ID of the test Discord server (required only if devMode is true) + * @param {Artibot} [parameters.artibot] */ - constructor({ token, clientId, testGuildId, devMode = true }) { + constructor({ token, artibot: { localizer, client, config: { testGuildId, devMode } } }) { this.rest = new REST({ version: "9" }); - this.commandJsonData = []; this.rest.setToken(token); - this.clientId = clientId; + this.clientId = client.user.id; this.testGuildId = testGuildId; this.devMode = devMode; this.localizer = localizer; } + /** + * JSON data of all slash commands and other interactions + * @type {string[]} + */ + commandJSONData = []; + /** * Generate data to send to Discord API to register interactions - * @param {Client} client - The Discord client for the bot + * @param {Module[]} modules - List of the modules to generate data from + */ + generateData(modules) { + // this.commandJSONData = [ + // ...Array.from(client.slashCommands.values()).map(({ command }) => command.data.toJSON()), + // ...Array.from(client.contextCommands.values()).map(({ command }) => command.data), + // ]; + + for (const module of modules) { + for (const part of module.parts) { + if (part.type == "slashcommand") { + this.commandJSONData.push(part.data.toJSON()); + } else if (part.type == "usermenu" || part.type == "messagemenu") { + this.commandJSONData.push(part.data); + } + } + } + } + + /** + * Empty all stored JSON data */ - generateData(client) { - this.commandJsonData = [ - ...Array.from(client.slashCommands.values()).map(({ command }) => command.data.toJSON()), - ...Array.from(client.contextCommands.values()).map(({ command }) => command.data), - ]; + resetData() { + this.commandJSONData.length = 0; } /** @@ -44,6 +63,7 @@ export default class InteractionManager { async register() { try { log("InteractionManager", this.localizer._("Initializing interactions and slash commands on Discord..."), "info", true); + if (!this.commandJSONData.length) return log("InteractionManager", this.localizer._("Nothing to register."), "warn", true); /* Send slash commands and other interactions to Discord API. @@ -56,16 +76,17 @@ export default class InteractionManager { if (this.devMode) { await this.rest.put( Routes.applicationGuildCommands(this.clientId, this.testGuildId), - { body: this.commandJsonData } + { body: this.commandJSONData } ); } else { await this.rest.put( Routes.applicationCommands(this.clientId), - { body: this.commandJsonData } + { body: this.commandJSONData } ); }; log("InteractionManager", this.localizer._("Interaction and slash commands initialized successfully."), "log", true); + log("InteractionManager", this.localizer.__(" -> Registered [[0]] interactions.", { placeholders: [this.commandJSONData.length] }), "log", true); return true; } catch (error) { log("InteractionManager", this.localizer._("An error occured when initializing interactions and slash commands, here are the details: ") + error, "warn", true); diff --git a/locales.json b/locales.json index 6c3d817..adf950f 100644 --- a/locales.json +++ b/locales.json @@ -84,7 +84,7 @@ }, "An error occured when initializing interactions and slash commands, here are the details: ": { - "fr": "Une erreur est survenue avec l'initialisation des interactions et commandes slash, voici les détais: " + "fr": "Une erreur est survenue avec l'initialisation des interactions et commandes slash, voici les détails: " }, "An error occured when executing this button...": { @@ -601,6 +601,14 @@ "Get the bot uptime": { "fr": "Savoir depuis combien de temps le bot est en ligne" + }, + + " -> Registered [[0]] interactions.": { + "fr": " -> [[0]] interactions ont été enregistrées." + }, + + "Nothing to register.": { + "fr": "Rien à enregistrer." } } diff --git a/testing.js b/testing.js index 339f3af..b247a32 100644 --- a/testing.js +++ b/testing.js @@ -5,7 +5,8 @@ const artibot = new Artibot({ ownerId: "382869186042658818", botName: "Artibot [DEV]", prefix: "abd ", - lang: "fr" + lang: "fr", + testGuildId: "775798875356397608" }); artibot.login({ token }); \ No newline at end of file From 39503f1b22e691c5e7c91ba824bb4546e89181b8 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 17:28:20 -0400 Subject: [PATCH 09/68] Rework help slash command verify that it's the good command name... --- core/commands/help.js | 1 - core/index.js | 18 +++-- core/slash-commands/help.js | 129 ++++++++++++++++++++---------------- events/commandHandler.js | 9 ++- events/slashHandler.js | 2 +- 5 files changed, 92 insertions(+), 67 deletions(-) diff --git a/core/commands/help.js b/core/commands/help.js index 439456b..f5cb3a5 100644 --- a/core/commands/help.js +++ b/core/commands/help.js @@ -7,7 +7,6 @@ import Artibot from "../../index.js"; */ export default async function helpCommand(message, args, artibot) { const { localizer, log, createEmbed, config } = artibot; - const { commands } = artibot.modules; // If there are no args, it means it needs whole help command. diff --git a/core/index.js b/core/index.js index 2a55667..a4afe7c 100644 --- a/core/index.js +++ b/core/index.js @@ -6,6 +6,7 @@ import checkupdatesCommand from "./commands/checkupdates.js"; import uptimeCommand from "./commands/uptime.js"; import { SlashCommandBuilder } from "@discordjs/builders"; import embedSlashCommand from "./slash-commands/embed.js"; +import helpSlashCommand from "./slash-commands/help.js"; /** * Create the Core module @@ -94,6 +95,18 @@ export default function coreModule(artibot) { .setRequired(false) ), mainFunction: embedSlashCommand + }), + new SlashCommand({ + id: "help", + data: new SlashCommandBuilder() + .setName("help") + .setDescription(localizer._("Gives a list of commands or infos about a specific command.")) + .addStringOption(option => + option + .setName("command") + .setDescription(localizer._("The command to get infos on.")) + ), + mainFunction: helpSlashCommand }) ] }); @@ -118,11 +131,6 @@ export default function coreModule(artibot) { }, // Slash commands - { - id: "embed", - type: "slashcommand", - path: "src/slash-commands/embed.js" - }, { id: "help", type: "slashcommand", diff --git a/core/slash-commands/help.js b/core/slash-commands/help.js index 2773611..9ad9a41 100644 --- a/core/slash-commands/help.js +++ b/core/slash-commands/help.js @@ -1,61 +1,76 @@ -const { MessageEmbed } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const { localizer } = require("../../index"); - -module.exports = { - // The data needed to register slash commands to Discord. - data: new SlashCommandBuilder() - .setName("help") - .setDescription(localizer._("Gives a list of commands or infos about a specific command.")) - .addStringOption(option => - option - .setName("command") - .setDescription(localizer._("The command to get infos on.")) - ), - - async execute(interaction, { config }) { - - const commands = interaction.client.slashCommands; - let name = interaction.options.getString("command"); - - const helpEmbed = new MessageEmbed() - .setColor(config.embedColor) - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }); - - if (name) { - name = name.toLowerCase(); - // If a single command has been asked for, send only this command's help. - helpEmbed.setTitle(localizer.__("Help on command `[[0]]`", { placeholders: [name] })); - if (commands.has(name)) { - const command = commands.get(name).command.data; - if (command.description) helpEmbed.setDescription(command.description + "\n\n**" + localizer._("Parameters:") + "**"); - command.options.forEach(option => { - let content = option.description; - if (option.choices) { - let choices = `\n${localizer._("Choices:")} `; - option.choices.forEach(choice => choices += choice + ", "); - choices = choices.slice(0, -2); - content += choices; - }; - if (!option.required) content += `\n*${localizer._("Optional")}*`; - helpEmbed.addField(option.name, content.trim(), true); - }); - } else { - helpEmbed.setDescription(localizer.__("There is no slash command with the name `[[0]]`.", { placeholders: [name] })).setColor("YELLOW"); - }; +import { CommandInteraction } from "discord.js"; +import Artibot, { SlashCommand } from "../../index.js"; + +/** + * Help slash command + * @param {CommandInteraction} interaction + * @param {Artibot} artibot + */ +export default async function execute(interaction, { config, localizer, createEmbed, modules }) { + let name = interaction.options.getString("command"); + + const helpEmbed = createEmbed(); + + /** + * List of all slash commands + * @type {SlashCommand[]} + */ + let commands = []; + + for (const module of modules) { + for (const part of module.parts) { + if (part.type == "slashcommand") commands.push(part); + } + } + + if (name) { + name = name.toLowerCase(); + // If a single command has been asked for, send only this command's help. + helpEmbed.setTitle(localizer.__("Help on command `[[0]]`", { placeholders: [name] })); + const command = commands.find(command => command.data.name == name); + if (command) { + if (command.data.description) helpEmbed.setDescription(command.data.description + "\n\n**" + localizer._("Parameters:") + "**"); + + command.data.options.forEach(option => { + /** @type {string} */ + let content = option.description; + + if (option.choices) { + let choices = `\n${localizer._("Choices:")} `; + option.choices.forEach(choice => choices += choice + ", "); + choices = choices.slice(0, -2); + content += choices; + }; + + if (!option.required) content += `\n*${localizer._("Optional")}*`; + + helpEmbed.addField(option.name, content.trim(), true); + }); + } else { - // Give a list of all the commands helpEmbed - .setTitle(localizer._("List of all slash commands")) - .setDescription( - "`" + commands.map(({ command }) => command.data.name).join("`, `") + "`\n\n" + localizer._("You can also have a list of classic commands with") + " `" + config.prefix + "help`." - ); + .setDescription(localizer.__("There is no slash command with the name `[[0]]`.", { placeholders: [name] })) + .setColor("YELLOW"); }; + } else { + /** + * List of the names of all slash commands + * @type {string[]} + */ + const names = []; + + for (const command of commands) { names.push(command.data.name) } + + // Give a list of all the commands + helpEmbed + .setTitle(localizer._("List of all slash commands")) + .setDescription( + "`" + names.join("`, `") + "`\n\n" + localizer._("You can also have a list of classic commands with") + " `" + config.prefix + "help`." + ); + }; - // Reply to the interaction - await interaction.reply({ - embeds: [helpEmbed], - }); - }, -}; + // Reply to the interaction + await interaction.reply({ + embeds: [helpEmbed], + }); +} diff --git a/events/commandHandler.js b/events/commandHandler.js index 3f44c4f..ee424ef 100644 --- a/events/commandHandler.js +++ b/events/commandHandler.js @@ -2,8 +2,11 @@ import { Collection, Message } from "discord.js"; import Artibot, { Command } from "../index.js"; import onMention from "../messages/onMention.js" -// Prefix regex, we will use to match in mention prefix. -const escapeRegex = (string) => { +/** + * @param {string} string + * @returns {string} + */ +function escapeRegex(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); }; @@ -126,7 +129,7 @@ export async function execute(message, artibot) { try { command.execute(message, args, artibot); } catch (error) { - log("CommandManager", error, "warn", true); + log("CommandHandler", error, "warn", true); message.reply({ content: localizer._("An error occured while trying to run this command.") }); diff --git a/events/slashHandler.js b/events/slashHandler.js index 5a222be..b9aa545 100644 --- a/events/slashHandler.js +++ b/events/slashHandler.js @@ -19,7 +19,7 @@ export async function execute(interaction, artibot) { for (const module of modules) { if (command) break; for (const part of module.parts) { - if (part.type == "slashcommand") { + if (part.type == "slashcommand" && part.data.name == interaction.commandName) { command = part; break; } From ddb64a66909890384b43fe395618dd22dd55f7e4 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 17:38:54 -0400 Subject: [PATCH 10/68] Migrate info slash command --- core/index.js | 13 +++-- core/slash-commands/info.js | 111 +++++++++++++++++------------------- 2 files changed, 61 insertions(+), 63 deletions(-) diff --git a/core/index.js b/core/index.js index a4afe7c..94e9ae7 100644 --- a/core/index.js +++ b/core/index.js @@ -7,6 +7,7 @@ import uptimeCommand from "./commands/uptime.js"; import { SlashCommandBuilder } from "@discordjs/builders"; import embedSlashCommand from "./slash-commands/embed.js"; import helpSlashCommand from "./slash-commands/help.js"; +import infoSlashCommand from "./slash-commands/info.js"; /** * Create the Core module @@ -107,6 +108,13 @@ export default function coreModule(artibot) { .setDescription(localizer._("The command to get infos on.")) ), mainFunction: helpSlashCommand + }), + new SlashCommand({ + id: "info", + data: new SlashCommandBuilder() + .setName("info") + .setDescription(localizer._("Learn more about this bot.")), + mainFunction: infoSlashCommand }) ] }); @@ -131,11 +139,6 @@ export default function coreModule(artibot) { }, // Slash commands - { - id: "help", - type: "slashcommand", - path: "src/slash-commands/help.js" - }, { id: "info", type: "slashcommand", diff --git a/core/slash-commands/info.js b/core/slash-commands/info.js index 4298a51..98c499a 100644 --- a/core/slash-commands/info.js +++ b/core/slash-commands/info.js @@ -8,67 +8,62 @@ * https://github.com/Artivain/artibot#licence */ -const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const { localizer } = require("../../index"); +import { MessageEmbed, MessageActionRow, MessageButton, CommandInteraction } from "discord.js"; +import Artibot from "../../index.js"; -module.exports = { - data: new SlashCommandBuilder() - .setName("info") - .setDescription(localizer._("Learn more about this bot.")), - - execute(interaction, { config, contributors, version }) { - var devs = "", donators = ""; - contributors.devs.forEach(dev => { - if (dev.discordTag) { - devs += `[${dev.name}](${dev.github}) (${dev.discordTag})\n`; - } else { - devs += `[${dev.name}](${dev.github})\n`; - } - }); - contributors.donators.forEach(donator => { - if (donator.discordTag) { - donators += `[${donator.name}](${donator.github}) (${donator.discordTag})\n`; - } else { - donators += `[${donator.name}](${donator.github})\n`; - } - }); - - if (config.botName == "Artibot" || config.botName == "Artibot [dev]") { - var description = localizer._("Artibot is a modern and open-source Discord bot maintained by Artivain and it's community.\n") + - "[GitHub](https://github.com/Artivain/artibot)" +/** + * + * @param {CommandInteraction} interaction + * @param {Artibot} artibot + */ +export default function execute(interaction, { config, contributors, version, localizer, createEmbed }) { + var devs = "", donators = ""; + contributors.devs.forEach(dev => { + if (dev.discordTag) { + devs += `[${dev.name}](${dev.github}) (${dev.discordTag})\n`; } else { - var description = localizer.__("[[0]] is based on Artibot, a modern and open-source Discord bot maintained by Artivain and it's community.\n", { placeholders: [config.botName] }) + "[GitHub](https://github.com/Artivain/artibot)"; - }; + devs += `[${dev.name}](${dev.github})\n`; + } + }); + contributors.donators.forEach(donator => { + if (donator.discordTag) { + donators += `[${donator.name}](${donator.github}) (${donator.discordTag})\n`; + } else { + donators += `[${donator.name}](${donator.github})\n`; + } + }); + + if (config.botName == "Artibot" || config.botName == "Artibot [dev]") { + var description = localizer._("Artibot is a modern and open-source Discord bot maintained by Artivain and it's community.\n") + + "[GitHub](https://github.com/Artivain/artibot)"; + } else { + var description = localizer.__("[[0]] is based on Artibot, a modern and open-source Discord bot maintained by Artivain and it's community.\n", { placeholders: [config.botName] }) + "[GitHub](https://github.com/Artivain/artibot)"; + }; - var memberCount = 0; - interaction.client.guilds.cache.forEach((guild) => { - memberCount += guild.memberCount; - }); + var memberCount = 0; + interaction.client.guilds.cache.forEach((guild) => { + memberCount += guild.memberCount; + }); - let embed = new MessageEmbed() - .setColor(config.embedColor) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setTitle(localizer.__("About [[0]]", { placeholders: [config.botName] })) - .setDescription(description) - .addField(localizer._("Number of servers"), interaction.client.guilds.cache.size + " " + localizer._("servers"), true) - .addField(localizer._("Number of users"), memberCount + " " + localizer._("users"), true) - .addField(localizer._("Version"), version) - .addField(localizer._("Developers"), devs, true) - .addField(localizer._("Donators"), donators, true); + let embed = createEmbed() + .setTitle(localizer.__("About [[0]]", { placeholders: [config.botName] })) + .setDescription(description) + .addField(localizer._("Number of servers"), interaction.client.guilds.cache.size + " " + localizer._("servers"), true) + .addField(localizer._("Number of users"), memberCount + " " + localizer._("users"), true) + .addField(localizer._("Version"), version) + .addField(localizer._("Developers"), devs, true) + .addField(localizer._("Donators"), donators, true); - const row = new MessageActionRow() - .addComponents( - new MessageButton() - .setLabel(localizer._("Learn more")) - .setStyle("LINK") - .setURL("https://github.com/Artivain/artibot") - ); + const row = new MessageActionRow() + .addComponents( + new MessageButton() + .setLabel(localizer._("Learn more")) + .setStyle("LINK") + .setURL("https://github.com/Artivain/artibot") + ); - interaction.reply({ - embeds: [embed], - components: [row] - }); - }, -}; \ No newline at end of file + interaction.reply({ + embeds: [embed], + components: [row] + }); +} \ No newline at end of file From ddec8e3f275cfb05461d0468caa507f3080e3297 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 17:46:38 -0400 Subject: [PATCH 11/68] Migrate ping slash command --- core/commands/ping.js | 2 +- core/index.js | 20 +++++------ core/slash-commands/ping.js | 68 ++++++++++++++++--------------------- 3 files changed, 38 insertions(+), 52 deletions(-) diff --git a/core/commands/ping.js b/core/commands/ping.js index 71ed65f..024725a 100644 --- a/core/commands/ping.js +++ b/core/commands/ping.js @@ -14,7 +14,7 @@ export default function execute(message, args, { config, createEmbed, localizer .setDescription( localizer.__("Pong!\n\nThe bot's latency is [[0]]ms.\nThe API's latency is [[1]]ms.", { placeholders: [ - message.createdTimestamp - Date.now(), + Math.abs(Date.now() - message.createdTimestamp), Math.round(message.client.ws.ping) ] }) diff --git a/core/index.js b/core/index.js index 94e9ae7..e49eca7 100644 --- a/core/index.js +++ b/core/index.js @@ -8,6 +8,7 @@ import { SlashCommandBuilder } from "@discordjs/builders"; import embedSlashCommand from "./slash-commands/embed.js"; import helpSlashCommand from "./slash-commands/help.js"; import infoSlashCommand from "./slash-commands/info.js"; +import pingSlashCommand from "./slash-commands/ping.js"; /** * Create the Core module @@ -115,6 +116,13 @@ export default function coreModule(artibot) { .setName("info") .setDescription(localizer._("Learn more about this bot.")), mainFunction: infoSlashCommand + }), + new SlashCommand({ + id: "ping", + data: new SlashCommandBuilder() + .setName("ping") + .setDescription(localizer._("Check if the bot is alive.")), + mainFunction: pingSlashCommand }) ] }); @@ -138,18 +146,6 @@ export default function coreModule(artibot) { path: "src/commands/resetinteractions.js" }, - // Slash commands - { - id: "info", - type: "slashcommand", - path: "src/slash-commands/info.js" - }, - { - id: "ping", - type: "slashcommand", - path: "src/slash-commands/ping.js" - }, - // User menu { id: "avatar", diff --git a/core/slash-commands/ping.js b/core/slash-commands/ping.js index e325276..f9b3d67 100644 --- a/core/slash-commands/ping.js +++ b/core/slash-commands/ping.js @@ -1,41 +1,31 @@ -const { MessageEmbed } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const { localizer } = require("../../index"); +import { CommandInteraction } from "discord.js"; +import Artibot from "../../index.js"; -module.exports = { - // The data needed to register slash commands to Discord. - data: new SlashCommandBuilder() - .setName("ping") - .setDescription(localizer._("Check if the bot is alive.")), +/** + * Ping slash command + * @param {CommandInteraction} interaction + * @param {Artibot} artibot + */ +export default async function execute(interaction, { config, localizer, createEmbed }) { + if (config.advancedCorePing) { + var embed = createEmbed() + .setTitle("Ping") + .setDescription( + localizer.__("Pong!\n\nThe bot's latency is [[0]]ms.\nThe API's latency is [[1]]ms.", { + placeholders: [ + Math.abs(Date.now() - interaction.createdTimestamp), + Math.round(interaction.client.ws.ping) + ] + }) + ); + } else { + var embed = createEmbed() + .setTitle("Ping") + .setDescription(`Pong!`); + } - async execute(interaction, { config }) { - - if (config.advancedCorePing) { - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Ping") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription( - localizer.__("Pong!\n\nThe bot's latency is [[0]]ms.\nThe API's latency is [[1]]ms.", { - placeholders: [ - Date.now() - interaction.createdTimestamp, - Math.round(interaction.client.ws.ping) - ] - }) - ); - } else { - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Ping") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(`Pong!`); - }; - - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); - }, -}; + await interaction.reply({ + embeds: [embed], + ephemeral: true + }); +} From f89afe2727bbd4b5bd8105a46a738fbce1a54678 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 19:06:57 -0400 Subject: [PATCH 12/68] Migrated ButtonHandler Migrated Delete button --- core/buttons/delete.js | 15 ++++++----- core/index.js | 9 ++++++- events/buttonHandler.js | 43 ++++++++++++++++++++++++++++++ events/buttonInteraction.js | 48 ---------------------------------- index.js | 20 +++++++++++--- messages/defaultButtonError.js | 31 ++++++++++------------ testing.js | 30 ++++++++++++++++++++- 7 files changed, 118 insertions(+), 78 deletions(-) create mode 100644 events/buttonHandler.js delete mode 100644 events/buttonInteraction.js diff --git a/core/buttons/delete.js b/core/buttons/delete.js index 97187c2..39832c5 100644 --- a/core/buttons/delete.js +++ b/core/buttons/delete.js @@ -1,8 +1,9 @@ -module.exports = { - id: "delete", +import { ButtonInteraction } from "discord.js"; - async execute(interaction) { - await interaction.message.delete(); - return - } -}; \ No newline at end of file +/** + * Simple button to delete the message it is attached to + * @param {ButtonInteraction} interaction + */ +export default function execute(interaction) { + interaction.message.delete(); +} \ No newline at end of file diff --git a/core/index.js b/core/index.js index e49eca7..d636f0f 100644 --- a/core/index.js +++ b/core/index.js @@ -1,4 +1,4 @@ -import Artibot, { Command, Module, SlashCommand } from "../index.js"; +import Artibot, { Button, Command, Module, SlashCommand } from "../index.js"; import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; import pingCommand from "./commands/ping.js"; @@ -9,6 +9,7 @@ import embedSlashCommand from "./slash-commands/embed.js"; import helpSlashCommand from "./slash-commands/help.js"; import infoSlashCommand from "./slash-commands/info.js"; import pingSlashCommand from "./slash-commands/ping.js"; +import deleteButton from "./buttons/delete.js"; /** * Create the Core module @@ -123,6 +124,12 @@ export default function coreModule(artibot) { .setName("ping") .setDescription(localizer._("Check if the bot is alive.")), mainFunction: pingSlashCommand + }), + + // Buttons + new Button({ + id: "delete", + mainFunction: deleteButton }) ] }); diff --git a/events/buttonHandler.js b/events/buttonHandler.js new file mode 100644 index 0000000..54c514e --- /dev/null +++ b/events/buttonHandler.js @@ -0,0 +1,43 @@ +import Artibot, { Button } from "../index.js"; +import { Interaction } from "discord.js"; +import buttonErrorMessage from "../messages/defaultButtonError.js"; + +export const name = "interactionCreate"; + +/** + * Event listener for button interactions + * @param {Interaction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + const { modules, log } = artibot; + // Checks if the interaction is a button interaction + if (!interaction.isButton()) return; + + /** @type {Button} */ + let button; + + for (const module of modules) { + if (button) break; + for (const part of module.parts) { + if (button) break; + if (part.type == "button" && (part.id == interaction.customId || interaction.customId.startsWith(part.id.split("*")[0]))) { + button = part; + } + } + } + + // If the interaction is not a registered button, return error message. + if (!button) return await buttonErrorMessage(interaction, artibot); + + // A try to execute the button. + try { + button.execute(interaction, artibot); + } catch (err) { + log("ButtonHandler", err, "warn", true); + interaction.reply({ + content: localizer._("An error occured when executing this button..."), + ephemeral: true, + }); + } +} diff --git a/events/buttonInteraction.js b/events/buttonInteraction.js deleted file mode 100644 index 3a81021..0000000 --- a/events/buttonInteraction.js +++ /dev/null @@ -1,48 +0,0 @@ -import log from "../logger.js"; -import Artibot from "../index.js"; -import { Interaction } from "discord.js"; - -export const name = "interactionCreate"; - -/** - * Event listener for button interactions - * @param {Interaction} interaction - * @param {Artibot} artibot - */ -export async function execute(interaction, artibot) { - // Deconstructed client from interaction object. - const { client } = interaction; - - // Checks if the interaction is a button interaction (to prevent weird bugs) - if (!interaction.isButton()) return; - - let data = artibot.modules.find(module => module.parts.find(part => part.id = interaction.customId)); - - if (!data) - data = client.buttonCommands.find((v, id) => { - /** @type {string[]} */ - const parts = id.split("*"); - return interaction.customId.startsWith(parts[0]); - }); - - // If the interaction is not a registered button, return error message. - if (!data) { - await require("../messages/defaultButtonError").execute(interaction); - return; - }; - - const { command } = data; - - // A try to execute the button. - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("ButtonManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured when executing this button..."), - ephemeral: true, - }); - return; - } -} diff --git a/index.js b/index.js index 3016c04..114f2ad 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ import logger from "./logger.js"; import Localizer from "artibot-localizer"; import chalk from "chalk"; import figlet from "figlet"; -import { Client, Collection, Intents, MessageEmbed, Permissions } from "discord.js"; +import { Client, Collection, Intents, MessageEmbed, Permissions, ButtonInteraction, CommandInteraction } from "discord.js"; import { createRequire } from 'module'; import coreModule from "./core/index.js"; import { readdirSync } from "fs"; @@ -168,7 +168,7 @@ export default class Artibot { log("Artibot", this.localizer._("Registered module: ") + module.name, "info", true); if (module.langs != "any" && !module.langs.includes(this.config.lang)) { - log("Artibot", this.localizer.__(" -> This module does not support the [[0]] language!", {placeholders: [this.config.lang]}), "warn", true); + log("Artibot", this.localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [this.config.lang] }), "warn", true); } for (const part of module.parts) { @@ -206,7 +206,7 @@ export default class Artibot { export class Module { /** * Any module part type. - * @typedef {Command|SlashCommand} ModulePartResolvable + * @typedef {Command|SlashCommand|Button} ModulePartResolvable */ /** @@ -296,7 +296,7 @@ export class SlashCommand extends BasePart { * @param {string} config.id - ID of the command * @param {SlashCommandBuilder} config.data - Data to register into the Discord API * @param {number} [config.cooldown=1] - Cooldown per user for this command, in seconds - * @param {function(Interaction, Artibot): void} config.mainFunction - Function to execute when the command is ran + * @param {function(CommandInteraction, Artibot): void} config.mainFunction - Function to execute when the command is ran * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup */ constructor({ id, data, cooldown = 1, mainFunction, initFunction }) { @@ -307,6 +307,18 @@ export class SlashCommand extends BasePart { } } +export class Button extends BasePart { + /** + * @param {Object} config - Config for this button + * @param {string} config.id - ID of the button. Supports asterix ("*") for wildcard. + * @param {function(ButtonInteraction, Artibot): void} config.mainFunction - Function to execute when the button is clicked + * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup + */ + constructor({ id, mainFunction, initFunction }) { + super({id, type: "button", mainFunction, initFunction}); + } +} + export class Embed extends MessageEmbed { /** * @param {Artibot} artibot diff --git a/messages/defaultButtonError.js b/messages/defaultButtonError.js index c06fea3..a89e19a 100644 --- a/messages/defaultButtonError.js +++ b/messages/defaultButtonError.js @@ -1,18 +1,15 @@ -const { locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); +import { ButtonInteraction } from "discord.js"; +import Artibot from "../index.js"; -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - async execute(interaction) { - await interaction.reply({ - content: localizer._("There was an error with this button!"), - ephemeral: true, - }); - return - } -}; +/** + * Send button error message + * @param {ButtonInteraction} interaction + * @param {Artibot} artibot + * @returns {Promise} + */ +export default function execute(interaction, { localizer }) { + return interaction.reply({ + content: localizer._("There was an error with this button!"), + ephemeral: true, + }); +} diff --git a/testing.js b/testing.js index b247a32..549624a 100644 --- a/testing.js +++ b/testing.js @@ -1,4 +1,5 @@ -import Artibot from "./index.js"; +import { MessageActionRow, MessageButton } from "discord.js"; +import Artibot, { Command, Module } from "./index.js"; import token from "./private.js"; const artibot = new Artibot({ @@ -9,4 +10,31 @@ const artibot = new Artibot({ testGuildId: "775798875356397608" }); +artibot.registerModule( + new Module({ + name: "Test", + id: "test", + version: "1.2.3", + langs: "any", + parts: [ + new Command({ + id: "test", + name: "test", + mainFunction: (message) => message.reply({ + content: "test", + components: [ + new MessageActionRow() + .addComponents( + new MessageButton() + .setCustomId("delete") + .setLabel("delete") + .setStyle("PRIMARY") + ) + ] + }) + }) + ] + }) +); + artibot.login({ token }); \ No newline at end of file From c2f1acfb5b1e119986003becfa2630fb62f0002b Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 20:09:27 -0400 Subject: [PATCH 13/68] Migrate context menu interactions migrate and improve react message menu --- core/index.js | 15 ++++--- core/message-menu/react.js | 31 +++++++------- events/contextHandler.js | 72 ++++++++++++++++++++++++++++++++ events/contextInteraction.js | 72 -------------------------------- index.js | 80 ++++++++++++++++++++++++++++-------- 5 files changed, 159 insertions(+), 111 deletions(-) create mode 100644 events/contextHandler.js delete mode 100644 events/contextInteraction.js diff --git a/core/index.js b/core/index.js index d636f0f..baf27d9 100644 --- a/core/index.js +++ b/core/index.js @@ -1,4 +1,4 @@ -import Artibot, { Button, Command, Module, SlashCommand } from "../index.js"; +import Artibot, { Button, Command, MessageContextMenuOption, Module, SlashCommand } from "../index.js"; import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; import pingCommand from "./commands/ping.js"; @@ -10,6 +10,7 @@ import helpSlashCommand from "./slash-commands/help.js"; import infoSlashCommand from "./slash-commands/info.js"; import pingSlashCommand from "./slash-commands/ping.js"; import deleteButton from "./buttons/delete.js"; +import reactMessageMenu from "./message-menu/react.js"; /** * Create the Core module @@ -130,6 +131,13 @@ export default function coreModule(artibot) { new Button({ id: "delete", mainFunction: deleteButton + }), + + // Message menu + new MessageContextMenuOption({ + id: "react", + name: localizer._("React"), + mainFunction: reactMessageMenu }) ] }); @@ -173,11 +181,6 @@ export default function coreModule(artibot) { }, // Buttons - { - id: "delete", - type: "button", - path: "src/buttons/delete.js" - }, { id: "registerinteractions", type: "button", diff --git a/core/message-menu/react.js b/core/message-menu/react.js index b55bba5..622fc7f 100644 --- a/core/message-menu/react.js +++ b/core/message-menu/react.js @@ -1,18 +1,19 @@ -const { localizer } = require("../../index"); +import { MessageContextMenuInteraction, Permissions } from "discord.js"; -module.exports = { - data: { - name: localizer._("React"), - type: 3, // 3 is for message context menus - }, +/** + * Add reaction to message + * @param {MessageContextMenuInteraction} interaction + */ +export default async function execute(interaction, { localizer }) { + if (!interaction.memberPermissions.has(Permissions.FLAGS.MANAGE_MESSAGES)) return interaction.reply({ + content: localizer._("You do not have the permission to execute this command!"), + ephemeral: true + }); - async execute(interaction) { - await interaction.options._hoistedOptions[0].message.react("✅"); + await interaction.targetMessage.react("✅"); - await interaction.reply({ - content: localizer._("Reaction added"), - ephemeral: true - }); - return - } -}; + await interaction.reply({ + content: localizer._("Reaction added"), + ephemeral: true + }); +} diff --git a/events/contextHandler.js b/events/contextHandler.js new file mode 100644 index 0000000..af20338 --- /dev/null +++ b/events/contextHandler.js @@ -0,0 +1,72 @@ +import { MessageContextMenuInteraction, UserContextMenuInteraction } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "interactionCreate"; + +/** + * Context interaction listener + * @param {MessageContextMenuInteraction|UserContextMenuInteraction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + // Checks if the interaction is a button interaction + if (!interaction.isContextMenu()) return; + + const { log, localizer, modules } = artibot; + + // Don't execute interactions in DM channels + if (!interaction.channel) return interaction.reply({ + content: localizer._("This is disabled in DM channels."), + ephemeral: true + }); + + if (interaction.targetType === "USER") { + + let command; + + for (const module of modules) { + if (command) break; + for (const part of module.parts) { + if (command) break; + if (part.type == "usermenu" && part.data.name == interaction.commandName) command = part; + } + } + + // A try to execute the interaction. + try { + await command.execute(interaction, artibot); + } catch (err) { + log("ContextHandler", err, "warn", true); + interaction.reply({ + content: localizer._("An error occured when executing this interaction..."), + ephemeral: true, + }); + } + + } else if (interaction.targetType === "MESSAGE") { + + let command; + + for (const module of modules) { + if (command) break; + for (const part of module.parts) { + if (command) break; + if (part.type == "messagemenu" && part.data.name == interaction.commandName) command = part; + } + } + + // A try to execute the interaction. + try { + await command.execute(interaction, artibot); + } catch (err) { + log("ContextHandler", err, "warn", true); + interaction.reply({ + content: localizer._("An error occured when executing this interaction..."), + ephemeral: true, + }); + } + + } else { // Almost impossible, but we are still catching the bug. + return log("InteractionManager", localizer._("Something weird happened with the menu. Received an unknown menu type."), "warn", true); + }; +} diff --git a/events/contextInteraction.js b/events/contextInteraction.js deleted file mode 100644 index a6925d5..0000000 --- a/events/contextInteraction.js +++ /dev/null @@ -1,72 +0,0 @@ -import { Interaction } from "discord.js"; -import Artibot, { log } from "../index.js"; - -export const name = "interactionCreate"; - -/** - * Context interaction listener - * @param {Interaction} interaction - * @param {Artibot} artibot - */ -export async function execute(interaction, artibot) { - // Deconstructed client from interaction object. - const { client } = interaction; - - // Checks if the interaction is a button interaction (to prevent weird bugs) - if (!interaction.isContextMenu()) - return; - - // Don't execute interactions in DM channels - if (!interaction.channel) - return interaction.reply({ - content: localizer._("This is disabled in DM channels."), - ephemeral: true - }); - - /**********************************************************************/ - // Checks if the interaction target was a user - if (interaction.targetType === "USER") { - - const { command } = client.contextCommands.get("USER " + interaction.commandName); - - // A try to execute the interaction. - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("InteractionManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured when executing this interaction..."), - ephemeral: true, - }); - return; - } - } - - // Checks if the interaction target was a message - else if (interaction.targetType === "MESSAGE") { - - const { command } = client.contextCommands.get("MESSAGE " + interaction.commandName); - - // A try to execute the interaction. - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("InteractionManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured when executing this interaction..."), - ephemeral: true, - }); - return; - } - } - - - - // Practically not possible, but we are still catching the bug. - // Possible Fix is a restart! - else { - return log("InteractionManager", localizer._("Something weird happened with the menu. Received an unknown menu type."), "warn", true); - }; -} diff --git a/index.js b/index.js index 114f2ad..d8c2c29 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ import logger from "./logger.js"; import Localizer from "artibot-localizer"; import chalk from "chalk"; import figlet from "figlet"; -import { Client, Collection, Intents, MessageEmbed, Permissions, ButtonInteraction, CommandInteraction } from "discord.js"; +import * as discord from "discord.js"; import { createRequire } from 'module'; import coreModule from "./core/index.js"; import { readdirSync } from "fs"; @@ -79,9 +79,9 @@ export default class Artibot { /** * Store cooldowns for commands - * @type {Collection>} + * @type {discord.Collection>} */ - this.cooldowns = new Collection(); + this.cooldowns = new discord.Collection(); // Send artwork to console console.log(chalk.blue(figlet.textSync('Artibot', { @@ -104,7 +104,7 @@ export default class Artibot { /** * Create an embed - * @param {MessageEmbed|MessageEmbedOptions|APIEmbed} [data] + * @param {discord.MessageEmbed|discord.MessageEmbedOptions|discord.APIEmbed} [data] * @returns {Embed} Preconfigured embed */ createEmbed = (data) => { @@ -129,14 +129,14 @@ export default class Artibot { if (!token) throw new Error("Token not set!"); this.#token = token; this.modules.forEach(module => additionalIntents = additionalIntents.concat(module.additionalIntents)); - this.client = new Client({ + this.client = new discord.Client({ intents: [ - Intents.FLAGS.GUILDS, - Intents.FLAGS.GUILD_MESSAGES, - Intents.FLAGS.GUILD_MESSAGE_REACTIONS, - Intents.FLAGS.GUILD_VOICE_STATES, - Intents.FLAGS.GUILD_MEMBERS, - Intents.FLAGS.GUILD_PRESENCES, + discord.Intents.FLAGS.GUILDS, + discord.Intents.FLAGS.GUILD_MESSAGES, + discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS, + discord.Intents.FLAGS.GUILD_VOICE_STATES, + discord.Intents.FLAGS.GUILD_MEMBERS, + discord.Intents.FLAGS.GUILD_PRESENCES, ...additionalIntents ] }); @@ -206,7 +206,7 @@ export default class Artibot { export class Module { /** * Any module part type. - * @typedef {Command|SlashCommand|Button} ModulePartResolvable + * @typedef {Command|SlashCommand|Button|MessageContextMenuOption|UserContextMenuOption} ModulePartResolvable */ /** @@ -267,7 +267,7 @@ export class Command extends BasePart { * @param {number} [config.cooldown] - Cooldown for this command usage, in seconds * @param {boolean} [config.ownerOnly=false] - If the command can only be executed by the owner * @param {boolean} [config.guildOnly=false] - If the command can only be executed in a guild - * @param {Permissions} [config.permissions] - Required permissions + * @param {discord.Permissions} [config.permissions] - Required permissions * @param {boolean} [config.requiresArgs=false] - Set to true if the command needs at least one argument * @param {function(Message, string[], Artibot): void} config.mainFunction - Function to execute when the command is ran * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup @@ -296,7 +296,7 @@ export class SlashCommand extends BasePart { * @param {string} config.id - ID of the command * @param {SlashCommandBuilder} config.data - Data to register into the Discord API * @param {number} [config.cooldown=1] - Cooldown per user for this command, in seconds - * @param {function(CommandInteraction, Artibot): void} config.mainFunction - Function to execute when the command is ran + * @param {function(discord.CommandInteraction, Artibot): void} config.mainFunction - Function to execute when the command is ran * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup */ constructor({ id, data, cooldown = 1, mainFunction, initFunction }) { @@ -307,22 +307,66 @@ export class SlashCommand extends BasePart { } } +/** + * Button interaction part for a module + * @extends BasePart + */ export class Button extends BasePart { /** * @param {Object} config - Config for this button * @param {string} config.id - ID of the button. Supports asterix ("*") for wildcard. - * @param {function(ButtonInteraction, Artibot): void} config.mainFunction - Function to execute when the button is clicked + * @param {function(discord.ButtonInteraction, Artibot): void} config.mainFunction - Function to execute when the button is clicked * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup */ constructor({ id, mainFunction, initFunction }) { - super({id, type: "button", mainFunction, initFunction}); + super({ id, type: "button", mainFunction, initFunction }); + } +} + +/** + * Message context menu option part for a module + * @extends BasePart + */ +export class MessageContextMenuOption extends BasePart { + /** + * @param {Object} config - Config for this context menu option + * @param {string} config.id - ID of this option + * @param {string} config.name - Name of this option + * @param {function(discord.MessageContextMenuInteraction, Artibot): void} config.mainFunction - Function to execute when the menu option is clicked + * @param {function(Artibot): void} config.initFunction - Function executed on bot startup + */ + constructor({ id, name, mainFunction, initFunction }) { + if (!name) throw new Error("Missing name parameter!"); + super({ id, type: "messagemenu", mainFunction, initFunction }); + this.data = { + name, + type: 3 // 3 is for message context menu + } + } +} + +export class UserContextMenuOption extends BasePart { + /** + * @param {Object} config - Config for this context menu option + * @param {string} config.id - ID of this option + * @param {string} config.name - Name of this option + * @param {function(discord.UserContextMenuInteraction, Artibot): void} config.mainFunction - Function to execute when the menu option is clicked + * @param {function(Artibot): void} config.initFunction - Function executed on bot startup + */ + constructor({ id, name, mainFunction, initFunction }) { + if (!name) throw new Error("Missing name parameter!"); + super({ id, type: "usermenu", mainFunction, initFunction }); + this.data = { + name, + type: 2 // 2 is for user context menus + } } } -export class Embed extends MessageEmbed { +export class Embed extends discord.MessageEmbed { /** * @param {Artibot} artibot - * @param {MessageEmbed|MessageEmbedOptions|APIEmbed} [data] + * @param {discord.MessageEmbed|discord.MessageEmbedOptions|discord.APIEmbed} [data] */ constructor(artibot, data) { super(data); From ac6a857a1dbe06d63352ec6d3c925ae6c30b97cb Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 20:22:13 -0400 Subject: [PATCH 14/68] Migrate and improve avatar user menu --- core/index.js | 10 +++++++++- core/user-menu/avatar.js | 41 ++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/core/index.js b/core/index.js index baf27d9..7c3b822 100644 --- a/core/index.js +++ b/core/index.js @@ -1,4 +1,4 @@ -import Artibot, { Button, Command, MessageContextMenuOption, Module, SlashCommand } from "../index.js"; +import Artibot, { Button, Command, MessageContextMenuOption, Module, SlashCommand, UserContextMenuOption } from "../index.js"; import helpCommand from "./commands/help.js"; import infoCommand from "./commands/info.js"; import pingCommand from "./commands/ping.js"; @@ -11,6 +11,7 @@ import infoSlashCommand from "./slash-commands/info.js"; import pingSlashCommand from "./slash-commands/ping.js"; import deleteButton from "./buttons/delete.js"; import reactMessageMenu from "./message-menu/react.js"; +import avatarUserMenu from "./user-menu/avatar.js"; /** * Create the Core module @@ -138,6 +139,13 @@ export default function coreModule(artibot) { id: "react", name: localizer._("React"), mainFunction: reactMessageMenu + }), + + // User menu + new UserContextMenuOption({ + id: "avatar", + name: localizer._("Avatar"), + mainFunction: avatarUserMenu }) ] }); diff --git a/core/user-menu/avatar.js b/core/user-menu/avatar.js index 3b93a86..67721af 100644 --- a/core/user-menu/avatar.js +++ b/core/user-menu/avatar.js @@ -1,26 +1,21 @@ -const { MessageEmbed } = require("discord.js"); -const { localizer } = require("../../index"); +import { UserContextMenuInteraction } from "discord.js"; +import Artibot from "../../index.js"; -module.exports = { - data: { - name: localizer._("Avatar"), - type: 2 // 2 is for user context menus - }, +/** + * Simple way to get the avatar of a user + * @param {UserContextMenuInteraction} interaction + * @param {Artibot} artibot + */ +export default function execute(interaction, { localizer, createEmbed }) { + const member = interaction.targetMember; + const avatar = member.displayAvatarURL({ dynamic: true, format: "webp", size: 512 }); - async execute(interaction, { config }) { - const infos = interaction.options._hoistedOptions[0].member; + const embed = createEmbed() + .setTitle(localizer._("Avatar")) + .setDescription(localizer.__("Here is the profile picture of <@[[0]]>:", { placeholders: [member.id] })) + .setImage(avatar); - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTitle(localizer._("Avatar")) - .setDescription(localizer.__("Here is the profile picture of <@[[0]]>:", {placeholders: [infos.user.id]})) - .setImage(`https://cdn.discordapp.com/avatars/${infos.user.id}/${infos.user.avatar}.webp?size=512`); - - await interaction.reply({ - embeds: [embed] - }); - return; - } -}; \ No newline at end of file + interaction.reply({ + embeds: [embed] + }); +} \ No newline at end of file From 21fe5e1f3df3ede94a02000f99f066becd2b06dd Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 20:53:27 -0400 Subject: [PATCH 15/68] Migrate and improve informations user menu --- core/index.js | 11 +- core/user-menu/informations.js | 98 +- ...ontextHandler.js => contextMenuHandler.js} | 4 +- package-lock.json | 4868 +++++++++++++++-- package.json | 9 +- 5 files changed, 4449 insertions(+), 541 deletions(-) rename events/{contextHandler.js => contextMenuHandler.js} (95%) diff --git a/core/index.js b/core/index.js index 7c3b822..5e3f253 100644 --- a/core/index.js +++ b/core/index.js @@ -12,6 +12,7 @@ import pingSlashCommand from "./slash-commands/ping.js"; import deleteButton from "./buttons/delete.js"; import reactMessageMenu from "./message-menu/react.js"; import avatarUserMenu from "./user-menu/avatar.js"; +import informationsUserMenu from "./user-menu/informations.js"; /** * Create the Core module @@ -146,6 +147,11 @@ export default function coreModule(artibot) { id: "avatar", name: localizer._("Avatar"), mainFunction: avatarUserMenu + }), + new UserContextMenuOption({ + id: "informations", + name: localizer._("Informations"), + mainFunction: informationsUserMenu }) ] }); @@ -170,11 +176,6 @@ export default function coreModule(artibot) { }, // User menu - { - id: "avatar", - type: "usermenu", - path: "src/user-menu/avatar.js" - }, { id: "informations", type: "usermenu", diff --git a/core/user-menu/informations.js b/core/user-menu/informations.js index 2ccd5ce..4a88630 100644 --- a/core/user-menu/informations.js +++ b/core/user-menu/informations.js @@ -1,62 +1,46 @@ -const { MessageEmbed } = require("discord.js"); -const moment = require("moment"); -const humanizeDuration = require("humanize-duration"); -const { localizer } = require("../../index"); +import { UserContextMenuInteraction } from "discord.js"; +import Artibot from "../../index.js"; -module.exports = { - data: { - name: localizer._("Informations"), - type: 2 // 2 is for user context menus - }, +/** + * Get some information on a user + * @param {UserContextMenuInteraction} interaction + * @param {Artibot} artibot + */ +export default function execute(interaction, { config, contributors, localizer, createEmbed }) { + const infos = interaction.targetMember; + let type = localizer._("User"); + const since = parseInt(infos.joinedTimestamp / 1000); - async execute(interaction, { config, contributors }) { + if (infos.user.bot) { + type = localizer._("Bot"); + } else if (infos.user.system) { + type = localizer._("System"); + }; - const infos = interaction.options._hoistedOptions[0].member; - var type = localizer._("User"); - const now = moment(); - const since = humanizeDuration(now - moment(infos.joinedTimestamp), { - language: config.locale, - delimiter: ", ", - largest: 2, - round: true, - units: ["y", "mo", "w", "d", "h", "m"] - }); + var more = ""; + if (infos.guild.ownerId === infos.user.id) { + more += localizer._("\nIs the owner of this server."); + }; + if (config.ownerId === infos.user.id) { + more += localizer._("\nIs the owner of this bot."); + }; + if (contributors.devs.find(element => element.discordId === infos.user.id)) { + more += localizer._("\n**Is one of the super devs of this bot!**"); + }; + if (contributors.donators.find(element => element.discordId === infos.user.id)) { + more += localizer._("\n**Is one of the super donators of this bot!**"); + }; - if (infos.user.bot) { - type = localizer._("Bot"); - } else if (infos.user.system) { - type = localizer._("System"); - }; + const embed = createEmbed() + .setTitle(localizer._("Information on the user")) + .setDescription( + localizer._("Name on the server: ") + (infos.nickname ? infos.nickname : infos.user.username) + "\n" + + localizer._("Tag:") + " `" + infos.user.username + "#" + infos.user.discriminator + "`\n" + + localizer._("ID:") + " `" + infos.user.id + "`" + + more + ) + .addField(localizer._("Type"), type) + .addField(localizer._("On this server since"), ` ()`); - var more = ""; - if (infos.guild.ownerId === infos.user.id) { - more += localizer._("\nIs the owner of this server."); - }; - if (config.ownerId === infos.user.id) { - more += localizer._("\nIs the owner of this bot."); - }; - if (contributors.devs.find(element => element.discordId === infos.user.id)) { - more += localizer._("\n**Is one of the super devs of this bot!**"); - }; - if (contributors.donators.find(element => element.discordId === infos.user.id)) { - more += localizer._("\n**Is one of the super donators of this bot!**"); - }; - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTitle(localizer._("Information on the user")) - .setDescription( - localizer._("Name on the server: ") + (infos.nickname ? infos.nickname : infos.user.username) + "\n" + - localizer._("Tag:") + " `" + infos.user.username + "#" + infos.user.discriminator + "`\n" + - localizer._("ID:") + " `" + infos.user.id + "`" + - more - ) - .addField(localizer._("Type"), type) - .addField(localizer._("On this server since"), since); - - await interaction.reply({ embeds: [embed] }); - return - } -}; \ No newline at end of file + interaction.reply({ embeds: [embed] }); +} \ No newline at end of file diff --git a/events/contextHandler.js b/events/contextMenuHandler.js similarity index 95% rename from events/contextHandler.js rename to events/contextMenuHandler.js index af20338..b03f3f6 100644 --- a/events/contextHandler.js +++ b/events/contextMenuHandler.js @@ -36,7 +36,7 @@ export async function execute(interaction, artibot) { try { await command.execute(interaction, artibot); } catch (err) { - log("ContextHandler", err, "warn", true); + log("ContextMenuHandler", err, "warn", true); interaction.reply({ content: localizer._("An error occured when executing this interaction..."), ephemeral: true, @@ -59,7 +59,7 @@ export async function execute(interaction, artibot) { try { await command.execute(interaction, artibot); } catch (err) { - log("ContextHandler", err, "warn", true); + log("ContextMenuHandler", err, "warn", true); interaction.reply({ content: localizer._("An error occured when executing this interaction..."), ephemeral: true, diff --git a/package-lock.json b/package-lock.json index 36132bb..fcbc920 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,15 +19,16 @@ "discord.js": "^13.6.0", "discordjs-reaction-role": "^2.1.1", "figlet": "^1.5.2", - "humanize-duration": "^3.27.1", - "moment": "^2.29.3", - "moment-timezone": "^0.5.34", "ms": "^2.1.3", "path": "^0.12.7", "whois": "^2.13.9" }, "devDependencies": { - "nodemon": "^2.0.15" + "nodemon": "^2.0.15", + "npm-check-updates": "^12.5.9" + }, + "funding": { + "url": "https://paypal.me/Artivain" } }, "node_modules/@discordjs/builders": { @@ -47,12 +48,11 @@ } }, "node_modules/@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==", + "version": "0.7.0-dev.1650672508-3617093", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", + "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==", "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { @@ -73,19 +73,201 @@ "node": ">=16.9.0" } }, - "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { - "version": "0.7.0-dev.1650672508-3617093", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", - "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==", - "engines": { - "node": ">=16.9.0" - } - }, "node_modules/@discordjs/rest/node_modules/discord-api-types": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.29.0.tgz", "integrity": "sha512-Ekq1ICNpOTVajXKZguNFrsDeTmam+ZeA38txsNLZnANdXUjU6QBPIZLUQTC6MzigFGb0Tt8vk4xLnXmzv0shNg==" }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", + "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", + "dev": true, + "dependencies": { + "@gar/promisify": "^1.1.3", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/fs/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/git": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", + "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", + "dev": true, + "dependencies": { + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^7.0.0", + "proc-log": "^2.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^2.0.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/git/node_modules/lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@npmcli/git/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/git/node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", + "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", + "dev": true, + "dependencies": { + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + }, + "bin": { + "installed-package-contents": "index.js" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@npmcli/move-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", + "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/node-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", + "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/promise-spawn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", + "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", + "dev": true, + "dependencies": { + "infer-owner": "^1.0.4" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/run-script": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-3.0.2.tgz", + "integrity": "sha512-vdjD/PMBl+OX9j9C9irx5sCCIKfp2PWkpPNH9zxvlJAfSZ3Qp5aU412v+O3PFJl3R1PFNwuyChCqHg4ma6ci2Q==", + "dev": true, + "dependencies": { + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^2.0.3" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/@sapphire/async-queue": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", @@ -96,18 +278,18 @@ } }, "node_modules/@sapphire/shapeshift": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.0.0.tgz", - "integrity": "sha512-SKq4mKZXW2xB6O2Im4lBCDYy8pnuAMC3Zziw5Ub7WvZMt0fgwebDnqh+9MhoMYUSjkLyQcEO8ZS9d3ES7aRhBw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.1.0.tgz", + "integrity": "sha512-Z1ISLP9pNI3jpKJxx82xtDpEsfomhJ3iPqcKdYLjAHmQP2X5yqQF6phA0Wd+MmdXp081wepOiT59XEN0xdTVvQ==", "engines": { "node": ">=v15.0.0", "npm": ">=7.0.0" } }, "node_modules/@sapphire/snowflake": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.1.tgz", - "integrity": "sha512-vmZq1I6J6iNRQVXP+N9HzOMOY4ORB3MunoFeWCw/aBnZTf1cDgDvP0RZFQS53B1TN95AIgFY9T+ItQ/fWAUYWQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", + "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -136,10 +318,19 @@ "node": ">=6" } }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/@types/node": { - "version": "17.0.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", - "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" + "version": "17.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", + "integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -177,6 +368,91 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/agentkeepalive/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agentkeepalive/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -221,6 +497,40 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", + "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/artibot-localizer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/artibot-localizer/-/artibot-localizer-1.0.2.tgz", @@ -295,6 +605,27 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/boxen/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/boxen/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -317,31 +648,99 @@ "node": ">=8" } }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", "dev": true, "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" + "semver": "^7.0.0" } }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "node_modules/builtins/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { - "pump": "^3.0.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cacache": { + "version": "16.0.6", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.6.tgz", + "integrity": "sha512-9a/MLxGaw3LEGes0HaPez2RgZWDV6X0jrgChsuxfEh8xoDoYGxaGrkMe7Dlyjrb655tA/b8fX0qlUg6Ii5MBvw==", + "dev": true, + "dependencies": { + "@npmcli/fs": "^2.1.0", + "@npmcli/move-file": "^2.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", + "infer-owner": "^1.0.4", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" }, "engines": { "node": ">=8" @@ -409,12 +808,36 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, + "node_modules/cint": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz", + "integrity": "sha1-cDhrG0jidz0NYxZqVa/5TvRFahI=", + "dev": true + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/cli-boxes": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", @@ -427,6 +850,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "dev": true, + "dependencies": { + "colors": "1.0.3" + }, + "engines": { + "node": ">= 0.2.0" + } + }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -475,6 +910,24 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -486,6 +939,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.2.0.tgz", + "integrity": "sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -509,6 +971,12 @@ "node": ">=8" } }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -578,6 +1046,33 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/discord-api-types": { "version": "0.31.2", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", @@ -634,6 +1129,15 @@ "npm": ">=7.0.0" } }, + "node_modules/discord.js/node_modules/@discordjs/collection": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", + "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/discord.js/node_modules/discord-api-types": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", @@ -676,6 +1180,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -685,6 +1198,21 @@ "once": "^1.4.0" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, "node_modules/escape-goat": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", @@ -699,6 +1227,43 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "node_modules/fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, "node_modules/figlet": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", @@ -763,6 +1328,33 @@ "node": ">= 6" } }, + "node_modules/fp-and-or": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", + "integrity": "sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -777,6 +1369,31 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -785,6 +1402,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -797,6 +1426,26 @@ "node": ">=6" } }, + "node_modules/glob": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.1.tgz", + "integrity": "sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -809,6 +1458,27 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/global-dirs": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", @@ -824,6 +1494,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -861,15 +1551,33 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, "engines": { - "node": ">=8" + "node": ">=4" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, "node_modules/has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", @@ -879,44 +1587,221 @@ "node": ">=8" } }, + "node_modules/hosted-git-info": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", + "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, - "node_modules/humanize-duration": { - "version": "3.27.1", - "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.27.1.tgz", - "integrity": "sha512-jCVkMl+EaM80rrMrAPl96SGG4NRac53UyI1o/yAzebDntEY6K6/Fj2HOjdPg8omTqIe5Y0wPBai2q5xXrIbarA==" - }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", - "dev": true - }, - "node_modules/import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, "engines": { - "node": ">=4" + "node": ">= 6" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, + "dependencies": { + "ms": "2.1.2" + }, "engines": { - "node": ">=0.8.19" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "node_modules/ignore-walk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", + "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ignore-walk/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/ignore-walk/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "node_modules/ini": { @@ -957,6 +1842,18 @@ "is-ci": "bin.js" } }, + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1002,6 +1899,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "dev": true + }, "node_modules/is-npm": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", @@ -1053,12 +1956,78 @@ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "dev": true }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "dev": true, + "dependencies": { + "jju": "^1.1.0" + } + }, + "node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonlines": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", + "integrity": "sha1-T80kbcXQ44aRkHxEqwAveC0dlMw=", + "dev": true + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, "node_modules/keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -1068,6 +2037,15 @@ "json-buffer": "3.0.0" } }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/latest-version": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", @@ -1080,6 +2058,69 @@ "node": ">=8" } }, + "node_modules/libnpmconfig": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", + "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "dev": true, + "dependencies": { + "figgy-pudding": "^3.5.1", + "find-up": "^3.0.0", + "ini": "^1.3.5" + } + }, + "node_modules/libnpmconfig/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libnpmconfig/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/libnpmconfig/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libnpmconfig/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/libnpmconfig/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -1091,6 +2132,12 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -1136,6 +2183,64 @@ "semver": "bin/semver.js" } }, + "node_modules/make-fetch-happen": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.2.tgz", + "integrity": "sha512-GWMGiZsKVeJACQGJ1P3Z+iNec7pLsU6YW1q11eaPn3RR8nRXHppFWfP7Eu0//55JK3hSjrAQRl8sDa5uXpq1Ew==", + "dev": true, + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^16.0.2", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^2.0.3", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.1.1", + "ssri": "^9.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1182,58 +2287,234 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "node_modules/moment": { - "version": "2.29.3", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz", - "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==", + "node_modules/minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": "*" + "node": ">=8" } }, - "node_modules/moment-timezone": { - "version": "0.5.34", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", - "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, "dependencies": { - "moment": ">= 2.9.0" + "minipass": "^3.0.0" }, "engines": { - "node": "*" + "node": ">= 8" } }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "node_modules/minipass-fetch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", + "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", + "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "minipass": "^3.1.6", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" }, "engines": { - "node": "4.x || >=6.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, - "peerDependencies": { - "encoding": "^0.1.0" + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "engines": { + "node": ">= 8" } }, - "node_modules/nodemon": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz", - "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==", + "node_modules/minipass-json-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", + "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", "dev": true, - "hasInstallScript": true, "dependencies": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.0.0.tgz", + "integrity": "sha512-Ma6p4s+XCTPxCuAMrOA/IJRmVy16R8Sdhtwl4PrCr7IBlj4cPawF0vg/l7nOT1jPbuNS7lIRJpBSvVsXwEZuzw==", + "dev": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^10.0.3", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^12.22 || ^14.13 || >=16" + } + }, + "node_modules/node-gyp/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/node-gyp/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/nodemon": { + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz", + "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", "ignore-by-default": "^1.0.1", "minimatch": "^3.0.4", "pstree.remy": "^1.1.8", @@ -1254,40 +2535,49 @@ "url": "https://opencollective.com/nodemon" } }, - "node_modules/nodemon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, "engines": { - "node": ">=4" + "node": "*" } }, - "node_modules/nodemon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/normalize-package-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", + "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=4" + "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "node_modules/normalize-package-data/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { - "abbrev": "1" + "lru-cache": "^6.0.0" }, "bin": { - "nopt": "bin/nopt.js" + "semver": "bin/semver.js" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/normalize-path": { @@ -1308,375 +2598,1189 @@ "node": ">=8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", "dev": true, "dependencies": { - "wrappy": "1" + "npm-normalize-package-bin": "^1.0.1" } }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "node_modules/npm-check-updates": { + "version": "12.5.9", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.9.tgz", + "integrity": "sha512-l9iOvD7EsQb96gFJL45V01YG6bP8+dmobYnSguvehPuNwgdWNMrE8RC8bSfURX5iUmX4bkobN4T8XMHXN9GMHA==", "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "cint": "^8.2.1", + "cli-table": "^0.3.11", + "commander": "^9.1.0", + "fast-memoize": "^2.5.2", + "find-up": "5.0.0", + "fp-and-or": "^0.1.3", + "get-stdin": "^8.0.0", + "globby": "^11.0.4", + "hosted-git-info": "^5.0.0", + "json-parse-helpfulerror": "^1.0.3", + "jsonlines": "^0.1.1", + "libnpmconfig": "^1.2.1", + "lodash": "^4.17.21", + "minimatch": "^5.0.1", + "p-map": "^4.0.0", + "pacote": "^13.0.5", + "parse-github-url": "^1.0.2", + "progress": "^2.0.3", + "prompts": "^2.4.2", + "rc-config-loader": "^4.1.0", + "remote-git-tags": "^3.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "semver-utils": "^1.1.4", + "source-map-support": "^0.5.21", + "spawn-please": "^1.0.0", + "update-notifier": "^5.1.0", + "yaml": "^1.10.2" + }, + "bin": { + "ncu": "build/src/bin/cli.js", + "npm-check-updates": "build/src/bin/cli.js" + }, "engines": { - "node": ">=6" + "node": ">=12" } }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/npm-check-updates/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "dependencies": { - "p-try": "^2.0.0" + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-check-updates/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/npm-check-updates/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/npm-check-updates/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "node_modules/npm-check-updates/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/npm-check-updates/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/path": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", "dependencies": { - "process": "^0.11.1", - "util": "^0.10.3" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "node_modules/npm-check-updates/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, "engines": { - "node": ">=8.6" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "node_modules/npm-check-updates/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, "engines": { - "node": ">=4" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "engines": { - "node": ">= 0.6.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "node_modules/npm-check-updates/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "node_modules/npm-check-updates/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "escape-goat": "^2.0.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "node_modules/npm-install-checks": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", + "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", + "dev": true, "dependencies": { - "safe-buffer": "^5.1.0" + "semver": "^7.1.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "node_modules/npm-install-checks/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" + "lru-cache": "^6.0.0" }, "bin": { - "rc": "cli.js" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/rc/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", "dev": true }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "node_modules/npm-package-arg": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz", + "integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==", "dev": true, "dependencies": { - "picomatch": "^2.2.1" + "hosted-git-info": "^5.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">=8.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/registry-auth-token": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", - "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "node_modules/npm-package-arg/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { - "rc": "^1.2.8" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" } }, - "node_modules/registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "node_modules/npm-packlist": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.2.tgz", + "integrity": "sha512-jLhcNisUgpz6v2KC75qSeEYAM8UBMYjQ2OhlCOJjB4Ovu7XXnD25UqZ6hOQNeGShL/2ju3LL2E/zBbsuzkIQ8w==", "dev": true, "dependencies": { - "rc": "^1.2.8" + "glob": "^8.0.1", + "ignore-walk": "^5.0.1", + "npm-bundled": "^1.1.2", + "npm-normalize-package-bin": "^1.0.1" + }, + "bin": { + "npm-packlist": "bin/index.js" }, "engines": { - "node": ">=8" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "node_modules/responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "node_modules/npm-pick-manifest": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", + "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", "dev": true, "dependencies": { - "lowercase-keys": "^1.0.0" + "npm-install-checks": "^5.0.0", + "npm-normalize-package-bin": "^1.0.1", + "npm-package-arg": "^9.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/npm-pick-manifest/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "node_modules/npm-registry-fetch": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.1.1.tgz", + "integrity": "sha512-5p8rwe6wQPLJ8dMqeTnA57Dp9Ox6GH9H60xkyJup07FmVlu3Mk7pf/kIIpl9gaN5bM8NM+UUx3emUWvDNTt39w==", "dev": true, "dependencies": { - "semver": "^6.3.0" + "make-fetch-happen": "^10.0.6", + "minipass": "^3.1.6", + "minipass-fetch": "^2.0.3", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^9.0.1", + "proc-log": "^2.0.0" }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "dependencies": { - "randombytes": "^2.1.0" + "wrappy": "1" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true, "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" + "node": ">=6" } }, - "node_modules/socks": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", - "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dependencies": { - "ip": "^1.1.5", - "smart-buffer": "^4.2.0" + "p-try": "^2.0.0" }, "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "aggregate-error": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-json-comments": { + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "dependencies": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/pacote": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.1.1.tgz", + "integrity": "sha512-MTT3k1OhUo+IpvoHGp25OwsRU0L+kJQM236OCywxvY4OIJ/YfloNW2/Yc3HMASH10BkfZaGMVK/pxybB7fWcLw==", + "dev": true, + "dependencies": { + "@npmcli/git": "^3.0.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/run-script": "^3.0.1", + "cacache": "^16.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.6", + "mkdirp": "^1.0.4", + "npm-package-arg": "^9.0.0", + "npm-packlist": "^5.0.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.1", + "proc-log": "^2.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^5.0.0", + "read-package-json-fast": "^2.0.3", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "lib/bin.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true, + "bin": { + "parse-github-url": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/proc-log": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", + "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "dependencies": { + "escape-goat": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc-config-loader": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.1.0.tgz", + "integrity": "sha512-aW+kX4qy0CiM9L4fG4Us3oEOpIrOrXzWykAn+xldD07Y9PXWjTH744oHbv0Kc9ZwWaylw3jMjxaf14RgStrNrA==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "js-yaml": "^4.0.0", + "json5": "^2.1.2", + "require-from-string": "^2.0.2" + } + }, + "node_modules/rc-config-loader/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/rc-config-loader/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/read-package-json": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.1.tgz", + "integrity": "sha512-MALHuNgYWdGW3gKzuNMuYtcSSZbGQm94fAp16xt8VsYTLBjUSc55bLMKe6gzpWue0Tfi6CBgwCSdDAqutGDhMg==", + "dev": true, + "dependencies": { + "glob": "^8.0.1", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "dev": true, + "dependencies": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/remote-git-tags": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz", + "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "dependencies": { + "lowercase-keys": "^1.0.0" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "dependencies": { + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/semver-diff/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/semver-utils": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", + "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", + "dev": true + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", + "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "dependencies": { + "ip": "^1.1.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.0.tgz", + "integrity": "sha512-wWqJhjb32Q6GsrUqzuFkukxb/zzide5quXYcMVpIjxalDBBYy2nqKCFQ/9+Ie4dvOYSQdOk3hUlZSdzZOd3zMQ==", + "dev": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spawn-please": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-1.0.0.tgz", + "integrity": "sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "dev": true + }, + "node_modules/ssri": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.0.tgz", + "integrity": "sha512-Y1Z6J8UYnexKFN1R/hxUaYoY2LVdKEzziPmVAFKiKX8fiwvCJTVzn/xYE9TEWod5OVyNfIHHuVfIEuBClL/uJQ==", + "dev": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">= 10" } }, "node_modules/to-readable-stream": { @@ -1755,9 +3859,27 @@ "dev": true }, "node_modules/underscore": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz", - "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.3.tgz", + "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==" + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } }, "node_modules/unique-string": { "version": "2.0.0", @@ -1815,6 +3937,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/update-notifier/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/update-notifier/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -1830,6 +3961,18 @@ "node": ">=10" } }, + "node_modules/update-notifier/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -1850,6 +3993,34 @@ "inherits": "2.0.3" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "dev": true, + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -1864,6 +4035,21 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -1882,6 +4068,15 @@ "whois": "bin.js" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -1969,6 +4164,15 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", @@ -2010,6 +4214,18 @@ "node": ">=6" } }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zod": { "version": "3.14.4", "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", @@ -2034,9 +4250,9 @@ } }, "@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" + "version": "0.7.0-dev.1650672508-3617093", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", + "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==" }, "@discordjs/rest": { "version": "0.4.1", @@ -2053,11 +4269,6 @@ "tslib": "^2.3.1" }, "dependencies": { - "@discordjs/collection": { - "version": "0.7.0-dev.1650672508-3617093", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", - "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==" - }, "discord-api-types": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.29.0.tgz", @@ -2065,20 +4276,165 @@ } } }, + "@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@npmcli/fs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", + "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", + "dev": true, + "requires": { + "@gar/promisify": "^1.1.3", + "semver": "^7.3.5" + }, + "dependencies": { + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@npmcli/git": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", + "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", + "dev": true, + "requires": { + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^7.0.0", + "proc-log": "^2.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^2.0.2" + }, + "dependencies": { + "lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + } + } + }, + "@npmcli/installed-package-contents": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", + "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", + "dev": true, + "requires": { + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "@npmcli/move-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", + "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + } + }, + "@npmcli/node-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", + "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==", + "dev": true + }, + "@npmcli/promise-spawn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", + "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", + "dev": true, + "requires": { + "infer-owner": "^1.0.4" + } + }, + "@npmcli/run-script": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-3.0.2.tgz", + "integrity": "sha512-vdjD/PMBl+OX9j9C9irx5sCCIKfp2PWkpPNH9zxvlJAfSZ3Qp5aU412v+O3PFJl3R1PFNwuyChCqHg4ma6ci2Q==", + "dev": true, + "requires": { + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^2.0.3" + } + }, "@sapphire/async-queue": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" }, "@sapphire/shapeshift": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.0.0.tgz", - "integrity": "sha512-SKq4mKZXW2xB6O2Im4lBCDYy8pnuAMC3Zziw5Ub7WvZMt0fgwebDnqh+9MhoMYUSjkLyQcEO8ZS9d3ES7aRhBw==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.1.0.tgz", + "integrity": "sha512-Z1ISLP9pNI3jpKJxx82xtDpEsfomhJ3iPqcKdYLjAHmQP2X5yqQF6phA0Wd+MmdXp081wepOiT59XEN0xdTVvQ==" }, "@sapphire/snowflake": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.1.tgz", - "integrity": "sha512-vmZq1I6J6iNRQVXP+N9HzOMOY4ORB3MunoFeWCw/aBnZTf1cDgDvP0RZFQS53B1TN95AIgFY9T+ItQ/fWAUYWQ==" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", + "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" }, "@sindresorhus/is": { "version": "4.6.0", @@ -2094,10 +4450,16 @@ "defer-to-connect": "^1.0.1" } }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true + }, "@types/node": { - "version": "17.0.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", - "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" + "version": "17.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", + "integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A==" }, "@types/node-fetch": { "version": "2.6.1", @@ -2134,6 +4496,70 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -2166,6 +4592,34 @@ "picomatch": "^2.0.4" } }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "are-we-there-yet": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", + "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "artibot-localizer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/artibot-localizer/-/artibot-localizer-1.0.2.tgz", @@ -2218,29 +4672,104 @@ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "requires": { + "semver": "^7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" } } } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "cacache": { + "version": "16.0.6", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.6.tgz", + "integrity": "sha512-9a/MLxGaw3LEGes0HaPez2RgZWDV6X0jrgChsuxfEh8xoDoYGxaGrkMe7Dlyjrb655tA/b8fX0qlUg6Ii5MBvw==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "@npmcli/fs": "^2.1.0", + "@npmcli/move-file": "^2.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", + "infer-owner": "^1.0.4", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11", + "unique-filename": "^1.1.1" + }, + "dependencies": { + "lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true + } } }, "cacheable-request": { @@ -2302,18 +4831,45 @@ "readdirp": "~3.6.0" } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, + "cint": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz", + "integrity": "sha1-cDhrG0jidz0NYxZqVa/5TvRFahI=", + "dev": true + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cli-boxes": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", "dev": true }, + "cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "dev": true, + "requires": { + "colors": "1.0.3" + } + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2358,6 +4914,18 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2366,6 +4934,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.2.0.tgz", + "integrity": "sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2386,6 +4960,12 @@ "xdg-basedir": "^4.0.0" } }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -2437,6 +5017,27 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "discord-api-types": { "version": "0.31.2", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", @@ -2479,6 +5080,11 @@ "zod": "^3.11.6" } }, + "@discordjs/collection": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", + "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" + }, "discord-api-types": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", @@ -2512,6 +5118,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "requires": { + "iconv-lite": "^0.6.2" + } + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -2521,6 +5136,18 @@ "once": "^1.4.0" } }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, "escape-goat": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", @@ -2532,6 +5159,40 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, "figlet": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", @@ -2570,6 +5231,27 @@ "mime-types": "^2.1.12" } }, + "fp-and-or": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", + "integrity": "sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==", + "dev": true + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -2577,11 +5259,39 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "dev": true, + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -2591,6 +5301,40 @@ "pump": "^3.0.0" } }, + "glob": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.1.tgz", + "integrity": "sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -2609,6 +5353,20 @@ "ini": "2.0.0" } }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -2642,10 +5400,25 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, "has-yarn": { @@ -2654,16 +5427,107 @@ "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", "dev": true }, + "hosted-git-info": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", + "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "dev": true, + "requires": { + "lru-cache": "^7.5.1" + }, + "dependencies": { + "lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true + } + } + }, "http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, - "humanize-duration": { - "version": "3.27.1", - "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.27.1.tgz", - "integrity": "sha512-jCVkMl+EaM80rrMrAPl96SGG4NRac53UyI1o/yAzebDntEY6K6/Fj2HOjdPg8omTqIe5Y0wPBai2q5xXrIbarA==" + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "requires": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true }, "ignore-by-default": { "version": "1.0.1", @@ -2671,6 +5535,35 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "ignore-walk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", + "dev": true, + "requires": { + "minimatch": "^5.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -2683,6 +5576,28 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", @@ -2717,6 +5632,15 @@ "ci-info": "^2.0.0" } }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2747,6 +5671,12 @@ "is-path-inside": "^3.0.2" } }, + "is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "dev": true + }, "is-npm": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", @@ -2783,12 +5713,66 @@ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "dev": true, + "requires": { + "jju": "^1.1.0" + } + }, + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true + }, + "jsonlines": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", + "integrity": "sha1-T80kbcXQ44aRkHxEqwAveC0dlMw=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -2798,6 +5782,12 @@ "json-buffer": "3.0.0" } }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, "latest-version": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", @@ -2807,6 +5797,59 @@ "package-json": "^6.3.0" } }, + "libnpmconfig": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", + "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "find-up": "^3.0.0", + "ini": "^1.3.5" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -2815,6 +5858,12 @@ "p-locate": "^4.1.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -2847,6 +5896,54 @@ } } }, + "make-fetch-happen": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.2.tgz", + "integrity": "sha512-GWMGiZsKVeJACQGJ1P3Z+iNec7pLsU6YW1q11eaPn3RR8nRXHppFWfP7Eu0//55JK3hSjrAQRl8sDa5uXpq1Ew==", + "dev": true, + "requires": { + "agentkeepalive": "^4.2.1", + "cacache": "^16.0.2", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^2.0.3", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.1.1", + "ssri": "^9.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true + } + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -2881,87 +5978,468 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "moment": { - "version": "2.29.3", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz", - "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==" + "minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-fetch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", + "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", + "dev": true, + "requires": { + "encoding": "^0.1.13", + "minipass": "^3.1.6", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-json-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", + "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "dev": true, + "requires": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-gyp": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.0.0.tgz", + "integrity": "sha512-Ma6p4s+XCTPxCuAMrOA/IJRmVy16R8Sdhtwl4PrCr7IBlj4cPawF0vg/l7nOT1jPbuNS7lIRJpBSvVsXwEZuzw==", + "dev": true, + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^10.0.3", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "nodemon": { + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz", + "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==", + "dev": true, + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5", + "update-notifier": "^5.1.0" + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", + "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", + "dev": true, + "requires": { + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "dependencies": { + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "dev": true + }, + "npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-check-updates": { + "version": "12.5.9", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.9.tgz", + "integrity": "sha512-l9iOvD7EsQb96gFJL45V01YG6bP8+dmobYnSguvehPuNwgdWNMrE8RC8bSfURX5iUmX4bkobN4T8XMHXN9GMHA==", + "dev": true, + "requires": { + "chalk": "^4.1.2", + "cint": "^8.2.1", + "cli-table": "^0.3.11", + "commander": "^9.1.0", + "fast-memoize": "^2.5.2", + "find-up": "5.0.0", + "fp-and-or": "^0.1.3", + "get-stdin": "^8.0.0", + "globby": "^11.0.4", + "hosted-git-info": "^5.0.0", + "json-parse-helpfulerror": "^1.0.3", + "jsonlines": "^0.1.1", + "libnpmconfig": "^1.2.1", + "lodash": "^4.17.21", + "minimatch": "^5.0.1", + "p-map": "^4.0.0", + "pacote": "^13.0.5", + "parse-github-url": "^1.0.2", + "progress": "^2.0.3", + "prompts": "^2.4.2", + "rc-config-loader": "^4.1.0", + "remote-git-tags": "^3.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "semver-utils": "^1.1.4", + "source-map-support": "^0.5.21", + "spawn-please": "^1.0.0", + "update-notifier": "^5.1.0", + "yaml": "^1.10.2" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "npm-install-checks": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", + "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", + "dev": true, + "requires": { + "semver": "^7.1.1" + }, + "dependencies": { + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true }, - "moment-timezone": { - "version": "0.5.34", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", - "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", + "npm-package-arg": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz", + "integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==", + "dev": true, "requires": { - "moment": ">= 2.9.0" + "hosted-git-info": "^5.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" + }, + "dependencies": { + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "npm-packlist": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.2.tgz", + "integrity": "sha512-jLhcNisUgpz6v2KC75qSeEYAM8UBMYjQ2OhlCOJjB4Ovu7XXnD25UqZ6hOQNeGShL/2ju3LL2E/zBbsuzkIQ8w==", + "dev": true, "requires": { - "whatwg-url": "^5.0.0" + "glob": "^8.0.1", + "ignore-walk": "^5.0.1", + "npm-bundled": "^1.1.2", + "npm-normalize-package-bin": "^1.0.1" } }, - "nodemon": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz", - "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==", + "npm-pick-manifest": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", + "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", "dev": true, "requires": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", - "pstree.remy": "^1.1.8", - "semver": "^5.7.1", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5", - "update-notifier": "^5.1.0" + "npm-install-checks": "^5.0.0", + "npm-normalize-package-bin": "^1.0.1", + "npm-package-arg": "^9.0.0", + "semver": "^7.3.5" }, "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "lru-cache": "^6.0.0" } } } }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "npm-registry-fetch": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.1.1.tgz", + "integrity": "sha512-5p8rwe6wQPLJ8dMqeTnA57Dp9Ox6GH9H60xkyJup07FmVlu3Mk7pf/kIIpl9gaN5bM8NM+UUx3emUWvDNTt39w==", "dev": true, "requires": { - "abbrev": "1" + "make-fetch-happen": "^10.0.6", + "minipass": "^3.1.6", + "minipass-fetch": "^2.0.3", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^9.0.1", + "proc-log": "^2.0.0" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true + "npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "dev": true, + "requires": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + } }, "once": { "version": "1.4.0", @@ -2994,6 +6472,15 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -3019,6 +6506,41 @@ } } }, + "pacote": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.1.1.tgz", + "integrity": "sha512-MTT3k1OhUo+IpvoHGp25OwsRU0L+kJQM236OCywxvY4OIJ/YfloNW2/Yc3HMASH10BkfZaGMVK/pxybB7fWcLw==", + "dev": true, + "requires": { + "@npmcli/git": "^3.0.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/run-script": "^3.0.1", + "cacache": "^16.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.6", + "mkdirp": "^1.0.4", + "npm-package-arg": "^9.0.0", + "npm-packlist": "^5.0.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.1", + "proc-log": "^2.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^5.0.0", + "read-package-json-fast": "^2.0.3", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11" + } + }, + "parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true + }, "path": { "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", @@ -3033,6 +6555,18 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -3045,11 +6579,49 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "proc-log": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", + "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "dev": true + }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, "pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -3075,6 +6647,12 @@ "escape-goat": "^2.0.0" } }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3103,6 +6681,68 @@ } } }, + "rc-config-loader": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.1.0.tgz", + "integrity": "sha512-aW+kX4qy0CiM9L4fG4Us3oEOpIrOrXzWykAn+xldD07Y9PXWjTH744oHbv0Kc9ZwWaylw3jMjxaf14RgStrNrA==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "js-yaml": "^4.0.0", + "json5": "^2.1.2", + "require-from-string": "^2.0.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "read-package-json": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.1.tgz", + "integrity": "sha512-MALHuNgYWdGW3gKzuNMuYtcSSZbGQm94fAp16xt8VsYTLBjUSc55bLMKe6gzpWue0Tfi6CBgwCSdDAqutGDhMg==", + "dev": true, + "requires": { + "glob": "^8.0.1", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "dev": true, + "requires": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3130,11 +6770,23 @@ "rc": "^1.2.8" } }, + "remote-git-tags": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz", + "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", + "dev": true + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -3149,11 +6801,63 @@ "lowercase-keys": "^1.0.0" } }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -3177,6 +6881,12 @@ } } }, + "semver-utils": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", + "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", + "dev": true + }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -3196,6 +6906,18 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -3210,6 +6932,106 @@ "smart-buffer": "^4.2.0" } }, + "socks-proxy-agent": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.0.tgz", + "integrity": "sha512-wWqJhjb32Q6GsrUqzuFkukxb/zzide5quXYcMVpIjxalDBBYy2nqKCFQ/9+Ie4dvOYSQdOk3hUlZSdzZOd3zMQ==", + "dev": true, + "requires": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "spawn-please": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-1.0.0.tgz", + "integrity": "sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "dev": true + }, + "ssri": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.0.tgz", + "integrity": "sha512-Y1Z6J8UYnexKFN1R/hxUaYoY2LVdKEzziPmVAFKiKX8fiwvCJTVzn/xYE9TEWod5OVyNfIHHuVfIEuBClL/uJQ==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3235,12 +7057,26 @@ "dev": true }, "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" + } + }, + "tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" } }, "to-readable-stream": { @@ -3304,9 +7140,27 @@ "dev": true }, "underscore": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz", - "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.3.tgz", + "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==" + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } }, "unique-string": { "version": "2.0.0", @@ -3349,6 +7203,12 @@ "supports-color": "^7.1.0" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -3357,6 +7217,15 @@ "requires": { "lru-cache": "^6.0.0" } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } } } }, @@ -3377,6 +7246,31 @@ "inherits": "2.0.3" } }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "dev": true, + "requires": { + "builtins": "^5.0.0" + } + }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -3391,6 +7285,15 @@ "webidl-conversions": "^3.0.0" } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -3406,6 +7309,15 @@ "yargs": "^15.4.1" } }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -3467,6 +7379,12 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true + }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", @@ -3501,6 +7419,12 @@ } } }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + }, "zod": { "version": "3.14.4", "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", diff --git a/package.json b/package.json index 0b8fb75..b629f93 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "start": "node index.js", - "test": "nodemon testing.js" + "test": "nodemon testing.js", + "upgrade": "ncu -u && npm install" }, "type": "module", "repository": "github:Artivain/artibot", @@ -36,14 +37,12 @@ "discord.js": "^13.6.0", "discordjs-reaction-role": "^2.1.1", "figlet": "^1.5.2", - "humanize-duration": "^3.27.1", - "moment": "^2.29.3", - "moment-timezone": "^0.5.34", "ms": "^2.1.3", "path": "^0.12.7", "whois": "^2.13.9" }, "devDependencies": { - "nodemon": "^2.0.15" + "nodemon": "^2.0.15", + "npm-check-updates": "^12.5.9" } } From 89be93599c7333f488268c318a29e11afdadc6e8 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 21:30:22 -0400 Subject: [PATCH 16/68] Improve InteractionManager Migrate and improve registerinteractions Migrate and improve resetinteractions Fix french errors --- core/buttons/registerinteractions.js | 89 ++++++++-------- core/commands/resetinteractions.js | 146 +++++++++++++-------------- core/index.js | 56 +++------- index.js | 5 +- interactionManager.js | 12 +-- locales.json | 12 +-- 6 files changed, 137 insertions(+), 183 deletions(-) diff --git a/core/buttons/registerinteractions.js b/core/buttons/registerinteractions.js index 8d80f22..7e35e37 100644 --- a/core/buttons/registerinteractions.js +++ b/core/buttons/registerinteractions.js @@ -1,56 +1,47 @@ -const interactionManager = require("../../../../ab-core/interactionManager"); -const { MessageEmbed } = require('discord.js'); -const { localizer } = require("../../index"); - -module.exports = { - id: "registerinteractions", - - async execute(interaction, { config }) { - if (interaction.member.user.id != config.ownerId) { - await interaction.reply({ - content: localizer._("You do not have the authorization to do this."), - ephemeral: true - }); - return - }; - - await interaction.deferUpdate(); - const waitingEmbed = new MessageEmbed() - .setColor("YELLOW") - .setTitle("InteractionManager") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("Initializing interactions...\nThis can take some time.")); - - await interaction.editReply({ - embeds: [waitingEmbed], - components: [] +import { ButtonInteraction, MessageEmbed } from 'discord.js'; +import Artibot from "../../index.js"; + +/** + * + * @param {ButtonInteraction} interaction + * @param {Artibot} artibot + * @returns + */ +export default async function execute(interaction, { config, modules, localizer, createEmbed, interactionManager: { generateData, register, resetData } }) { + if (interaction.member.user.id != config.ownerId) { + return interaction.reply({ + content: localizer._("You do not have the authorization to do this."), + ephemeral: true }); - await interaction.editReply() + } + + await interaction.deferUpdate(); + const waitingEmbed = createEmbed() + .setColor("YELLOW") + .setTitle("InteractionManager") + .setDescription(localizer._("Initializing interactions...\nThis can take some time.")); - interactionManager.generateData(interaction.client); - let success = await interactionManager.register(); + await interaction.editReply({ + embeds: [waitingEmbed], + components: [] + }); - if (success) { - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("InteractionManager") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("The interactions have been initialized in Discord API.")); + resetData(); + generateData(modules); + let success = await register(); - await interaction.editReply({ embeds: [embed] }); - } else { - const embed = new MessageEmbed() - .setColor("RED") - .setTitle("InteractionManager") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("An error occured while initializing interactions in Discord API.\nCheck the console for more details.")); + if (success) { + const embed = createEmbed() + .setTitle("InteractionManager") + .setDescription(localizer._("The interactions have been initialized in Discord API.")); - await interaction.editReply({ embeds: [embed] }); - }; + await interaction.editReply({ embeds: [embed] }); + } else { + const embed = createEmbed() + .setColor("RED") + .setTitle("InteractionManager") + .setDescription(localizer._("An error occured while initializing interactions in Discord API.\nCheck the console for more details.")); - return + await interaction.editReply({ embeds: [embed] }); } -}; \ No newline at end of file +} diff --git a/core/commands/resetinteractions.js b/core/commands/resetinteractions.js index 78674af..b188a68 100644 --- a/core/commands/resetinteractions.js +++ b/core/commands/resetinteractions.js @@ -1,84 +1,78 @@ -const { MessageActionRow, MessageButton, MessageEmbed } = require('discord.js'); -const { localizer } = require("../../index"); +import { Message, MessageActionRow, MessageButton, MessageEmbed } from 'discord.js'; +import Artibot from "../../index.js"; -module.exports = { - name: "resetinteractions", - description: localizer._("Deletes the cache of the interactions and slash commands in Discord's API."), - ownerOnly: true, +/** + * + * @param {Message} message + * @param {string[]} args + * @param {Artibot} artibot + */ +export default async function execute(message, args, { config, log, localizer, createEmbed }) { + const waitingEmbed = createEmbed() + .setColor("YELLOW") + .setTitle("InteractionManager") + .setDescription(localizer._("Deleting saved slash commands from the bot and test server...\nThis can take some time.")); - async execute(message, args, { config, log }) { - const waitingEmbed = new MessageEmbed() - .setColor("YELLOW") - .setTitle("SlashManager") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("Deleting saved slash commands from the bot and test server...\nThis can take some time.")); - const response = await message.reply({ - embeds: [waitingEmbed] - }); + const response = await message.reply({ + embeds: [waitingEmbed] + }); - log("SlashManager", localizer._("Deleting saved slash commands from the bot and test server..."), "log", true); + log("InteractionManager", localizer._("Deleting saved slash commands and interactions from the bot and test server..."), "log", true); - // Fetch test guild - message.client.guilds.fetch(config.testGuildId) - .then(guild => { - // Remove all commands from test guild - guild.commands.set([]) - .then(() => { - log("SlashManager", localizer._("Slash commands have been deleted from test server."), "log", true); + // Fetch test guild + const testGuild = await message.client.guilds.fetch(config.testGuildId); + // Remove all commands from test guild + try { + await testGuild.commands.set([]); + log("InteractionManager", localizer._("Slash commands have been deleted from test server."), "log", true); + } catch (e) { + const errorEmbed = createEmbed() + .setColor("RED") + .setTitle("InteractionManager") + .setDescription(localizer._("An error occured while deleting slash commands from test server.\nCheck the console for more details.")); - // Remove all commands from the client (so in all servers) - message.client.application.commands.set([]) - .then(() => { - log("SlashManager", localizer._("Slash commands have been deleted from the bot."), "log", true); + await response.edit({ embeds: [errorEmbed] }); + log("InteractionManager", localizer._("An error occured while deleting slash commands from test server: ") + e, "warn", true); + return + } - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(localizer._("Purge finished")) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("The commands have been deleted from the test server and the bot successfully.\nYou can decide to register them back right now, or later by restarting the bot.")); + // Remove all commands from the client (so in all servers) + try { + await message.client.application.commands.set([]); + log("InteractionManager", localizer._("Slash commands have been deleted from the bot."), "log", true); + } catch (e) { + const errorEmbed = new MessageEmbed() + .setColor("RED") + .setTitle("InteractionManager") + .setFooter({ text: config.botName, iconURL: config.botIcon }) + .setTimestamp() + .setDescription(localizer._("An error occured while deleting slash commands from the bot.\nCheck the console for more details.")); + await response.edit({ embeds: [errorEmbed] }); + log("InteractionManager", localizer._("An error occured while deleting slash commands from the bot: ") + e, "warn", true); + return + } - const row = new MessageActionRow() - .addComponents( - new MessageButton() - .setCustomId("registerinteractions") - .setLabel(localizer._("Now")) - .setStyle("PRIMARY") - .setEmoji("✅"), - new MessageButton() - .setCustomId("delete") - .setLabel(localizer._("Later")) - .setStyle("SECONDARY") - .setEmoji("⌛") - ); + const embed = createEmbed() + .setTitle(localizer._("Purge finished")) + .setDescription(localizer._("The commands have been deleted from the test server and the bot successfully.\nYou can decide to register them back right now, or later by restarting the bot.")); - response.edit({ - embeds: [embed], - components: [row] - }); - }) - .catch(e => { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("SlashManager") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("An error occured while deleting slash commands from the bot.\nCheck the console for more details.")); - response.edit({ embeds: [errorEmbed] }); - log("SlashManager", localizer._("An error occured while deleting slash commands from the bot: ") + e, "warn", true); - }); - }) - .catch(e => { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("SlashManager") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("An error occured while deleting slash commands from test server.\nCheck the console for more details.")); - response.edit({ embeds: [errorEmbed] }); - log("SlashManager", localizer._("An error occured while deleting slash commands from test server: ") + e, "warn", true); - }); - }); - } -}; \ No newline at end of file + const row = new MessageActionRow() + .addComponents( + new MessageButton() + .setCustomId("registerinteractions") + .setLabel(localizer._("Now")) + .setStyle("PRIMARY") + .setEmoji("✅"), + new MessageButton() + .setCustomId("delete") + .setLabel(localizer._("Later")) + .setStyle("SECONDARY") + .setEmoji("⌛") + ); + + response.edit({ + embeds: [embed], + components: [row] + }); + +} \ No newline at end of file diff --git a/core/index.js b/core/index.js index 5e3f253..0604ba7 100644 --- a/core/index.js +++ b/core/index.js @@ -13,6 +13,8 @@ import deleteButton from "./buttons/delete.js"; import reactMessageMenu from "./message-menu/react.js"; import avatarUserMenu from "./user-menu/avatar.js"; import informationsUserMenu from "./user-menu/informations.js"; +import resetinteractions from "./commands/resetinteractions.js"; +import registerinteractions from "./buttons/registerinteractions.js"; /** * Create the Core module @@ -68,6 +70,13 @@ export default function coreModule(artibot) { description: localizer._("Get the bot uptime"), mainFunction: uptimeCommand }), + new Command({ + id: "resetinteractions", + name: "resetinteractions", + description: localizer._("Deletes the cache of the interactions and slash commands in Discord's API."), + ownerOnly: true, + mainFunction: resetinteractions + }), // Slash commands new SlashCommand({ @@ -134,6 +143,10 @@ export default function coreModule(artibot) { id: "delete", mainFunction: deleteButton }), + new Button({ + id: "registerinteractions", + mainFunction: registerinteractions + }), // Message menu new MessageContextMenuOption({ @@ -155,47 +168,4 @@ export default function coreModule(artibot) { }) ] }); - - asd = { - manifest: { - - manifestVersion: 1, - moduleVersion: require("../../package.json").version, - name: "Artibot Core", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - - // Commands - { - id: "resetinteractions", - type: "command", - path: "src/commands/resetinteractions.js" - }, - - // User menu - { - id: "informations", - type: "usermenu", - path: "src/user-menu/informations.js" - }, - - // Message menu - { - id: "react", - type: "messagemenu", - path: "src/message-menu/react.js" - }, - - // Buttons - { - id: "registerinteractions", - type: "button", - path: "src/buttons/registerinteractions.js" - } - ] - } - }; } \ No newline at end of file diff --git a/index.js b/index.js index d8c2c29..343a874 100644 --- a/index.js +++ b/index.js @@ -143,6 +143,9 @@ export default class Artibot { this.listeners = []; + /** @type {InteractionManager} */ + this.interactionManager; + log("Artibot", this.localizer._("Loading event listeners..."), "log", true); const eventFiles = readdirSync("./events").filter(file => file.endsWith(".js")); @@ -265,7 +268,7 @@ export class Command extends BasePart { * @param {string[]} [config.aliases] - List of alternative names * @param {string} [config.usage] - Help text for the usage * @param {number} [config.cooldown] - Cooldown for this command usage, in seconds - * @param {boolean} [config.ownerOnly=false] - If the command can only be executed by the owner + * @param {boolean} [config.ownerOnly=false] - If the command can only be executed by the owner of the bot * @param {boolean} [config.guildOnly=false] - If the command can only be executed in a guild * @param {discord.Permissions} [config.permissions] - Required permissions * @param {boolean} [config.requiresArgs=false] - Set to true if the command needs at least one argument diff --git a/interactionManager.js b/interactionManager.js index bf99e71..ee4fa45 100644 --- a/interactionManager.js +++ b/interactionManager.js @@ -32,12 +32,7 @@ export default class InteractionManager { * Generate data to send to Discord API to register interactions * @param {Module[]} modules - List of the modules to generate data from */ - generateData(modules) { - // this.commandJSONData = [ - // ...Array.from(client.slashCommands.values()).map(({ command }) => command.data.toJSON()), - // ...Array.from(client.contextCommands.values()).map(({ command }) => command.data), - // ]; - + generateData = (modules) => { for (const module of modules) { for (const part of module.parts) { if (part.type == "slashcommand") { @@ -52,15 +47,16 @@ export default class InteractionManager { /** * Empty all stored JSON data */ - resetData() { + resetData = () => { this.commandJSONData.length = 0; } /** * Register interactions in Discord API * @returns {boolean} True if everything went good, false if there was a problem. + * @async */ - async register() { + register = async () => { try { log("InteractionManager", this.localizer._("Initializing interactions and slash commands on Discord..."), "info", true); if (!this.commandJSONData.length) return log("InteractionManager", this.localizer._("Nothing to register."), "warn", true); diff --git a/locales.json b/locales.json index adf950f..e10bfcc 100644 --- a/locales.json +++ b/locales.json @@ -328,15 +328,15 @@ }, "Deletes the cache of the interactions and slash commands in Discord's API.": { - "fr": "Supprime le cache des intéractions et des commandes slash auprès de L'API Discord." + "fr": "Supprime le cache des interactions et des commandes slash auprès de L'API Discord." }, "Deleting saved slash commands from the bot and test server...\nThis can take some time.": { "fr": "Suppression des commandes slash du bot et du serveur de test en cours...\nCeci peut prendre du temps." }, - "Deleting saved slash commands from the bot and test server...": { - "fr": "Suppression des commandes slash du bot et du serveur de test en cours..." + "Deleting saved slash commands and interactions from the bot and test server...": { + "fr": "Suppression des commandes slash et interactions du bot et du serveur de test en cours..." }, "Slash commands have been deleted from test server.": { @@ -568,15 +568,15 @@ }, "Initializing interactions...\nThis can take some time.": { - "fr": "Initialisation des intéractions...\nCeci peut prendre du temps." + "fr": "Initialisation des interactions...\nCeci peut prendre du temps." }, "The interactions have been initialized in Discord API.": { - "fr": "Les intéractions ont bien été initialisées auprès de Discord." + "fr": "Les interactions ont bien été initialisées auprès de Discord." }, "An error occured while initializing interactions in Discord API.\nCheck the console for more details.": { - "fr": "Une erreur est survenue avec l'initialisation des intéractions auprès de Discord.\nConsulter la console pour plus de détails." + "fr": "Une erreur est survenue avec l'initialisation des interactions auprès de Discord.\nConsulter la console pour plus de détails." }, "Learn more": { From a2e5b35e663751ea01bd6231aa8ec86f340b0367 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 23:34:18 -0400 Subject: [PATCH 17/68] Migrate SelectMenuHandler --- events/selectInteraction.js | 41 ------------------------------ events/selectMenuHandler.js | 42 +++++++++++++++++++++++++++++++ index.js | 46 ++++++++++++++++++++++++---------- messages/defaultSelectError.js | 18 ------------- messages/selectMenuError.js | 14 +++++++++++ testing.js | 30 ++++++++++++++++++++-- 6 files changed, 117 insertions(+), 74 deletions(-) delete mode 100644 events/selectInteraction.js create mode 100644 events/selectMenuHandler.js delete mode 100644 messages/defaultSelectError.js create mode 100644 messages/selectMenuError.js diff --git a/events/selectInteraction.js b/events/selectInteraction.js deleted file mode 100644 index ff6aeb9..0000000 --- a/events/selectInteraction.js +++ /dev/null @@ -1,41 +0,0 @@ -import { Interaction } from "discord.js"; -import Artibot from "../index.js"; - -export const name = "interactionCreate"; - -/** - * - * @param {Interaction} interaction - * @param {Artibot} artibot - */ -export async function execute(interaction, artibot) { - const { client } = interaction; - const { log, localizer } = artibot; - - // Checks if the interaction is a select menu interaction - if (!interaction.isSelectMenu()) - return; - - const data = client.selectCommands.get(interaction.customId); - - // If the interaction is not a registered dropdown, return error message. - if (!data) { - await require("../messages/defaultSelectError").execute(interaction); - return; - }; - - const { command } = data; - - // A try to execute the interaction. - try { - await command.execute(interaction, commons); - return; - } catch (err) { - log("ButtonManager", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured while executing this menu option."), - ephemeral: true, - }); - return; - }; -} diff --git a/events/selectMenuHandler.js b/events/selectMenuHandler.js new file mode 100644 index 0000000..fd67203 --- /dev/null +++ b/events/selectMenuHandler.js @@ -0,0 +1,42 @@ +import { SelectMenuInteraction } from "discord.js"; +import Artibot from "../index.js"; +import selectMenuError from "../messages/selectMenuError.js"; + +export const name = "interactionCreate"; + +/** + * + * @param {SelectMenuInteraction} interaction + * @param {Artibot} artibot + */ +export async function execute(interaction, artibot) { + // Checks if the interaction is a select menu interaction + if (!interaction.isSelectMenu()) return; + + const { client } = interaction; + const { log, localizer, modules } = artibot; + + let command; + + for (const module of modules) { + if (command) break; + for (const part of module.parts) { + if (command) break; + if (part.type == "selectmenu" && part.id == interaction.customId) command = part; + } + } + + // If the interaction is not a registered dropdown, return error message. + if (!command) return selectMenuError(interaction, artibot); + + // A try to execute the interaction. + try { + await command.execute(interaction, artibot); + } catch (err) { + log("SelectMenuHandler", err, "warn", true); + interaction.reply({ + content: localizer._("An error occured while executing this menu option."), + ephemeral: true + }); + } +} diff --git a/index.js b/index.js index 343a874..6356dad 100644 --- a/index.js +++ b/index.js @@ -209,7 +209,7 @@ export default class Artibot { export class Module { /** * Any module part type. - * @typedef {Command|SlashCommand|Button|MessageContextMenuOption|UserContextMenuOption} ModulePartResolvable + * @typedef {Command|SlashCommand|Button|MessageContextMenuOption|UserContextMenuOption|Global} ModulePartResolvable */ /** @@ -242,8 +242,8 @@ class BasePart { * @param {Object} config - Config for this part * @param {string} config.id - ID of the part * @param {string} config.type - Type of the part - * @param {function(): void} config.mainFunction - The function when the part is executed - * @param {function(): void} [config.initFunction] - The function executed on bot startup + * @param {function(): void|Promise} config.mainFunction - The function when the part is executed + * @param {function(): void|Promise} [config.initFunction] - The function executed on bot startup */ constructor({ id, type, mainFunction, initFunction }) { if (!id || !type || !mainFunction) throw new Error("Missing parameter(s)"); @@ -272,8 +272,8 @@ export class Command extends BasePart { * @param {boolean} [config.guildOnly=false] - If the command can only be executed in a guild * @param {discord.Permissions} [config.permissions] - Required permissions * @param {boolean} [config.requiresArgs=false] - Set to true if the command needs at least one argument - * @param {function(Message, string[], Artibot): void} config.mainFunction - Function to execute when the command is ran - * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup + * @param {function(Message, string[], Artibot): void|Promise} config.mainFunction - Function to execute when the command is ran + * @param {function(Artibot): void|Promise} [config.initFunction] - Function executed on bot startup */ constructor({ id, name, description, aliases = [], usage, cooldown, ownerOnly = false, guildOnly = false, permissions, requiresArgs = false, mainFunction, initFunction }) { super({ id, type: "command", mainFunction, initFunction }); @@ -299,8 +299,8 @@ export class SlashCommand extends BasePart { * @param {string} config.id - ID of the command * @param {SlashCommandBuilder} config.data - Data to register into the Discord API * @param {number} [config.cooldown=1] - Cooldown per user for this command, in seconds - * @param {function(discord.CommandInteraction, Artibot): void} config.mainFunction - Function to execute when the command is ran - * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup + * @param {function(discord.CommandInteraction, Artibot): void|Promise} config.mainFunction - Function to execute when the command is ran + * @param {function(Artibot): void|Promise} [config.initFunction] - Function executed on bot startup */ constructor({ id, data, cooldown = 1, mainFunction, initFunction }) { if (!data) throw new Error("Missing data parameter"); @@ -318,8 +318,8 @@ export class Button extends BasePart { /** * @param {Object} config - Config for this button * @param {string} config.id - ID of the button. Supports asterix ("*") for wildcard. - * @param {function(discord.ButtonInteraction, Artibot): void} config.mainFunction - Function to execute when the button is clicked - * @param {function(Artibot): void} [config.initFunction] - Function executed on bot startup + * @param {function(discord.ButtonInteraction, Artibot): void|Promise} config.mainFunction - Function to execute when the button is clicked + * @param {function(Artibot): void|Promise} [config.initFunction] - Function executed on bot startup */ constructor({ id, mainFunction, initFunction }) { super({ id, type: "button", mainFunction, initFunction }); @@ -335,8 +335,8 @@ export class MessageContextMenuOption extends BasePart { * @param {Object} config - Config for this context menu option * @param {string} config.id - ID of this option * @param {string} config.name - Name of this option - * @param {function(discord.MessageContextMenuInteraction, Artibot): void} config.mainFunction - Function to execute when the menu option is clicked - * @param {function(Artibot): void} config.initFunction - Function executed on bot startup + * @param {function(discord.MessageContextMenuInteraction, Artibot): void|Promise} config.mainFunction - Function to execute when the menu option is clicked + * @param {function(Artibot): void|Promise} config.initFunction - Function executed on bot startup */ constructor({ id, name, mainFunction, initFunction }) { if (!name) throw new Error("Missing name parameter!"); @@ -348,13 +348,17 @@ export class MessageContextMenuOption extends BasePart { } } +/** + * User context menu option part for a module + * @extends BasePart + */ export class UserContextMenuOption extends BasePart { /** * @param {Object} config - Config for this context menu option * @param {string} config.id - ID of this option * @param {string} config.name - Name of this option - * @param {function(discord.UserContextMenuInteraction, Artibot): void} config.mainFunction - Function to execute when the menu option is clicked - * @param {function(Artibot): void} config.initFunction - Function executed on bot startup + * @param {function(discord.UserContextMenuInteraction, Artibot): void|Promise} config.mainFunction - Function to execute when the menu option is clicked + * @param {function(Artibot): void|Promise} config.initFunction - Function executed on bot startup */ constructor({ id, name, mainFunction, initFunction }) { if (!name) throw new Error("Missing name parameter!"); @@ -366,6 +370,22 @@ export class UserContextMenuOption extends BasePart { } } +/** + * Select menu option part for a module + * @extends BasePart + */ +export class SelectMenuOption extends BasePart { + /** + * @param {Object} config - Config for this menu option + * @param {string} config.id - ID of this option + * @param {function(discord.SelectMenuInteraction, Artibot): void|Promise} config.mainFunction - Function executed when this option is selected + * @param {function(Artibot): void|Promise} config.initFunction - Function executed on bot startup + */ + constructor({ id, mainFunction, initFunction }) { + super({ id, type: "selectmenu", mainFunction, initFunction }); + } +} + export class Embed extends discord.MessageEmbed { /** * @param {Artibot} artibot diff --git a/messages/defaultSelectError.js b/messages/defaultSelectError.js deleted file mode 100644 index a104293..0000000 --- a/messages/defaultSelectError.js +++ /dev/null @@ -1,18 +0,0 @@ -const { locale } = require("../../config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "..", "locales.json") -}); - -module.exports = { - async execute(interaction) { - await interaction.reply({ - content: localizer._("There was an error with this menu option!"), - ephemeral: true, - }); - return - } -}; diff --git a/messages/selectMenuError.js b/messages/selectMenuError.js new file mode 100644 index 0000000..d8e2523 --- /dev/null +++ b/messages/selectMenuError.js @@ -0,0 +1,14 @@ +import { SelectMenuInteraction } from "discord.js"; +import Artibot from "../index.js"; + +/** + * Error message for select menu interaction + * @param {SelectMenuInteraction} interaction + * @param {Artibot} artibot + */ +export default function execute(interaction, { localizer }) { + interaction.reply({ + content: localizer._("There was an error with this menu option!"), + ephemeral: true, + }); +} diff --git a/testing.js b/testing.js index 549624a..1736eeb 100644 --- a/testing.js +++ b/testing.js @@ -1,5 +1,6 @@ -import { MessageActionRow, MessageButton } from "discord.js"; -import Artibot, { Command, Module } from "./index.js"; +import { SelectMenuOptionBuilder } from "@discordjs/builders"; +import { MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js"; +import Artibot, { Command, Module, SelectMenuOption } from "./index.js"; import token from "./private.js"; const artibot = new Artibot({ @@ -29,9 +30,34 @@ artibot.registerModule( .setCustomId("delete") .setLabel("delete") .setStyle("PRIMARY") + ), + new MessageActionRow() + .addComponents( + new MessageSelectMenu() + .setCustomId("test.selectmenu") + .setPlaceholder("select something") + .addOptions([ + { + label: "Testing option", + description: "Testing option to do testing", + value: "asdasd" + }, + { + label: "Testing option 2", + description: "Testing option to do testing a second time", + value: "qweqwe" + } + ]) ) ] }) + }), + new SelectMenuOption({ + id: "test.selectmenu", + mainFunction: (interaction) => interaction.reply({ + content: "Ok: " + interaction.values.join(", "), + ephemeral: true + }) }) ] }) From aacc17974b330c3d74b3a05b2a510d1f93be727c Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 23:37:37 -0400 Subject: [PATCH 18/68] Create Global part type --- index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/index.js b/index.js index 6356dad..fafd1ee 100644 --- a/index.js +++ b/index.js @@ -386,6 +386,23 @@ export class SelectMenuOption extends BasePart { } } +/** + * Global part for a module + * - Special part which is not managed by a event handler and only ran at startup + * @extends BasePart + */ +export class Global extends BasePart { + /** + * @param {Object} config - Config for this global + * @param {string} config.id - ID of this global + * @param {function(Artibot): void|Promise} config.mainFunction - Function executed on bot startup + */ + constructor({ id, mainFunction }) { + super({ id, type: "global", mainFunction }); + this.init = mainFunction; + } +} + export class Embed extends discord.MessageEmbed { /** * @param {Artibot} artibot From 762bbea832816f38bd8ec6971d6f0d41eb194f20 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 24 Apr 2022 23:49:14 -0400 Subject: [PATCH 19/68] try to make the pterodactyl start trigger work as expected --- events/pterodactylStart.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/pterodactylStart.js b/events/pterodactylStart.js index cf1e617..b7b9d83 100644 --- a/events/pterodactylStart.js +++ b/events/pterodactylStart.js @@ -5,7 +5,7 @@ export const once = true; * Send pterodactyl started trigger */ export function execute() { - if (process.env.RUNS_IN_PTERODACTYL) { + if ("RUNS_IN_PTERODACTYL" in process.env && process.env.RUNS_IN_PTERODACTYL) { console.log("Pterodactyl start trigger"); - }; + } } \ No newline at end of file From db7fee35d7af7c175fb7cfc459430e99524082aa Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Mon, 25 Apr 2022 00:40:58 -0400 Subject: [PATCH 20/68] Migrate and improve triggers --- events/triggerCreate.js | 45 --------------------------------------- events/triggerHandler.js | 33 ++++++++++++++++++++++++++++ index.js | 46 ++++++++++++++++++++++++++++++---------- testing.js | 16 ++++++++++++-- 4 files changed, 82 insertions(+), 58 deletions(-) delete mode 100644 events/triggerCreate.js create mode 100644 events/triggerHandler.js diff --git a/events/triggerCreate.js b/events/triggerCreate.js deleted file mode 100644 index 10dd097..0000000 --- a/events/triggerCreate.js +++ /dev/null @@ -1,45 +0,0 @@ -import { Message } from "discord.js"; -import Artibot from "../index.js"; - -export const name = "messageCreate"; - -/** - * Trigger event listener - * @param {Message} message - * @param {Artibot} artibot - */ -export async function execute(message, artibot) { - // Ignore bots - if (message.author.bot) return; - - const { log, localizer } = artibot; - - // Checking ALL triggers using every function and breaking out if a trigger was found. - let check = false; - - artibot.modules.forEach(async (module) => { - if (check) return false; - module.parts.forEach(async (part) => { - if (check) return false; - if (part.type != "trigger") return false; - - part.triggers.forEach(async(trigger) => { - // If validated, it will try to execute the trigger. - if (message.content.includes(trigger)) { - try { - command.execute(message, commons); - } catch (error) { - // If checks fail, reply back! - log("TriggerManager", error, "warn", true); - message.reply({ - content: localizer._("An error occured while trying to execute a trigger."), - }); - }; - - check = true; - return false; - }; - }); - }); - }); -} diff --git a/events/triggerHandler.js b/events/triggerHandler.js new file mode 100644 index 0000000..4ccfff1 --- /dev/null +++ b/events/triggerHandler.js @@ -0,0 +1,33 @@ +import { Message } from "discord.js"; +import Artibot from "../index.js"; + +export const name = "messageCreate"; + +/** + * Trigger event listener + * @param {Message} message + * @param {Artibot} artibot + */ +export async function execute(message, artibot) { + // Ignore bots + if (message.author.bot) return; + + const { log, localizer } = artibot; + + for (const module of artibot.modules) { + for (const part of module.parts) { + if (part.type != "trigger") continue; + for (const trigger of part.triggers) { + if (typeof trigger == "string" && message.content.includes(trigger) || typeof trigger == "object" && trigger.test(message.content)) { + (async () => { + try { + await part.execute(message, trigger, artibot); + } catch (e) { + if (artibot.config.debug) log("TriggerHandler", e, "debug", true); + } + })(); + } + } + } + } +} diff --git a/index.js b/index.js index fafd1ee..7be91fe 100644 --- a/index.js +++ b/index.js @@ -25,14 +25,15 @@ export default class Artibot { * @param {Object} config - Configuration for Artibot * @param {Snowflake} config.ownerId - Discord ID of the owner of the bot * @param {Snowflake} config.testGuildId - Discord ID of the testing guild - * @param {string} [config.botName] - Name of the Discord bot. Used almost everywhere. - * @param {string} [config.botIcon] - URL of the profile picture of the bot - * @param {string} [config.prefix] - Prefix for the commands - * @param {boolean} [config.devMode] - Set to false if the bot must be used in more than one server. Interactions could take more time to refresh. - * @param {string} [config.lang] - Set the lang of the bot - * @param {string} [config.embedColor] - Color for the embeds sent by the bot - * @param {boolean} [config.advancedCorePing] - Set to false if you want to hide advanced infos from ping commands - * @param {boolean} [config.checkForUpdates] - Set to false if you don't want the bot to check for new updates + * @param {string} [config.botName="Artibot"] - Name of the Discord bot. Used almost everywhere. + * @param {string} [config.botIcon="https://assets.artivain.com/fav/bots/artibot-512.jpg"] - URL of the profile picture of the bot + * @param {string} [config.prefix="ab "] - Prefix for the commands + * @param {boolean} [config.devMode=true] - Set to false if the bot must be used in more than one server. Interactions could take more time to refresh. + * @param {string} [config.lang="en"] - Set the lang of the bot + * @param {string} [config.embedColor="#06476d"] - Color for the embeds sent by the bot + * @param {boolean} [config.advancedCorePing=true] - Set to false if you want to hide advanced infos from ping commands + * @param {boolean} [config.checkForUpdates=true] - Set to false if you don't want the bot to check for new updates + * @param {boolean} [config.debug=false] - Set to true to show debug messages in console */ constructor({ ownerId, @@ -44,7 +45,8 @@ export default class Artibot { lang = "en", embedColor = "#06476d", advancedCorePing = true, - checkForUpdates = true + checkForUpdates = true, + debug = false }) { // Verify that the owner ID is set if (!ownerId) throw new Error("You must set the owner ID."); @@ -72,7 +74,8 @@ export default class Artibot { lang, embedColor, advancedCorePing, - checkForUpdates + checkForUpdates, + debug } this.version = version; @@ -209,7 +212,7 @@ export default class Artibot { export class Module { /** * Any module part type. - * @typedef {Command|SlashCommand|Button|MessageContextMenuOption|UserContextMenuOption|Global} ModulePartResolvable + * @typedef {Command|SlashCommand|Button|MessageContextMenuOption|UserContextMenuOption|TriggerGroup|Global} ModulePartResolvable */ /** @@ -386,6 +389,27 @@ export class SelectMenuOption extends BasePart { } } +export class TriggerGroup extends BasePart { + /** + * @param {Object} config - Config for this trigger group + * @param {string} config.id - ID of this trigger group + * @param {Array} config.triggers - List of triggers + * @param {function(discord.Message, string|RegExp, Artibot): void|Promise} config.mainFunction - Function executed on trigger found + * @param {function(Artibot): void|Promise} config.initFunction - Function executed on bot startup + */ + constructor({ id, triggers, mainFunction, initFunction }) { + if (!triggers || !triggers.length) throw new Error("Triggers cannot be empty!"); + + super({ id, type: "trigger", mainFunction, initFunction }); + + /** + * List of triggers + * @type {Array} + */ + this.triggers = triggers; + } +} + /** * Global part for a module * - Special part which is not managed by a event handler and only ran at startup diff --git a/testing.js b/testing.js index 1736eeb..0f19c5f 100644 --- a/testing.js +++ b/testing.js @@ -1,6 +1,6 @@ import { SelectMenuOptionBuilder } from "@discordjs/builders"; import { MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js"; -import Artibot, { Command, Module, SelectMenuOption } from "./index.js"; +import Artibot, { Command, Module, SelectMenuOption, TriggerGroup } from "./index.js"; import token from "./private.js"; const artibot = new Artibot({ @@ -8,7 +8,8 @@ const artibot = new Artibot({ botName: "Artibot [DEV]", prefix: "abd ", lang: "fr", - testGuildId: "775798875356397608" + testGuildId: "775798875356397608", + debug: true }); artibot.registerModule( @@ -58,6 +59,17 @@ artibot.registerModule( content: "Ok: " + interaction.values.join(", "), ephemeral: true }) + }), + new TriggerGroup({ + id: "testingtrigger", + triggers: ["sus", /asd/i, "plzdelete"], + mainFunction: async (message, trigger) => { + if (trigger == "plzdelete") return await message.delete(); + return await message.reply({ + ephemeral: true, + content: "Triggered: " + trigger.toString() + }); + } }) ] }) From 3e9aa87288dba27c6720fca061bc77dd1b520d2f Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Mon, 25 Apr 2022 18:09:42 -0400 Subject: [PATCH 21/68] Cleanup unused files Update dependencies Update Node.js Prepare jsdoc --- .gitignore | 4 +- .node-version | 2 +- index-old.js | 343 ---------------------------------- interactionManager.js | 1 - loader.js | 51 ----- package-lock.json | 425 ++++++++++++++++++++++++++++++++++++++++-- package.json | 8 +- updater.js | 77 -------- 8 files changed, 418 insertions(+), 493 deletions(-) delete mode 100644 index-old.js delete mode 100644 loader.js delete mode 100644 updater.js diff --git a/.gitignore b/.gitignore index 6a7b50d..3b568d3 100644 --- a/.gitignore +++ b/.gitignore @@ -107,4 +107,6 @@ dist **/private.js **/config.json **/config.js -updaterFiles \ No newline at end of file +updaterFiles + +out \ No newline at end of file diff --git a/.node-version b/.node-version index 0b77208..a1fe187 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.14.0 \ No newline at end of file +16.14.2 \ No newline at end of file diff --git a/index-old.js b/index-old.js deleted file mode 100644 index 045b02b..0000000 --- a/index-old.js +++ /dev/null @@ -1,343 +0,0 @@ -const interactionManager = require("./interactionManager"); -const { checkUpdates } = require("./updater"); -const { log } = require("./logger"); -const Localizer = require("artibot-localizer"); -const loader = require("./loader"); - -const fs = require("fs"); -const { Client, Collection, Intents } = require("discord.js"); -const chalk = require("chalk"); -const figlet = require("figlet"); -const path = require("path"); - -console.log(chalk.blue(figlet.textSync('Artibot', { - font: 'ANSI Shadow', - horizontalLayout: 'fitted' -}))); - -// Initialize localizer -const localizer = new Localizer({ - filePath: path.resolve(__dirname, "locales.json") -}); - -try { - var config = require("../config.json"); - var { clientId, testGuildId, enabledModules } = config; -} catch (error) { - if (error.code !== 'MODULE_NOT_FOUND') { - // Re-throw not "Module not found" errors - throw error; - } else { - log("Artibot", localizer.translateWithPlaceholders("Configuration error: [[0]] file does not exist.", { placeholders: ["config.json"] }), "err", true); - process.exit(1); - }; -}; - -// Set localizer lang with the config one -localizer.setLocale(config.locale); - -try { var token = require("../private.json").botToken; } catch (error) { - if (error.code !== 'MODULE_NOT_FOUND') { - // Re-throw not "Module not found" errors - throw error; - } else { - log("Artibot", localizer.translateWithPlaceholders("Configuration error: [[0]] file does not exist.", { placeholders: ["private.json"] }), "err", true); - process.exit(1); - }; -}; - -if (!token) { - log("Artibot", localizer.translateWithPlaceholders("Configuration error: [[0]] file is invalid.", { placeholders: ["private.json"] }), "err", true); - process.exit(1); -}; - -if (!clientId || !testGuildId || !enabledModules) { - log("Artibot", localizer.translateWithPlaceholders("Configuration error: [[0]] file is invalid.", { placeholders: ["config.json"] }), "err", true); - process.exit(1); -}; - -// Since Discord.js v13, we must declare intents -const client = new Client({ - intents: [ - Intents.FLAGS.GUILDS, - Intents.FLAGS.GUILD_MESSAGES, - Intents.FLAGS.GUILD_MESSAGE_REACTIONS, - Intents.FLAGS.GUILD_VOICE_STATES, - Intents.FLAGS.GUILD_MEMBERS, - Intents.FLAGS.GUILD_PRESENCES - ] -}); - -/*****************************************/ -/* Manage event handlers */ -/*****************************************/ - -const eventFiles = fs - .readdirSync("./ab-core/events") - .filter((file) => file.endsWith(".js")); - -// Activer tous les fichiers lorsque requis -for (const file of eventFiles) { - const event = require(`./events/${file}`); - if (event.once) { - client.once(event.name, (...args) => event.execute(...args, client)); - } else { - client.on( - event.name, - async (...args) => await event.execute(...args, client) - ); - }; -}; - -/*****************************************/ -/* Create collections */ -/*****************************************/ - -client.commands = new Collection(); -client.slashCommands = new Collection(); -client.buttonCommands = new Collection(); -client.selectCommands = new Collection(); -client.contextCommands = new Collection(); -client.cooldowns = new Collection(); -client.triggers = new Collection(); -client.globals = new Collection(); - -/*****************************************/ -/* Load manifests */ -/*****************************************/ - -log("Loader", localizer.translate("Loading manifests..."), "log", true); -const manifests = loader.getManifests(); -log("Loader", localizer.translateWithPlaceholders("Found [[0]] modules.", { placeholders: [manifests.length] }), "log", true); - -/*****************************************/ -/* Initialize globals */ -/*****************************************/ - -const globalModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "global") return true; -}); - -for (const module of globalModules) { - const parts = module.parts.filter(part => part.type == "global"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const global = require(filePath); - client.globals.set(part.id, { global, part, module }); - }; -}; - -/*****************************************/ -/* Initialize commands */ -/*****************************************/ - -log("CommandManager", localizer.translate("Activating commands:"), "info", true); - -const commandsModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "command") return true; -}); - -for (const module of commandsModules) { - log("CommandManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("CommandManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "command"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - client.commands.set(command.name, { command, part, module }); - log("CommandManager", " - " + command.name, "log", true); - }; -}; - -/*****************************************/ -/* Initialize slash commands */ -/*****************************************/ - -log("SlashManager", localizer.translate("Activating slash commands:"), "info", true); - -const slashModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "slashcommand") return true; -}); - -for (const module of slashModules) { - log("SlashManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("SlashManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "slashcommand"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - client.slashCommands.set(command.data.name, { command, part, module }); - log("SlashManager", " - " + command.data.name, "log", true); - }; -}; - -if (client.commands.size == 0) log("SlashManager", localizer.translate("No module to activate."), "log", true); - -/*****************************************/ -/* Initialize messages menu */ -/*****************************************/ - -log("InteractionManager", localizer.translate("Activating context menu on messages:"), "info", true); - -const messageMenuModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "messagemenu") return true; -}); - -for (const module of messageMenuModules) { - log("InteractionManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("InteractionManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "messagemenu"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - const keyName = `MESSAGE ${command.data.name}`; - client.contextCommands.set(keyName, { command, part, module }); - log("InteractionManager", " - " + command.data.name, "log", true); - }; -}; - -const interactionAmmount = client.contextCommands.size; - -if (interactionAmmount == 0) log("InteractionManager", localizer.translate("No module to activate."), "log", true); - -/*****************************************/ -/* Initialize users menu */ -/*****************************************/ - -log("InteractionManager", localizer.translate("Activating context menu on users:"), "info", true); - -const userMenuModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "usermenu") return true; -}); - -for (const module of userMenuModules) { - log("InteractionManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("InteractionManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "usermenu"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - const keyName = `USER ${command.data.name}`; - client.contextCommands.set(keyName, { command, part, module }); - log("InteractionManager", " - " + command.data.name, "log", true); - }; -}; - -if (interactionAmmount == client.contextCommands.size) log("InteractionManager", localizer.translate("No module to activate."), "log", true); - -/*****************************************/ -/* Initialize buttons */ -/*****************************************/ - -log("ButtonManager", localizer.translate("Activating buttons:"), "info", true); - -const buttonModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "button") return true; -}); - -for (const module of buttonModules) { - log("ButtonManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("ButtonManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "button"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - client.buttonCommands.set(command.id, { command, part, module }); - log("ButtonManager", " - " + command.id, "log", true); - }; -}; - -if (client.buttonCommands.size == 0) log("ButtonManager", localizer.translate("No module to activate."), "log", true); - -/*****************************************/ -/* Initialize dropdown menus */ -/*****************************************/ - -log("ButtonManager", localizer.translate("Activating select menus:"), "info", true); - -const dropdownModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "selectmenu") return true; -}); - -for (const module of dropdownModules) { - log("ButtonManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("ButtonManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "selectmenu"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - client.selectCommands.set(command.id, { command, part, module }); - log("ButtonManager", " - " + command.id, "log", true); - }; -}; - -if (client.selectCommands.size == 0) log("ButtonManager", localizer.translate("No module to activate."), "log", true); - -/*****************************************/ -/* Initialize triggers */ -/*****************************************/ - -log("TriggerManager", localizer.translate("Activating triggers:"), "info", true); - -const triggerModules = manifests.filter(manifest => { - for (const part of manifest.parts) if (part.type == "trigger") return true; -}); - -for (const module of triggerModules) { - log("TriggerManager", ` - ${localizer.translate("Activating module")} ${module.name} (v${module.moduleVersion})`, "log", true); - if (module.supportedLocales != "any" && !module.supportedLocales.includes(config.locale)) { - log("TriggerManager", localizer.__(" -> This module does not support the [[0]] language!", { placeholders: [config.locale] }), "warn", true); - }; - const parts = module.parts.filter(part => part.type == "trigger"); - for (const part of parts) { - const filePath = `../ab-modules/${module.id}/${part.path}`; - const command = require(filePath); - client.triggers.set(part.id, { command, part, module }); - log("TriggerManager", " - " + part.id, "log", true); - }; -}; - -if (client.triggers.size == 0) log("TriggerManager", localizer.translate("No module to activate."), "log", true); - -// Connect to Discord API -client.login(token); - -/**********************************************/ -/* Check for updates on GitHub */ -/**********************************************/ - -checkUpdates().then(response => { - /** - * If check for updates is disabled, don't do anything - * @since 2.0.0 - */ - if (!response) return; - - if (response.upToDate) { - log("Updater", localizer.translateWithPlaceholders("Artibot is up to date (v[[0]]).", { placeholders: [response.currentVersion] }), "info", true); - } else { - log("Updater", localizer.translate("An update for Artibot is available!"), "warn", true); - log("Updater", localizer.translateWithPlaceholders(" - Installed version: [[0]]", { placeholders: [response.currentVersion] }), "info", true); - log("Updater", localizer.translateWithPlaceholders(" - Latest version: [[0]]", { placeholders: [response.remoteVersion] }), "info", true); - }; -}); - -/**********************************************/ -/* Initialize slash commands in Discord's API */ -/**********************************************/ - -interactionManager.init(token); -interactionManager.generateData(client); -interactionManager.register(); \ No newline at end of file diff --git a/interactionManager.js b/interactionManager.js index ee4fa45..1ae1b5d 100644 --- a/interactionManager.js +++ b/interactionManager.js @@ -1,6 +1,5 @@ import { REST } from "@discordjs/rest"; import { Routes } from "discord-api-types/v9"; -import { Client } from "discord.js"; import Artibot, { log, Module } from "./index.js"; /** diff --git a/loader.js b/loader.js deleted file mode 100644 index c2e9483..0000000 --- a/loader.js +++ /dev/null @@ -1,51 +0,0 @@ -const { checkUpdates } = require("./updater"); -const { log } = require("./logger"); -const Localizer = require("artibot-localizer"); -const config = require("../config.json"); -const path = require("path"); -const fs = require("fs"); -const contributors = require("../contributors.json"); -const { version } = require("../package.json"); - -const localizer = new Localizer({ - lang: config.locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - commons: { - checkUpdates, - log, - config, - contributors, - version - }, - - /** - * Get all index files of modules - * @returns {{id: string, name: string, manifestVersion: Number, moduleVersion: string, supportedLocales: string[]|"any", parts: {id: string, type: string, path: string}[]}[]} - Array of manifests - */ - getManifests() { - let entries = []; - - // Get all folders - const folders = fs.readdirSync("./ab-modules", { withFileTypes: true }) - .filter(dirent => dirent.isDirectory()) - .map(dirent => dirent.name) - .filter(name => config.enabledModules.includes(name) || name == "core"); - - for (const folder of folders) { - try { - const { manifest } = require(`../ab-modules/${folder}/index.js`); - entries.push({ ...manifest, id: folder }); - } catch (error) { - // Re-throw not "Module not found" errors - if (error.code !== 'MODULE_NOT_FOUND') throw error; - - log("Loader", localizer.__("An error occured while trying to load manifest file of module [[0]].", { placeholders: [folder] }), "warn", true); - }; - }; - - return entries - } -}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fcbc920..88c9df4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,9 @@ "@discordjs/builders": "^0.13.0", "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "axios": "^0.26.1", + "axios": "^0.27.0", "chalk": "^5.0.1", - "discord-api-types": "^0.31.2", + "discord-api-types": "^0.32.0", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", "discordjs-reaction-role": "^2.1.1", @@ -24,6 +24,7 @@ "whois": "^2.13.9" }, "devDependencies": { + "jsdoc": "^3.6.10", "nodemon": "^2.0.15", "npm-check-updates": "^12.5.9" }, @@ -31,6 +32,18 @@ "url": "https://paypal.me/Artivain" } }, + "node_modules/@babel/parser": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", + "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@discordjs/builders": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.13.0.tgz", @@ -47,6 +60,11 @@ "node": ">=16.9.0" } }, + "node_modules/@discordjs/builders/node_modules/discord-api-types": { + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", + "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" + }, "node_modules/@discordjs/collection": { "version": "0.7.0-dev.1650672508-3617093", "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", @@ -327,6 +345,28 @@ "node": ">= 10" } }, + "node_modules/@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "dev": true + }, + "node_modules/@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dev": true, + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "node_modules/@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "dev": true + }, "node_modules/@types/node": { "version": "17.0.26", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", @@ -545,11 +585,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", - "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.0.tgz", + "integrity": "sha512-XV/WrPxXfzgZ8j4lcB5i6LyaXmi90yetmV/Fem0kmglGx+mpY06CiweL3YxU6wOTNLmqLUePW4G8h45nGZ/+pA==", "dependencies": { - "follow-redirects": "^1.14.8" + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" } }, "node_modules/balanced-match": { @@ -567,6 +608,12 @@ "node": ">=8" } }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, "node_modules/boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -770,6 +817,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "dev": true, + "dependencies": { + "lodash": "^4.17.15" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/chalk": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", @@ -1074,9 +1133,9 @@ } }, "node_modules/discord-api-types": { - "version": "0.31.2", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", - "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.0.tgz", + "integrity": "sha512-i6HyCwWRocvtIcM7hamI3eQTCxLN/UvWtm/JktaXRSWDmASfhHam2juhej+e4U/Q/Fni1uUlyloMCBTL04Dl6Q==" }, "node_modules/discord-giveaways": { "version": "5.1.1", @@ -1198,6 +1257,15 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -1222,6 +1290,15 @@ "node": ">=8" } }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1980,6 +2057,56 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "dev": true, + "dependencies": { + "xmlcreate": "^2.0.4" + } + }, + "node_modules/jsdoc": { + "version": "3.6.10", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.10.tgz", + "integrity": "sha512-IdQ8ppSo5LKZ9o3M+LKIIK8i00DIe5msDvG3G81Km+1dhy0XrOWD0Ji8H61ElgyEj/O9KRLokgKbAM9XX9CJAg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.9.4", + "@types/markdown-it": "^12.2.3", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^4.0.1", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.2" + }, + "bin": { + "jsdoc": "jsdoc.js" + }, + "engines": { + "node": ">=8.15.0" + } + }, + "node_modules/jsdoc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -2037,6 +2164,15 @@ "json-buffer": "3.0.0" } }, + "node_modules/klaw": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-4.0.1.tgz", + "integrity": "sha512-pgsE40/SvC7st04AHiISNewaIMUbY5V/K8b21ekiPiFoYs/EYSdsGa+FJArB1d441uq4Q8zZyIxvAzkGNlBdRw==", + "dev": true, + "engines": { + "node": ">=14.14.0" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -2121,6 +2257,15 @@ "node": ">=4" } }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "dependencies": { + "uc.micro": "^1.0.1" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -2219,6 +2364,50 @@ "node": ">=12" } }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it-anchor": { + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.2.tgz", + "integrity": "sha512-JNaekTlIwwyYGBN3zifZDxgz4bSL8sbEj58fdTZGmPSMMGXBZapFjcZk2I33Jy79c1fvCKHpF7MA/67FOTjvzA==", + "dev": true, + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, + "node_modules/marked": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", + "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3400,6 +3589,15 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "node_modules/requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" + } + }, "node_modules/responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -3766,6 +3964,12 @@ "node": ">=4" } }, + "node_modules/taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, "node_modules/tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -3852,6 +4056,12 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, "node_modules/undefsafe": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", @@ -4153,6 +4363,12 @@ "node": ">=8" } }, + "node_modules/xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", + "dev": true + }, "node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -4236,6 +4452,12 @@ } }, "dependencies": { + "@babel/parser": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", + "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "dev": true + }, "@discordjs/builders": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.13.0.tgz", @@ -4247,6 +4469,13 @@ "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.3.1" + }, + "dependencies": { + "discord-api-types": { + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", + "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" + } } }, "@discordjs/collection": { @@ -4456,6 +4685,28 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, + "@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", + "dev": true + }, + "@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dev": true, + "requires": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", + "dev": true + }, "@types/node": { "version": "17.0.26", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", @@ -4631,11 +4882,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "axios": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", - "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.0.tgz", + "integrity": "sha512-XV/WrPxXfzgZ8j4lcB5i6LyaXmi90yetmV/Fem0kmglGx+mpY06CiweL3YxU6wOTNLmqLUePW4G8h45nGZ/+pA==", "requires": { - "follow-redirects": "^1.14.8" + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" } }, "balanced-match": { @@ -4650,6 +4902,12 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, "boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -4810,6 +5068,15 @@ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, + "catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, "chalk": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", @@ -5039,9 +5306,9 @@ } }, "discord-api-types": { - "version": "0.31.2", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.31.2.tgz", - "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.0.tgz", + "integrity": "sha512-i6HyCwWRocvtIcM7hamI3eQTCxLN/UvWtm/JktaXRSWDmASfhHam2juhej+e4U/Q/Fni1uUlyloMCBTL04Dl6Q==" }, "discord-giveaways": { "version": "5.1.1", @@ -5136,6 +5403,12 @@ "once": "^1.4.0" } }, + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true + }, "env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -5154,6 +5427,12 @@ "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", "dev": true }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -5734,6 +6013,46 @@ "argparse": "^2.0.1" } }, + "js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "dev": true, + "requires": { + "xmlcreate": "^2.0.4" + } + }, + "jsdoc": { + "version": "3.6.10", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.10.tgz", + "integrity": "sha512-IdQ8ppSo5LKZ9o3M+LKIIK8i00DIe5msDvG3G81Km+1dhy0XrOWD0Ji8H61ElgyEj/O9KRLokgKbAM9XX9CJAg==", + "dev": true, + "requires": { + "@babel/parser": "^7.9.4", + "@types/markdown-it": "^12.2.3", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^4.0.1", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.2" + }, + "dependencies": { + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -5782,6 +6101,12 @@ "json-buffer": "3.0.0" } }, + "klaw": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-4.0.1.tgz", + "integrity": "sha512-pgsE40/SvC7st04AHiISNewaIMUbY5V/K8b21ekiPiFoYs/EYSdsGa+FJArB1d441uq4Q8zZyIxvAzkGNlBdRw==", + "dev": true + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -5850,6 +6175,15 @@ } } }, + "linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -5928,6 +6262,38 @@ } } }, + "markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "requires": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.2.tgz", + "integrity": "sha512-JNaekTlIwwyYGBN3zifZDxgz4bSL8sbEj58fdTZGmPSMMGXBZapFjcZk2I33Jy79c1fvCKHpF7MA/67FOTjvzA==", + "dev": true, + "requires": {} + }, + "marked": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", + "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", + "dev": true + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -6792,6 +7158,15 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -7065,6 +7440,12 @@ "has-flag": "^3.0.0" } }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, "tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -7133,6 +7514,12 @@ "is-typedarray": "^1.0.0" } }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, "undefsafe": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", @@ -7368,6 +7755,12 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "dev": true }, + "xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", + "dev": true + }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", diff --git a/package.json b/package.json index b629f93..c94dfe3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "start": "node index.js", "test": "nodemon testing.js", - "upgrade": "ncu -u && npm install" + "upgrade": "ncu -u && npm install", + "build-docs": "jsdoc ." }, "type": "module", "repository": "github:Artivain/artibot", @@ -30,9 +31,9 @@ "@discordjs/builders": "^0.13.0", "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "axios": "^0.26.1", + "axios": "^0.27.0", "chalk": "^5.0.1", - "discord-api-types": "^0.31.2", + "discord-api-types": "^0.32.0", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", "discordjs-reaction-role": "^2.1.1", @@ -42,6 +43,7 @@ "whois": "^2.13.9" }, "devDependencies": { + "jsdoc": "^3.6.10", "nodemon": "^2.0.15", "npm-check-updates": "^12.5.9" } diff --git a/updater.js b/updater.js deleted file mode 100644 index fb6ec6a..0000000 --- a/updater.js +++ /dev/null @@ -1,77 +0,0 @@ -const AutoGitUpdate = require('auto-git-update'); -const { checkForUpdates, locale } = require("../config.json"); -const { log } = require("./logger"); -const Localizer = require("artibot-localizer"); -const path = require('path'); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -// if ran with npm run updater -if (require.main === module) { - - if (!checkForUpdates) { - log("Updater", localizer._("Configuration error!"), "err", true); - process.exit(1); - }; - - const updater = new AutoGitUpdate({ - repository: 'https://github.com/Artivain/artibot', - tempLocation: '../updaterFiles', - exitOnComplete: true, - fromReleases: true, - logConfig: { - logDebug: true, - logDetail: true, - logGeneral: true, - logWarning: true, - logError: true - } - }); - - updater.autoUpdate(); - -} else { - - module.exports = { - async checkUpdates() { - if (!checkForUpdates) { - return log("Updater", localizer.translate("Check for updates is disabled in config"), "err", true) - }; - - const updater = new AutoGitUpdate({ - repository: 'https://github.com/Artivain/artibot', - tempLocation: '../../updaterFiles', - exitOnComplete: false, - fromReleases: true, - logConfig: { - logDebug: false, - logDetail: false, - logGeneral: false, - logWarning: true, - logError: true - } - }); - - return updater.compareVersions(); - }, - - async doUpdates(options) { - if (!checkForUpdates) throw new Error(localizer.translate("Configuration error!")); - - const autoUpdater = new AutoGitUpdate(options); - - autoUpdater.setLogConfig({ - logDebug: true, - logDetail: true, - logGeneral: true, - logWarning: true, - logError: true - }); - return autoUpdater.autoUpdate(); - } - }; - -}; \ No newline at end of file From 04f722015a1556e36c2421a47a2c7ddc0658aaee Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Mon, 25 Apr 2022 22:01:42 -0400 Subject: [PATCH 22/68] Begin to setup jsdoc --- .gitignore | 2 +- .gitmodules | 3 +++ README.md | 2 +- events/triggerHandler.js | 2 +- jsdoc-template | 1 + jsdoc.json | 42 ++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 7 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 jsdoc-template create mode 100644 jsdoc.json diff --git a/.gitignore b/.gitignore index 3b568d3..90ec441 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,4 @@ dist **/config.js updaterFiles -out \ No newline at end of file +documentation \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..050ec65 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "jsdoc-template"] + path = jsdoc-template + url = https://github.com/GoudronViande24/artibot-jsdoc-template diff --git a/README.md b/README.md index 0874d54..a2351b0 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Bot open-source fait par Artivain et les contributeurs. [![GitHub forks](https://img.shields.io/github/forks/Artivain/artibot?style=flat-square)](https://github.com/Artivain/artibot/network) [![GitHub stars](https://img.shields.io/github/stars/Artivain/artibot?style=flat-square)](https://github.com/Artivain/artibot/stargazers)
-[![Node.js](https://img.shields.io/badge/Node.js-16.14.0-blue?style=flat-square)](https://github.com/Artivain/artibot/blob/main/.node-version) +[![Node.js](https://img.shields.io/badge/Node.js-16.14.2-blue?style=flat-square)](https://github.com/Artivain/artibot/blob/main/.node-version) [![GitHub package.json dependency version (prod)](https://img.shields.io/github/package-json/dependency-version/Artivain/artibot/discord.js?style=flat-square)](https://discord.js.org/#/) [![GitHub package.json dependency version (prod)](https://img.shields.io/github/package-json/dependency-version/Artivain/artibot/axios?style=flat-square)](https://axios-http.com/)
diff --git a/events/triggerHandler.js b/events/triggerHandler.js index 4ccfff1..6ff84b1 100644 --- a/events/triggerHandler.js +++ b/events/triggerHandler.js @@ -12,7 +12,7 @@ export async function execute(message, artibot) { // Ignore bots if (message.author.bot) return; - const { log, localizer } = artibot; + const { log } = artibot; for (const module of artibot.modules) { for (const part of module.parts) { diff --git a/jsdoc-template b/jsdoc-template new file mode 160000 index 0000000..da17acd --- /dev/null +++ b/jsdoc-template @@ -0,0 +1 @@ +Subproject commit da17acd9693e6b946fd18a55ace6982be03a0361 diff --git a/jsdoc.json b/jsdoc.json new file mode 100644 index 0000000..e90f479 --- /dev/null +++ b/jsdoc.json @@ -0,0 +1,42 @@ +{ + "plugins": [ + "plugins/markdown" + ], + "recurseDepth": 10, + "source": { + "includePattern": ".+\\.js(doc|x)?$", + "excludePattern": "(^|\\/|\\\\)_", + "exclude": [ + "ab-modules", + "node-modules" + ], + "include": [ + "index.js", + "core", + "logger.js", + "interactionManager.js", + "messages", + "events", + "README.md", + "LICENSE" + ] + }, + "sourceType": "module", + "tags": { + "allowUnknownTags": true, + "dictionaries": [ + "jsdoc", + "closure" + ] + }, + "templates": { + "cleverLinks": false, + "monospaceLinks": false + }, + "opts": { + "template": "jsdoc-template", + "encoding": "utf8", + "destination": "documentation", + "recurse": false + } +} \ No newline at end of file diff --git a/package.json b/package.json index c94dfe3..5796f70 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "node index.js", "test": "nodemon testing.js", "upgrade": "ncu -u && npm install", - "build-docs": "jsdoc ." + "build-docs": "jsdoc -c ./jsdoc.json" }, "type": "module", "repository": "github:Artivain/artibot", From 12b95b00c85797fce5721843b3685cfd8a31ba85 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 26 Apr 2022 23:48:40 -0400 Subject: [PATCH 23/68] better idea: use it as dev dependency let's try to run this in Cloudflare pages --- .gitmodules | 3 - index.js | 7 +- interactionManager.js | 7 +- jsdoc-template | 1 - jsdoc.json | 8 +- logger.js | 7 +- package-lock.json | 1000 ++++++++++++++++++++++++++++------------- package.json | 7 +- test.md | 10 + 9 files changed, 712 insertions(+), 338 deletions(-) delete mode 100644 .gitmodules delete mode 160000 jsdoc-template create mode 100644 test.md diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 050ec65..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "jsdoc-template"] - path = jsdoc-template - url = https://github.com/GoudronViande24/artibot-jsdoc-template diff --git a/index.js b/index.js index 7be91fe..ccc8fc7 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ const { version } = require('./package.json'); * @see https://github.com/Artivain/artibot * @license GPL-3.0-or-later */ -export default class Artibot { +export class Artibot { /** * @param {Object} config - Configuration for Artibot * @param {Snowflake} config.ownerId - Discord ID of the owner of the bot @@ -206,6 +206,9 @@ export default class Artibot { } } +/** @ignore */ +export default Artibot; + /** * Base class for Artibot modules */ @@ -442,7 +445,7 @@ export class Embed extends discord.MessageEmbed { /** * Log message to console, with proper coloring and prefix. - * + * @ignore * @author Artivain * @since v1.5.3 * @param {string} name Name of the module sending the log. diff --git a/interactionManager.js b/interactionManager.js index 1ae1b5d..273cdb1 100644 --- a/interactionManager.js +++ b/interactionManager.js @@ -5,7 +5,7 @@ import Artibot, { log, Module } from "./index.js"; /** * Interaction management utility for Artibot */ -export default class InteractionManager { +export class InteractionManager { /** * @param {Object} parameters - Parameters for this InteractionManager * @param {string} parameters.token - Token for the Discord bot @@ -88,4 +88,7 @@ export default class InteractionManager { return false; }; } -} \ No newline at end of file +} + +/** @ignore */ +export default InteractionManager; \ No newline at end of file diff --git a/jsdoc-template b/jsdoc-template deleted file mode 160000 index da17acd..0000000 --- a/jsdoc-template +++ /dev/null @@ -1 +0,0 @@ -Subproject commit da17acd9693e6b946fd18a55ace6982be03a0361 diff --git a/jsdoc.json b/jsdoc.json index e90f479..b916137 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -12,13 +12,9 @@ ], "include": [ "index.js", - "core", "logger.js", "interactionManager.js", - "messages", - "events", - "README.md", - "LICENSE" + "README.md" ] }, "sourceType": "module", @@ -34,7 +30,7 @@ "monospaceLinks": false }, "opts": { - "template": "jsdoc-template", + "template": "node_modules/artibot-jsdoc-template", "encoding": "utf8", "destination": "documentation", "recurse": false diff --git a/logger.js b/logger.js index e5eaba4..fb269a0 100644 --- a/logger.js +++ b/logger.js @@ -10,7 +10,7 @@ import chalk from "chalk"; * @param {("log"|"warn"|"err"|"debug"|"info")} [type="log"] Type of message. * @param {boolean} [isCore=false] Is this message sent from the core? Probably not. */ -export default function log(name, msg, type = "log", isCore = false) { +export function log(name, msg, type = "log", isCore = false) { type = type.toLowerCase(); if (isCore) { var prefix = chalk.green(`[${name}]`); @@ -32,4 +32,7 @@ export default function log(name, msg, type = "log", isCore = false) { } else throw new Error(`[Logger] log: "${type}" is not a valid type. Valid values are: "log", "warn", "err", "debug", "info".`); console.log(prefix, content); -} \ No newline at end of file +} + +/** @ignore */ +export default log; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 88c9df4..47c48ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@discordjs/builders": "^0.13.0", "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "axios": "^0.27.0", + "axios": "^0.27.1", "chalk": "^5.0.1", "discord-api-types": "^0.32.0", "discord-giveaways": "^5.1.1", @@ -24,6 +24,7 @@ "whois": "^2.13.9" }, "devDependencies": { + "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template", "jsdoc": "^3.6.10", "nodemon": "^2.0.15", "npm-check-updates": "^12.5.9" @@ -66,9 +67,9 @@ "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" }, "node_modules/@discordjs/collection": { - "version": "0.7.0-dev.1650672508-3617093", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", - "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==", + "version": "0.7.0-dev.1650931751-df64d3e", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650931751-df64d3e.tgz", + "integrity": "sha512-8oPvjx69kAUz5r+I1uzLZrsgSPIC4ybbK4eBAgx2ShNLliFk9hbg0vNkFfJoKKAoS6Mzfxo/47B0+rKdEBXW6w==", "engines": { "node": ">=16.9.0" } @@ -102,6 +103,20 @@ "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", "dev": true }, + "node_modules/@jsdoc/util": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.5.tgz", + "integrity": "sha512-lKtV31dM1yXJt7SwCwQenodWkS9hHXWXXR6WmhoXMSS4BIAYKY5M4PUtLiD8xOtzJVIXoOCAL7X2GwI2m09gfA==", + "dev": true, + "dependencies": { + "klaw-sync": "^6.0.0", + "lodash": "^4.17.21", + "ow": "^0.27.0" + }, + "engines": { + "node": ">=v14.17.6" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -150,6 +165,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/@npmcli/fs/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@npmcli/fs/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -185,15 +212,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@npmcli/git/node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/@npmcli/git/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -368,9 +386,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", - "integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A==" + "version": "17.0.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz", + "integrity": "sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -571,6 +589,19 @@ "node": ">=8" } }, + "node_modules/artibot-jsdoc-template": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#ab4455b6e723a6dbf72b4459704a0a44b009e92a", + "dev": true, + "license": "MIT", + "dependencies": { + "@jsdoc/util": "^0.2.5", + "common-path-prefix": "^3.0.0", + "jsdoc": "^3.6.10", + "lodash": "^4.17.21", + "taffydb": "^2.7.3" + } + }, "node_modules/artibot-localizer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/artibot-localizer/-/artibot-localizer-1.0.2.tgz", @@ -585,9 +616,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.0.tgz", - "integrity": "sha512-XV/WrPxXfzgZ8j4lcB5i6LyaXmi90yetmV/Fem0kmglGx+mpY06CiweL3YxU6wOTNLmqLUePW4G8h45nGZ/+pA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.1.tgz", + "integrity": "sha512-ePNMai55xo5GsXajb/k756AqZqpqeDaGwGcdvbZLSSELbbYwsIn2jNmGfUPEwd8j/yu4OoMstLLIVa4t0MneEA==", "dependencies": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -673,6 +704,18 @@ "node": ">=8" } }, + "node_modules/boxen/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -710,6 +753,18 @@ "semver": "^7.0.0" } }, + "node_modules/builtins/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/builtins/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -754,15 +809,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -805,6 +851,15 @@ "node": ">=8" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -1007,6 +1062,12 @@ "node": "^12.20.0 || >=14" } }, + "node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1030,6 +1091,18 @@ "node": ">=8" } }, + "node_modules/configstore/node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -1217,15 +1290,18 @@ } }, "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, "dependencies": { "is-obj": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/duplexer3": { @@ -1362,15 +1438,19 @@ } }, "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/follow-redirects": { @@ -1571,6 +1651,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -1676,15 +1765,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/hosted-git-info/node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -1877,18 +1957,16 @@ } }, "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "engines": { - "node": ">=10" - } + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/ip": { "version": "1.1.5", @@ -2095,17 +2173,11 @@ "node": ">=8.15.0" } }, - "node_modules/jsdoc/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/jsdoc/node_modules/taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true }, "node_modules/json-buffer": { "version": "3.0.0", @@ -2173,6 +2245,15 @@ "node": ">=14.14.0" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -2217,12 +2298,6 @@ "node": ">=6" } }, - "node_modules/libnpmconfig/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, "node_modules/libnpmconfig/node_modules/locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2236,6 +2311,21 @@ "node": ">=6" } }, + "node_modules/libnpmconfig/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/libnpmconfig/node_modules/p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", @@ -2267,14 +2357,18 @@ } }, "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -2283,6 +2377,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -2293,15 +2393,12 @@ } }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/make-dir": { @@ -2355,15 +2452,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/markdown-it": { "version": "12.3.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", @@ -2665,19 +2753,16 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/node-gyp/node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "node_modules/node-gyp/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" + "yallist": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/node-gyp/node_modules/semver": { @@ -2725,9 +2810,9 @@ } }, "node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, "dependencies": { "abbrev": "1" @@ -2736,7 +2821,7 @@ "nopt": "bin/nopt.js" }, "engines": { - "node": "*" + "node": ">=6" } }, "node_modules/normalize-package-data": { @@ -2754,6 +2839,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, + "node_modules/normalize-package-data/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/normalize-package-data/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -2865,22 +2962,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/npm-check-updates/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/npm-check-updates/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2890,19 +2971,16 @@ "node": ">=8" } }, - "node_modules/npm-check-updates/node_modules/locate-path": { + "node_modules/npm-check-updates/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "p-locate": "^5.0.0" + "yallist": "^4.0.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm-check-updates/node_modules/minimatch": { @@ -2917,36 +2995,6 @@ "node": ">=10" } }, - "node_modules/npm-check-updates/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-check-updates/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/npm-check-updates/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -2986,6 +3034,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/npm-install-checks/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/npm-install-checks/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -3021,6 +3081,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/npm-package-arg/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/npm-package-arg/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -3069,6 +3141,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/npm-pick-manifest/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/npm-pick-manifest/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -3126,6 +3210,26 @@ "wrappy": "1" } }, + "node_modules/ow": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz", + "integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.1", + "callsites": "^3.1.0", + "dot-prop": "^6.0.1", + "lodash.isequal": "^4.5.0", + "type-fest": "^1.2.1", + "vali-date": "^1.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -3136,28 +3240,33 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { @@ -3474,11 +3583,14 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/rc/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/read-package-json": { "version": "5.0.1", @@ -3944,12 +4056,15 @@ } }, "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { @@ -3965,9 +4080,9 @@ } }, "node_modules/taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.3.tgz", + "integrity": "sha1-KtNxaWKUmPylvIQkMJbTzeDsOjQ=", "dev": true }, "node_modules/tar": { @@ -4020,6 +4135,21 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/touch/node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -4036,9 +4166,9 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, "engines": { "node": ">=10" @@ -4156,6 +4286,18 @@ "node": ">=8" } }, + "node_modules/update-notifier/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/update-notifier/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -4209,6 +4351,20 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "node_modules/vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -4430,6 +4586,54 @@ "node": ">=6" } }, + "node_modules/yargs/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -4479,9 +4683,9 @@ } }, "@discordjs/collection": { - "version": "0.7.0-dev.1650672508-3617093", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650672508-3617093.tgz", - "integrity": "sha512-Got8gPiFFEwY0tJo6hK/ZGvg8LFEYMyopchL/l5WjvN5YXDSKqlcSfWk3SqA9F8Eb2ZloauUoXY2B3uMMJUUBA==" + "version": "0.7.0-dev.1650931751-df64d3e", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650931751-df64d3e.tgz", + "integrity": "sha512-8oPvjx69kAUz5r+I1uzLZrsgSPIC4ybbK4eBAgx2ShNLliFk9hbg0vNkFfJoKKAoS6Mzfxo/47B0+rKdEBXW6w==" }, "@discordjs/rest": { "version": "0.4.1", @@ -4511,6 +4715,17 @@ "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", "dev": true }, + "@jsdoc/util": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.5.tgz", + "integrity": "sha512-lKtV31dM1yXJt7SwCwQenodWkS9hHXWXXR6WmhoXMSS4BIAYKY5M4PUtLiD8xOtzJVIXoOCAL7X2GwI2m09gfA==", + "dev": true, + "requires": { + "klaw-sync": "^6.0.0", + "lodash": "^4.17.21", + "ow": "^0.27.0" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -4547,6 +4762,15 @@ "semver": "^7.3.5" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -4575,12 +4799,6 @@ "which": "^2.0.2" }, "dependencies": { - "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true - }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -4708,9 +4926,9 @@ "dev": true }, "@types/node": { - "version": "17.0.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", - "integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A==" + "version": "17.0.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz", + "integrity": "sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==" }, "@types/node-fetch": { "version": "2.6.1", @@ -4871,6 +5089,18 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "artibot-jsdoc-template": { + "version": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#ab4455b6e723a6dbf72b4459704a0a44b009e92a", + "dev": true, + "from": "artibot-jsdoc-template@GoudronViande24/artibot-jsdoc-template", + "requires": { + "@jsdoc/util": "^0.2.5", + "common-path-prefix": "^3.0.0", + "jsdoc": "^3.6.10", + "lodash": "^4.17.21", + "taffydb": "^2.7.3" + } + }, "artibot-localizer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/artibot-localizer/-/artibot-localizer-1.0.2.tgz", @@ -4882,9 +5112,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "axios": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.0.tgz", - "integrity": "sha512-XV/WrPxXfzgZ8j4lcB5i6LyaXmi90yetmV/Fem0kmglGx+mpY06CiweL3YxU6wOTNLmqLUePW4G8h45nGZ/+pA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.1.tgz", + "integrity": "sha512-ePNMai55xo5GsXajb/k756AqZqpqeDaGwGcdvbZLSSELbbYwsIn2jNmGfUPEwd8j/yu4OoMstLLIVa4t0MneEA==", "requires": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -4948,6 +5178,12 @@ "requires": { "has-flag": "^4.0.0" } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true } } }, @@ -4985,6 +5221,15 @@ "semver": "^7.0.0" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -5020,14 +5265,6 @@ "ssri": "^9.0.0", "tar": "^6.1.11", "unique-filename": "^1.1.1" - }, - "dependencies": { - "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true - } } }, "cacheable-request": { @@ -5062,6 +5299,12 @@ } } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -5207,6 +5450,12 @@ "integrity": "sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w==", "dev": true }, + "common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5225,6 +5474,17 @@ "unique-string": "^2.0.0", "write-file-atomic": "^3.0.0", "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + } } }, "console-control-strings": { @@ -5366,9 +5626,9 @@ "requires": {} }, "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, "requires": { "is-obj": "^2.0.0" @@ -5487,11 +5747,12 @@ } }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, @@ -5630,6 +5891,14 @@ "dev": true, "requires": { "ini": "2.0.0" + }, + "dependencies": { + "ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true + } } }, "globby": { @@ -5713,14 +5982,6 @@ "dev": true, "requires": { "lru-cache": "^7.5.1" - }, - "dependencies": { - "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true - } } }, "http-cache-semantics": { @@ -5878,14 +6139,15 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, "ip": { @@ -6045,10 +6307,10 @@ "underscore": "~1.13.2" }, "dependencies": { - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", "dev": true } } @@ -6107,6 +6369,15 @@ "integrity": "sha512-pgsE40/SvC7st04AHiISNewaIMUbY5V/K8b21ekiPiFoYs/EYSdsGa+FJArB1d441uq4Q8zZyIxvAzkGNlBdRw==", "dev": true }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11" + } + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -6142,12 +6413,6 @@ "locate-path": "^3.0.0" } }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -6158,6 +6423,15 @@ "path-exists": "^3.0.0" } }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", @@ -6185,11 +6459,12 @@ } }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" } }, "lodash": { @@ -6198,6 +6473,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -6205,13 +6486,10 @@ "dev": true }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", + "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "dev": true }, "make-dir": { "version": "3.1.0", @@ -6252,14 +6530,6 @@ "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.1.1", "ssri": "^9.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true - } } }, "markdown-it": { @@ -6478,13 +6748,13 @@ "path-is-absolute": "^1.0.0" } }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { - "abbrev": "1" + "yallist": "^4.0.0" } }, "semver": { @@ -6517,9 +6787,9 @@ } }, "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, "requires": { "abbrev": "1" @@ -6537,6 +6807,15 @@ "validate-npm-package-license": "^3.0.4" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -6625,29 +6904,19 @@ "supports-color": "^7.1.0" } }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "locate-path": { + "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { - "p-locate": "^5.0.0" + "yallist": "^4.0.0" } }, "minimatch": { @@ -6659,24 +6928,6 @@ "brace-expansion": "^2.0.1" } }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -6706,6 +6957,15 @@ "semver": "^7.1.1" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -6734,6 +6994,15 @@ "validate-npm-package-name": "^4.0.0" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -6769,6 +7038,15 @@ "semver": "^7.3.5" }, "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -6816,6 +7094,20 @@ "wrappy": "1" } }, + "ow": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz", + "integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==", + "dev": true, + "requires": { + "@sindresorhus/is": "^4.0.1", + "callsites": "^3.1.0", + "dot-prop": "^6.0.1", + "lodash.isequal": "^4.5.0", + "type-fest": "^1.2.1", + "vali-date": "^1.0.0" + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -6823,19 +7115,21 @@ "dev": true }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } }, "p-map": { @@ -7039,10 +7333,10 @@ "strip-json-comments": "~2.0.1" }, "dependencies": { - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true } } @@ -7426,9 +7720,9 @@ } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { @@ -7441,9 +7735,9 @@ } }, "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.3.tgz", + "integrity": "sha1-KtNxaWKUmPylvIQkMJbTzeDsOjQ=", "dev": true }, "tar": { @@ -7482,6 +7776,17 @@ "dev": true, "requires": { "nopt": "~1.0.10" + }, + "dependencies": { + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "1" + } + } } }, "tr46": { @@ -7500,9 +7805,9 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true }, "typedarray-to-buffer": { @@ -7596,6 +7901,15 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -7631,6 +7945,13 @@ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", "requires": { "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } } }, "util-deprecate": { @@ -7639,6 +7960,12 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -7794,6 +8121,41 @@ "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + } } }, "yargs-parser": { diff --git a/package.json b/package.json index 5796f70..c44e24e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "node index.js", "test": "nodemon testing.js", - "upgrade": "ncu -u && npm install", + "upgrade": "ncu -u && npm install && npm update", "build-docs": "jsdoc -c ./jsdoc.json" }, "type": "module", @@ -31,7 +31,7 @@ "@discordjs/builders": "^0.13.0", "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "axios": "^0.27.0", + "axios": "^0.27.1", "chalk": "^5.0.1", "discord-api-types": "^0.32.0", "discord-giveaways": "^5.1.1", @@ -45,6 +45,7 @@ "devDependencies": { "jsdoc": "^3.6.10", "nodemon": "^2.0.15", - "npm-check-updates": "^12.5.9" + "npm-check-updates": "^12.5.9", + "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template" } } diff --git a/test.md b/test.md new file mode 100644 index 0000000..17a3a11 --- /dev/null +++ b/test.md @@ -0,0 +1,10 @@ +# asdasd! + +asdasd +as +da +sd + +- asd +- asd +- asd \ No newline at end of file From 36c8e1059e1f199e072cadf01d94e6f150681a51 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 26 Apr 2022 23:56:20 -0400 Subject: [PATCH 24/68] update dependencies --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 47c48ed..9b33407 100644 --- a/package-lock.json +++ b/package-lock.json @@ -386,9 +386,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz", - "integrity": "sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==" + "version": "17.0.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", + "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -591,7 +591,7 @@ }, "node_modules/artibot-jsdoc-template": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#ab4455b6e723a6dbf72b4459704a0a44b009e92a", + "resolved": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#90a8958aaf2e6d0bfcc11f02e60b2f8628c0990f", "dev": true, "license": "MIT", "dependencies": { @@ -4926,9 +4926,9 @@ "dev": true }, "@types/node": { - "version": "17.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz", - "integrity": "sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==" + "version": "17.0.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", + "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==" }, "@types/node-fetch": { "version": "2.6.1", @@ -5090,7 +5090,7 @@ "dev": true }, "artibot-jsdoc-template": { - "version": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#ab4455b6e723a6dbf72b4459704a0a44b009e92a", + "version": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#90a8958aaf2e6d0bfcc11f02e60b2f8628c0990f", "dev": true, "from": "artibot-jsdoc-template@GoudronViande24/artibot-jsdoc-template", "requires": { From 354fd4b8b38125ae3a8476fa9c80108186db0601 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 15:49:56 -0400 Subject: [PATCH 25/68] Allow for custom config entries per module --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ccc8fc7..1182491 100644 --- a/index.js +++ b/index.js @@ -167,8 +167,9 @@ export class Artibot { /** * Register a module in Artibot * @param {Module|function(Artibot): Module} module - The module to register or a function to initialize the module + * @param {Object} [config] - Custom configuration for the module. See module documentation to learn more. */ - registerModule = (module) => { + registerModule = (module, config = {}) => { if (typeof module == "function") module = module(this); this.modules.push(module); log("Artibot", this.localizer._("Registered module: ") + module.name, "info", true); @@ -180,6 +181,11 @@ export class Artibot { for (const part of module.parts) { log("Artibot", `- [${part.type}] ${part.id}`, "log", true); } + + if (Object.entries(config).length !== 0) { + this.config[module.id] = config; + log("Artibot", this.localizer.__("Custom configuration for [[0]] saved.", { placeholders: [module.name] }), "log", true); + } } /** From 315e973e7f345bfe2ec53a5c79a60042d709e0ed Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 16:06:27 -0400 Subject: [PATCH 26/68] Publish a first version to npm move whois extension to own repo --- ab-modules/whois/index.js | 21 ----- ab-modules/whois/locales.json | 77 ---------------- ab-modules/whois/whois.js | 162 ---------------------------------- package.json | 3 +- 4 files changed, 2 insertions(+), 261 deletions(-) delete mode 100644 ab-modules/whois/index.js delete mode 100644 ab-modules/whois/locales.json delete mode 100644 ab-modules/whois/whois.js diff --git a/ab-modules/whois/index.js b/ab-modules/whois/index.js deleted file mode 100644 index b62ca96..0000000 --- a/ab-modules/whois/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Manifest file for whois module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "1.3.0", - name: "WHOIS", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "whois", - type: "slashcommand", - path: "whois.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/whois/locales.json b/ab-modules/whois/locales.json deleted file mode 100644 index c10085f..0000000 --- a/ab-modules/whois/locales.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Get info on a domain": { - "fr": "Obtenir des informations sur un nom de domaine" - }, - - "The domain to verify": { - "fr": "Le domaine à vérifier" - }, - - "`[[0]]` is not a valid domain.\nThis WHOIS only supports `.com`, `.net` and `.edu` TLDs.": { - "fr": "`[[0]]` n'est pas un domaine valide.\nCe WHOIS ne supporte que les extensions `.com`, `.net` et `.edu.`" - }, - - "An error occured.": { - "fr": "Une erreur est survenue." - }, - - "Domain `[[0]]` not found.": { - "fr": "Impossible de trouver le domaine `[[0]]`." - }, - - "Name not found": { - "fr": "Nom introuvable" - }, - - "Here are the results for [[0]]": { - "fr": "Voici les résultats pour [[0]]" - }, - - "See complete list online": { - "fr": "Voir la fiche complète en ligne" - }, - - "Registrar": { - "fr": "Registraire" - }, - - "Registrar WHOIS server": { - "fr": "Serveur WHOIS du registraire" - }, - - "Domain registration date": { - "fr": "Date d'enregistrement du domaine" - }, - - "Email for abuse report": { - "fr": "Courriel pour le signalement d'abus" - }, - - "Domain status (ICANN)": { - "fr": "Statut du domain (ICANN)" - }, - - "Owner's name": { - "fr": "Nom du propriétaire" - }, - - "DNSSEC status": { - "fr": "Statut DNSSEC" - }, - - "DNS server(s)": { - "fr": "Serveur(s) DNS" - }, - - "Reseller": { - "fr": "Revendeur" - } - } -} \ No newline at end of file diff --git a/ab-modules/whois/whois.js b/ab-modules/whois/whois.js deleted file mode 100644 index 396adeb..0000000 --- a/ab-modules/whois/whois.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * WHOIS slash command - * Uses Node.js WHOIS module to get info about a domain - * @author GoudronViande24 - */ - -const whois = require('whois'); -const { MessageEmbed } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const Localizer = require("artibot-localizer"); -const { locale } = require("../../config.json"); -const path = require('path'); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - // The data needed to register slash commands to Discord. - data: new SlashCommandBuilder() - .setName("whois") - .setDescription(localizer._("Get info on a domain")) - .addStringOption(option => - option.setName("domain") - .setDescription(localizer._("The domain to verify")) - .setRequired(true) - ), - - async execute(interaction, { config }) { - const domain = interaction.options.getString("domain"); - - if (!domain.endsWith(".com") && !domain.endsWith(".net") && !domain.endsWith(".edu")) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle(`WHOIS - ${domain}`) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("`[[0]]` is not a valid domain.\nThis WHOIS only supports `.com`, `.net` and `.edu` TLDs.", { placeholders: [domain] })); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - whois.lookup(domain, async (err, data) => { - - if (err) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle(`WHOIS - ${domain}`) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("An error occured.")); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - // Delete the extra stuff at the end of the response - data = data.substring(0, (data.indexOf("\nURL of the ICANN WHOIS Data Problem Reporting System:") - 1)); - - let results = data.split("\n").reduce((obj, str, index) => { - let strParts = str.split(":"); - - if (strParts[0] && strParts[1]) { - let [key, ...rest] = str.split(':'); - key = key.replace(/\s+/g, ''); - if (key !== key.toUpperCase()) key = key.charAt(0).toLowerCase() + key.slice(1) // Make first letter lowercase - else key = key.toLowerCase(); // Make the key all lowercase if it's an acronym - let value = rest.join(':').trim(); - - // Check if key already exists - if (key in obj) { - // Check if value is a string - if (typeof obj[key] == "string") { - obj[key] = [obj[key], value]; - } else { // Else add value to the array - obj[key].push(value); - }; - } else { - obj[key] = value; - }; - }; - - return obj; - }, {}); - - // Check if no data is returned (domain not found) - if (Object.keys(results).length === 0) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle(`WHOIS - ${domain}`) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("Domain `[[0]]` not found.", { placeholders: [domain] })); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - if (typeof results.domainStatus == "string") { - let code = results.domainStatus.split("#")[1].split(/[^A-Za-z]/)[0]; - var status = `[${code}](http://www.icann.org/epp#${code})`; - } else { - var status = ""; - results.domainStatus.forEach(value => { - let code = value.split("#")[1].split(/[^A-Za-z]/)[0]; - status += `[${code}](http://www.icann.org/epp#${code})\n`; - }); - status = status.trim(); - }; - - if (typeof results.nameServer == "string") { - var ns = results.nameServer; - } else { - var ns = ""; - results.nameServer.forEach(value => { - ns += `${value}\n`; - }); - ns = ns.trim(); - }; - - if (results.registrantOrganization) { - var name = results.registrantOrganization; - } else if (results.registrantName) { - var name = results.registrantName; - } else { - var name = localizer._("Name not found"); - }; - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(`WHOIS - ${domain}`) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(`${localizer.__("Here are the results for [[0]]", { placeholders: [domain] })}\n[${localizer._("See complete list online")}](https://who.is/whois/${domain})`) - .addField(localizer._("Registrar"), `[${results.registrar}](${results.registrarURL})`, true) - .addField(localizer._("Registrar WHOIS server"), results.registrarWHOISServer, true) - .addField(localizer._("Domain registration date"), results.creationDate, true) - .addField(localizer._("Email for abuse report"), results.registrarAbuseContactEmail, true) - .addField(localizer._("Domain status (ICANN)"), status, true) - .addField(localizer._("Owner's name"), name, true) - .addField(localizer._("DNSSEC status"), results.dnssec, true) - .addField(localizer._("DNS server(s)"), ns, true); - - if (results.reseller) { - embed.addField(localizer._("Reseller"), results.reseller, true); - }; - - return await interaction.reply({ - embeds: [embed] - }); - - }); - } -}; \ No newline at end of file diff --git a/package.json b/package.json index c44e24e..3040312 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "artibot", "version": "3.0.0", - "description": "Bot open-source fait par Artivain et les contributeurs. ", + "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { "start": "node index.js", @@ -15,6 +15,7 @@ "Discord", "javascript", "Artivain", + "artibot", "framework", "bot", "free", From aec4d0ba175dbd0fff2d1dffacf6c001d75a3a54 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 20:30:23 -0400 Subject: [PATCH 27/68] Improve documentation --- index.js | 21 ++++++++++++++++++--- package-lock.json | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 1182491..c0e7c88 100644 --- a/index.js +++ b/index.js @@ -109,12 +109,26 @@ export class Artibot { * Create an embed * @param {discord.MessageEmbed|discord.MessageEmbedOptions|discord.APIEmbed} [data] * @returns {Embed} Preconfigured embed + * @method */ createEmbed = (data) => { return new Embed(this, data); } - /** Lists of people who contributed to the Artibot */ + /** + * Contributor informations + * @typedef {{name: string, github: string, discordId: Snowflake|null, discordTag: string|null}} Contributor + */ + + /** + * List of contributors + * @typedef {{devs: Contributor[], contributors: Contributor[]}} ContributorList + */ + + /** + * Lists of people who contributed to the Artibot + * @type {ContributorList} + */ contributors = require("./contributors.json"); /** @@ -168,6 +182,7 @@ export class Artibot { * Register a module in Artibot * @param {Module|function(Artibot): Module} module - The module to register or a function to initialize the module * @param {Object} [config] - Custom configuration for the module. See module documentation to learn more. + * @method */ registerModule = (module, config = {}) => { if (typeof module == "function") module = module(this); @@ -191,8 +206,8 @@ export class Artibot { /** * Get latest release version of a GitHub repository * @param {string} [repo="Artivain/artibot"] - GitHub repository to get latest version - * @returns {string|false} Version number, or false if repo not found or an error happens - * @async + * @returns {Promise.} Version number, or false if repo not found or an error happens + * @method */ checkForUpdates = async (repo = "Artivain/artibot") => { const request = await axios({ diff --git a/package-lock.json b/package-lock.json index 9b33407..33b511b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -591,7 +591,7 @@ }, "node_modules/artibot-jsdoc-template": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#90a8958aaf2e6d0bfcc11f02e60b2f8628c0990f", + "resolved": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#df654bf12bc19e6195548480174aa5c9dccb25b9", "dev": true, "license": "MIT", "dependencies": { @@ -5090,7 +5090,7 @@ "dev": true }, "artibot-jsdoc-template": { - "version": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#90a8958aaf2e6d0bfcc11f02e60b2f8628c0990f", + "version": "git+ssh://git@github.com/GoudronViande24/artibot-jsdoc-template.git#df654bf12bc19e6195548480174aa5c9dccb25b9", "dev": true, "from": "artibot-jsdoc-template@GoudronViande24/artibot-jsdoc-template", "requires": { From 994527de01b9ee9b585f764354121cdf63d54b67 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 20:57:46 -0400 Subject: [PATCH 28/68] Try to fix problem on loading events listeners --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c0e7c88..f0c993b 100644 --- a/index.js +++ b/index.js @@ -164,7 +164,7 @@ export class Artibot { this.interactionManager; log("Artibot", this.localizer._("Loading event listeners..."), "log", true); - const eventFiles = readdirSync("./events").filter(file => file.endsWith(".js")); + const eventFiles = readdirSync("events").filter(file => file.endsWith(".js")); for (const file of eventFiles) { const { name, execute, once } = await import(`./events/${file}`); From 289c453d41eccfcfcb9384ce46319e02cb737bb5 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 21:00:47 -0400 Subject: [PATCH 29/68] bring back __dirname in esm! --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f0c993b..99d2f1a 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,10 @@ import coreModule from "./core/index.js"; import { readdirSync } from "fs"; import axios from "axios"; import { SlashCommandBuilder } from "@discordjs/builders"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __dirname = fileURLToPath(import.meta.url); const require = createRequire(import.meta.url); const { version } = require('./package.json'); @@ -164,7 +168,7 @@ export class Artibot { this.interactionManager; log("Artibot", this.localizer._("Loading event listeners..."), "log", true); - const eventFiles = readdirSync("events").filter(file => file.endsWith(".js")); + const eventFiles = readdirSync(path.join(__dirname, "events")).filter(file => file.endsWith(".js")); for (const file of eventFiles) { const { name, execute, once } = await import(`./events/${file}`); From 445d2115a56176f8d9c7b16a0ac1a70dd02a657b Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 21:01:41 -0400 Subject: [PATCH 30/68] I really can't read --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 99d2f1a..1264b6b 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,8 @@ import { SlashCommandBuilder } from "@discordjs/builders"; import path from "path"; import { fileURLToPath } from "url"; -const __dirname = fileURLToPath(import.meta.url); +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); const require = createRequire(import.meta.url); const { version } = require('./package.json'); From 76d9b7aa01b06b8d391aa0ee4869439d66ed536f Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 23:26:17 -0400 Subject: [PATCH 31/68] try to fix localizer problem --- index.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 1264b6b..d16f923 100644 --- a/index.js +++ b/index.js @@ -64,7 +64,7 @@ export class Artibot { // Create a localizer for the core this.localizer = new Localizer({ - filePath: "locales.json", + filePath: path.join(__dirname, "locales.json"), lang }); diff --git a/package-lock.json b/package-lock.json index 33b511b..e01084a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.0", + "version": "3.0.1", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", diff --git a/package.json b/package.json index 3040312..17c4c16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.0", + "version": "3.0.1", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { From eff9abf2ea9a19fa8b57e68288405e02b9f181f4 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 23:31:28 -0400 Subject: [PATCH 32/68] Add translation --- locales.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locales.json b/locales.json index e10bfcc..76a7873 100644 --- a/locales.json +++ b/locales.json @@ -609,6 +609,10 @@ "Nothing to register.": { "fr": "Rien à enregistrer." + }, + + "Custom configuration for [[0]] saved.": { + "fr": "Configuration personnalisée pour [[0]] sauvegardée." } } From aa574f9be614a72e539905d5e45a6e8b3431ff33 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Wed, 27 Apr 2022 23:31:58 -0400 Subject: [PATCH 33/68] v3.0.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e01084a..ef9918f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.1", + "version": "3.0.2", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", diff --git a/package.json b/package.json index 17c4c16..c5bd940 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.1", + "version": "3.0.2", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { From 894ea492ef18e06991df2e293c2fa19347970eaf Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 28 Apr 2022 13:20:58 -0400 Subject: [PATCH 34/68] Moving pokedex to his own repo Better error handling in slashhandler --- ab-modules/pokemon/index.js | 21 ----- ab-modules/pokemon/locales.json | 69 -------------- ab-modules/pokemon/pokedex.js | 161 -------------------------------- events/slashHandler.js | 12 ++- locales.json | 4 + package-lock.json | 4 +- package.json | 2 +- 7 files changed, 15 insertions(+), 258 deletions(-) delete mode 100644 ab-modules/pokemon/index.js delete mode 100644 ab-modules/pokemon/locales.json delete mode 100644 ab-modules/pokemon/pokedex.js diff --git a/ab-modules/pokemon/index.js b/ab-modules/pokemon/index.js deleted file mode 100644 index d2be3a2..0000000 --- a/ab-modules/pokemon/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Manifest file for pokemon module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "1.1.0", - name: "Pokemon", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "pokedex", - type: "slashcommand", - path: "pokedex.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/pokemon/locales.json b/ab-modules/pokemon/locales.json deleted file mode 100644 index b7069fd..0000000 --- a/ab-modules/pokemon/locales.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Get infos on a Pokémon.": { - "fr": "Obtenir des informations sur un Pokémon." - }, - - "The ID (or English name) of the Pokémon to search.": { - "fr": "Le ID (ou le nom en anglais) du Pokémon à chercher." - }, - - "Searching...": { - "fr": "Recherche en cours..." - }, - - "**Error:**\nCannot find the Pokémon with ID or name `[[0]]`.": { - "fr": "**Erreur:**\nImpossible de trouver le Pokémon avec le ID ou le nom `[[0]]`." - }, - - "An error occured.": { - "fr": "Une erreur est survenue." - }, - - "Legendary Pokémon": { - "fr": "Pokémon légendaire" - }, - - "Mythic Pokémon": { - "fr": "Pokémon mythique" - }, - - "Type(s)": { - "fr": "Type(s)" - }, - - "Height": { - "fr": "Grandeur" - }, - - "Weight": { - "fr": "Poid" - }, - - "Generation": { - "fr": "Génération" - }, - - "Forms": { - "fr": "Formes" - }, - - "Abilities": { - "fr": "Capacité(s)" - }, - - "Special attribute": { - "fr": "Attribut spécial" - }, - - "Evolves from": { - "fr": "Est l'évolution de" - } - } -} \ No newline at end of file diff --git a/ab-modules/pokemon/pokedex.js b/ab-modules/pokemon/pokedex.js deleted file mode 100644 index 4d957c3..0000000 --- a/ab-modules/pokemon/pokedex.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Pokedex for Discord - * Uses pokeapi - * @author GoudronViande24 - * @since 1.0.0 - */ - -const { MessageEmbed } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const axios = require("axios").default; -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -const icon = "https://cdn.pixabay.com/photo/2019/11/27/14/06/pokemon-4657023_960_720.png"; -const apiBase = "https://pokeapi.co/api/v2"; - -/** - * Get lenght in feets and inches - * @param {number} n Length in centimeters - * @returns {string} Feets and inches (example: 5'8") - */ - -function toFeet(n) { - var realFeet = ((n * 0.393700) / 12); - var feet = Math.floor(realFeet); - var inches = Math.round((realFeet - feet) * 12); - return `${feet}'${inches}"`; -}; - -/** - * Remove line breaks from a string - * @param {string} str String to remove line breaks - * @returns {string} Same string without line breaks - */ - -function removeLineBreaks(str) { - // There is also an invisible character in there (U+000c) - return str.replace(/(\r\n|\n|\r| )/gm, " "); -}; - -module.exports = { - // ######################################## - // Create the command with all the options - // ######################################## - - data: new SlashCommandBuilder() - .setName("pokedex") - .setDescription(localizer._("Get infos on a Pokémon.")) - .addStringOption(option => - option - .setName("id") - .setDescription(localizer._("The ID (or English name) of the Pokémon to search.")) - .setRequired(true) - ), - - async execute(interaction, { config }) { - // Send "Loading" embed - let waitEmbed = new MessageEmbed() - .setColor("#e3350d") - .setTitle("Pokédex") - .setImage(icon) - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Searching...")); - - const message = await interaction.reply({ - embeds: [waitEmbed], - fetchReply: true - }); - - const input = interaction.options.getString("id").toLowerCase(); - - try { - var response = await axios.get(apiBase + "/pokemon-species/" + input); - var response2 = await axios.get(apiBase + "/pokemon/" + input); - } catch (error) { - if (error.response.status == 404) { - var content = localizer.__("**Error:**\nCannot find the Pokémon with ID or name `[[0]]`.", { placeholders: [input] }); - } else { - var content = localizer._("An error occured."); - }; - - let errorEmbed = new MessageEmbed() - .setColor("#e3350d") - .setTitle("Pokédex") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(content); - - await message.edit({ - embeds: [errorEmbed] - }); - - return - }; - - const data = response.data; - const data2 = response2.data; - - let types = []; - data2.types.forEach(i => types.push(i.type.name)); - types = types.join("\n"); - - let forms = []; - data2.forms.forEach(form => forms.push(form.name)); - forms = forms.join("\n"); - - let abilities = []; - data2.abilities.forEach(i => abilities.push(i.ability.name)); - abilities = abilities.join("\n"); - - let special = []; - if (data.is_legendary) special.push(localizer._("Legendary Pokémon")); - if (data.is_mythical) special.push(localizer._("Mythic Pokémon")); - special = special.join("\n"); - - const flavorText = removeLineBreaks(data.flavor_text_entries.find(i => i.language.name == config.locale.toLowerCase()).flavor_text); - const name = data.names.find(i => i.language.name == config.locale.toLowerCase()).name; - const id = data.id; - const generation = data.generation.name.split("-")[1].toUpperCase(); - const category = data.genera.find(i => i.language.name == config.locale.toLowerCase()).genus; - const image = data2.sprites.other["official-artwork"].front_default; - const height = `${data2.height * 10} cm\n${toFeet(data2.height * 10)}`; - const weight = `${data2.weight / 10} kg\n${Math.round(data2.weight / 10 * 2.205 * 10) / 10} lb`; - - let embed = new MessageEmbed() - .setColor("#e3350d") - .setTitle("Pokédex") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(`**${name}** - #${id}\n${category}\n${flavorText}`) - .setImage(image) - .addField(localizer._("Type(s)"), types, true) - .addField(localizer._("Height"), height, true) - .addField(localizer._("Weight"), weight, true) - .addField(localizer._("Generation"), generation, true) - .addField(localizer._("Forms"), forms, true) - .addField(localizer._("Abilities"), abilities, true); - - if (special) { - embed.addField(localizer._("Special attribute"), special, true); - }; - - if (data.evolves_from_species) { - const response3 = await axios.get(data.evolves_from_species.url); - const data3 = response3.data; - const evolvesFromName = data3.names.find(i => i.language.name == config.locale).name; - embed.addField(localizer._("Evolves from"), evolvesFromName, true); - }; - - await message.edit({ - embeds: [embed] - }); - } -}; diff --git a/events/slashHandler.js b/events/slashHandler.js index b9aa545..c8a3f14 100644 --- a/events/slashHandler.js +++ b/events/slashHandler.js @@ -34,9 +34,13 @@ export async function execute(interaction, artibot) { await command.execute(interaction, artibot); } catch (err) { log("SlashHandler", err, "warn", true); - await interaction.reply({ - content: localizer._("An error occured while executing this command."), - ephemeral: true - }); + try { + await interaction.reply({ + content: localizer._("An error occured while executing this command."), + ephemeral: true + }); + } catch (err) { + log("SlashHandler", localizer._("Additionally, an error occured when sending the error message to the user. Maybe the interaction already has been replied to."), "warn", true); + } }; } diff --git a/locales.json b/locales.json index 76a7873..6ec0cab 100644 --- a/locales.json +++ b/locales.json @@ -613,6 +613,10 @@ "Custom configuration for [[0]] saved.": { "fr": "Configuration personnalisée pour [[0]] sauvegardée." + }, + + "Additionally, an error occured when sending the error message to the user. Maybe the interaction already has been replied to.": { + "fr": "De plus, une erreur est survenue en envoyant le message d'erreur à l'utilisateur. Peut-être que l'interaction a déjà eu une réponse." } } diff --git a/package-lock.json b/package-lock.json index ef9918f..318b5eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.2", + "version": "3.0.3", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", diff --git a/package.json b/package.json index c5bd940..838163a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.2", + "version": "3.0.3", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { From ebdafeeb280588b65b0c625c7a2fecd2808bccc2 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Fri, 29 Apr 2022 15:46:07 -0400 Subject: [PATCH 35/68] Change some badges --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a2351b0..3df82b0 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,12 @@ Bot open-source fait par Artivain et les contributeurs. [![GitHub package.json version](https://img.shields.io/github/package-json/v/Artivain/artibot?color=orange&label=alpha&style=flat-square)](https://github.com/Artivain/artibot) [![GitHub package.json version (branch)](https://img.shields.io/github/package-json/v/Artivain/artibot/unstable?color=red&label=unstable&style=flat-square)](https://github.com/Artivain/artibot/tree/unstable)
-[![Discord](https://img.shields.io/discord/784679956717240391?label=Discord%20support%20server&style=flat-square)](https://discord.artivain.com) +[![Discord](https://img.shields.io/discord/784679956717240391?label=Discord%20support%20server&style=flat-square&logo=discord)](https://discord.artivain.com)
-![GitHub all releases](https://img.shields.io/github/downloads/Artivain/artibot/total?label=total%20downloads&style=flat-square) +![npm](https://img.shields.io/npm/dm/artibot?label=Monthly%20downloads&logo=npm&style=flat-square) +![npm](https://img.shields.io/npm/dt/artibot?label=Total%20downloads&logo=npm&style=flat-square) +
+[![Donate](https://img.shields.io/badge/Help%20us-donate-green?logo=paypal&style=flat-square)](https://paypal.me/Artivain) --- From e13b4062d1a020a98d856eb24e8e834e6062b5c0 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Fri, 29 Apr 2022 19:18:15 -0400 Subject: [PATCH 36/68] add node version in package.json prepare for 3.0.4 begin to move meme extension to own repo --- ab-modules/meme/69.js | 9 ------- ab-modules/meme/chucknorris.js | 48 ---------------------------------- ab-modules/meme/dadjoke.js | 40 ---------------------------- ab-modules/meme/index.js | 39 --------------------------- ab-modules/meme/locales.json | 29 -------------------- ab-modules/meme/sus.js | 9 ------- package.json | 5 +++- 7 files changed, 4 insertions(+), 175 deletions(-) delete mode 100644 ab-modules/meme/69.js delete mode 100644 ab-modules/meme/chucknorris.js delete mode 100644 ab-modules/meme/dadjoke.js delete mode 100644 ab-modules/meme/index.js delete mode 100644 ab-modules/meme/locales.json delete mode 100644 ab-modules/meme/sus.js diff --git a/ab-modules/meme/69.js b/ab-modules/meme/69.js deleted file mode 100644 index 3b64e2d..0000000 --- a/ab-modules/meme/69.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - triggers: [" 69 "], - - execute(message) { - message.reply({ - content: "Nice", - }); - } -}; diff --git a/ab-modules/meme/chucknorris.js b/ab-modules/meme/chucknorris.js deleted file mode 100644 index 3983a7d..0000000 --- a/ab-modules/meme/chucknorris.js +++ /dev/null @@ -1,48 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const https = require('https'); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - name: "chucknorris", - description: localizer._("Tells a Chuck Norris joke."), - aliases: ["cn"], - - execute(message, args, { config, log }) { - const options = { - hostname: 'api.chucknorris.io', - port: 443, - path: '/jokes/random', - method: 'GET' - }; - - const req = https.request(options, res => { - res.on('data', data => { - let embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(localizer._("Chuck Norris joke")) - .setDescription(JSON.parse(data).value) - .setThumbnail(JSON.parse(data).icon_url) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp(); - - message.reply({ - embeds: [embed] - }); - }); - }); - - req.on('error', error => { - message.reply(localizer._("An error occured while executing this command.")); - log("Meme", error); - }); - - req.end(); - } -} diff --git a/ab-modules/meme/dadjoke.js b/ab-modules/meme/dadjoke.js deleted file mode 100644 index dafb7a4..0000000 --- a/ab-modules/meme/dadjoke.js +++ /dev/null @@ -1,40 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const axios = require("axios").default; -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -const options = { - url: "https://icanhazdadjoke.com/", - method: "get", - headers: { - "User-Agent": "Artibot (https://github.com/Artivain/artibot)", - "Accept": "application/json" - } -}; - -module.exports = { - name: "dadjoke", - description: localizer._("Tells a dad joke."), - - async execute(message, args, { config }) { - const reponse = await axios(options); - const joke = reponse.data.joke; - - let embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(localizer._("Dad joke")) - .setDescription(joke) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp(); - - await message.reply({ - embeds: [embed] - }); - } -}; \ No newline at end of file diff --git a/ab-modules/meme/index.js b/ab-modules/meme/index.js deleted file mode 100644 index 96b7ca7..0000000 --- a/ab-modules/meme/index.js +++ /dev/null @@ -1,39 +0,0 @@ -// Manifest file for meme module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "1.2.0", - name: "Meme", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "69", - type: "trigger", - path: "69.js" - }, - - { - id: "sus", - type: "trigger", - path: "sus.js" - }, - - { - id: "chucknorris", - type: "command", - path: "chucknorris.js" - }, - - { - id: "dadjoke", - type: "command", - path: "dadjoke.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/meme/locales.json b/ab-modules/meme/locales.json deleted file mode 100644 index 423980e..0000000 --- a/ab-modules/meme/locales.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Tells a Chuck Norris joke.": { - "fr": "Dit une blague de Chuck Norris." - }, - - "Chuck Norris joke": { - "fr": "Blague de Chuck Norris" - }, - - "An error occured while executing this command.": { - "fr": "Une erreur est survenue pendant l'utilisation de cette commande." - }, - - "Tells a dad joke.": { - "fr": "Dit une blague de papa." - }, - - "Dad joke": { - "fr": "Blague de papa" - } - } -} \ No newline at end of file diff --git a/ab-modules/meme/sus.js b/ab-modules/meme/sus.js deleted file mode 100644 index e68e9e2..0000000 --- a/ab-modules/meme/sus.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - triggers: [" sus ", " sus", "sus "], - - execute(message) { - message.reply({ - content: "ඞ", - }); - } -}; diff --git a/package.json b/package.json index 838163a..460fc38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.3", + "version": "3.0.4", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { @@ -10,6 +10,9 @@ "build-docs": "jsdoc -c ./jsdoc.json" }, "type": "module", + "engines": { + "node": "^16.14.2" + }, "repository": "github:Artivain/artibot", "keywords": [ "Discord", From 8354c1dd881ec3e777bfa69871c609c2563d9971 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Fri, 29 Apr 2022 20:36:27 -0400 Subject: [PATCH 37/68] Update badges --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3df82b0..073bdee 100644 --- a/README.md +++ b/README.md @@ -8,29 +8,31 @@ Open source Discord bot made by Artivain and the community. Bot open-source fait par Artivain et les contributeurs.

-[![CodeFactor](https://www.codefactor.io/repository/github/artivain/artibot/badge?style=flat-square)](https://www.codefactor.io/repository/github/artivain/artibot) -![GitHub repo size](https://img.shields.io/github/repo-size/Artivain/artibot?style=flat-square) -[![GitHub license](https://img.shields.io/github/license/Artivain/artibot?style=flat-square)](https://github.com/Artivain/artibot/blob/main/LICENSE) +[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/Artivain/artibot?label=codefactor%20grade&logo=codefactor&style=for-the-badge&logoColor=white)](https://www.codefactor.io/repository/github/artivain/artibot) +![npms.io (final)](https://img.shields.io/npms-io/final-score/artibot?label=npms.io%20score&style=for-the-badge) +![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/artibot?label=Snyk%20vulnerabilities&logo=snyk&style=for-the-badge) +[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/Artivain/artibot?label=Code%20Climate%20maintainability&logo=code%20climate&style=for-the-badge)](https://codeclimate.com/github/Artivain/artibot/maintainability) +![LGTM Grade](https://img.shields.io/lgtm/grade/javascript/github/Artivain/artibot?label=LGTM%20grade&logo=lgtm&style=for-the-badge)
-[![GitHub issues](https://img.shields.io/github/issues/Artivain/artibot?style=flat-square)](https://github.com/Artivain/artibot/issues) -[![GitHub forks](https://img.shields.io/github/forks/Artivain/artibot?style=flat-square)](https://github.com/Artivain/artibot/network) -[![GitHub stars](https://img.shields.io/github/stars/Artivain/artibot?style=flat-square)](https://github.com/Artivain/artibot/stargazers) +![GitHub repo size](https://img.shields.io/github/repo-size/Artivain/artibot?style=for-the-badge&logo=github) +[![GitHub license](https://img.shields.io/github/license/Artivain/artibot?style=for-the-badge&logo=gnu)](https://github.com/Artivain/artibot/blob/main/LICENSE)
-[![Node.js](https://img.shields.io/badge/Node.js-16.14.2-blue?style=flat-square)](https://github.com/Artivain/artibot/blob/main/.node-version) -[![GitHub package.json dependency version (prod)](https://img.shields.io/github/package-json/dependency-version/Artivain/artibot/discord.js?style=flat-square)](https://discord.js.org/#/) -[![GitHub package.json dependency version (prod)](https://img.shields.io/github/package-json/dependency-version/Artivain/artibot/axios?style=flat-square)](https://axios-http.com/) +[![GitHub issues](https://img.shields.io/github/issues/Artivain/artibot?style=for-the-badge&logo=github)](https://github.com/Artivain/artibot/issues) +[![GitHub forks](https://img.shields.io/github/forks/Artivain/artibot?style=for-the-badge&logo=github)](https://github.com/Artivain/artibot/network) +[![GitHub stars](https://img.shields.io/github/stars/Artivain/artibot?style=for-the-badge&logo=github)](https://github.com/Artivain/artibot/stargazers)
-[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Artivain/artibot?label=latest&style=flat-square&color=green)](https://github.com/Artivain/artibot/releases/latest) -[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Artivain/artibot?color=yellow&include_prereleases&label=beta&style=flat-square)](https://github.com/Artivain/artibot/releases) -[![GitHub package.json version](https://img.shields.io/github/package-json/v/Artivain/artibot?color=orange&label=alpha&style=flat-square)](https://github.com/Artivain/artibot) -[![GitHub package.json version (branch)](https://img.shields.io/github/package-json/v/Artivain/artibot/unstable?color=red&label=unstable&style=flat-square)](https://github.com/Artivain/artibot/tree/unstable) +[![node-lts](https://img.shields.io/node/v-lts/artibot?color=blue&label=Node.js&logo=node.js&logoColor=white&style=for-the-badge)](https://github.com/Artivain/artibot/blob/main/.node-version) +[![npm (prod) dependency version](https://img.shields.io/npm/dependency-version/artibot/discord.js?logo=discord&logoColor=white&style=for-the-badge)](https://discord.js.org/#/) +[![npm (prod) dependency version](https://img.shields.io/npm/dependency-version/artibot/axios?logoColor=white&style=for-the-badge)](https://axios-http.com/)
-[![Discord](https://img.shields.io/discord/784679956717240391?label=Discord%20support%20server&style=flat-square&logo=discord)](https://discord.artivain.com) +[![npm](https://img.shields.io/npm/v/artibot?color=green&label=Latest%20version&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/artibot) +[![GitHub package.json version](https://img.shields.io/github/package-json/v/Artivain/artibot?color=yellow&label=Development%20version&style=for-the-badge&logo=github)](https://github.com/Artivain/artibot)
-![npm](https://img.shields.io/npm/dm/artibot?label=Monthly%20downloads&logo=npm&style=flat-square) -![npm](https://img.shields.io/npm/dt/artibot?label=Total%20downloads&logo=npm&style=flat-square) +[![Discord](https://img.shields.io/discord/784679956717240391?label=Discord%20support%20server&style=for-the-badge&logo=discord&logoColor=white)](https://discord.artivain.com) +[![Donate](https://img.shields.io/badge/Help%20us-donate-green?logo=paypal&style=for-the-badge)](https://paypal.me/Artivain)
-[![Donate](https://img.shields.io/badge/Help%20us-donate-green?logo=paypal&style=flat-square)](https://paypal.me/Artivain) +![npm](https://img.shields.io/npm/dm/artibot?label=Monthly%20downloads&logo=npm&style=for-the-badge) +![npm](https://img.shields.io/npm/dt/artibot?label=Total%20downloads&logo=npm&style=for-the-badge) --- From ee345a10b76789cd9840ceefd13f2907e7791701 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Fri, 29 Apr 2022 21:10:23 -0400 Subject: [PATCH 38/68] improve "people" fields --- package-lock.json | 7 +++++-- package.json | 13 ++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 318b5eb..6936308 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.3", + "version": "3.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.3", + "version": "3.0.4", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", @@ -29,6 +29,9 @@ "nodemon": "^2.0.15", "npm-check-updates": "^12.5.9" }, + "engines": { + "node": "^16.14.2" + }, "funding": { "url": "https://paypal.me/Artivain" } diff --git a/package.json b/package.json index 460fc38..eb84b8a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,18 @@ "free", "api" ], - "author": "Artivain", + "author": { + "name": "Artivain", + "email": "info@artivain.com", + "url": "https://artivain.com" + }, + "contributors": [ + { + "name": "Thomas Fournier", + "email": "thomas@artivain.com", + "url": "https://github.com/GoudronViande24" + } + ], "license": "GPL-3.0-or-later", "bugs": { "url": "https://github.com/Artivain/artibot/issues" From c7f60201aa589081a1b5ddcc1c72717470bb6d18 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sat, 30 Apr 2022 00:05:11 -0400 Subject: [PATCH 39/68] Use png instead of jpg for the icon --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d16f923..7494d02 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ export class Artibot { * @param {Snowflake} config.ownerId - Discord ID of the owner of the bot * @param {Snowflake} config.testGuildId - Discord ID of the testing guild * @param {string} [config.botName="Artibot"] - Name of the Discord bot. Used almost everywhere. - * @param {string} [config.botIcon="https://assets.artivain.com/fav/bots/artibot-512.jpg"] - URL of the profile picture of the bot + * @param {string} [config.botIcon="https://assets.artivain.com/fav/bots/artibot-512.png"] - URL of the profile picture of the bot * @param {string} [config.prefix="ab "] - Prefix for the commands * @param {boolean} [config.devMode=true] - Set to false if the bot must be used in more than one server. Interactions could take more time to refresh. * @param {string} [config.lang="en"] - Set the lang of the bot @@ -44,7 +44,7 @@ export class Artibot { ownerId, testGuildId, botName = "Artibot", - botIcon = "https://assets.artivain.com/fav/bots/artibot-512.jpg", + botIcon = "https://assets.artivain.com/fav/bots/artibot-512.png", prefix = "ab ", devMode = true, lang = "en", From f10d95d640aefe48f73f69f25995c8d62af61210 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 3 May 2022 22:38:47 -0400 Subject: [PATCH 40/68] upgrade dependencies --- package-lock.json | 176 +++++++++++++++++++++++----------------------- package.json | 8 +-- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6936308..a0948a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,12 +12,12 @@ "@discordjs/builders": "^0.13.0", "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "axios": "^0.27.1", + "axios": "^0.27.2", "chalk": "^5.0.1", "discord-api-types": "^0.32.0", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", - "discordjs-reaction-role": "^2.1.1", + "discordjs-reaction-role": "^3.0.0", "figlet": "^1.5.2", "ms": "^2.1.3", "path": "^0.12.7", @@ -26,8 +26,8 @@ "devDependencies": { "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template", "jsdoc": "^3.6.10", - "nodemon": "^2.0.15", - "npm-check-updates": "^12.5.9" + "nodemon": "^2.0.16", + "npm-check-updates": "^12.5.11" }, "engines": { "node": "^16.14.2" @@ -37,9 +37,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", - "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.10.tgz", + "integrity": "sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -70,9 +70,9 @@ "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" }, "node_modules/@discordjs/collection": { - "version": "0.7.0-dev.1650931751-df64d3e", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650931751-df64d3e.tgz", - "integrity": "sha512-8oPvjx69kAUz5r+I1uzLZrsgSPIC4ybbK4eBAgx2ShNLliFk9hbg0vNkFfJoKKAoS6Mzfxo/47B0+rKdEBXW6w==", + "version": "0.7.0-dev.1651493036-4ba0f56", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1651493036-4ba0f56.tgz", + "integrity": "sha512-/6eYweo3mprHqYO+DTM89mZNp1AdvZelMZGSeiCUtMadhsdjycR1cfA08fRtivDGaRnvmecDaKIEfig9mXaRxw==", "engines": { "node": ">=16.9.0" } @@ -317,9 +317,9 @@ } }, "node_modules/@sapphire/shapeshift": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.1.0.tgz", - "integrity": "sha512-Z1ISLP9pNI3jpKJxx82xtDpEsfomhJ3iPqcKdYLjAHmQP2X5yqQF6phA0Wd+MmdXp081wepOiT59XEN0xdTVvQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.2.0.tgz", + "integrity": "sha512-UEnKgMlQyI0yY/q+lCMX0VJft9y86IsesgbIQj6e62FBYSaMVr+IaMNpi4z45Q14VnuMACbK0yrbHISNqgUYcQ==", "engines": { "node": ">=v15.0.0", "npm": ">=7.0.0" @@ -389,9 +389,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", - "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==" + "version": "17.0.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", + "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -619,9 +619,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.1.tgz", - "integrity": "sha512-ePNMai55xo5GsXajb/k756AqZqpqeDaGwGcdvbZLSSELbbYwsIn2jNmGfUPEwd8j/yu4OoMstLLIVa4t0MneEA==", + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", "dependencies": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -784,9 +784,9 @@ } }, "node_modules/cacache": { - "version": "16.0.6", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.6.tgz", - "integrity": "sha512-9a/MLxGaw3LEGes0HaPez2RgZWDV6X0jrgChsuxfEh8xoDoYGxaGrkMe7Dlyjrb655tA/b8fX0qlUg6Ii5MBvw==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.7.tgz", + "integrity": "sha512-a4zfQpp5vm4Ipdvbj+ZrPonikRhm6WBEd4zT1Yc1DXsmAxrPgDwWBLF/u/wTVXSFPIgOJ1U3ghSa2Xm4s3h28w==", "dev": true, "dependencies": { "@npmcli/fs": "^2.1.0", @@ -1282,9 +1282,9 @@ } }, "node_modules/discordjs-reaction-role": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/discordjs-reaction-role/-/discordjs-reaction-role-2.1.1.tgz", - "integrity": "sha512-4vhhBY327Aem177ISZiaJa8+D08XVuEhs4sNo0iVsllXA1FeDnnAVJ2iwZTG8PXb2ZGWHT+Ft8lpRGmIg5UPig==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/discordjs-reaction-role/-/discordjs-reaction-role-3.0.0.tgz", + "integrity": "sha512-FAwRM+ivCMSPzhHmf6OzrmnVdsQOv99RqPhjVZg4002674BCEIa+2BS97Il/ek6nsIsaT57rlPjJ3D7wBEHYwg==", "engines": { "node": ">=16.6" }, @@ -1457,9 +1457,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.0.tgz", + "integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==", "funding": [ { "type": "individual", @@ -2396,9 +2396,9 @@ } }, "node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.9.0.tgz", + "integrity": "sha512-lkcNMUKqdJk96TuIXUidxaPuEg5sJo/+ZyVE2BDFnuZGzwXem7d8582eG8vbu4todLfT14snP6iHriCHXXi5Rw==", "dev": true, "engines": { "node": ">=12" @@ -2482,9 +2482,9 @@ } }, "node_modules/marked": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", - "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", + "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -2784,9 +2784,9 @@ } }, "node_modules/nodemon": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz", - "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.16.tgz", + "integrity": "sha512-zsrcaOfTWRuUzBn3P44RDliLlp263Z/76FPoHFr3cFFkOz0lTPAcIw8dCzfdVIx/t3AtDYCZRCDkoCojJqaG3w==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2897,9 +2897,9 @@ } }, "node_modules/npm-check-updates": { - "version": "12.5.9", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.9.tgz", - "integrity": "sha512-l9iOvD7EsQb96gFJL45V01YG6bP8+dmobYnSguvehPuNwgdWNMrE8RC8bSfURX5iUmX4bkobN4T8XMHXN9GMHA==", + "version": "12.5.11", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.11.tgz", + "integrity": "sha512-uS3yYYK/F1VvZlJRymuCkq+MY2R7v/WlORo5WPUTYx+1OwkqeDMC/CEEGfCN7ATwT2M+JxVVKk9Gq/TGiZjJOw==", "dev": true, "dependencies": { "chalk": "^4.1.2", @@ -3320,9 +3320,9 @@ } }, "node_modules/pacote": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.1.1.tgz", - "integrity": "sha512-MTT3k1OhUo+IpvoHGp25OwsRU0L+kJQM236OCywxvY4OIJ/YfloNW2/Yc3HMASH10BkfZaGMVK/pxybB7fWcLw==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.2.0.tgz", + "integrity": "sha512-IT4/xHT8eLi4cJdKSGCuqooWp2YwRP5OgrQypbBlLG8Ubzw+h7s57QbrA2SegQcdGefD81ZvuI+aL0JlfFcPCA==", "dev": true, "dependencies": { "@npmcli/git": "^3.0.0", @@ -4494,9 +4494,9 @@ } }, "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz", + "integrity": "sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw==", "engines": { "node": ">=10.0.0" }, @@ -4660,9 +4660,9 @@ }, "dependencies": { "@babel/parser": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", - "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.10.tgz", + "integrity": "sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ==", "dev": true }, "@discordjs/builders": { @@ -4686,9 +4686,9 @@ } }, "@discordjs/collection": { - "version": "0.7.0-dev.1650931751-df64d3e", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1650931751-df64d3e.tgz", - "integrity": "sha512-8oPvjx69kAUz5r+I1uzLZrsgSPIC4ybbK4eBAgx2ShNLliFk9hbg0vNkFfJoKKAoS6Mzfxo/47B0+rKdEBXW6w==" + "version": "0.7.0-dev.1651493036-4ba0f56", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1651493036-4ba0f56.tgz", + "integrity": "sha512-/6eYweo3mprHqYO+DTM89mZNp1AdvZelMZGSeiCUtMadhsdjycR1cfA08fRtivDGaRnvmecDaKIEfig9mXaRxw==" }, "@discordjs/rest": { "version": "0.4.1", @@ -4877,9 +4877,9 @@ "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" }, "@sapphire/shapeshift": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.1.0.tgz", - "integrity": "sha512-Z1ISLP9pNI3jpKJxx82xtDpEsfomhJ3iPqcKdYLjAHmQP2X5yqQF6phA0Wd+MmdXp081wepOiT59XEN0xdTVvQ==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-2.2.0.tgz", + "integrity": "sha512-UEnKgMlQyI0yY/q+lCMX0VJft9y86IsesgbIQj6e62FBYSaMVr+IaMNpi4z45Q14VnuMACbK0yrbHISNqgUYcQ==" }, "@sapphire/snowflake": { "version": "3.2.2", @@ -4929,9 +4929,9 @@ "dev": true }, "@types/node": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", - "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==" + "version": "17.0.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", + "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==" }, "@types/node-fetch": { "version": "2.6.1", @@ -5115,9 +5115,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "axios": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.1.tgz", - "integrity": "sha512-ePNMai55xo5GsXajb/k756AqZqpqeDaGwGcdvbZLSSELbbYwsIn2jNmGfUPEwd8j/yu4OoMstLLIVa4t0MneEA==", + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", "requires": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -5245,9 +5245,9 @@ } }, "cacache": { - "version": "16.0.6", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.6.tgz", - "integrity": "sha512-9a/MLxGaw3LEGes0HaPez2RgZWDV6X0jrgChsuxfEh8xoDoYGxaGrkMe7Dlyjrb655tA/b8fX0qlUg6Ii5MBvw==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.7.tgz", + "integrity": "sha512-a4zfQpp5vm4Ipdvbj+ZrPonikRhm6WBEd4zT1Yc1DXsmAxrPgDwWBLF/u/wTVXSFPIgOJ1U3ghSa2Xm4s3h28w==", "dev": true, "requires": { "@npmcli/fs": "^2.1.0", @@ -5623,9 +5623,9 @@ } }, "discordjs-reaction-role": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/discordjs-reaction-role/-/discordjs-reaction-role-2.1.1.tgz", - "integrity": "sha512-4vhhBY327Aem177ISZiaJa8+D08XVuEhs4sNo0iVsllXA1FeDnnAVJ2iwZTG8PXb2ZGWHT+Ft8lpRGmIg5UPig==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/discordjs-reaction-role/-/discordjs-reaction-role-3.0.0.tgz", + "integrity": "sha512-FAwRM+ivCMSPzhHmf6OzrmnVdsQOv99RqPhjVZg4002674BCEIa+2BS97Il/ek6nsIsaT57rlPjJ3D7wBEHYwg==", "requires": {} }, "dot-prop": { @@ -5760,9 +5760,9 @@ } }, "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.0.tgz", + "integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==" }, "form-data": { "version": "4.0.0", @@ -6489,9 +6489,9 @@ "dev": true }, "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.9.0.tgz", + "integrity": "sha512-lkcNMUKqdJk96TuIXUidxaPuEg5sJo/+ZyVE2BDFnuZGzwXem7d8582eG8vbu4todLfT14snP6iHriCHXXi5Rw==", "dev": true }, "make-dir": { @@ -6556,9 +6556,9 @@ "requires": {} }, "marked": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.14.tgz", - "integrity": "sha512-HL5sSPE/LP6U9qKgngIIPTthuxC0jrfxpYMZ3LdGDD3vTnLs59m2Z7r6+LNDR3ToqEQdkKd6YaaEfJhodJmijQ==", + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", + "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", "dev": true }, "mdurl": { @@ -6772,9 +6772,9 @@ } }, "nodemon": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz", - "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.16.tgz", + "integrity": "sha512-zsrcaOfTWRuUzBn3P44RDliLlp263Z/76FPoHFr3cFFkOz0lTPAcIw8dCzfdVIx/t3AtDYCZRCDkoCojJqaG3w==", "dev": true, "requires": { "chokidar": "^3.5.2", @@ -6852,9 +6852,9 @@ } }, "npm-check-updates": { - "version": "12.5.9", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.9.tgz", - "integrity": "sha512-l9iOvD7EsQb96gFJL45V01YG6bP8+dmobYnSguvehPuNwgdWNMrE8RC8bSfURX5iUmX4bkobN4T8XMHXN9GMHA==", + "version": "12.5.11", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.11.tgz", + "integrity": "sha512-uS3yYYK/F1VvZlJRymuCkq+MY2R7v/WlORo5WPUTYx+1OwkqeDMC/CEEGfCN7ATwT2M+JxVVKk9Gq/TGiZjJOw==", "dev": true, "requires": { "chalk": "^4.1.2", @@ -7170,9 +7170,9 @@ } }, "pacote": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.1.1.tgz", - "integrity": "sha512-MTT3k1OhUo+IpvoHGp25OwsRU0L+kJQM236OCywxvY4OIJ/YfloNW2/Yc3HMASH10BkfZaGMVK/pxybB7fWcLw==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.2.0.tgz", + "integrity": "sha512-IT4/xHT8eLi4cJdKSGCuqooWp2YwRP5OgrQypbBlLG8Ubzw+h7s57QbrA2SegQcdGefD81ZvuI+aL0JlfFcPCA==", "dev": true, "requires": { "@npmcli/git": "^3.0.0", @@ -8074,9 +8074,9 @@ } }, "ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz", + "integrity": "sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw==", "requires": {} }, "xdg-basedir": { diff --git a/package.json b/package.json index eb84b8a..c79dd0d 100644 --- a/package.json +++ b/package.json @@ -46,12 +46,12 @@ "@discordjs/builders": "^0.13.0", "@discordjs/rest": "^0.4.1", "artibot-localizer": "^1.0.2", - "axios": "^0.27.1", + "axios": "^0.27.2", "chalk": "^5.0.1", "discord-api-types": "^0.32.0", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", - "discordjs-reaction-role": "^2.1.1", + "discordjs-reaction-role": "^3.0.0", "figlet": "^1.5.2", "ms": "^2.1.3", "path": "^0.12.7", @@ -59,8 +59,8 @@ }, "devDependencies": { "jsdoc": "^3.6.10", - "nodemon": "^2.0.15", - "npm-check-updates": "^12.5.9", + "nodemon": "^2.0.16", + "npm-check-updates": "^12.5.11", "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template" } } From b8850e03693b880cb16d71a1fc4eab893cd072dc Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 3 May 2022 22:41:16 -0400 Subject: [PATCH 41/68] Properly manage additional intents no duplicates --- index.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 7494d02..7416f44 100644 --- a/index.js +++ b/index.js @@ -150,18 +150,21 @@ export class Artibot { async login({ token = this.#token, additionalIntents = [] }) { if (!token) throw new Error("Token not set!"); this.#token = token; - this.modules.forEach(module => additionalIntents = additionalIntents.concat(module.additionalIntents)); - this.client = new discord.Client({ - intents: [ + const moduleIntents = []; + this.modules.forEach(module => module.additionalIntents.forEach(intent => moduleIntents.push(intent))); + const intents = [...new Set([ + [ discord.Intents.FLAGS.GUILDS, discord.Intents.FLAGS.GUILD_MESSAGES, discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS, discord.Intents.FLAGS.GUILD_VOICE_STATES, discord.Intents.FLAGS.GUILD_MEMBERS, - discord.Intents.FLAGS.GUILD_PRESENCES, - ...additionalIntents - ] - }); + discord.Intents.FLAGS.GUILD_PRESENCES + ], + ...additionalIntents, + ...moduleIntents + ])]; + this.client = new discord.Client({ intents }); this.listeners = []; From 890c0f875a6b75986faa1fc74dfa4e695c2c988b Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 3 May 2022 23:06:30 -0400 Subject: [PATCH 42/68] Better error catching & handling --- events/buttonHandler.js | 2 +- events/commandHandler.js | 2 +- events/initModulesParts.js | 12 +++++++++--- events/updateBotName.js | 7 ++++++- locales.json | 8 ++++++++ test.md | 10 ---------- 6 files changed, 25 insertions(+), 16 deletions(-) delete mode 100644 test.md diff --git a/events/buttonHandler.js b/events/buttonHandler.js index 54c514e..09d380f 100644 --- a/events/buttonHandler.js +++ b/events/buttonHandler.js @@ -32,7 +32,7 @@ export async function execute(interaction, artibot) { // A try to execute the button. try { - button.execute(interaction, artibot); + await button.execute(interaction, artibot); } catch (err) { log("ButtonHandler", err, "warn", true); interaction.reply({ diff --git a/events/commandHandler.js b/events/commandHandler.js index ee424ef..14e0ced 100644 --- a/events/commandHandler.js +++ b/events/commandHandler.js @@ -127,7 +127,7 @@ export async function execute(message, artibot) { // Execute the final command. Put everything above this. try { - command.execute(message, args, artibot); + await command.execute(message, args, artibot); } catch (error) { log("CommandHandler", error, "warn", true); message.reply({ diff --git a/events/initModulesParts.js b/events/initModulesParts.js index 93f863a..811a7cf 100644 --- a/events/initModulesParts.js +++ b/events/initModulesParts.js @@ -10,9 +10,15 @@ export const once = true; * @param {Artibot} artibot */ export function execute(client, artibot) { - artibot.modules.forEach(module => { - module.parts.forEach(part => { - if (part.init && typeof part.init == "function") part.init(artibot); + artibot.modules.forEach(async (module) => { + module.parts.forEach(async (part) => { + if (part.init && typeof part.init == "function") { + try { + await part.init(artibot); + } catch (err) { + artibot.log("Artibot", artibot.localizer.__("An error occured when trying to run initializing script for [[0]]: ", { placeholders: [part.id] }) + err, "warn", true); + } + } }); }); } \ No newline at end of file diff --git a/events/updateBotName.js b/events/updateBotName.js index a17bf03..db5bcf5 100644 --- a/events/updateBotName.js +++ b/events/updateBotName.js @@ -13,6 +13,11 @@ export function execute(client, artibot) { const { log, localizer, config } = artibot; if (client.user.username != config.botName) { client.user.setUsername(config.botName) - .then(log("Artibot", localizer.__("Bot name updated to [[0]].", { placeholders: [config.botName] }), "log", true)); + .then(() => + log("Artibot", localizer.__("Bot name updated to [[0]].", { placeholders: [config.botName] }), "info", true) + ) + .catch(() => + log("Artibot", localizer._("An error occured when trying to change the bot name. Try again later."), "warn", true) + ); }; } \ No newline at end of file diff --git a/locales.json b/locales.json index 6ec0cab..efb7d62 100644 --- a/locales.json +++ b/locales.json @@ -617,6 +617,14 @@ "Additionally, an error occured when sending the error message to the user. Maybe the interaction already has been replied to.": { "fr": "De plus, une erreur est survenue en envoyant le message d'erreur à l'utilisateur. Peut-être que l'interaction a déjà eu une réponse." + }, + + "An error occured when trying to run initializing script for [[0]]: ": { + "fr": "Une erreur est survenue en exécutant le script d'initialisation pour [[0]]: " + }, + + "An error occured when trying to change the bot name. Try again later.": { + "fr": "Une erreur est survenue en essayant de changer le nom du bot. Réessayez plus tard." } } diff --git a/test.md b/test.md deleted file mode 100644 index 17a3a11..0000000 --- a/test.md +++ /dev/null @@ -1,10 +0,0 @@ -# asdasd! - -asdasd -as -da -sd - -- asd -- asd -- asd \ No newline at end of file From bd009b2584d650f3e0aca7c6ef708d90f3c51265 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 5 May 2022 18:44:51 -0400 Subject: [PATCH 43/68] Move Twitch to own repo --- ab-modules/twitch/.gitignore | 1 - ab-modules/twitch/config-example.json | 22 -- ab-modules/twitch/discordChannelSync.js | 46 ---- ab-modules/twitch/index.js | 275 ------------------------ ab-modules/twitch/liveEmbed.js | 84 -------- ab-modules/twitch/locales.json | 149 ------------- ab-modules/twitch/miniDb.js | 57 ----- ab-modules/twitch/private-example.json | 4 - ab-modules/twitch/twitchApi.js | 80 ------- ab-modules/twitch/twitchMonitor.js | 261 ---------------------- 10 files changed, 979 deletions(-) delete mode 100644 ab-modules/twitch/.gitignore delete mode 100644 ab-modules/twitch/config-example.json delete mode 100644 ab-modules/twitch/discordChannelSync.js delete mode 100644 ab-modules/twitch/index.js delete mode 100644 ab-modules/twitch/liveEmbed.js delete mode 100644 ab-modules/twitch/locales.json delete mode 100644 ab-modules/twitch/miniDb.js delete mode 100644 ab-modules/twitch/private-example.json delete mode 100644 ab-modules/twitch/twitchApi.js delete mode 100644 ab-modules/twitch/twitchMonitor.js diff --git a/ab-modules/twitch/.gitignore b/ab-modules/twitch/.gitignore deleted file mode 100644 index 6320cd2..0000000 --- a/ab-modules/twitch/.gitignore +++ /dev/null @@ -1 +0,0 @@ -data \ No newline at end of file diff --git a/ab-modules/twitch/config-example.json b/ab-modules/twitch/config-example.json deleted file mode 100644 index e735732..0000000 --- a/ab-modules/twitch/config-example.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "checkInterval": 60000, - "notificationChannel": "notifs", - "twitchChannels": [ - "goudronviande24", - "zariaa2020", - "venzy01" - ], - "mentions": { - "goudronviande24": "everyone" - }, - "showGameIcon": true, - "showGame": true, - "showViews": true, - "showUptime": true, - "showThumbnail": true, - "colors": { - "live": "#9146ff", - "offline": "GREY" - }, - "debug": false -} diff --git a/ab-modules/twitch/discordChannelSync.js b/ab-modules/twitch/discordChannelSync.js deleted file mode 100644 index f648f3b..0000000 --- a/ab-modules/twitch/discordChannelSync.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Helper class for syncing discord target channels. - */ -class DiscordChannelSync { - /** - * @param {Client} client Discord.js client. - * @param {string} channelName Name of the Discord channel we are looking for on each server (e.g. `config.discord_announce_channel`). - * @param {boolean} verbose If true, log guild membership info to stdout (debug / info purposes). - * @return {Channel[]} List of Discord.js channels - */ - static getChannelList(client, channelName, verbose, log, localizer) { - let nextTargetChannels = []; - - client.guilds.cache.forEach((guild) => { - let targetChannel = guild.channels.cache.find(g => g.name === channelName); - - if (!targetChannel) { - if (verbose) { - log('TwitchMonitor', localizer.__("Configuration error: The server [[0]] does not have a #[[1]] channel!", { placeholders: [guild.name, channelName] })); - }; - } else { - let permissions = targetChannel.permissionsFor(guild.me); - - if (verbose) { - log('TwitchMonitor', localizer.__(" --> for the [[0]] server, the announcements channel is #[[1]]", { placeholders: [guild.name, targetChannel.name] })); - }; - - if (!permissions.has("SEND_MESSAGES")) { - if (verbose) { - log('TwitchMonitor', localizer.__("Configuration error: The bot does not have SEND_MESSAGES permission in #[[0]] channel on [[1]] server. The announcements will not be sent.", { placeholders: [targetChannel.name, guild.name] })); - }; - }; - - nextTargetChannels.push(targetChannel); - }; - }); - - if (verbose) { - log('TwitchMonitor', localizer.__("Total of [[0]] #[[1]] channels.", { placeholders: [nextTargetChannels.length, channelName] })); - } - - return nextTargetChannels; - } -} - -module.exports = DiscordChannelSync; \ No newline at end of file diff --git a/ab-modules/twitch/index.js b/ab-modules/twitch/index.js deleted file mode 100644 index 0198c78..0000000 --- a/ab-modules/twitch/index.js +++ /dev/null @@ -1,275 +0,0 @@ -/** - * TwitchMonitor Module for Artibot - * Based on Timbot (https://github.com/roydejong/timbot), par roydejong (https://github.com/roydejong) - * Most of the code is just adapted for this project. - * @author GoudronViande24 - * @author roydejong - */ - -const Localizer = require("artibot-localizer"); -const path = require("path"); - -module.exports = { - name: "TwitchMonitor", - - manifest: { - manifestVersion: 1, - moduleVersion: "3.0.0", - name: "TwitchMonitor", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "twitch", - type: "global", - path: "index.js" - } - ] - }, - - async execute({ client, config, log }) { - const localizer = new Localizer({ - lang: config.locale, - filePath: path.resolve(__dirname, "locales.json") - }); - - config.twitch = require("./config.json"); - config.twitch.private = require("./private.json"); - const twitchAPI = require("./twitchApi"); - const DiscordChannelSync = require("./discordChannelSync"); - const LiveEmbed = require("./liveEmbed"); - const MiniDb = require("./miniDb"); - const TwitchMonitor = require("./twitchMonitor"); - TwitchMonitor.init(log, localizer); - - let targetChannels = []; - - let syncServerList = (logMembership) => { - targetChannels = DiscordChannelSync.getChannelList(client, config.twitch.notificationChannel, logMembership, log, localizer); - }; - - // Init list of connected servers, and determine which channels we are announcing to - syncServerList(true); - - // Activity updater - class StreamActivity { - /** - * Registers a channel that has come online, and updates the user activity. - */ - static setChannelOnline(stream) { - this.onlineChannels[stream.user_name] = stream; - } - - /** - * Marks a channel has having gone offline, and updates the user activity if needed. - */ - static setChannelOffline(stream) { - delete this.onlineChannels[stream.user_name]; - } - - static init(discordClient) { - this.discordClient = discordClient; - this.onlineChannels = {}; - } - } - - // --------------------------------------------------------------------------------------------------------------------- - // Live events - - let liveMessageDb = new MiniDb('live-messages', log, localizer); - let messageHistory = liveMessageDb.get("history") || {}; - - TwitchMonitor.onChannelLiveUpdate((streamData) => { - const isLive = streamData.type === "live"; - - // Refresh channel list - try { - syncServerList(false); - } catch (e) { }; - - // Update activity - StreamActivity.setChannelOnline(streamData); - - // Generate message - const msgFormatted = localizer.__("**[[0]]** is live on Twitch!", { placeholders: [streamData.user_name] }); - const msgEmbed = LiveEmbed.createForStream(streamData); - - // Broadcast to all target channels - let anySent = false; - - for (let i = 0; i < targetChannels.length; i++) { - const discordChannel = targetChannels[i]; - const liveMsgDiscrim = `${discordChannel.guild.id}_${discordChannel.name}_${streamData.id}`; - - if (discordChannel) { - try { - // Either send a new message, or update an old one - let existingMsgId = messageHistory[liveMsgDiscrim] || null; - - if (existingMsgId) { - // Fetch existing message - discordChannel.messages.fetch(existingMsgId) - .then((existingMsg) => { - existingMsg.edit({ - content: msgFormatted, - embeds: [msgEmbed] - }).then((message) => { - // Clean up entry if no longer live - if (!isLive) { - delete messageHistory[liveMsgDiscrim]; - liveMessageDb.put('history', messageHistory); - } - }); - }) - .catch((e) => { - // Unable to retrieve message object for editing - if (e.message === "Unknown Message") { - // Specific error: the message does not exist, most likely deleted. - delete messageHistory[liveMsgDiscrim]; - liveMessageDb.put('history', messageHistory); - // This will cause the message to be posted as new in the next update if needed. - } - }); - } else { - // Sending a new message - if (!isLive) { - // We do not post "new" notifications for channels going/being offline - continue; - } - - // Expand the message with a @mention for "here" or "everyone" - // We don't do this in updates because it causes some people to get spammed - let mentionMode = (config.twitch.mentions && config.twitch.mentions[streamData.user_name.toLowerCase()]) || null; - - if (mentionMode) { - mentionMode = mentionMode.toLowerCase(); - - if (mentionMode === "everyone" || mentionMode === "here") { - // Reserved @ keywords for discord that can be mentioned directly as text - mentionMode = `@${mentionMode}`; - } else { - // Most likely a role that needs to be translated to <@&id> format - let roleData = discordChannel.guild.roles.cache.find((role) => { - return (role.name.toLowerCase() === mentionMode); - }); - - if (roleData) { - mentionMode = `<@&${roleData.id}>`; - } else { - log("TwitchMonitor", localizer.__("Cannot tag [[0]] role (role not found on server [[1]])", { placeholders: [mentionMode, discordChannel.guild.name] })); - mentionMode = null; - } - } - } - - let msgToSend = msgFormatted; - - if (mentionMode) { - msgToSend = msgFormatted + ` ${mentionMode}` - } - - discordChannel.send({ - content: msgToSend, - embeds: [msgEmbed] - }) - .then((message) => { - log('TwitchMonitor', localizer.__("Announcement sent in #[[0]] on [[1]]", { placeholders: [discordChannel.name, discordChannel.guild.name] })); - - messageHistory[liveMsgDiscrim] = message.id; - liveMessageDb.put('history', messageHistory); - }) - .catch((err) => { - log('TwitchMonitor', localizer.__("Cannot send the announcement in #[[0]] on [[1]]: [[2]]", { - placeholders: [ - discordChannel.name, - discordChannel.guild.name, - err.message - ] - })); - }); - } - - anySent = true; - } catch (e) { - log('TwitchMonitor', localizer._("An error occured while sending the message: ") + e, "warn"); - } - } - } - - liveMessageDb.put('history', messageHistory); - return anySent; - }); - - TwitchMonitor.onChannelOffline((streamData) => { - // Update activity - StreamActivity.setChannelOffline(streamData); - }); - - // --- Common functions ------------------------------------------------------------------------------------------------ - String.prototype.replaceAll = function (search, replacement) { - var target = this; - return target.split(search).join(replacement); - }; - - String.prototype.spacifyCamels = function () { - let target = this; - - try { - return target.replace(/([a-z](?=[A-Z]))/g, '$1 '); - } catch (e) { - return target; - } - }; - - Array.prototype.joinEnglishList = function () { - let a = this; - - try { - return [a.slice(0, -1).join(', '), a.slice(-1)[0]].join(a.length < 2 ? '' : ' and '); - } catch (e) { - return a.join(', '); - } - }; - - String.prototype.lowercaseFirstChar = function () { - let string = this; - return string.charAt(0).toUpperCase() + string.slice(1); - }; - - Array.prototype.hasEqualValues = function (b) { - let a = this; - - if (a.length !== b.length) { - return false; - } - - a.sort(); - b.sort(); - - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { - return false; - } - } - - return true; - } - - // Keep our activity in the user list in sync - StreamActivity.init(client); - - // Begin Twitch API polling - TwitchMonitor.start(); - - client.on("guildCreate", guild => { - syncServerList(true); - }); - - client.on("guildDelete", guild => { - syncServerList(true); - }); - - } -} \ No newline at end of file diff --git a/ab-modules/twitch/liveEmbed.js b/ab-modules/twitch/liveEmbed.js deleted file mode 100644 index eef11f4..0000000 --- a/ab-modules/twitch/liveEmbed.js +++ /dev/null @@ -1,84 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const moment = require('moment'); -const humanizeDuration = require("humanize-duration"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const config = require('./config.json'); -config.private = require("./private.json"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -class LiveEmbed { - static createForStream(streamData) { - const isLive = streamData.type === "live"; - const allowBoxArt = config.showGameIcon; - - let msgEmbed = new MessageEmbed(); - msgEmbed.setColor(isLive ? config.colors.live : config.colors.offline); - msgEmbed.setURL(`https://twitch.tv/${streamData.user_name.toLowerCase()}`); - - // Thumbnail - let thumbUrl = streamData.profile_image_url; - - if (allowBoxArt && streamData.game && streamData.game.box_art_url) { - thumbUrl = streamData.game.box_art_url; - thumbUrl = thumbUrl.replace("{width}", "288"); - thumbUrl = thumbUrl.replace("{height}", "384"); - } - - msgEmbed.setThumbnail(thumbUrl); - - // Title - if (isLive) { - msgEmbed.setTitle(":red_circle: " + localizer.__("**[[0]] is live on Twitch!**", { placeholders: [streamData.user_name] })); - msgEmbed.addField(localizer._("Title"), streamData.title, false); - } else { - msgEmbed.setTitle(":white_circle: " + localizer.__("[[0]] was live on Twitch.", { placeholders: [streamData.user_name] })); - msgEmbed.setDescription(localizer._("The stream has ended.")); - - msgEmbed.addField(localizer._("Title"), streamData.title, true); - } - - // Add game - if (streamData.game && config.showGame) { - msgEmbed.addField(localizer._("Game"), streamData.game.name, false); - } - - if (isLive) { - // Add status - if (config.showViews) msgEmbed.addField(localizer._("Viewers"), isLive ? localizer.__("Currently [[0]]", { placeholders: [streamData.viewer_count] }) : localizer._("The stream has ended."), true); - - // Set main image (stream preview) - if (config.showThumbnail) { - let imageUrl = streamData.thumbnail_url; - imageUrl = imageUrl.replace("{width}", "1280"); - imageUrl = imageUrl.replace("{height}", "720"); - let thumbnailBuster = (Date.now() / 1000).toFixed(0); - imageUrl += `?t=${thumbnailBuster}`; - msgEmbed.setImage(imageUrl); - } - - // Add uptime - if (config.showUptime) { - let now = moment(); - let startedAt = moment(streamData.started_at); - - msgEmbed.addField(localizer._("Online since"), humanizeDuration(now - startedAt, { - language: locale, - delimiter: ", ", - largest: 2, - round: true, - units: ["y", "mo", "w", "d", "h", "m"] - }), true); - } - } - - return msgEmbed; - } -} - -module.exports = LiveEmbed; \ No newline at end of file diff --git a/ab-modules/twitch/locales.json b/ab-modules/twitch/locales.json deleted file mode 100644 index a616163..0000000 --- a/ab-modules/twitch/locales.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "**[[0]]** is live on Twitch!": { - "fr": "**[[0]]** est en live sur Twitch!" - }, - - "Cannot tag [[0]] role (role not found on server [[1]])": { - "fr": "Impossible de mentionner le rôle: [[0]] (le rôle n'existe pas sur le serveur [[1]])" - }, - - "Announcement sent in #[[0]] on [[1]]": { - "fr": "Annonce envoyée dans #[[0]] sur [[1]]" - }, - - "Cannot send the announcement in #[[0]] on [[1]]: [[2]]": { - "fr": "Impossible d'envoyer l'annonce dans #[[0]] sur [[1]]: [[2]]" - }, - - "An error occured while sending the message: ": { - "fr": "Erreur lors de l'envoi du message: " - }, - - "**[[0]] is live on Twitch!**": { - "fr": "**[[0]] est en live sur Twitch!**" - }, - - "Title": { - "fr": "Titre" - }, - - "[[0]] was live on Twitch.": { - "fr": "[[0]] était en live sur Twitch." - }, - - "The stream has ended.": { - "fr": "Le live est maintenant terminé." - }, - - "Game": { - "fr": "Jeu" - }, - - "Viewers": { - "fr": "Visionnements" - }, - - "Currently [[0]]": { - "fr": "Actuellement [[0]]" - }, - - "Online since": { - "fr": "En ligne depuis" - }, - - "Configuration error: The server [[0]] does not have a #[[1]] channel!": { - "fr": "Problème de configuration: Le serveur [[0]] ne contient pas le salon #[[1]]!" - }, - - " --> for the [[0]] server, the announcements channel is #[[1]]": { - "fr": " --> pour le serveur [[0]], le salon d'annonces est #[[1]]" - }, - - "Configuration error: The bot does not have SEND_MESSAGES permission in #[[0]] channel on [[1]] server. The announcements will not be sent.": { - "fr": "Problème de configuration: Le bot n'a pas la permission SEND_MESSAGES dans le salon #[[0]] sur le serveur [[1]]. L'envoi des annonces ne fonctionnera pas." - }, - - "Total of [[0]] #[[1]] channels.": { - "fr": "Total de [[0]] salons pour le nom [[1]]." - }, - - "Creating directory for minidb: [[0]]": { - "fr": "Création du dossier pour minidb: [[0]]" - }, - - "Writing error: [[0]], [[1]]": { - "fr": "Erreur d'écriture: [[0]], [[1]]" - }, - - "API request failed with Helix error: [[0]] ([[1]]/[[2]])": { - "fr": "La requête sur l'API Helix a eu une erreur: [[0]] ([[1]]/[[2]])" - }, - - "API request failed with error: ": { - "fr": "La requête sur l'API a eu une error: " - }, - - "No channels to listen to. Maybe you should disable this module in the config to free up some system resources.": { - "fr": "Pas de chaînes à écouter. Vous devriez désactiver le module pour sauver des ressources système." - }, - - "Periodic check": { - "fr": "Vérification périodique" - }, - - "Initial check": { - "fr": "Vérification initiale" - }, - - "Listens to: [[0]] (Checks every [[1]]ms)": { - "fr": "Écoute: [[0]] (Vérification chaque [[1]]ms)" - }, - - "Refreshing": { - "fr": "Rafraichissement" - }, - - "No reason": { - "fr": "Aucune raison" - }, - - "An error occured while updating the user: ": { - "fr": "Erreur pendant la mise à jour de l'utilisateur: " - }, - - "An error occured while updating the game: ": { - "fr": "Erreur pendant la mise à jour du jeu: " - }, - - "An error occured while updating streams: ": { - "fr": "Erreur dans la mise à jour des streams: " - }, - - "Updating users data: ": { - "fr": "Mise à jour des données des utilisateurs: " - }, - - "Updating games data: ": { - "fr": "Mise à jour des données de jeux: " - }, - - "The stream is now online: ": { - "fr": "Le stream est maintenant en ligne: " - }, - - "The stream is now offline: ": { - "fr": "Le stream n'est plus en ligne: " - }, - - "Cannot send the announcement, another try will be done on next update.": { - "fr": "Impossible d'envoyer la notification, une autre tentative sera faite à la prochaine mise à jour." - } - } -} \ No newline at end of file diff --git a/ab-modules/twitch/miniDb.js b/ab-modules/twitch/miniDb.js deleted file mode 100644 index bf58623..0000000 --- a/ab-modules/twitch/miniDb.js +++ /dev/null @@ -1,57 +0,0 @@ -const fs = require('fs'); - -class MiniDb { - constructor(name, log, localizer) { - this.logToConsole = log; - this.localizer = localizer; - this.basePath = `${__dirname}/data/`; - - if (!fs.existsSync(this.basePath)) { - this.logToConsole('TwitchMonitor', this.localizer.__("Creating directory for minidb: [[0]]", { placeholders: [this.basePath] })); - fs.mkdirSync(this.basePath); - } - - this.basePath = `${__dirname}/data/${name}`; - - if (!fs.existsSync(this.basePath)) { - this.logToConsole('TwitchMonitor', this.localizer.__("Creating directory for minidb: [[0]]", { placeholders: [this.basePath] })); - fs.mkdirSync(this.basePath); - } - } - - get(id) { - const filePath = `${this.basePath}/${id}.json`; - - try { - if (fs.existsSync(filePath)) { - const raw = fs.readFileSync(filePath, { - encoding: 'utf8', - flag: 'r' - }); - return JSON.parse(raw) || null; - } - } catch (e) { - this.logToConsole('TwitchMonitor', this.localizer.__("Writing error: [[0]], [[1]]", { placeholders: [filePath, e] }), "error"); - } - return null; - } - - put(id, value) { - const filePath = `${this.basePath}/${id}.json`; - - try { - const raw = JSON.stringify(value); - fs.writeFileSync(filePath, raw, { - encoding: 'utf8', - mode: '666', - flag: 'w' - }); - return true; - } catch (e) { - this.logToConsole('TwitchMonitor', this.localizer.__("Writing error: [[0]], [[1]]", { placeholders: [filePath, e] }), "error"); - return false; - } - } -} - -module.exports = MiniDb; \ No newline at end of file diff --git a/ab-modules/twitch/private-example.json b/ab-modules/twitch/private-example.json deleted file mode 100644 index aced74e..0000000 --- a/ab-modules/twitch/private-example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "token": "Get this from https://twitchapps.com/tokengen/", - "clientId": "Get this from Twitch" -} \ No newline at end of file diff --git a/ab-modules/twitch/twitchApi.js b/ab-modules/twitch/twitchApi.js deleted file mode 100644 index 1281e5d..0000000 --- a/ab-modules/twitch/twitchApi.js +++ /dev/null @@ -1,80 +0,0 @@ -const axios = require('axios'); -const config = require("./config.json"); -config.private = require("./private.json"); - -// Twitch Helix API helper ("New Twitch API"). - -class TwitchApi { - static init(log, localizer) { - this.logToConsole = log; - this.localizer = localizer; - } - - static get requestOptions() { - // Automatically remove "oauth:" prefix if it's present - const oauthPrefix = "oauth:"; - let oauthBearer = config.private.token; - if (oauthBearer.startsWith(oauthPrefix)) { - oauthBearer = oauthBearer.substr(oauthPrefix.length); - } - // Construct default request options - return { - baseURL: "https://api.twitch.tv/helix/", - headers: { - "Client-ID": config.private.clientId, - "Authorization": `Bearer ${oauthBearer}` - } - }; - } - - static handleApiError(err) { - const res = err.response || {}; - - if (res.data && res.data.message) { - this.logToConsole('TwitchMonitor', this.localizer.__("API request failed with Helix error: [[0]] ([[1]]/[[2]])", { placeholders: [res.data.message, res.data.error, res.data.status] }), "error"); - } else { - this.logToConsole('TwitchMonitor', this.localizer._("API request failed with error: ") + (err.message || err), "error"); - } - } - - static fetchStreams(channelNames) { - return new Promise((resolve, reject) => { - axios.get(`/streams?user_login=${channelNames.join('&user_login=')}`, this.requestOptions) - .then((res) => { - resolve(res.data.data || []); - }) - .catch((err) => { - this.handleApiError(err); - reject(err); - }); - }); - } - - static fetchUsers(channelNames) { - return new Promise((resolve, reject) => { - axios.get(`/users?login=${channelNames.join('&login=')}`, this.requestOptions) - .then((res) => { - resolve(res.data.data || []); - }) - .catch((err) => { - this.handleApiError(err); - reject(err); - }); - }); - } - - static fetchGames(gameIds) { - return new Promise((resolve, reject) => { - axios.get(`/games?id=${gameIds.join('&id=')}`, this.requestOptions) - .then((res) => { - resolve(res.data.data || []); - }) - .catch((err) => { - this.handleApiError(err); - reject(err); - }); - }); - } -} - -module.exports = TwitchApi; \ No newline at end of file diff --git a/ab-modules/twitch/twitchMonitor.js b/ab-modules/twitch/twitchMonitor.js deleted file mode 100644 index c5deec4..0000000 --- a/ab-modules/twitch/twitchMonitor.js +++ /dev/null @@ -1,261 +0,0 @@ -const config = require('./config.json'); -config.private = require("./private.json"); -const TwitchApi = require('./twitchApi'); -const MiniDb = require('./miniDb'); -const moment = require('moment'); - -class TwitchMonitor { - static init(log, localizer) { - this.logToConsole = log; - this.localizer = localizer; - - this._userDb = new MiniDb("twitch-users", this.logToConsole, this.localizer); - this._gameDb = new MiniDb("twitch-games", this.logToConsole, this.localizer); - - this._lastUserRefresh = this._userDb.get("last-update") || null; - this._pendingUserRefresh = false; - this._userData = this._userDb.get("user-list") || {}; - - this._pendingGameRefresh = false; - this._gameData = this._gameDb.get("game-list") || {}; - this._watchingGameIds = []; - } - - static start() { - // Load channel names from config - this.channelNames = config.twitchChannels; - if (!this.channelNames.length) { - this.logToConsole('TwitchMonitor', this.localizer._("No channels to listen to. Maybe you should disable this module in the config to free up some system resources."), "warn"); - return; - } - - // Configure polling interval - let checkIntervalMs = parseInt(config.checkInterval); - if (isNaN(checkIntervalMs) || checkIntervalMs < TwitchMonitor.MIN_POLL_INTERVAL_MS) { - // Enforce minimum poll interval to help avoid rate limits - checkIntervalMs = TwitchMonitor.MIN_POLL_INTERVAL_MS; - } - setInterval(() => { - this.refresh(this.localizer._("Periodic check")); - }, checkIntervalMs + 1000); - - // Immediate refresh after startup - setTimeout(() => { - this.refresh(this.localizer._("Initial check")); - }, 1000); - - // Ready! - this.logToConsole('TwitchMonitor', this.localizer.__("Listens to: [[0]] (Checks every [[1]]ms)", { - placeholders: [ - this.channelNames.join(', '), - checkIntervalMs - ] - })); - } - - static refresh(reason) { - const now = moment(); - if (config.debug) this.logToConsole('TwitchMonitor', `${this.localizer._("Refreshing")} (${reason ? reason : this.localizer._("No reason")})`); - - // Refresh all users periodically - if (this._lastUserRefresh === null || now.diff(moment(this._lastUserRefresh), 'minutes') >= 10) { - TwitchApi.fetchUsers(this.channelNames) - .then((users) => { - this.handleUserList(users); - }) - .catch((err) => { - this.logToConsole('TwitchMonitor', this.localizer._("An error occured while updating the user: ") + err, "warn"); - }) - .then(() => { - if (this._pendingUserRefresh) { - this._pendingUserRefresh = false; - } - }) - } - - // Refresh all games if needed - if (this._pendingGameRefresh) { - TwitchApi.fetchGames(this._watchingGameIds) - .then((games) => { - this.handleGameList(games); - }) - .catch((err) => { - this.logToConsole('TwitchMonitor', this.localizer._("An error occured while updating the game: ") + err, "warn"); - }) - .then(() => { - if (this._pendingGameRefresh) { - this._pendingGameRefresh = false; - } - }); - } - - // Refresh all streams - if (!this._pendingUserRefresh && !this._pendingGameRefresh) { - TwitchApi.fetchStreams(this.channelNames) - .then((channels) => { - this.handleStreamList(channels); - }) - .catch((err) => { - this.logToConsole('TwitchMonitor', this.localizer._("An error occured while updating streams: "), err); - }); - } - } - - static handleUserList(users) { - let gotChannelNames = []; - - users.forEach((user) => { - const channelName = user.login.toLowerCase(); - - let prevUserData = this._userData[channelName] || {}; - this._userData[channelName] = Object.assign({}, prevUserData, user); - - gotChannelNames.push(user.display_name); - }); - - if (gotChannelNames.length) { - if (config.debug) this.logToConsole('TwitchMonitor', this.localizer._("Updating users data: ") + gotChannelNames.join(', '), "debug"); - } - - this._lastUserRefresh = moment(); - - this._userDb.put("last-update", this._lastUserRefresh); - this._userDb.put("user-list", this._userData); - } - - static handleGameList(games) { - let gotGameNames = []; - - games.forEach((game) => { - const gameId = game.id; - - let prevGameData = this._gameData[gameId] || {}; - this._gameData[gameId] = Object.assign({}, prevGameData, game); - - gotGameNames.push(`${game.id} → ${game.name}`); - }); - - if (gotGameNames.length) { - if (config.debug) this.logToConsole('TwitchMonitor', this.localizer._("Updating games data: ") + gotGameNames.join(', '), "debug"); - } - - this._lastGameRefresh = moment(); - - this._gameDb.put("last-update", this._lastGameRefresh); - this._gameDb.put("game-list", this._gameData); - } - - static handleStreamList(streams) { - // Index channel data & build list of stream IDs now online - let nextOnlineList = []; - let nextGameIdList = []; - - streams.forEach((stream) => { - const channelName = stream.user_name.toLowerCase(); - - if (stream.type === "live") { - nextOnlineList.push(channelName); - } - - let userDataBase = this._userData[channelName] || {}; - let prevStreamData = this.streamData[channelName] || {}; - - this.streamData[channelName] = Object.assign({}, userDataBase, prevStreamData, stream); - this.streamData[channelName].game = (stream.game_id && this._gameData[stream.game_id]) || null; - - if (stream.game_id) { - nextGameIdList.push(stream.game_id); - } - }); - - // Find channels that are now online, but were not before - let notifyFailed = false; - - for (let i = 0; i < nextOnlineList.length; i++) { - let _chanName = nextOnlineList[i]; - - if (this.activeStreams.indexOf(_chanName) === -1) { - // Stream was not in the list before - this.logToConsole('TwitchMonitor', this.localizer._("The stream is now online: ") + _chanName); - } - - if (!this.handleChannelLiveUpdate(this.streamData[_chanName], true)) { - notifyFailed = true; - } - } - - // Find channels that are now offline, but were online before - for (let i = 0; i < this.activeStreams.length; i++) { - let _chanName = this.activeStreams[i]; - - if (nextOnlineList.indexOf(_chanName) === -1) { - // Stream was in the list before, but no longer - this.logToConsole('TwitchMonitor', this.localizer._("The stream is now offline: ") + _chanName); - this.streamData[_chanName].type = "detected_offline"; - this.handleChannelOffline(this.streamData[_chanName]); - } - } - - if (!notifyFailed) { - // Notify OK, update list - this.activeStreams = nextOnlineList; - } else { - this.logToConsole('TwitchMonitor', this.localizer._("Cannot send the announcement, another try will be done on next update.")); - } - - if (!this._watchingGameIds.hasEqualValues(nextGameIdList)) { - // We need to refresh game info - this._watchingGameIds = nextGameIdList; - this._pendingGameRefresh = true; - this.refresh(this.localizer._("Updating games data: ")); - } - } - - static handleChannelLiveUpdate(streamData, isOnline) { - for (let i = 0; i < this.channelLiveCallbacks.length; i++) { - let _callback = this.channelLiveCallbacks[i]; - - if (_callback) { - if (_callback(streamData, isOnline) === false) { - return false; - } - } - } - - return true; - } - - static handleChannelOffline(streamData) { - this.handleChannelLiveUpdate(streamData, false); - - for (let i = 0; i < this.channelOfflineCallbacks.length; i++) { - let _callback = this.channelOfflineCallbacks[i]; - - if (_callback) { - if (_callback(streamData) === false) { - return false; - } - } - } - - return true; - } - - static onChannelLiveUpdate(callback) { - this.channelLiveCallbacks.push(callback); - } - - static onChannelOffline(callback) { - this.channelOfflineCallbacks.push(callback); - } -} - -TwitchMonitor.activeStreams = []; -TwitchMonitor.streamData = {}; - -TwitchMonitor.channelLiveCallbacks = []; -TwitchMonitor.channelOfflineCallbacks = []; - -TwitchMonitor.MIN_POLL_INTERVAL_MS = 30000; - -module.exports = TwitchMonitor; \ No newline at end of file From 3ad90cccecd72eaf798ba6503be7f5df6eae849f Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 5 May 2022 18:53:20 -0400 Subject: [PATCH 44/68] Add wakatime badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 073bdee..94106a0 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Bot open-source fait par Artivain et les contributeurs. [![GitHub issues](https://img.shields.io/github/issues/Artivain/artibot?style=for-the-badge&logo=github)](https://github.com/Artivain/artibot/issues) [![GitHub forks](https://img.shields.io/github/forks/Artivain/artibot?style=for-the-badge&logo=github)](https://github.com/Artivain/artibot/network) [![GitHub stars](https://img.shields.io/github/stars/Artivain/artibot?style=for-the-badge&logo=github)](https://github.com/Artivain/artibot/stargazers) +[![wakatime](https://wakatime.com/badge/github/Artivain/artibot.svg?style=for-the-badge)](https://wakatime.com/badge/github/Artivain/artibot)
[![node-lts](https://img.shields.io/node/v-lts/artibot?color=blue&label=Node.js&logo=node.js&logoColor=white&style=for-the-badge)](https://github.com/Artivain/artibot/blob/main/.node-version) [![npm (prod) dependency version](https://img.shields.io/npm/dependency-version/artibot/discord.js?logo=discord&logoColor=white&style=for-the-badge)](https://discord.js.org/#/) From 22ade8b0c45f7cca1c286ed0fa334796ba4a9bab Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sat, 7 May 2022 20:13:22 -0400 Subject: [PATCH 45/68] move clocks to own repo --- ab-modules/clocks/clocks.js | 82 -------------------------- ab-modules/clocks/config-example.json | 14 ----- ab-modules/clocks/index.js | 21 ------- ab-modules/clocks/locales.json | 33 ----------- ab-modules/clocks/private-example.json | 4 -- 5 files changed, 154 deletions(-) delete mode 100644 ab-modules/clocks/clocks.js delete mode 100644 ab-modules/clocks/config-example.json delete mode 100644 ab-modules/clocks/index.js delete mode 100644 ab-modules/clocks/locales.json delete mode 100644 ab-modules/clocks/private-example.json diff --git a/ab-modules/clocks/clocks.js b/ab-modules/clocks/clocks.js deleted file mode 100644 index a7f06d9..0000000 --- a/ab-modules/clocks/clocks.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Clocks module - Show time from many timezones in your Discord server - * @author GoudronViande24 - */ - -const moment = require('moment'); -require('moment-timezone'); -const { Client, Intents } = require("discord.js"); -const Localizer = require("artibot-localizer"); -const path = require('path'); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -function updateActivity(client, config, clock) { - const timeNowUpdate = moment().tz(clock.timezone).format(config.format); - client.user.setActivity(`🕒 ${timeNowUpdate}`); -}; - -function startClock(clock, config, i, log) { - // Since discord.js v13, intents are mandatory - const client = new Client({ - intents: [Intents.FLAGS.GUILDS] - }); - client.once("ready", client => { - if (client.user.username !== clock.botName) { - client.user.setUsername(clock.botName); - log("Clocks", localizer.__("Clock #[[0]]: Name changed for [[1]]", { placeholders: [i, clock.botName] })); - }; - - // set the interval - setInterval(() => updateActivity(client, config, clock), config.updateinterval); - updateActivity(client, config, clock); - - // tell when it's ready - log("Clocks", localizer.__("Clock #[[0]]: Connected as [[1]] ([[2]]) on [[3]]", { - placeholders: [ - i, - client.user.tag, - client.user.id, - moment().format("MMMM DD YYYY, HH:mm:ss") - ] - })); - }); - client.login(config.tokens[i]); -}; - -module.exports = { - name: "Clocks", - - execute({ log }) { - config = require("./config.json"); - try { config.tokens = require("./private.json"); } catch (error) { - if (error.code !== 'MODULE_NOT_FOUND') { - // Re-throw not "Module not found" errors - throw error; - } else { - log("Clocks", localizer._("Configuration error: The private.json file does not exists.")); - process.exit(1); - }; - }; - - if (!config.tokens) { - log("Clocks", localizer._("Configuration error: The private.json file is invalid.")); - process.exit(1); - }; - - if (config.tokens.length != config.clocks.length) { - log("Clocks", localizer._("Configuration error: The amount of tokens is not equal to the amount of clocks.")); - process.exit(1); - }; - - log("Clocks", localizer._("Loading...")); - - for (var i = 0, len = config.clocks.length; i < len; i++) { - startClock(config.clocks[i], config, i, log); - }; - } -}; \ No newline at end of file diff --git a/ab-modules/clocks/config-example.json b/ab-modules/clocks/config-example.json deleted file mode 100644 index 459806d..0000000 --- a/ab-modules/clocks/config-example.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "format": "HH:mm (z)", - "updateinterval": 10000, - "clocks": [ - { - "botName": "Montréal", - "timezone": "America/Montreal" - }, - { - "botName": "Paris", - "timezone": "Europe/Paris" - } - ] -} \ No newline at end of file diff --git a/ab-modules/clocks/index.js b/ab-modules/clocks/index.js deleted file mode 100644 index 9107149..0000000 --- a/ab-modules/clocks/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Manifest file for clocks module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "3.0.0", - name: "Clocks", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "clocks", - type: "global", - path: "clocks.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/clocks/locales.json b/ab-modules/clocks/locales.json deleted file mode 100644 index fb95a0f..0000000 --- a/ab-modules/clocks/locales.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Clock #[[0]]: Name changed for [[1]]": { - "fr": "Horloge #[[0]]: Nom changé pour [[1]]" - }, - - "Clock #[[0]]: Connected as [[1]] ([[2]]) on [[3]]": { - "fr": "Horloge #[[0]]: Connecté en tant que [[1]] ([[2]]) le [[3]]" - }, - - "Configuration error: The private.json file does not exists.": { - "fr": "Erreur de configuration: Le fichier private.json est introuvable." - }, - - "Configuration error: The private.json file is invalid.": { - "fr": "Erreur de configuration: Le fichier private.json est invalide." - }, - - "Configuration error: The amount of tokens is not equal to the amount of clocks.": { - "fr": "Erreur de configuration: Le nombre de tokens n'est pas équivalent au nombre d'horloges." - }, - - "Loading...": { - "fr": "Chargement..." - } - } -} \ No newline at end of file diff --git a/ab-modules/clocks/private-example.json b/ab-modules/clocks/private-example.json deleted file mode 100644 index faae11e..0000000 --- a/ab-modules/clocks/private-example.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "insert token 1 here", - "insert token 2 here" -] \ No newline at end of file From dda57a41470f86e694d3b6f250e5e207f8ae9df5 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sat, 7 May 2022 20:41:46 -0400 Subject: [PATCH 46/68] Move welcome to own repo --- ab-modules/welcome/config-example.json | 23 ----- ab-modules/welcome/index.js | 123 ------------------------- ab-modules/welcome/locales.json | 49 ---------- 3 files changed, 195 deletions(-) delete mode 100644 ab-modules/welcome/config-example.json delete mode 100644 ab-modules/welcome/index.js delete mode 100644 ab-modules/welcome/locales.json diff --git a/ab-modules/welcome/config-example.json b/ab-modules/welcome/config-example.json deleted file mode 100644 index 95da30b..0000000 --- a/ab-modules/welcome/config-example.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "debug": false, - "servers": { - - "775798875356397608": { - "name": "Super Cool Server", - "welcome": { - "activate": true, - "channel": "926959115404738640", - "showProfilePicture": true, - "showMemberCount": true, - "customInfo": "asdasd" - }, - "farewell": { - "activate": true, - "channel": "926959115404738640", - "showProfilePicture": false, - "showMemberCount": true - } - } - - } -} diff --git a/ab-modules/welcome/index.js b/ab-modules/welcome/index.js deleted file mode 100644 index c908b54..0000000 --- a/ab-modules/welcome/index.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Welcome module for Artibot - * @author GoudronViande24 - */ - -const { debug, servers } = require("./config.json"); -const { MessageEmbed } = require("discord.js"); -const Localizer = require("artibot-localizer"); -const path = require("path"); - -module.exports = { - name: "Welcome", - - manifest: { - manifestVersion: 1, - moduleVersion: "2.0.0", - name: "Welcome", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "welcome", - type: "global", - path: "index.js" - } - ] - }, - - async execute({ client, config, log }) { - // Initializer localizer - const localizer = new Localizer({ - lang: config.locale, - filePath: path.resolve(__dirname, "locales.json") - }); - - // Welcome - client.on("guildMemberAdd", async member => { - if (debug) log("Welcome", localizer.__("[[0]] joined [[1]]", { placeholders: [member.user.username, member.guild.name] }), "debug"); - - // If there is nothing in the config for this server, skip. - if (!(member.guild.id in servers)) { - if (debug) log("Welcome", localizer.__("[[0]] is not in configuration file.", { placeholders: [member.guild.name] }), "debug"); - return - }; - // If welcome is not activated for the server, skip. - if (!servers[member.guild.id].welcome.activate) return; - - let guild = member.guild; - guild.config = servers[member.guild.id]; - const welcomeChannel = await member.guild.channels.fetch(guild.config.welcome.channel); - - // Create content for the embed, based on preferences from the config - let content = localizer.__("Welcome in [[0]] server!", { placeholders: [(guild.config.name ? guild.config.name : guild.name)] }); - if (guild.config.welcome.showMemberCount) content += "\n" + localizer.__("We are now **[[0]]** members.", { placeholders: [guild.memberCount] }); - - const color = (await member.user.fetch(true)).accentColor || config.embedColor; - - const embed = new MessageEmbed() - .setColor(color) - .setTitle(localizer.__("[[0]] joined the server!", { placeholders: [member.user.username] })) - .setDescription(content) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp(); - - if (guild.config.welcome.showProfilePicture) { - embed.setThumbnail(`https://cdn.discordapp.com/avatars/${member.user.id}/${member.user.avatar}.webp?size=512`); - }; - - if (guild.config.welcome.customInfo) embed.addField(localizer._("Infos"), guild.config.welcome.customInfo); - - return await welcomeChannel.send({ - embeds: [embed] - }); - - }); - - // Farewell - client.on("guildMemberRemove", async member => { - if (debug) log("Welcome", localizer.__("[[0]] left [[1]]", { placeholders: [member.user.username, member.guild.name] }), "debug"); - - // If there is nothing in the config for this server, skip. - if (!(member.guild.id in servers)) { - if (debug) log("Welcome", localizer.__("[[0]] is not in configuration file.", { placeholders: [member.guild.name] }), "debug"); - return - }; - // If farewell is not activated for the server, skip. - if (!servers[member.guild.id].farewell.activate) return; - - let guild = member.guild; - guild.config = servers[member.guild.id]; - const farewellChannel = await member.guild.channels.fetch(guild.config.farewell.channel); - - // Create content for the embed, based on preferences from the config - let content = localizer._("We hope to see you back soon!"); - if (guild.config.farewell.showMemberCount) content += "\n" + localizer.__("We are now **[[0]]** members.", { placeholders: [guild.memberCount] }); - - const color = (await member.user.fetch(true)).accentColor || config.embedColor; - - const embed = new MessageEmbed() - .setColor(color) - .setTitle(localizer.__("[[0]] left the server.", { placeholders: [member.user.username] })) - .setDescription(content) - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp(); - - if (guild.config.farewell.showProfilePicture) { - embed.setThumbnail(`https://cdn.discordapp.com/avatars/${member.user.id}/${member.user.avatar}.webp?size=512`); - }; - - if (guild.config.farewell.customInfo) embed.addField(localizer._("Infos"), guild.config.welcome.customInfo); - - return await farewellChannel.send({ - embeds: [embed] - }); - - }); - - log("Welcome", localizer._("Ready.")); - - } -}; \ No newline at end of file diff --git a/ab-modules/welcome/locales.json b/ab-modules/welcome/locales.json deleted file mode 100644 index 08b3f1f..0000000 --- a/ab-modules/welcome/locales.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "[[0]] joined [[1]]": { - "fr": "[[0]] vient de rejoindre [[1]]" - }, - - "[[0]] is not in configuration file.": { - "fr": "[[0]] n'est pas dans le fichier de configuration." - }, - - "Welcome in [[0]] server!": { - "fr": "Bienvenue dans le serveur [[0]]!" - }, - - "We are now **[[0]]** members.": { - "fr": "Nous sommes maintenant **[[0]]** membres." - }, - - "[[0]] joined the server!": { - "fr": "[[0]] vient de rejoindre le serveur!" - }, - - "Infos": { - "fr": "Informations" - }, - - "[[0]] left [[1]]": { - "fr": "[[0]] vient de quitter [[1]]" - }, - - "We hope to see you back soon!": { - "fr": "On espère te revoir bientôt!" - }, - - "[[0]] left the server.": { - "fr": "[[0]] vient de quitter le serveur." - }, - - "Ready.": { - "fr": "Prêt." - } - } -} \ No newline at end of file From be3a51dc665cfae774c96efd09a804a1956eb9e7 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 10 May 2022 21:48:08 -0400 Subject: [PATCH 47/68] Move crypto to own repo --- ab-modules/crypto/config-example.json | 3 -- ab-modules/crypto/crypto.js | 55 --------------------------- ab-modules/crypto/index.js | 21 ---------- ab-modules/crypto/locales.json | 25 ------------ 4 files changed, 104 deletions(-) delete mode 100644 ab-modules/crypto/config-example.json delete mode 100644 ab-modules/crypto/crypto.js delete mode 100644 ab-modules/crypto/index.js delete mode 100644 ab-modules/crypto/locales.json diff --git a/ab-modules/crypto/config-example.json b/ab-modules/crypto/config-example.json deleted file mode 100644 index f20f4f1..0000000 --- a/ab-modules/crypto/config-example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "currencies": ["CAD", "EUR", "USD"] -} \ No newline at end of file diff --git a/ab-modules/crypto/crypto.js b/ab-modules/crypto/crypto.js deleted file mode 100644 index 7b967b0..0000000 --- a/ab-modules/crypto/crypto.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Cryptocurrencies market value - * Uses Coinbase's API to get current values - * @author GoudronViande24 - * @since 1.0.0 - */ - -const { MessageEmbed } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const axios = require('axios'); -const { currencies } = require("./config.json"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - // The data needed to register slash commands to Discord. - data: new SlashCommandBuilder() - .setName("crypto") - .setDescription(localizer._("Get the current value of a cryptocurrency.")) - .addStringOption(option => - option.setName("crypto") - .setDescription(localizer._("The cryptocurrency to look for")) - .setRequired(true) - .addChoice("Bitcoin", "BTC") - .addChoice("Ethereum", "ETH") - ), - - async execute(interaction, { config }) { - const crypto = interaction.options.getString("crypto"); - var costs = ""; - - for (const currency of currencies) { - let url = `https://api.coinbase.com/v2/prices/${crypto}-${currency}/spot`; - let data = (await axios.get(url)).data.data; - costs += `**${data.currency}**: ${parseFloat(data.amount).toFixed(2)}\n`; - }; - - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(`${localizer._("Actual value")} - ${crypto}`) - .setFooter({ text: config.botName, iconUR: config.botIcon }) - .setTimestamp() - .setDescription(costs + "\n`"+ localizer._("Data fetched from Coinbase") + "`"); - - await interaction.reply({ - embeds: [embed] - }); - } -}; \ No newline at end of file diff --git a/ab-modules/crypto/index.js b/ab-modules/crypto/index.js deleted file mode 100644 index cf0e717..0000000 --- a/ab-modules/crypto/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Manifest file for crypto module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "1.0.1", - name: "Crypto", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "crypto", - type: "slashcommand", - path: "crypto.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/crypto/locales.json b/ab-modules/crypto/locales.json deleted file mode 100644 index b9aece3..0000000 --- a/ab-modules/crypto/locales.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Get the current value of a cryptocurrency.": { - "fr": "Voir la valeur de certaines cryptomonaies." - }, - - "The cryptocurrency to look for": { - "fr": "La cryptomonnaie à vérifier" - }, - - "Actual value": { - "fr": "Valeur actuelle" - }, - - "Data fetched from Coinbase": { - "fr": "Données fournies par Coinbase" - } - } -} \ No newline at end of file From 9945b97f7c696ce648f108bebf1f4609d2474c5a Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 10 May 2022 21:48:24 -0400 Subject: [PATCH 48/68] use slash to separate versions in user agent --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7416f44..983f812 100644 --- a/index.js +++ b/index.js @@ -223,7 +223,7 @@ export class Artibot { url: `https://api.github.com/repos/${repo}/releases/latest`, responseType: "json", headers: { - "User-Agent": "Artibot " + this.version + "User-Agent": "Artibot/" + this.version }, validateStatus: () => { return true } }); From 0dc0692daf3bc4bdfa1a1f1a6653f5093d84762e Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 10 May 2022 22:24:12 -0400 Subject: [PATCH 49/68] Error handling on registering module --- index.js | 10 +++++++++- locales.json | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 983f812..8766f8e 100644 --- a/index.js +++ b/index.js @@ -193,7 +193,15 @@ export class Artibot { * @method */ registerModule = (module, config = {}) => { - if (typeof module == "function") module = module(this); + if (typeof module == "function") { + try { + module = module(this); + } catch (err) { + this.log("Artibot", this.localizer._("Error when registering module: ") + err, "err", true); + process.exit(1); + } + } + this.modules.push(module); log("Artibot", this.localizer._("Registered module: ") + module.name, "info", true); diff --git a/locales.json b/locales.json index efb7d62..5a1030e 100644 --- a/locales.json +++ b/locales.json @@ -625,6 +625,10 @@ "An error occured when trying to change the bot name. Try again later.": { "fr": "Une erreur est survenue en essayant de changer le nom du bot. Réessayez plus tard." + }, + + "Error when registering module: ": { + "fr": "Une erreur est survenue en chargeant un module: " } } From 66320b63038ac6014f061285f2aedf93da26d1ad Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 10 May 2022 22:54:39 -0400 Subject: [PATCH 50/68] Use a Collection for storing modules --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 8766f8e..fe2eaa3 100644 --- a/index.js +++ b/index.js @@ -100,9 +100,9 @@ export class Artibot { /** * List of registered modules - * @type {Module[]} + * @type {discord.Collection.} */ - this.modules = []; + this.modules = new discord.Collection(); // Register the Core module this.registerModule(coreModule); @@ -201,8 +201,9 @@ export class Artibot { process.exit(1); } } - - this.modules.push(module); + + this.modules.set(module.id, module); + log("Artibot", this.localizer._("Registered module: ") + module.name, "info", true); if (module.langs != "any" && !module.langs.includes(this.config.lang)) { From c09a336d50923b664e05209be3e1a6e321b425ec Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Tue, 10 May 2022 22:55:52 -0400 Subject: [PATCH 51/68] version 3.0.5 upgrade dependencies --- package-lock.json | 103 +++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 54 insertions(+), 53 deletions(-) diff --git a/package-lock.json b/package-lock.json index a0948a3..2763af1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.4", + "version": "3.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.4", + "version": "3.0.5", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", @@ -14,7 +14,7 @@ "artibot-localizer": "^1.0.2", "axios": "^0.27.2", "chalk": "^5.0.1", - "discord-api-types": "^0.32.0", + "discord-api-types": "^0.32.1", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", "discordjs-reaction-role": "^3.0.0", @@ -389,9 +389,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", - "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==" + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.32.tgz", + "integrity": "sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -1209,9 +1209,9 @@ } }, "node_modules/discord-api-types": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.0.tgz", - "integrity": "sha512-i6HyCwWRocvtIcM7hamI3eQTCxLN/UvWtm/JktaXRSWDmASfhHam2juhej+e4U/Q/Fni1uUlyloMCBTL04Dl6Q==" + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.1.tgz", + "integrity": "sha512-/ewl0CPYT5xjOC+SJ7wADJKjtpZfiiUaYXOP/Ns54lnBcv4Xqa4iKSqRF/w1fjiUvWTYN9W8UuOiyCHtmu5fJw==" }, "node_modules/discord-giveaways": { "version": "5.1.1", @@ -1972,9 +1972,9 @@ "dev": true }, "node_modules/ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.7.tgz", + "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==" }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -2282,6 +2282,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "deprecated": "This module is not used anymore. npm config is parsed by npm itself and by @npmcli/config", "dev": true, "dependencies": { "figgy-pudding": "^3.5.1", @@ -2429,9 +2430,9 @@ } }, "node_modules/make-fetch-happen": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.2.tgz", - "integrity": "sha512-GWMGiZsKVeJACQGJ1P3Z+iNec7pLsU6YW1q11eaPn3RR8nRXHppFWfP7Eu0//55JK3hSjrAQRl8sDa5uXpq1Ew==", + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.3.tgz", + "integrity": "sha512-s/UjmGjUHn9m52cctFhN2ITObbT+axoUhgeir8xGrOlPbKDyJsdhQzb8PGncPQQ28uduHybFJ6Iumy2OZnreXw==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -2472,9 +2473,9 @@ } }, "node_modules/markdown-it-anchor": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.2.tgz", - "integrity": "sha512-JNaekTlIwwyYGBN3zifZDxgz4bSL8sbEj58fdTZGmPSMMGXBZapFjcZk2I33Jy79c1fvCKHpF7MA/67FOTjvzA==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.3.tgz", + "integrity": "sha512-3IiHYh/kJHY2IcuKv5qv+IKNxDwXjVoYQ5FvbBUPywcwCQ4ICLIw5z0QrhYBtcD7h88MfFK3zKAkABTvPMxm7A==", "dev": true, "peerDependencies": { "@types/markdown-it": "*", @@ -3112,9 +3113,9 @@ } }, "node_modules/npm-packlist": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.2.tgz", - "integrity": "sha512-jLhcNisUgpz6v2KC75qSeEYAM8UBMYjQ2OhlCOJjB4Ovu7XXnD25UqZ6hOQNeGShL/2ju3LL2E/zBbsuzkIQ8w==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.3.tgz", + "integrity": "sha512-KuSbzgejxdsAWbNNyEs8EsyDHsO+nJF6k+9WuWzFbSNh5tFHs4lDApXw7kntKpuehfp8lKRzJkMtz0+WmGvTIw==", "dev": true, "dependencies": { "glob": "^8.0.1", @@ -3320,9 +3321,9 @@ } }, "node_modules/pacote": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.2.0.tgz", - "integrity": "sha512-IT4/xHT8eLi4cJdKSGCuqooWp2YwRP5OgrQypbBlLG8Ubzw+h7s57QbrA2SegQcdGefD81ZvuI+aL0JlfFcPCA==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.3.0.tgz", + "integrity": "sha512-auhJAUlfC2TALo6I0s1vFoPvVFgWGx+uz/PnIojTTgkGwlK3Np8sGJ0ghfFhiuzJXTZoTycMLk8uLskdntPbDw==", "dev": true, "dependencies": { "@npmcli/git": "^3.0.0", @@ -4650,9 +4651,9 @@ } }, "node_modules/zod": { - "version": "3.14.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", - "integrity": "sha512-U9BFLb2GO34Sfo9IUYp0w3wJLlmcyGoMd75qU9yf+DrdGA4kEx6e+l9KOkAlyUO0PSQzZCa3TR4qVlcmwqSDuw==", + "version": "3.15.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.15.1.tgz", + "integrity": "sha512-WAdjcoOxa4S9oc/u7fTbC3CC7uVqptLLU0LKqS8RDBOrCXp2t5avM8BUfgNVZJymGWAx6SEUYxWPPoYuQ5rgwQ==", "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -4929,9 +4930,9 @@ "dev": true }, "@types/node": { - "version": "17.0.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", - "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==" + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.32.tgz", + "integrity": "sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw==" }, "@types/node-fetch": { "version": "2.6.1", @@ -5569,9 +5570,9 @@ } }, "discord-api-types": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.0.tgz", - "integrity": "sha512-i6HyCwWRocvtIcM7hamI3eQTCxLN/UvWtm/JktaXRSWDmASfhHam2juhej+e4U/Q/Fni1uUlyloMCBTL04Dl6Q==" + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.1.tgz", + "integrity": "sha512-/ewl0CPYT5xjOC+SJ7wADJKjtpZfiiUaYXOP/Ns54lnBcv4Xqa4iKSqRF/w1fjiUvWTYN9W8UuOiyCHtmu5fJw==" }, "discord-giveaways": { "version": "5.1.1", @@ -6154,9 +6155,9 @@ "dev": true }, "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.7.tgz", + "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==" }, "is-binary-path": { "version": "2.1.0", @@ -6512,9 +6513,9 @@ } }, "make-fetch-happen": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.2.tgz", - "integrity": "sha512-GWMGiZsKVeJACQGJ1P3Z+iNec7pLsU6YW1q11eaPn3RR8nRXHppFWfP7Eu0//55JK3hSjrAQRl8sDa5uXpq1Ew==", + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.3.tgz", + "integrity": "sha512-s/UjmGjUHn9m52cctFhN2ITObbT+axoUhgeir8xGrOlPbKDyJsdhQzb8PGncPQQ28uduHybFJ6Iumy2OZnreXw==", "dev": true, "requires": { "agentkeepalive": "^4.2.1", @@ -6549,9 +6550,9 @@ } }, "markdown-it-anchor": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.2.tgz", - "integrity": "sha512-JNaekTlIwwyYGBN3zifZDxgz4bSL8sbEj58fdTZGmPSMMGXBZapFjcZk2I33Jy79c1fvCKHpF7MA/67FOTjvzA==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.3.tgz", + "integrity": "sha512-3IiHYh/kJHY2IcuKv5qv+IKNxDwXjVoYQ5FvbBUPywcwCQ4ICLIw5z0QrhYBtcD7h88MfFK3zKAkABTvPMxm7A==", "dev": true, "requires": {} }, @@ -7018,9 +7019,9 @@ } }, "npm-packlist": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.2.tgz", - "integrity": "sha512-jLhcNisUgpz6v2KC75qSeEYAM8UBMYjQ2OhlCOJjB4Ovu7XXnD25UqZ6hOQNeGShL/2ju3LL2E/zBbsuzkIQ8w==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.3.tgz", + "integrity": "sha512-KuSbzgejxdsAWbNNyEs8EsyDHsO+nJF6k+9WuWzFbSNh5tFHs4lDApXw7kntKpuehfp8lKRzJkMtz0+WmGvTIw==", "dev": true, "requires": { "glob": "^8.0.1", @@ -7170,9 +7171,9 @@ } }, "pacote": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.2.0.tgz", - "integrity": "sha512-IT4/xHT8eLi4cJdKSGCuqooWp2YwRP5OgrQypbBlLG8Ubzw+h7s57QbrA2SegQcdGefD81ZvuI+aL0JlfFcPCA==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.3.0.tgz", + "integrity": "sha512-auhJAUlfC2TALo6I0s1vFoPvVFgWGx+uz/PnIojTTgkGwlK3Np8sGJ0ghfFhiuzJXTZoTycMLk8uLskdntPbDw==", "dev": true, "requires": { "@npmcli/git": "^3.0.0", @@ -8184,9 +8185,9 @@ "dev": true }, "zod": { - "version": "3.14.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", - "integrity": "sha512-U9BFLb2GO34Sfo9IUYp0w3wJLlmcyGoMd75qU9yf+DrdGA4kEx6e+l9KOkAlyUO0PSQzZCa3TR4qVlcmwqSDuw==" + "version": "3.15.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.15.1.tgz", + "integrity": "sha512-WAdjcoOxa4S9oc/u7fTbC3CC7uVqptLLU0LKqS8RDBOrCXp2t5avM8BUfgNVZJymGWAx6SEUYxWPPoYuQ5rgwQ==" } } } diff --git a/package.json b/package.json index c79dd0d..c35d5d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.4", + "version": "3.0.5", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { @@ -48,7 +48,7 @@ "artibot-localizer": "^1.0.2", "axios": "^0.27.2", "chalk": "^5.0.1", - "discord-api-types": "^0.32.0", + "discord-api-types": "^0.32.1", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", "discordjs-reaction-role": "^3.0.0", From eff2b619ba6d0b25ccfc09dc90253cfd7d3accb8 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 12 May 2022 16:58:21 -0400 Subject: [PATCH 52/68] Fix iteration problem caused by modules now being a collection --- core/commands/checkupdates.js | 2 +- core/slash-commands/help.js | 2 +- events/buttonHandler.js | 2 +- events/contextMenuHandler.js | 4 ++-- events/selectMenuHandler.js | 2 +- events/slashHandler.js | 2 +- interactionManager.js | 5 +++-- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/commands/checkupdates.js b/core/commands/checkupdates.js index d749a75..eed2fe6 100644 --- a/core/commands/checkupdates.js +++ b/core/commands/checkupdates.js @@ -29,7 +29,7 @@ export default async function execute(message, args, { config, localizer, versio }) + "\n"; } - for (const module of modules) { + for (const [, module] of modules) { if (!module.repo) return; const { name, version, repo } = module; const latest = await checkForUpdates(repo); diff --git a/core/slash-commands/help.js b/core/slash-commands/help.js index 9ad9a41..beb0d53 100644 --- a/core/slash-commands/help.js +++ b/core/slash-commands/help.js @@ -17,7 +17,7 @@ export default async function execute(interaction, { config, localizer, createEm */ let commands = []; - for (const module of modules) { + for (const [, module] of modules) { for (const part of module.parts) { if (part.type == "slashcommand") commands.push(part); } diff --git a/events/buttonHandler.js b/events/buttonHandler.js index 09d380f..e1fa438 100644 --- a/events/buttonHandler.js +++ b/events/buttonHandler.js @@ -17,7 +17,7 @@ export async function execute(interaction, artibot) { /** @type {Button} */ let button; - for (const module of modules) { + for (const [, module] of modules) { if (button) break; for (const part of module.parts) { if (button) break; diff --git a/events/contextMenuHandler.js b/events/contextMenuHandler.js index b03f3f6..5da2150 100644 --- a/events/contextMenuHandler.js +++ b/events/contextMenuHandler.js @@ -24,7 +24,7 @@ export async function execute(interaction, artibot) { let command; - for (const module of modules) { + for (const [, module] of modules) { if (command) break; for (const part of module.parts) { if (command) break; @@ -47,7 +47,7 @@ export async function execute(interaction, artibot) { let command; - for (const module of modules) { + for (const [, module] of modules) { if (command) break; for (const part of module.parts) { if (command) break; diff --git a/events/selectMenuHandler.js b/events/selectMenuHandler.js index fd67203..80fa0b0 100644 --- a/events/selectMenuHandler.js +++ b/events/selectMenuHandler.js @@ -18,7 +18,7 @@ export async function execute(interaction, artibot) { let command; - for (const module of modules) { + for (const [, module] of modules) { if (command) break; for (const part of module.parts) { if (command) break; diff --git a/events/slashHandler.js b/events/slashHandler.js index c8a3f14..5d1a1d7 100644 --- a/events/slashHandler.js +++ b/events/slashHandler.js @@ -16,7 +16,7 @@ export async function execute(interaction, artibot) { let command; - for (const module of modules) { + for (const [, module] of modules) { if (command) break; for (const part of module.parts) { if (part.type == "slashcommand" && part.data.name == interaction.commandName) { diff --git a/interactionManager.js b/interactionManager.js index 273cdb1..bb6a848 100644 --- a/interactionManager.js +++ b/interactionManager.js @@ -1,5 +1,6 @@ import { REST } from "@discordjs/rest"; import { Routes } from "discord-api-types/v9"; +import { Collection } from "discord.js"; import Artibot, { log, Module } from "./index.js"; /** @@ -29,10 +30,10 @@ export class InteractionManager { /** * Generate data to send to Discord API to register interactions - * @param {Module[]} modules - List of the modules to generate data from + * @param {Collection} modules - List of the modules to generate data from */ generateData = (modules) => { - for (const module of modules) { + for (const [, module] of modules) { for (const part of module.parts) { if (part.type == "slashcommand") { this.commandJSONData.push(part.data.toJSON()); From 53b50b9ef16da531fd04e9939b20936043a6b8b8 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 12 May 2022 17:44:28 -0400 Subject: [PATCH 53/68] Move vcrole to own repo --- ab-modules/vcRole/config-example.json | 4 -- ab-modules/vcRole/index.js | 53 --------------------------- ab-modules/vcRole/locales.json | 17 --------- 3 files changed, 74 deletions(-) delete mode 100644 ab-modules/vcRole/config-example.json delete mode 100644 ab-modules/vcRole/index.js delete mode 100644 ab-modules/vcRole/locales.json diff --git a/ab-modules/vcRole/config-example.json b/ab-modules/vcRole/config-example.json deleted file mode 100644 index 58878de..0000000 --- a/ab-modules/vcRole/config-example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "role": "Vocal", - "debug": false -} \ No newline at end of file diff --git a/ab-modules/vcRole/index.js b/ab-modules/vcRole/index.js deleted file mode 100644 index 7b9f647..0000000 --- a/ab-modules/vcRole/index.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Module to give a role to people in a vocal channel - * @author GoudronViande24 - */ - -const Localizer = require("artibot-localizer"); -const path = require("path"); - -module.exports = { - name: "vcRole", - - manifest: { - manifestVersion: 1, - moduleVersion: "1.2.0", - name: "VC Role", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "vcrole", - type: "global", - path: "index.js" - } - ] - }, - - execute({ client, log, config }) { - const localizer = new Localizer({ - lang: config.lang, - filePath: path.resolve(__dirname, "locales.json") - }); - config = require("./config.json"); - log("VC Role", localizer._("Ready.")); - - client.on("voiceStateUpdate", (oldState, newState) => { - const role = newState.guild.roles.cache.find(role => role.name.toLowerCase() == config.role.toLowerCase()); - - if (!role && config.debug) { - log("VC Role", localizer.__("Cannot find [[0]] role in server [[1]]", { placeholders: [config.role, newState.guild.name] }), "debug"); - }; - - if (!role) return; - - if (newState.channelId) { - newState.member.roles.add(role); - } else { - newState.member.roles.remove(role); - }; - }); - } -}; \ No newline at end of file diff --git a/ab-modules/vcRole/locales.json b/ab-modules/vcRole/locales.json deleted file mode 100644 index dc17705..0000000 --- a/ab-modules/vcRole/locales.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Ready.": { - "fr": "Prêt." - }, - - "Cannot find [[0]] role in server [[1]]": { - "fr": "Impossible de trouver le rôle [[0]] dans le serveur [[1]]" - } - } -} \ No newline at end of file From fa1157a18114c860ba4463ec2f1cad2c17b087c9 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 12 May 2022 17:44:43 -0400 Subject: [PATCH 54/68] remove some intents from default ones --- index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.js b/index.js index fe2eaa3..8b35098 100644 --- a/index.js +++ b/index.js @@ -156,8 +156,6 @@ export class Artibot { [ discord.Intents.FLAGS.GUILDS, discord.Intents.FLAGS.GUILD_MESSAGES, - discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS, - discord.Intents.FLAGS.GUILD_VOICE_STATES, discord.Intents.FLAGS.GUILD_MEMBERS, discord.Intents.FLAGS.GUILD_PRESENCES ], From 9d73de963a445b9ca168bc538b54a4abd69cd436 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 12 May 2022 17:49:11 -0400 Subject: [PATCH 55/68] Increment version number --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2763af1..4134c3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.5", + "version": "3.0.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.5", + "version": "3.0.6", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", diff --git a/package.json b/package.json index c35d5d6..d5b37e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.5", + "version": "3.0.6", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { From 9a021168d050d433ebd74ce5cec65c627f5ee97a Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 12 May 2022 17:59:20 -0400 Subject: [PATCH 56/68] move autoroles to own repo clear unused dependencies --- ab-modules/autoroles/config-example.json | 11 - ab-modules/autoroles/createrolepicker.js | 100 ------ ab-modules/autoroles/index.js | 33 -- ab-modules/autoroles/locales.json | 53 ---- ab-modules/autoroles/reactionroles.js | 29 -- ab-modules/autoroles/rolebutton.js | 62 ---- package-lock.json | 387 +++-------------------- package.json | 7 +- 8 files changed, 54 insertions(+), 628 deletions(-) delete mode 100644 ab-modules/autoroles/config-example.json delete mode 100644 ab-modules/autoroles/createrolepicker.js delete mode 100644 ab-modules/autoroles/index.js delete mode 100644 ab-modules/autoroles/locales.json delete mode 100644 ab-modules/autoroles/reactionroles.js delete mode 100644 ab-modules/autoroles/rolebutton.js diff --git a/ab-modules/autoroles/config-example.json b/ab-modules/autoroles/config-example.json deleted file mode 100644 index 3cff7d4..0000000 --- a/ab-modules/autoroles/config-example.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "allowNewPickers": true, - - "reactionRoles": [ - { - "messageId": "919056960865828865", - "reaction": "✅", - "roleId": "919056998727835660" - } - ] -} \ No newline at end of file diff --git a/ab-modules/autoroles/createrolepicker.js b/ab-modules/autoroles/createrolepicker.js deleted file mode 100644 index 13f06c9..0000000 --- a/ab-modules/autoroles/createrolepicker.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Command to create a role picker - * @author GoudronViande24 - * @since 2.0.0 - */ - -const { MessageActionRow, MessageButton, TextChannel, MessageEmbed, Permissions } = require("discord.js"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -/** @type {Boolean} */ -let enabled; - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -/** - * Send an error message - * @param {TextChannel} channel - The channel to send the error to - * @param {Object} config - Artibot's config - * @param {string} reason - The error description - * @returns {TextChannel} The error message - */ -async function sendErrorMessage(channel, config, reason) { - return await channel.send({ - embeds: [ - new MessageEmbed() - .setColor("RED") - .setTitle("Autorole") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(reason) - ] - }); -}; - -const allowedModes = [ - "toggle", - "addonly", - "removeonly" -]; - -module.exports = { - name: "createrolepicker", - description: localizer._("Create a role picker."), - usage: localizer._(""), - - async init({ log }) { - try { - enabled = require("./config.json").allowNewPickers; - } catch { - enabled = true; - log("Auto roles", localizer._("Configuration file not found or invalid. The createrolepicker command is enabled by default."), "warn"); - }; - }, - - async execute(message, args, { config }) { - // Check if command is enabled - if (!enabled) return sendErrorMessage(message.channel, config, localizer._("This command is disabled.")); - - // Check if user has admin permissions - if (!message.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR)) return sendErrorMessage(message.channel, config, - localizer._("You must be an administrator to use this command.") - ); - - // Check if there is an argument - if (!args.length) return sendErrorMessage(message.channel, config, localizer._("No arguments! Use the `help createrolepicker` command to learn more.")); - - const row = new MessageActionRow(); - args = args.join(" ").split(", "); - - args.slice(0, 5).forEach(arg => { - const settings = arg.split(":"); - - if (settings.length != 3 || !message.guild.roles.cache.get(settings[2]) || !allowedModes.includes(settings[1])) { - return sendErrorMessage( - message.channel, - config, - localizer.__("[[0]] is not valid.", { placeholders: [arg] }) - ); - }; - - row.addComponents( - new MessageButton() - .setLabel(settings[0]) - .setStyle("PRIMARY") - .setCustomId(`autorole-${settings[1]}-${settings[2]}`) - ); - }); - - await message.channel.send({ - components: [row] - }); - - message.delete(); - } -} \ No newline at end of file diff --git a/ab-modules/autoroles/index.js b/ab-modules/autoroles/index.js deleted file mode 100644 index 1ad166e..0000000 --- a/ab-modules/autoroles/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Autoroles module for Artibot - * Partly based on Node.js module discordjs-reaction-role - * @author GoudronViande24 - */ - -module.exports = { - manifest: { - manifestVersion: 1, - moduleVersion: "2.0.0", - name: "Auto roles", - supportedLocales: ["en", "fr"], - parts: [ - { - id: "reactionrole", - type: "global", - path: "reactionroles.js" - }, - - { - id: "autorole-*", - type: "button", - path: "rolebutton.js" - }, - - { - id: "createrolepicker", - type: "command", - path: "createrolepicker.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/autoroles/locales.json b/ab-modules/autoroles/locales.json deleted file mode 100644 index 0d8a9ce..0000000 --- a/ab-modules/autoroles/locales.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Requested mode is not valid!": { - "fr": "Le mode demandé n'est pas valide!" - }, - - "You no longer have the [[0]] role.": { - "fr": "Vous n'avez désormais plus le rôle [[0]]." - }, - - "You now have the [[0]] role.": { - "fr": "Vous avez maintenant le rôle [[0]]." - }, - - "Create a role picker.": { - "fr": "Créer un sélecteur de rôles." - }, - - "": { - "fr": "" - }, - - "Configuration file not found or invalid.": { - "fr": "Le fichier de configuration est introuvable ou est invalide." - }, - - "[[0]] is not valid.": { - "fr": "[[0]] n'est pas valide." - }, - - "No arguments! Use the `help createrolepicker` command to learn more.": { - "fr": "Pas d'arguments! Utilisez la commande `help createrolepicker` pour en savoir plus." - }, - - "You must be an administrator to use this command.": { - "fr": "Vous devez être un administrateur pour utiliser cette commande." - }, - - "Configuration file not found or invalid. The createrolepicker command is enabled by default.": { - "fr": "Le fichier de configuration est introuvable ou est invalide. La commande createrolepicker est activée par défaut." - }, - - "This command is disabled.": { - "fr": "Cette commande est désactivée." - } - } -} \ No newline at end of file diff --git a/ab-modules/autoroles/reactionroles.js b/ab-modules/autoroles/reactionroles.js deleted file mode 100644 index dcd7b34..0000000 --- a/ab-modules/autoroles/reactionroles.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Reaction roles for Artibot - * @author GoudronViande24 - * @since 1.0.0 - */ - -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - name: "Reaction roles", - - async execute({ client, log }) { - const ReactionRole = require("discordjs-reaction-role").default; - try { - const config = require("./config.json"); - - new ReactionRole(client, config.reactionRoles); - } catch { - return log("Reaction roles", localizer._("Configuration file not found or invalid.")); - }; - } -} \ No newline at end of file diff --git a/ab-modules/autoroles/rolebutton.js b/ab-modules/autoroles/rolebutton.js deleted file mode 100644 index 912e012..0000000 --- a/ab-modules/autoroles/rolebutton.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Auto role button - * @since 2.0.0 - * @author GoudronViande24 - */ - -const { MessageEmbed } = require("discord.js"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - id: "autorole-*", - - async execute(interaction, { config }) { - const roleId = interaction.customId.split("-")[2], - mode = interaction.customId.split("-")[1]; - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Autorole") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp(); - - const role = await interaction.guild.roles.fetch(roleId); - - switch (mode) { - case "toggle": - if (interaction.member.roles.cache.has(roleId)) { - await interaction.member.roles.remove(roleId); - embed.setDescription(localizer.__("You no longer have the [[0]] role.", { placeholders: [role.name] })); - } else { - await interaction.member.roles.add(roleId); - embed.setDescription(localizer.__("You now have the [[0]] role.", { placeholders: [role.name] })); - }; - break; - - case "addonly": - await interaction.member.roles.add(roleId); - embed.setDescription(localizer.__("You now have the [[0]] role.", { placeholders: [role.name] })); - break; - - case "removeonly": - await interaction.member.roles.remove(roleId); - embed.setDescription(localizer.__("You no longer have the [[0]] role.", { placeholders: [role.name] })); - break; - - default: - throw new Error(localizer._("Requested mode is not valid!")); - }; - - return await interaction.reply({ - embeds: [embed], - ephemeral: true - }) - } -}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4134c3b..42ab923 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.6", + "version": "3.0.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.6", + "version": "3.0.7", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", @@ -17,11 +17,8 @@ "discord-api-types": "^0.32.1", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", - "discordjs-reaction-role": "^3.0.0", "figlet": "^1.5.2", - "ms": "^2.1.3", - "path": "^0.12.7", - "whois": "^2.13.9" + "path": "^0.12.7" }, "devDependencies": { "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template", @@ -527,6 +524,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -535,6 +533,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -979,29 +978,6 @@ "node": ">= 0.2.0" } }, - "node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -1015,6 +991,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1025,7 +1002,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/color-support": { "version": "1.1.3", @@ -1130,14 +1108,6 @@ "ms": "^2.1.1" } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -1281,17 +1251,6 @@ "node": ">=12" } }, - "node_modules/discordjs-reaction-role": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/discordjs-reaction-role/-/discordjs-reaction-role-3.0.0.tgz", - "integrity": "sha512-FAwRM+ivCMSPzhHmf6OzrmnVdsQOv99RqPhjVZg4002674BCEIa+2BS97Il/ek6nsIsaT57rlPjJ3D7wBEHYwg==", - "engines": { - "node": ">=16.6" - }, - "peerDependencies": { - "discord.js": "^13.0.0" - } - }, "node_modules/dot-prop": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", @@ -1316,7 +1275,8 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/encoding": { "version": "0.1.13", @@ -1554,14 +1514,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-stdin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", @@ -1974,7 +1926,8 @@ "node_modules/ip": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.7.tgz", - "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==" + "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==", + "dev": true }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -2025,6 +1978,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -2683,7 +2637,8 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/negotiator": { "version": "0.6.3", @@ -3292,6 +3247,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, "engines": { "node": ">=6" } @@ -3380,6 +3336,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -3683,14 +3640,6 @@ "node": ">=8" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3700,11 +3649,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, "node_modules/requizzle": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", @@ -3872,7 +3816,8 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true }, "node_modules/signal-exit": { "version": "3.0.7", @@ -3899,6 +3844,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" @@ -3908,6 +3854,7 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "dev": true, "dependencies": { "ip": "^1.1.5", "smart-buffer": "^4.2.0" @@ -4039,6 +3986,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4052,6 +4000,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4205,7 +4154,8 @@ "node_modules/underscore": { "version": "1.13.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.3.tgz", - "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==" + "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==", + "dev": true }, "node_modules/unique-filename": { "version": "1.1.1", @@ -4420,24 +4370,6 @@ "node": ">= 8" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "node_modules/whois": { - "version": "2.13.9", - "resolved": "https://registry.npmjs.org/whois/-/whois-2.13.9.tgz", - "integrity": "sha512-W5KVS1dbWq2gfKP0mGqZoINdOgkIDfubq0FSOc8Oc1j3aQgAzbh6dn4yNt2jTUXLAougsVqNMqVMa8xp+tek2w==", - "dependencies": { - "socks": "^2.2.2", - "underscore": "^1.9.1", - "yargs": "^15.4.1" - }, - "bin": { - "whois": "bin.js" - } - }, "node_modules/wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", @@ -4529,11 +4461,6 @@ "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", "dev": true }, - "node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -4549,95 +4476,6 @@ "node": ">= 6" } }, - "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-parser/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -5045,12 +4883,14 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -5384,28 +5224,6 @@ "colors": "1.0.3" } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - }, - "dependencies": { - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - } - } - }, "clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -5419,6 +5237,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { "color-name": "~1.1.4" } @@ -5426,7 +5245,8 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "color-support": { "version": "1.1.3", @@ -5512,11 +5332,6 @@ "ms": "^2.1.1" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, "decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -5623,12 +5438,6 @@ } } }, - "discordjs-reaction-role": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/discordjs-reaction-role/-/discordjs-reaction-role-3.0.0.tgz", - "integrity": "sha512-FAwRM+ivCMSPzhHmf6OzrmnVdsQOv99RqPhjVZg4002674BCEIa+2BS97Il/ek6nsIsaT57rlPjJ3D7wBEHYwg==", - "requires": {} - }, "dot-prop": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", @@ -5647,7 +5456,8 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "encoding": { "version": "0.1.13", @@ -5825,11 +5635,6 @@ "wide-align": "^1.1.5" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, "get-stdin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", @@ -6157,7 +5962,8 @@ "ip": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.7.tgz", - "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==" + "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==", + "dev": true }, "is-binary-path": { "version": "2.1.0", @@ -6195,7 +6001,8 @@ "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true }, "is-glob": { "version": "4.0.3", @@ -6704,7 +6511,8 @@ "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "negotiator": { "version": "0.6.3", @@ -7148,7 +6956,8 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true }, "package-json": { "version": "6.5.0", @@ -7217,7 +7026,8 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true }, "path-is-absolute": { "version": "1.0.1", @@ -7440,22 +7250,12 @@ "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", "dev": true }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, "requizzle": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", @@ -7571,7 +7371,8 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true }, "signal-exit": { "version": "3.0.7", @@ -7594,12 +7395,14 @@ "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true }, "socks": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "dev": true, "requires": { "ip": "^1.1.5", "smart-buffer": "^4.2.0" @@ -7709,6 +7512,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -7719,6 +7523,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -7838,7 +7643,8 @@ "underscore": { "version": "1.13.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.3.tgz", - "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==" + "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==", + "dev": true }, "unique-filename": { "version": "1.1.1", @@ -8012,21 +7818,6 @@ "isexe": "^2.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "whois": { - "version": "2.13.9", - "resolved": "https://registry.npmjs.org/whois/-/whois-2.13.9.tgz", - "integrity": "sha512-W5KVS1dbWq2gfKP0mGqZoINdOgkIDfubq0FSOc8Oc1j3aQgAzbh6dn4yNt2jTUXLAougsVqNMqVMa8xp+tek2w==", - "requires": { - "socks": "^2.2.2", - "underscore": "^1.9.1", - "yargs": "^15.4.1" - } - }, "wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", @@ -8092,11 +7883,6 @@ "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", "dev": true }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -8109,75 +7895,6 @@ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - } - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - } - } - }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index d5b37e2..2343dd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.6", + "version": "3.0.7", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { @@ -51,11 +51,8 @@ "discord-api-types": "^0.32.1", "discord-giveaways": "^5.1.1", "discord.js": "^13.6.0", - "discordjs-reaction-role": "^3.0.0", "figlet": "^1.5.2", - "ms": "^2.1.3", - "path": "^0.12.7", - "whois": "^2.13.9" + "path": "^0.12.7" }, "devDependencies": { "jsdoc": "^3.6.10", From ea668cbd1afa43bfffee9dfe7c908d2995baf253 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Fri, 13 May 2022 17:51:31 -0400 Subject: [PATCH 57/68] fix iteration problem with modules --- events/triggerHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/triggerHandler.js b/events/triggerHandler.js index 6ff84b1..d47d2d6 100644 --- a/events/triggerHandler.js +++ b/events/triggerHandler.js @@ -14,7 +14,7 @@ export async function execute(message, artibot) { const { log } = artibot; - for (const module of artibot.modules) { + for (const [, module] of artibot.modules) { for (const part of module.parts) { if (part.type != "trigger") continue; for (const trigger of part.triggers) { From 66af1c92f89ab4040aae6547618b555188841694 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 11:28:21 -0400 Subject: [PATCH 58/68] Move giveaways module to own repo --- ab-modules/giveaways/.gitignore | 1 - ab-modules/giveaways/giveaways.js | 657 ------------------------------ ab-modules/giveaways/index.js | 21 - ab-modules/giveaways/locales.json | 213 ---------- 4 files changed, 892 deletions(-) delete mode 100644 ab-modules/giveaways/.gitignore delete mode 100644 ab-modules/giveaways/giveaways.js delete mode 100644 ab-modules/giveaways/index.js delete mode 100644 ab-modules/giveaways/locales.json diff --git a/ab-modules/giveaways/.gitignore b/ab-modules/giveaways/.gitignore deleted file mode 100644 index 6320cd2..0000000 --- a/ab-modules/giveaways/.gitignore +++ /dev/null @@ -1 +0,0 @@ -data \ No newline at end of file diff --git a/ab-modules/giveaways/giveaways.js b/ab-modules/giveaways/giveaways.js deleted file mode 100644 index a64db8b..0000000 --- a/ab-modules/giveaways/giveaways.js +++ /dev/null @@ -1,657 +0,0 @@ -/** - * Giveaway module based on discord-giveaways by androz2091 - * @author GoudronViande24 - * @since 1.0.0 - */ - -const { MessageEmbed, Permissions } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const { GiveawaysManager } = require('discord-giveaways'); -const fs = require("fs"); -const path = require("path"); -const ms = require('ms'); -const Localizer = require("artibot-localizer"); -const { locale } = require("../../config.json"); - -var manager; -const localizer = new Localizer({ - filePath: path.resolve(__dirname, "locales.json"), - lang: locale -}); - -module.exports = { - // ######################################## - // Create the command with all the options - // ######################################## - - data: new SlashCommandBuilder() - .setName("giveaway") - .setDescription(localizer._("Create and manage giveaways.")) - .addSubcommand(subcommand => - subcommand - .setName('create') - .setDescription(localizer._("Create a giveaway")) - .addStringOption(option => - option - .setName("prize") - .setDescription(localizer._("The prize to win in this giveaway.")) - .setRequired(true) - ) - .addStringOption(option => - option - .setName("duration") - .setDescription(localizer._("Time before the end of the giveaway. Examples: '5h', '2d'")) - .setRequired(true) - ) - .addIntegerOption(option => - option - .setName("winners") - .setDescription(localizer._("How much people will win the prize")) - .setRequired(true) - ) - .addUserOption(option => - option - .setName("host") - .setDescription(localizer._("User that will host the giveaway (sponsor, donator, etc.). By default, it is you.")) - ) - .addChannelOption(option => - option - .setName("channel") - .setDescription(localizer._("The channel in which to publish the giveaway.")) - ) - ) - .addSubcommand(subcommand => - subcommand - .setName('create-drop') - .setDescription('Créer un drop') - .addStringOption(option => - option - .setName("prize") - .setDescription(localizer._("The prize to win in this drop.")) - .setRequired(true) - ) - .addIntegerOption(option => - option - .setName("winners") - .setDescription(localizer._("How much people will win the prize")) - .setRequired(true) - ) - .addUserOption(option => - option - .setName("host") - .setDescription(localizer._("User that will host the giveaway (sponsor, donator, etc.). By default, it is you.")) - ) - .addChannelOption(option => - option - .setName("channel") - .setDescription(localizer._("The channel in which to start the drop.")) - ) - ) - .addSubcommand(subcommand => - subcommand - .setName('reroll') - .setDescription(localizer._("Find new winner(s) for an ended giveaway")) - .addStringOption(option => - option - .setName("id") - .setDescription(localizer._("The giveaway's message ID.")) - .setRequired(true) - ) - ) - .addSubcommand(subcommand => - subcommand - .setName('edit') - .setDescription(localizer._("Edit a giveaway.")) - .addStringOption(option => - option - .setName("id") - .setDescription(localizer._("The giveaway's message ID.")) - .setRequired(true) - ) - .addStringOption(option => - option - .setName("option") - .setDescription(localizer._("What to edit in the giveaway?")) - .addChoice(localizer._("How much people will win the prize"), "winnerCount") - .addChoice(localizer._("Prize to win"), "prize") - .addChoice(localizer._("Add time"), "time") - .setRequired(true) - ) - .addStringOption(option => - option - .setName("value") - .setDescription(localizer._("The value of the option to edit.")) - .setRequired(true) - ) - ) - .addSubcommand(subcommand => - subcommand - .setName('end') - .setDescription(localizer._("Ends a giveaway immediately.")) - .addStringOption(option => - option - .setName("id") - .setDescription(localizer._("The giveaway's message ID.")) - .setRequired(true) - ) - ), - - // ######################################## - // Initialize the manager on bot statup - // ######################################## - - async init({ client, config, log }) { - // Verify that the data directory exists - if (!fs.existsSync(path.resolve(__dirname, "data", "giveaways.json"))) { - if (!fs.existsSync(path.resolve(__dirname, "data"))) { - log("Giveaways", localizer._("Creating the directory to store the data")); - fs.mkdirSync(path.resolve(__dirname, "data")); - }; - }; - - // Karens are gonna ask for this - manager = new GiveawaysManager(client, { - storage: path.resolve(__dirname, "data", "giveaways.json"), - default: { - botsCanWin: false, - embedColor: config.embedColor, - embedColorEnd: '#000000', - reaction: '🎉' - } - }); - - log("Giveaways", localizer._("Ready.")); - }, - - async execute(interaction, { config }) { - const command = interaction.options.getSubcommand(); - - // ######################################## - // End subcommand - // ######################################## - - if (command == "end") { - const messageId = interaction.options.getString("id"); - const giveaway = manager.giveaways.find((g) => g.guildId === interaction.guildId && g.messageId === messageId); - - if (!giveaway) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Giveaway not found.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - const isGiveawayOwner = giveaway.hostedBy.slice(0, -1).substring(2) == interaction.member.id; - const isAdmin = interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR); - - if (!isAdmin && !isGiveawayOwner) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("**You cannot execute this command.**\nYou must have the administrator permissions or be the host of the giveaway.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - if (giveaway.ended) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("The giveaway is already ended.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - var embed = await manager.end(messageId).then(() => { - return new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("The giveaway has been ended successfully.")); - }) - .catch(() => { - return new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("An error occured.")); - }); - }; - - // ######################################## - // Edit subcommand - // ######################################## - - if (command == "edit") { - const messageId = interaction.options.getString("id"); - const giveaway = manager.giveaways.find((g) => g.guildId === interaction.guildId && g.messageId === messageId); - - if (!giveaway) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Giveaway not found.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - const isGiveawayOwner = giveaway.hostedBy.slice(0, -1).substring(2) == interaction.member.id; - const isAdmin = interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR); - - if (!isAdmin && !isGiveawayOwner) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("**You cannot execute this command.**\nYou must have the administrator permissions or be the host of the giveaway.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - if (giveaway.ended) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Cannot edit an ended giveaway.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - const option = interaction.options.getString("option"); - const value = interaction.options.getString("value"); - - if (option == "winnerCount") { - if (!isNaN(value) && parseInt(value) > 0) { - var settings = { newWinnerCount: parseInt(value) }; - } else { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Entered value is invalid.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - }; - - if (option == "prize") { - var settings = { newPrize: value }; - }; - - if (option == "time") { - /** - * Check if duration is valid - * @since 2.1.1 - */ - if (!ms(value)) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer.__("`[[0]]` is not a valid duration.", { placeholders: [duration] })); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - var settings = { addTime: ms(value) }; - }; - - var embed = await manager.edit(messageId, settings).then(() => { - return new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("The giveaway has been edited.")); - }) - .catch(() => { - return new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("An error occured.")); - }); - }; - - // ######################################## - // Reroll subcommand - // ######################################## - - if (command == "reroll") { - const messageId = interaction.options.getString("id"); - const giveaway = manager.giveaways.find((g) => g.guildId === interaction.guildId && g.messageId === messageId); - - if (!giveaway) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Giveaway not found.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - const isGiveawayOwner = giveaway.hostedBy.slice(0, -1).substring(2) == interaction.member.id; - const isAdmin = interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR); - - if (!isAdmin && !isGiveawayOwner) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("**You cannot execute this command.**\nYou must have the administrator permissions or be the host of the giveaway.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - var embed = await manager.reroll(messageId, { - winnerCount: 1, - messages: { - congrat: localizer._("Congratulations, {winners}! 🎉\nYou just won **{this.prize}**!"), - error: localizer._("No valid entry, impossible to choose a new winner for **{this.prize}**.") - } - }).then(() => { - return new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("Giveaway has been rerolled.")); - }) - .catch(() => { - return new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("An error occured.")); - }); - }; - - // ######################################## - // Create subcommand - // ######################################## - - if (command == "create") { - if (interaction.options.getChannel("channel")) { - var isSameGuild = interaction.channel.guild.id == interaction.options.getChannel("channel").guild.id; - } else var isSameGuild = true; - - if (!interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR) && isSameGuild) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("**You cannot execute this command.**\nYou must have the administrator permissions.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - const duration = interaction.options.getString("duration"), - winnerCount = interaction.options.getInteger('winners'), - prize = interaction.options.getString('prize'); - - if (interaction.options.getChannel("channel")) { - var channel = interaction.options.getChannel("channel"); - if (channel.type !== "GUILD_TEXT") { - return interaction.reply({ - content: localizer._("Impossible to create a giveaway in this channel."), - ephemeral: true - }); - }; - } else { - var channel = interaction.channel; - } - - if (interaction.options.getUser("host")) { - var hostedBy = interaction.options.getUser("host"); - } else { - var hostedBy = interaction.member.user; - }; - - /** - * Check if duration is valid - * @since 2.1.1 - */ - if (!ms(duration) || ms(duration) < 1) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer.__("`[[0]]` is not a valid duration.", { placeholders: [duration] })); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - /** - * Check if there is at least one winner - * @since 2.1.1 - */ - if (!winnerCount || winnerCount < 1) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("You must have at least one winner!")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - await manager.start(channel, { - duration: ms(duration), - winnerCount, - prize, - hostedBy, - messages: { - giveawayEnded: localizer._("Giveaway ended."), - inviteToParticipate: localizer._("React with 🎉 to participate!"), - winMessage: localizer._("🎉 Congratulations, {winners}! 🎉\nYou just won **{this.prize}**!"), - drawing: localizer._("Draw ({this.winnerCount} winner(s)): {timestamp}."), - embedFooter: { - text: config.botName, - iconURL: config.botIcon - }, - noWinner: localizer._("Giveaway canceled, no valid entry."), - winners: localizer._("Winner(s):"), - endedAt: localizer._("Ended on"), - hostedBy: localizer._("Hosted by {this.hostedBy}") - } - }); - - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("The giveaway has been created!")); - }; - - // ######################################## - // Create drop subcommand - // ######################################## - - if (command == "create-drop") { - if (interaction.options.getChannel("channel")) { - var isSameGuild = interaction.channel.guild.id == interaction.options.getChannel("channel").guild.id; - } else var isSameGuild = true; - - if (!interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR) && isSameGuild) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("**You cannot execute this command.**\nYou must have the administrator permissions.")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - const winnerCount = interaction.options.getInteger("winners"), - prize = interaction.options.getString("prize"); - - if (interaction.options.getChannel("channel")) { - var channel = interaction.options.getChannel("channel"); - if (channel.type !== "GUILD_TEXT") { - return interaction.reply({ - content: localizer._("Impossible to create a giveaway in this channel."), - ephemeral: true - }); - }; - } else { - var channel = interaction.channel; - } - - if (interaction.options.getUser("host")) { - var hostedBy = interaction.options.getUser("host"); - } else { - var hostedBy = interaction.member.user; - }; - - /** - * Check if there is at least one winner - * @since 2.1.1 - */ - if (!winnerCount || winnerCount < 1) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("You must have at least one winner!")); - - await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - - return - }; - - await manager.start(channel, { - duration: ms("1d"), - winnerCount, - prize, - hostedBy, - messages: { - dropMessage: localizer._("Be the first to react with 🎉 to win!\n{this.winnerCount} winner(s)"), - giveawayEnded: localizer._("Drop ended."), - winMessage: localizer._("🎉 Congratulations, {winners}! 🎉\nYou just won **{this.prize}**!"), - embedFooter: { - text: config.botName, - iconURL: config.botIcon - }, - noWinner: localizer._("Drop canceled, no valid entry."), - winners: localizer._("Winner(s):"), - endedAt: localizer._("Ended on"), - hostedBy: localizer._("Hosted by {this.hostedBy}") - }, - isDrop: true - }); - - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Giveaways") - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(localizer._("The drop has been started!")); - }; - - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); - } -}; diff --git a/ab-modules/giveaways/index.js b/ab-modules/giveaways/index.js deleted file mode 100644 index 2af3a77..0000000 --- a/ab-modules/giveaways/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Manifest file for giveaways module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "2.1.1", - name: "Giveaways", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "giveaways", - type: "slashcommand", - path: "giveaways.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/giveaways/locales.json b/ab-modules/giveaways/locales.json deleted file mode 100644 index 36e110a..0000000 --- a/ab-modules/giveaways/locales.json +++ /dev/null @@ -1,213 +0,0 @@ -{ - "version": "1.0.1", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Get the current value of a cryptocurrency.": { - "fr": "Voir la valeur de certaines cryptomonaies." - }, - - "The cryptocurrency to look for": { - "fr": "La cryptomonnaie à vérifier" - }, - - "Actual value": { - "fr": "Valeur actuelle" - }, - - "Data fetched from Coinbase": { - "fr": "Données fournies par Coinbase" - }, - - "Create and manage giveaways.": { - "fr": "Créer et gérer des giveaways." - }, - - "Create a giveaway": { - "fr": "Créer un giveaway" - }, - - "The prize to win in this giveaway.": { - "fr": "Le prix qui sera à gagner dans le giveaway." - }, - - "Time before the end of the giveaway. Examples: '5h', '2d'": { - "fr": "Le temps avant la fin du giveaway. Exemples: '5h', '2d'" - }, - - "How much people will win the prize": { - "fr": "Nombre de gagnants" - }, - - "User that will host the giveaway (sponsor, donator, etc.). By default, it is you.": { - "fr": "Utilisateur qui héberge le giveaway (sponsor, donateur, etc.). Par défaut, c'est toi." - }, - - "The channel in which to publish the giveaway.": { - "fr": "Le salon dans lequel le giveaway sera publié." - }, - - "The prize to win in this drop.": { - "fr": "Le prix qui sera à gagner dans le drop." - }, - - "The channel in which to start the drop.": { - "fr": "Le salon dans lequel le drop sera lancé." - }, - - "Find new winner(s) for an ended giveaway": { - "fr": "Trouver un ou plusieurs nouveau(x) gagnant(s) pour un giveaway terminé" - }, - - "The giveaway's message ID.": { - "fr": "Le ID du message du giveaway." - }, - - "Edit a giveaway.": { - "fr": "Modifier un giveaway." - }, - - "What to edit in the giveaway?": { - "fr": "Quelle option modifier dans le giveaway?" - }, - - "Prize to win": { - "fr": "Prix à gagner" - }, - - "Add time": { - "fr": "Ajouter du temps" - }, - - "The value of the option to edit.": { - "fr": "La valeur de la modification." - }, - - "Ends a giveaway immediately.": { - "fr": "Termine immédiatement un giveaway." - }, - - "Creating the directory to store the data": { - "fr": "Création du dossier pour le stockage des données" - }, - - "Ready.": { - "fr": "Prêt." - }, - - "Giveaway not found.": { - "fr": "Giveaway introuvable." - }, - - "**You cannot execute this command.**\nYou must have the administrator permissions or be the host of the giveaway.": { - "fr": "**Vous ne pouvez pas exécuter cette commande.**\nVous devez avoir les permissions administrateur ou être celui qui héberge le giveaway." - }, - - "The giveaway is already ended.": { - "fr": "Le giveaway est déjà terminé." - }, - - "The giveaway has been ended successfully.": { - "fr": "Le giveaway a bien été terminé." - }, - - "An error occured.": { - "fr": "Une erreur est survenue." - }, - - "Cannot edit an ended giveaway.": { - "fr": "Impossible de modifier un giveaway terminé." - }, - - "Entered value is invalid.": { - "fr": "La valeur entrée est invalide." - }, - - "The giveaway has been edited.": { - "fr": "Le giveaway a bien été modifié." - }, - - "Congratulations, {winners}! 🎉\nYou just won **{this.prize}**!": { - "fr": "🎉 Félicitations, {winners}! 🎉\nVous avez gagné **{this.prize}**!" - }, - - "No valid entry, impossible to choose a new winner for **{this.prize}**.": { - "fr": "Aucun participant valide, impossible de désigner un gagnant pour **{this.prize}**." - }, - - "Giveaway has been rerolled.": { - "fr": "Le reroll a été effectué." - }, - - "**You cannot execute this command.**\nYou must have the administrator permissions.": { - "fr": "**Vous ne pouvez pas exécuter cette commande.**\nVous devez avoir les permissions administrateur." - }, - - "Impossible to create a giveaway in this channel.": { - "fr": "Impossible de créer le giveaway dans ce channel." - }, - - "Giveaway ended.": { - "fr": "Giveaway terminé." - }, - - "React with 🎉 to participate!": { - "fr": "Réagis avec 🎉 pour participer!" - }, - - "🎉 Congratulations, {winners}! 🎉\nYou just won **{this.prize}**!": { - "fr": "🎉 Félicitations, {winners}! 🎉\nVous avez gagné **{this.prize}**!" - }, - - "Draw ({this.winnerCount} winner(s)): {timestamp}.": { - "fr": "Tirage ({this.winnerCount} gagnant(s)): {timestamp}." - }, - - "Giveaway canceled, no valid entry.": { - "fr": "Giveaway annulé, aucun participant n'est éligible." - }, - - "Winner(s):": { - "fr": "Gagnant(s):" - }, - - "Ended on": { - "fr": "Terminait le" - }, - - "Hosted by {this.hostedBy}": { - "fr": "Présenté par {this.hostedBy}" - }, - - "The giveaway has been created!": { - "fr": "Le giveaway a bien été créé!" - }, - - "Be the first to react with 🎉 to win!\n{this.winnerCount} winner(s)": { - "fr": "Soyez le premier à réagir avec 🎉 pour gagner!\n{this.winnerCount} gagnant(s)" - }, - - "Drop ended.": { - "fr": "Drop terminé." - }, - - "Drop canceled, no valid entry.": { - "fr": "Drop annulé, aucun participant n'est éligible." - }, - - "The drop has been started!": { - "fr": "Le drop a bien été lancé!" - }, - - "`[[0]]` is not a valid duration.": { - "fr": "`[[0]]` n'est pas une durée valide." - }, - - "You must have at least one winner!": { - "fr": "Il doit y avoir au moins un gagnant!" - } - } -} \ No newline at end of file From 97110ba6e99f29f07d3c93822b3922d05df78a4b Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 12:40:09 -0400 Subject: [PATCH 59/68] Move documentation plugin to own repo --- ab-modules/documentation/config-example.json | 24 ---------- ab-modules/documentation/documentation.js | 47 -------------------- ab-modules/documentation/index.js | 20 --------- 3 files changed, 91 deletions(-) delete mode 100644 ab-modules/documentation/config-example.json delete mode 100644 ab-modules/documentation/documentation.js delete mode 100644 ab-modules/documentation/index.js diff --git a/ab-modules/documentation/config-example.json b/ab-modules/documentation/config-example.json deleted file mode 100644 index 5ff2b5b..0000000 --- a/ab-modules/documentation/config-example.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "Documentation", - "commandName": "documentation", - "commandDescription": "Obtenir de l'aide.", - "argName": "page", - "argDescription": "Le nom de la page à consulter.", - "pages": [ - { - "name": "Général", - "content": "Plein d'informations à propos de quelque-chose.\n\n**Supporte le markdown Discord.**\n[Même des liens custom!](https://artivain.com)" - }, - { - "name": "Page avec plus de trucs", - "content": "Exemple pour une deuxième page dans la commande. Celle-ci a une icône, une image et un auteur, tous des paramètres facultatifs.", - "icon": "https://artivain.com/wp-content/uploads/2021/01/logo-artivain-nouveau-fav-512.png", - "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/960px-Image_created_with_a_mobile_phone.png", - "author": { - "name": "GoudronViande24", - "iconURL": "https://artivain.com/wp-content/uploads/2021/01/logo-artivain-nouveau-fav-512.png", - "url": "https://github.com/GoudronViande24" - } - } - ] -} \ No newline at end of file diff --git a/ab-modules/documentation/documentation.js b/ab-modules/documentation/documentation.js deleted file mode 100644 index 1d99516..0000000 --- a/ab-modules/documentation/documentation.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Documentation module - * Allows to create a custom help command from a simple json file. - * @author GoudronViande24 - * @since 1.0.0 - */ - -const { MessageEmbed } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const { name, commandName, commandDescription, argName, argDescription, pages } = require("./config.json"); - -var choices = []; -pages.forEach(page => choices.push([page.name, page.name])); - -module.exports = { - // Create command data to register it in Discord's API - data: new SlashCommandBuilder() - .setName(commandName) - .setDescription(commandDescription) - .addStringOption(option => - option - .setName(argName) - .setDescription(argDescription) - .setRequired(true) - .addChoices(choices) - ), - - async execute(interaction, { config }) { - const page = pages.find(page => page.name == interaction.options.getString(argName)); - - var embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle(`${name} | ${page.name}`) - .setTimestamp() - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setDescription(page.content); - - if (page.icon) embed.setThumbnail(page.icon); - if (page.image) embed.setImage(page.image); - if (page.author) embed.setAuthor(page.author); - - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); - } -}; diff --git a/ab-modules/documentation/index.js b/ab-modules/documentation/index.js deleted file mode 100644 index 5824e5c..0000000 --- a/ab-modules/documentation/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// Manifest file for documentation module - -const config = require("./config.json"); - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "1.1.0", - name: "Documentation", - supportedLocales: "any", - parts: [ - { - id: config.commandName, - type: "slashcommand", - path: "documentation.js" - } - ] - } -}; \ No newline at end of file From 5ccd3316c7789b82e8c3c0603a527428fafe7906 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 14:48:05 -0400 Subject: [PATCH 60/68] save custom config for module before loading them --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8b35098..af6eca3 100644 --- a/index.js +++ b/index.js @@ -191,6 +191,8 @@ export class Artibot { * @method */ registerModule = (module, config = {}) => { + this.config[module.id] = config; + if (typeof module == "function") { try { module = module(this); @@ -213,7 +215,6 @@ export class Artibot { } if (Object.entries(config).length !== 0) { - this.config[module.id] = config; log("Artibot", this.localizer.__("Custom configuration for [[0]] saved.", { placeholders: [module.name] }), "log", true); } } From f8ce41735fcdce9f52586623ed38b047c9c86a41 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 19:23:48 -0400 Subject: [PATCH 61/68] save custom config for module before loading them From 3acd240d5c50161def8cd54e40ff4a0a615a9371 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 19:24:28 -0400 Subject: [PATCH 62/68] Revert last changes I miss some braincells sometime --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index af6eca3..8b35098 100644 --- a/index.js +++ b/index.js @@ -191,8 +191,6 @@ export class Artibot { * @method */ registerModule = (module, config = {}) => { - this.config[module.id] = config; - if (typeof module == "function") { try { module = module(this); @@ -215,6 +213,7 @@ export class Artibot { } if (Object.entries(config).length !== 0) { + this.config[module.id] = config; log("Artibot", this.localizer.__("Custom configuration for [[0]] saved.", { placeholders: [module.name] }), "log", true); } } From c939ebda2ddeaaa57e104a12caf26fc5b56d1d2f Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 19:28:01 -0400 Subject: [PATCH 63/68] Make an update of the package to revert last changes --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42ab923..b853e73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.7", + "version": "3.0.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.7", + "version": "3.0.8", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", diff --git a/package.json b/package.json index 2343dd3..e8678cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.7", + "version": "3.0.8", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": { From f3129ce460dc7b8f74e8677aceb9a464677acb38 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Sun, 15 May 2022 19:31:55 -0400 Subject: [PATCH 64/68] Pass custom config to module on register --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8b35098..057e234 100644 --- a/index.js +++ b/index.js @@ -186,14 +186,14 @@ export class Artibot { /** * Register a module in Artibot - * @param {Module|function(Artibot): Module} module - The module to register or a function to initialize the module + * @param {Module|function(Artibot, Object): Module} module - The module to register or a function to initialize the module * @param {Object} [config] - Custom configuration for the module. See module documentation to learn more. * @method */ registerModule = (module, config = {}) => { if (typeof module == "function") { try { - module = module(this); + module = module(this, config); } catch (err) { this.log("Artibot", this.localizer._("Error when registering module: ") + err, "err", true); process.exit(1); From 7a8327c4d56fedc98489e28f033cc5c7118c6eba Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Mon, 16 May 2022 20:38:30 -0400 Subject: [PATCH 65/68] move moderation to own repo --- ab-modules/moderation/index.js | 39 ------- ab-modules/moderation/locales.json | 113 -------------------- ab-modules/moderation/mute.js | 150 --------------------------- ab-modules/moderation/purge.js | 92 ---------------- ab-modules/moderation/purgebutton.js | 55 ---------- ab-modules/moderation/unmute.js | 124 ---------------------- 6 files changed, 573 deletions(-) delete mode 100644 ab-modules/moderation/index.js delete mode 100644 ab-modules/moderation/locales.json delete mode 100644 ab-modules/moderation/mute.js delete mode 100644 ab-modules/moderation/purge.js delete mode 100644 ab-modules/moderation/purgebutton.js delete mode 100644 ab-modules/moderation/unmute.js diff --git a/ab-modules/moderation/index.js b/ab-modules/moderation/index.js deleted file mode 100644 index 20d7b9d..0000000 --- a/ab-modules/moderation/index.js +++ /dev/null @@ -1,39 +0,0 @@ -// Manifest file for moderation module - -module.exports = { - manifest: { - - manifestVersion: 1, - moduleVersion: "1.2.0", - name: "Moderation", - supportedLocales: [ - "en", - "fr" - ], - parts: [ - { - id: "mute", - type: "slashcommand", - path: "mute.js" - }, - - { - id: "unmute", - type: "slashcommand", - path: "unmute.js" - }, - - { - id: "purge", - type: "slashcommand", - path: "purge.js" - }, - - { - id: "purge-*", - type: "button", - path: "purgebutton.js" - } - ] - } -}; \ No newline at end of file diff --git a/ab-modules/moderation/locales.json b/ab-modules/moderation/locales.json deleted file mode 100644 index f4a6472..0000000 --- a/ab-modules/moderation/locales.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "version": "1.0.0", - "localizerVersion": 1, - "default": "en", - "contributors": [ - "GoudronViande24" - ], - "strings": { - "Mute a user.": { - "fr": "Réduire au silence total un utilisateur." - }, - - "The user to mute.": { - "fr": "L'utilisateur à rendre muet." - }, - - "How much time the user must stay muted. Examples: '5m', '1h'.": { - "fr": "Le temps pendant lequel l'utilisateur sera muet. Exemples: '5m', '1h'." - }, - - "The reason why the user gets muted.": { - "fr": "La raison du mute de l'utilisateur." - }, - - "No reason given.": { - "fr": "Aucune raison fournie." - }, - - "You don't have the required permissions to execute this command!": { - "fr": "Vous n'avez pas la permission de faire cette commande!" - }, - - "`[[0]]` is not a valid duration.": { - "fr": "`[[0]]` n'est pas une durée valide." - }, - - "You have been muted by [[0]] for [[1]] on **[[1]]** server.": { - "fr": "Vous avez été réduit au silence par [[0]] pendant [[1]] sur **[[1]]**." - }, - - "Reason": { - "fr": "Raison" - }, - - "[[0]] has been muted for [[1]].": { - "fr": "[[0]] a bien été réduit au silence pour [[1]]." - }, - - "Note": { - "fr": "Note" - }, - - "This user does not accept DMs and so has not been warned in DM.": { - "fr": "Cet utilisateur n'accepte pas les messages privés et n'a donc pas été averti en privé." - }, - - "An error occured while trying to send a DM to the user.": { - "fr": "Une erreur est survenue en essayant d'avertir l'utilisateur en privé." - }, - - "I don't have required permissions to mute this user!": { - "fr": "Je n'ai pas les permissions requises pour rendre muet cet utilisateur!" - }, - - "An error occured.": { - "fr": "Une erreur est survenue." - }, - - "Unmutes a user.": { - "fr": "Redonner le droit de parole à un utilisateur." - }, - - "The user to unmute.": { - "fr": "L'utilisateur auquel rendre la parole." - }, - - "This user is not muted...\nA second mouth would be weird, right?": { - "fr": "Cet utilisateur n'est pas muet...\nUne deuxième bouche serait bizarre, non?" - }, - - "[[0]] unmuted you on **[[1]]**.": { - "fr": "[[0]] vient de vous redonner le droit de parler sur **[[1]]**." - }, - - "[[0]] got his voice back.": { - "fr": "[[0]] a bien retrouvé sa voix." - }, - - "Mass delete messages.": { - "fr": "Supprimer en masse des messages." - }, - - "How much messages to delete?": { - "fr": "Combien de messages supprimer?" - }, - - "Deleted [[0]] messages.": { - "fr": "[[0]] messages supprimés." - }, - - "By the way, I cannot delete messages older than 2 weeks.": { - "fr": "En passant, je ne peux pas supprimer les messages plus vieux que 2 semaines." - }, - - "**Error:** You do not have the required permissions to use this command!": { - "fr": "**Erreur:** Vous n'avez pas les permissions requises pour utiliser cette commande!" - }, - - "Delete [[0]] more": { - "fr": "Supprimer [[0]] de plus" - } - } -} \ No newline at end of file diff --git a/ab-modules/moderation/mute.js b/ab-modules/moderation/mute.js deleted file mode 100644 index 3421ede..0000000 --- a/ab-modules/moderation/mute.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Mute command - * Uses Discord timeout feature added in Discord.js 13.4.0 - * @author GoudronViande24 - * @since 1.0.0 - */ - -const { MessageEmbed, Permissions } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const ms = require("ms"); -const humanizeDuration = require("humanize-duration"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - // The data needed to register slash commands to Discord. - data: new SlashCommandBuilder() - .setName("mute") - .setDescription(localizer._("Mute a user.")) - .addUserOption(option => - option.setName("user") - .setDescription(localizer._("The user to mute.")) - .setRequired(true) - ) - .addStringOption(option => - option - .setName("duration") - .setDescription(localizer._("How much time the user must stay muted. Examples: '5m', '1h'.")) - .setRequired(true) - ) - .addStringOption(option => - option - .setName("reason") - .setDescription(localizer._("The reason why the user gets muted.")) - ), - - async execute(interaction, { config, log }) { - const user = interaction.options.getUser("user"), - guild = interaction.guild, - moderator = interaction.member, - time = interaction.options.getString("duration"), - reason = interaction.options.getString("reason"), - logsReason = `${moderator.user.username} -> ${reason ? reason : localizer._("No reason given.")}`, - humanTime = humanizeDuration(ms(time), { - language: config.locale, - delimiter: ", ", - largest: 2, - round: true, - units: ["y", "mo", "w", "d", "h", "m", "s"] - }); - - // Check for required permissions - if (!moderator.permissions.has([Permissions.FLAGS.MODERATE_MEMBERS])) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Mute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("You don't have the required permissions to execute this command!")); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - // Check if time requested is valid - if (ms(time) < ms("5s") || ms(time) > ms("4w")) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Mute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("`[[0]]` is not a valid duration.", { placeholders: [time] })); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - // Get the member, because for some reason Discord returns a user - const member = await guild.members.fetch(user.id).then(m => { return m }); - - // Try to timeout the member and create the embed according to what happens - var embed = await member.timeout(ms(time), logsReason) - .then(async member => { - const dmEmbed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Mute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("You have been muted by [[0]] for [[1]] on **[[1]]** server.", { placeholders: [moderator, humanTime, guild.name] })); - - if (reason) dmEmbed.addField("Reason", reason); - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Mute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("[[0]] has been muted for [[1]].", { placeholders: [member, humanTime] })); - - // Send DM to muted user to inform him of the reason and the moderator - await member.send({ embeds: [dmEmbed] }) - .catch(error => { - if (error == "DiscordAPIError: Cannot send messages to this user") { - embed.addField(localizer._("Note"), localizer._("This user does not accept DMs and so has not been warned in DM.")).setColor("YELLOW"); - } else { - embed.addField(localizer._("Note"), localizer._("An error occured while trying to send a DM to the user.")).setColor("ORANGE"); - log("Moderation", error); - }; - }); - - return embed - }) - .catch(error => { - if (error == "DiscordAPIError: Missing Permissions") { - var errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Mute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("I don't have required permissions to mute this user!")); - } else { - console.log(error); - var errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Mute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("An error occured.")); - }; - - return errorEmbed - }); - - // finally send the response - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); - } -}; \ No newline at end of file diff --git a/ab-modules/moderation/purge.js b/ab-modules/moderation/purge.js deleted file mode 100644 index ef27f26..0000000 --- a/ab-modules/moderation/purge.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Purge command - * @author GoudronViande24 - * @since 1.2.0 - */ - -const { MessageEmbed, Permissions, MessageActionRow, MessageButton } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - data: new SlashCommandBuilder() - .setName("purge") - .setDescription(localizer._("Mass delete messages.")) - .addIntegerOption(option => - option.setName("amount") - .setDescription(localizer._("How much messages to delete?")) - .setRequired(true) - .setMaxValue(100) - .setMinValue(0) - ), - - async execute(interaction, { config }) { - if (!interaction.memberPermissions.has(Permissions.FLAGS.MANAGE_MESSAGES)) { - return await interaction.reply({ - embeds: [ - new MessageEmbed() - .setColor("RED") - .setTitle("Purge") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("**Error:** You do not have the required permissions to use this command!")) - ], - ephemeral: true - }); - }; - - const amount = interaction.options.getInteger("amount"); - - const deleted = await interaction.channel.bulkDelete(amount, true); - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Purge") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription( - localizer.__("Deleted [[0]] messages.", { placeholders: [deleted.size] }) + ( - deleted.size < 1 ? "\n\n" + localizer._("By the way, I cannot delete messages older than 2 weeks.") : "" - ) - ); - - const row = new MessageActionRow() - .addComponents( - new MessageButton() - .setLabel(localizer.__("Delete [[0]] more", { placeholders: [5] })) - .setStyle("DANGER") - .setCustomId("purge-5") - ) - .addComponents( - new MessageButton() - .setLabel(localizer.__("Delete [[0]] more", { placeholders: [10] })) - .setStyle("DANGER") - .setCustomId("purge-10") - ) - .addComponents( - new MessageButton() - .setLabel(localizer.__("Delete [[0]] more", { placeholders: [20] })) - .setStyle("DANGER") - .setCustomId("purge-20") - ) - .addComponents( - new MessageButton() - .setLabel(localizer.__("Delete [[0]] more", { placeholders: [50] })) - .setStyle("DANGER") - .setCustomId("purge-50") - ); - - await interaction.reply({ - embeds: [embed], - components: [row], - ephemeral: true - }); - } -}; \ No newline at end of file diff --git a/ab-modules/moderation/purgebutton.js b/ab-modules/moderation/purgebutton.js deleted file mode 100644 index e23a2bc..0000000 --- a/ab-modules/moderation/purgebutton.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Purge X messages - * @author GoudronViande24 - * @since 1.2.0 - */ - -const { MessageEmbed, Permissions } = require("discord.js"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - id: "purge-*", - - async execute(interaction, { config }) { - if (!interaction.memberPermissions.has(Permissions.FLAGS.MANAGE_MESSAGES)) { - return await interaction.reply({ - embeds: [ - new MessageEmbed() - .setColor("RED") - .setTitle("Purge") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("**Error:** You do not have the required permissions to use this command!")) - ], - ephemeral: true - }); - }; - - const amount = interaction.customId.split("-")[1]; - - const deleted = await interaction.channel.bulkDelete(amount, true); - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Purge") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription( - localizer.__("Deleted [[0]] messages.", { placeholders: [deleted.size] }) + ( - deleted.size < 1 ? "\n\n" + localizer._("By the way, I cannot delete messages older than 2 weeks.") : "" - ) - ); - - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); - } -}; \ No newline at end of file diff --git a/ab-modules/moderation/unmute.js b/ab-modules/moderation/unmute.js deleted file mode 100644 index b26e92c..0000000 --- a/ab-modules/moderation/unmute.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Unmute command - * Uses Discord timeout feature added in Discord.js 13.4.0 - * @author GoudronViande24 - * @since 1.0.1 - */ - -const { MessageEmbed, Permissions } = require("discord.js"); -const { SlashCommandBuilder } = require("@discordjs/builders"); -const Localizer = require("artibot-localizer"); -const path = require("path"); -const { locale } = require("../../config.json"); - -const localizer = new Localizer({ - lang: locale, - filePath: path.resolve(__dirname, "locales.json") -}); - -module.exports = { - // The data needed to register slash commands to Discord. - data: new SlashCommandBuilder() - .setName("unmute") - .setDescription(localizer._("Unmutes a user.")) - .addUserOption(option => - option.setName("user") - .setDescription(localizer._("The user to unmute.")) - .setRequired(true) - ), - - async execute(interaction, { config }) { - const user = interaction.options.getUser("user"), - guild = interaction.guild, - moderator = interaction.member; - - // Check for required permissions - if (!moderator.permissions.has([Permissions.FLAGS.MODERATE_MEMBERS])) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Unmute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("You don't have the required permissions to execute this command!")); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - // Get the member, because for some reason Discord returns a user - const member = await guild.members.fetch(user.id).then(m => { return m }); - - if (member.communicationDisabledUntil == null) { - const errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Unmute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._(localizer._("This user is not muted...\nA second mouth would be weird, right?"))); - - return await interaction.reply({ - embeds: [errorEmbed], - ephemeral: true - }); - }; - - // Try to timeout the member and create the embed according to what happens - var embed = await member.timeout(null) - .then(async member => { - const dmEmbed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Unmute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("[[0]] unmuted you on **[[1]]**.", { placeholders: [moderator, guild.name] })); - - const embed = new MessageEmbed() - .setColor(config.embedColor) - .setTitle("Unmute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer.__("[[0]] got his voice back.", { placeholders: [member] })); - - // Send DM to muted user to inform him of the reason and the moderator - await member.send({ embeds: [dmEmbed] }) - .catch(error => { - if (error == "DiscordAPIError: Cannot send messages to this user") { - embed.addField(localizer._("Note"), localizer._("This user does not accept DMs and so has not been warned in DM.")).setColor("YELLOW"); - } else { - embed.addField(localizer._("Note"), localizer._("An error occured while trying to send a DM to the user.")).setColor("ORANGE"); - console.log(error); - }; - }); - - return embed - }) - .catch(error => { - if (error == "DiscordAPIError: Missing Permissions") { - var errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Unmute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("I don't have required permissions to mute this user!")); - } else { - console.log(error); - var errorEmbed = new MessageEmbed() - .setColor("RED") - .setTitle("Unmute") - .setFooter({ text: config.botName, iconURL: config.botIcon }) - .setTimestamp() - .setDescription(localizer._("An error occured.")); - }; - - return errorEmbed - }); - - // finally send the response - await interaction.reply({ - embeds: [embed], - ephemeral: true - }); - } -}; \ No newline at end of file From ae3385bd1382183ac826557e226d8ba85c07a44c Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 19 May 2022 17:47:46 -0400 Subject: [PATCH 66/68] remove unused dependencies update some dependencies --- package-lock.json | 493 ++++++++++++++++++---------------------------- package.json | 7 +- 2 files changed, 192 insertions(+), 308 deletions(-) diff --git a/package-lock.json b/package-lock.json index b853e73..6a47d69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,8 @@ "artibot-localizer": "^1.0.2", "axios": "^0.27.2", "chalk": "^5.0.1", - "discord-api-types": "^0.32.1", - "discord-giveaways": "^5.1.1", - "discord.js": "^13.6.0", + "discord-api-types": "^0.33.0", + "discord.js": "^13.7.0", "figlet": "^1.5.2", "path": "^0.12.7" }, @@ -24,7 +23,7 @@ "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template", "jsdoc": "^3.6.10", "nodemon": "^2.0.16", - "npm-check-updates": "^12.5.11" + "npm-check-updates": "^13.0.1" }, "engines": { "node": "^16.14.2" @@ -34,9 +33,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.10.tgz", - "integrity": "sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-AqDccGC+m5O/iUStSJy3DGRIUFu7WbY/CppZYwrEUB4N0tZlnI8CSTsgL7v5fHVFmUbRv2sd+yy27o8Ydt4MGg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -67,9 +66,9 @@ "integrity": "sha512-gpzXTvFVg7AjKVVJFH0oJGC0q0tO34iJGSHZNz9u3aqLxlD6LfxEs9wWVVikJqn9gra940oUTaPFizCkRDcEiA==" }, "node_modules/@discordjs/collection": { - "version": "0.7.0-dev.1651493036-4ba0f56", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1651493036-4ba0f56.tgz", - "integrity": "sha512-/6eYweo3mprHqYO+DTM89mZNp1AdvZelMZGSeiCUtMadhsdjycR1cfA08fRtivDGaRnvmecDaKIEfig9mXaRxw==", + "version": "0.7.0-dev.1652918980-adf461b", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1652918980-adf461b.tgz", + "integrity": "sha512-46X1nBbEAxhUWmb8suTDMEaHxO8MBSvmDYD4i03evS56PYt2U8p60iQrq0Gw5TaP4nR4ANLnTFKLPeho5yf0WQ==", "engines": { "node": ">=16.9.0" } @@ -386,9 +385,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.32.tgz", - "integrity": "sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw==" + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.35.tgz", + "integrity": "sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg==" }, "node_modules/@types/node-fetch": { "version": "2.6.1", @@ -615,7 +614,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { "version": "0.27.2", @@ -783,9 +782,9 @@ } }, "node_modules/cacache": { - "version": "16.0.7", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.7.tgz", - "integrity": "sha512-a4zfQpp5vm4Ipdvbj+ZrPonikRhm6WBEd4zT1Yc1DXsmAxrPgDwWBLF/u/wTVXSFPIgOJ1U3ghSa2Xm4s3h28w==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.0.tgz", + "integrity": "sha512-Pk4aQkwCW82A4jGKFvcGkQFqZcMspfP9YWq9Pr87/ldDvlWf718zeI6KWCdKt/jeihu6BytHRUicJPB1K2k8EQ==", "dev": true, "dependencies": { "@npmcli/fs": "^2.1.0", @@ -942,7 +941,7 @@ "node_modules/cint": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz", - "integrity": "sha1-cDhrG0jidz0NYxZqVa/5TvRFahI=", + "integrity": "sha512-gyWqJHXgDFPNx7PEyFJotutav+al92TTC3dWlMFyTETlOyKBQMZb7Cetqmj3GlrnSILHwSJRwf4mIGzc7C5lXw==", "dev": true }, "node_modules/clean-stack": { @@ -1129,14 +1128,6 @@ "node": ">=4.0.0" } }, - "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -1179,77 +1170,42 @@ } }, "node_modules/discord-api-types": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.1.tgz", - "integrity": "sha512-/ewl0CPYT5xjOC+SJ7wADJKjtpZfiiUaYXOP/Ns54lnBcv4Xqa4iKSqRF/w1fjiUvWTYN9W8UuOiyCHtmu5fJw==" - }, - "node_modules/discord-giveaways": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-5.1.1.tgz", - "integrity": "sha512-TogRQrnyDVtu+/juWwK22ykBKO1K8p7yPfXEZ67xao70bkNj+FLw0lOaBQqdomNWa3JypaE9FNXLgY0LaRyJIg==", - "dependencies": { - "deepmerge": "^4.2.2", - "serialize-javascript": "^6.0.0" - }, - "engines": { - "node": ">=16.6.0" - }, - "peerDependencies": { - "discord.js": ">=13.5.0" - } + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.0.tgz", + "integrity": "sha512-RS1dMM6xuMhdHwQJ0T+XuCD7v1tKnyZ89Eq6q/DbOJWMbIh3ihgAzDhcF70QsFCtk9a5Gn9XU29S7eoEXuwQ5w==" }, "node_modules/discord.js": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", - "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", - "dependencies": { - "@discordjs/builders": "^0.11.0", - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.26.0", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.7.0.tgz", + "integrity": "sha512-iV/An3FEB/CiBGdjWHRtgskM4UuWPq5vjhjKsrQhdVU16dbKrBxA+eIV2HWA07B3tXUGM6eco1wkr42gxxV1BA==", + "dependencies": { + "@discordjs/builders": "^0.13.0", + "@discordjs/collection": "^0.6.0", + "@sapphire/async-queue": "^1.3.1", + "@types/node-fetch": "^2.6.1", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.30.0", "form-data": "^4.0.0", "node-fetch": "^2.6.1", - "ws": "^8.4.0" + "ws": "^8.6.0" }, "engines": { "node": ">=16.6.0", "npm": ">=7.0.0" } }, - "node_modules/discord.js/node_modules/@discordjs/builders": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", - "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", - "dependencies": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.26.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/discord.js/node_modules/@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.6.0.tgz", + "integrity": "sha512-Ieaetb36l0nmAS5X9Upqk4W7euAO6FdXPxn3I8vBAKEcoIzEZI1mcVcPfCfagGJZSgBKpENnAnKkP4GAn+MV8w==", "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", - "engines": { - "node": ">=12" - } + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.30.0.tgz", + "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" }, "node_modules/dot-prop": { "version": "6.0.1", @@ -1539,17 +1495,16 @@ } }, "node_modules/glob": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.1.tgz", - "integrity": "sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "once": "^1.3.0" }, "engines": { "node": ">=12" @@ -1580,9 +1535,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -1857,9 +1812,9 @@ } }, "node_modules/ignore-walk/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -1924,9 +1879,9 @@ "dev": true }, "node_modules/ip": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.7.tgz", - "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", "dev": true }, "node_modules/is-binary-path": { @@ -2351,9 +2306,9 @@ } }, "node_modules/lru-cache": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.9.0.tgz", - "integrity": "sha512-lkcNMUKqdJk96TuIXUidxaPuEg5sJo/+ZyVE2BDFnuZGzwXem7d8582eG8vbu4todLfT14snP6iHriCHXXi5Rw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz", + "integrity": "sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==", "dev": true, "engines": { "node": ">=12" @@ -2384,13 +2339,13 @@ } }, "node_modules/make-fetch-happen": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.3.tgz", - "integrity": "sha512-s/UjmGjUHn9m52cctFhN2ITObbT+axoUhgeir8xGrOlPbKDyJsdhQzb8PGncPQQ28uduHybFJ6Iumy2OZnreXw==", + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.5.tgz", + "integrity": "sha512-mucOj2H0Jn/ax7H9K9T1bf0p1nn/mBFa551Os7ed9xRfLEx20aZhZeLslmRYfAaAqXZUGipcs+m5KOKvOH0XKA==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", - "cacache": "^16.0.2", + "cacache": "^16.1.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", @@ -2427,9 +2382,9 @@ } }, "node_modules/markdown-it-anchor": { - "version": "8.6.3", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.3.tgz", - "integrity": "sha512-3IiHYh/kJHY2IcuKv5qv+IKNxDwXjVoYQ5FvbBUPywcwCQ4ICLIw5z0QrhYBtcD7h88MfFK3zKAkABTvPMxm7A==", + "version": "8.6.4", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.4.tgz", + "integrity": "sha512-Ul4YVYZNxMJYALpKtu+ZRdrryYt/GlQ5CK+4l1bp/gWXOG2QWElt6AqF3Mih/wfUKdZbNAZVXGR73/n6U/8img==", "dev": true, "peerDependencies": { "@types/markdown-it": "*", @@ -2437,9 +2392,9 @@ } }, "node_modules/marked": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", - "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.16.tgz", + "integrity": "sha512-wahonIQ5Jnyatt2fn8KqF/nIqZM8mh3oRu2+l5EANGMhu6RFjiSG52QNE2eWzFMI94HqYSgN184NurgNG6CztA==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -2693,15 +2648,15 @@ } }, "node_modules/node-gyp/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -2853,15 +2808,15 @@ } }, "node_modules/npm-check-updates": { - "version": "12.5.11", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.11.tgz", - "integrity": "sha512-uS3yYYK/F1VvZlJRymuCkq+MY2R7v/WlORo5WPUTYx+1OwkqeDMC/CEEGfCN7ATwT2M+JxVVKk9Gq/TGiZjJOw==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-13.0.1.tgz", + "integrity": "sha512-DU0/pDWrc4kTgc9V5MtM7RPoUrMBfDzSxcCBt+hJjSyxQ47ULrjWhVwpNpUmHCAUfHYdzwYKGW/Z65/vKwWNag==", "dev": true, "dependencies": { "chalk": "^4.1.2", "cint": "^8.2.1", "cli-table": "^0.3.11", - "commander": "^9.1.0", + "commander": "^9.2.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", @@ -2874,26 +2829,26 @@ "lodash": "^4.17.21", "minimatch": "^5.0.1", "p-map": "^4.0.0", - "pacote": "^13.0.5", + "pacote": "^13.3.0", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts": "^2.4.2", "rc-config-loader": "^4.1.0", "remote-git-tags": "^3.0.0", "rimraf": "^3.0.2", - "semver": "^7.3.5", + "semver": "^7.3.7", "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", "spawn-please": "^1.0.0", "update-notifier": "^5.1.0", - "yaml": "^1.10.2" + "yaml": "^2.1.0" }, "bin": { "ncu": "build/src/bin/cli.js", "npm-check-updates": "build/src/bin/cli.js" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/npm-check-updates/node_modules/brace-expansion": { @@ -2943,9 +2898,9 @@ } }, "node_modules/npm-check-updates/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -3068,9 +3023,9 @@ } }, "node_modules/npm-packlist": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.3.tgz", - "integrity": "sha512-KuSbzgejxdsAWbNNyEs8EsyDHsO+nJF6k+9WuWzFbSNh5tFHs4lDApXw7kntKpuehfp8lKRzJkMtz0+WmGvTIw==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.4.tgz", + "integrity": "sha512-G4sCWzzHokHC5oxGD46Q9vCe+eN2tFb+3RfADD/eZbx4nKa7Y1eku1xvIWrw5R3F3hWX7IM2BgdqbQsyBUa3IA==", "dev": true, "dependencies": { "glob": "^8.0.1", @@ -3277,9 +3232,9 @@ } }, "node_modules/pacote": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.3.0.tgz", - "integrity": "sha512-auhJAUlfC2TALo6I0s1vFoPvVFgWGx+uz/PnIojTTgkGwlK3Np8sGJ0ghfFhiuzJXTZoTycMLk8uLskdntPbDw==", + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.4.1.tgz", + "integrity": "sha512-FqlSWlD8n+ejCE17GF/lf0yasztMGFl4UFzYQk5njaK/qPPWfVDWnfQwqmqeXObWLSmIBew+O+CFD24vxkVDjg==", "dev": true, "dependencies": { "@npmcli/git": "^3.0.0", @@ -3486,14 +3441,6 @@ } ] }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -3702,15 +3649,15 @@ } }, "node_modules/rimraf/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -3748,6 +3695,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -3805,14 +3753,6 @@ "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", "dev": true }, - "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3962,9 +3902,9 @@ "dev": true }, "node_modules/ssri": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.0.tgz", - "integrity": "sha512-Y1Z6J8UYnexKFN1R/hxUaYoY2LVdKEzziPmVAFKiKX8fiwvCJTVzn/xYE9TEWod5OVyNfIHHuVfIEuBClL/uJQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", + "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", "dev": true, "dependencies": { "minipass": "^3.1.1" @@ -4468,12 +4408,12 @@ "dev": true }, "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.0.tgz", + "integrity": "sha512-OuAINfTsoJrY5H7CBWnKZhX6nZciXBydrMtTHr1dC4nP40X5jyTIVlogZHxSlVZM8zSgXRfgZGsaHF4+pV+JRw==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/yocto-queue": { @@ -4487,21 +4427,13 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.15.1.tgz", - "integrity": "sha512-WAdjcoOxa4S9oc/u7fTbC3CC7uVqptLLU0LKqS8RDBOrCXp2t5avM8BUfgNVZJymGWAx6SEUYxWPPoYuQ5rgwQ==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } }, "dependencies": { "@babel/parser": { - "version": "7.17.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.10.tgz", - "integrity": "sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-AqDccGC+m5O/iUStSJy3DGRIUFu7WbY/CppZYwrEUB4N0tZlnI8CSTsgL7v5fHVFmUbRv2sd+yy27o8Ydt4MGg==", "dev": true }, "@discordjs/builders": { @@ -4525,9 +4457,9 @@ } }, "@discordjs/collection": { - "version": "0.7.0-dev.1651493036-4ba0f56", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1651493036-4ba0f56.tgz", - "integrity": "sha512-/6eYweo3mprHqYO+DTM89mZNp1AdvZelMZGSeiCUtMadhsdjycR1cfA08fRtivDGaRnvmecDaKIEfig9mXaRxw==" + "version": "0.7.0-dev.1652918980-adf461b", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1652918980-adf461b.tgz", + "integrity": "sha512-46X1nBbEAxhUWmb8suTDMEaHxO8MBSvmDYD4i03evS56PYt2U8p60iQrq0Gw5TaP4nR4ANLnTFKLPeho5yf0WQ==" }, "@discordjs/rest": { "version": "0.4.1", @@ -4768,9 +4700,9 @@ "dev": true }, "@types/node": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.32.tgz", - "integrity": "sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw==" + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.35.tgz", + "integrity": "sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg==" }, "@types/node-fetch": { "version": "2.6.1", @@ -4953,7 +4885,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { "version": "0.27.2", @@ -5086,9 +5018,9 @@ } }, "cacache": { - "version": "16.0.7", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.7.tgz", - "integrity": "sha512-a4zfQpp5vm4Ipdvbj+ZrPonikRhm6WBEd4zT1Yc1DXsmAxrPgDwWBLF/u/wTVXSFPIgOJ1U3ghSa2Xm4s3h28w==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.0.tgz", + "integrity": "sha512-Pk4aQkwCW82A4jGKFvcGkQFqZcMspfP9YWq9Pr87/ldDvlWf718zeI6KWCdKt/jeihu6BytHRUicJPB1K2k8EQ==", "dev": true, "requires": { "@npmcli/fs": "^2.1.0", @@ -5200,7 +5132,7 @@ "cint": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/cint/-/cint-8.2.1.tgz", - "integrity": "sha1-cDhrG0jidz0NYxZqVa/5TvRFahI=", + "integrity": "sha512-gyWqJHXgDFPNx7PEyFJotutav+al92TTC3dWlMFyTETlOyKBQMZb7Cetqmj3GlrnSILHwSJRwf4mIGzc7C5lXw==", "dev": true }, "clean-stack": { @@ -5347,11 +5279,6 @@ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" - }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -5385,56 +5312,35 @@ } }, "discord-api-types": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.32.1.tgz", - "integrity": "sha512-/ewl0CPYT5xjOC+SJ7wADJKjtpZfiiUaYXOP/Ns54lnBcv4Xqa4iKSqRF/w1fjiUvWTYN9W8UuOiyCHtmu5fJw==" - }, - "discord-giveaways": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-5.1.1.tgz", - "integrity": "sha512-TogRQrnyDVtu+/juWwK22ykBKO1K8p7yPfXEZ67xao70bkNj+FLw0lOaBQqdomNWa3JypaE9FNXLgY0LaRyJIg==", - "requires": { - "deepmerge": "^4.2.2", - "serialize-javascript": "^6.0.0" - } + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.0.tgz", + "integrity": "sha512-RS1dMM6xuMhdHwQJ0T+XuCD7v1tKnyZ89Eq6q/DbOJWMbIh3ihgAzDhcF70QsFCtk9a5Gn9XU29S7eoEXuwQ5w==" }, "discord.js": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", - "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", - "requires": { - "@discordjs/builders": "^0.11.0", - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.26.0", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.7.0.tgz", + "integrity": "sha512-iV/An3FEB/CiBGdjWHRtgskM4UuWPq5vjhjKsrQhdVU16dbKrBxA+eIV2HWA07B3tXUGM6eco1wkr42gxxV1BA==", + "requires": { + "@discordjs/builders": "^0.13.0", + "@discordjs/collection": "^0.6.0", + "@sapphire/async-queue": "^1.3.1", + "@types/node-fetch": "^2.6.1", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.30.0", "form-data": "^4.0.0", "node-fetch": "^2.6.1", - "ws": "^8.4.0" + "ws": "^8.6.0" }, "dependencies": { - "@discordjs/builders": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", - "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", - "requires": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.26.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" - } - }, "@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.6.0.tgz", + "integrity": "sha512-Ieaetb36l0nmAS5X9Upqk4W7euAO6FdXPxn3I8vBAKEcoIzEZI1mcVcPfCfagGJZSgBKpENnAnKkP4GAn+MV8w==" }, "discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.30.0.tgz", + "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" } } }, @@ -5651,17 +5557,16 @@ } }, "glob": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.1.tgz", - "integrity": "sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "once": "^1.3.0" }, "dependencies": { "brace-expansion": { @@ -5674,9 +5579,9 @@ } }, "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -5903,9 +5808,9 @@ } }, "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -5960,9 +5865,9 @@ "dev": true }, "ip": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.7.tgz", - "integrity": "sha512-SLm2ERgmBGag79RfrIknk+40ZOJCgUBpCQTl3WE2YER21VR0W3Vt/OAXXaYLSU0AIcBqWnytoTwk2ZcTbxH0xg==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", "dev": true }, "is-binary-path": { @@ -6297,9 +6202,9 @@ "dev": true }, "lru-cache": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.9.0.tgz", - "integrity": "sha512-lkcNMUKqdJk96TuIXUidxaPuEg5sJo/+ZyVE2BDFnuZGzwXem7d8582eG8vbu4todLfT14snP6iHriCHXXi5Rw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz", + "integrity": "sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==", "dev": true }, "make-dir": { @@ -6320,13 +6225,13 @@ } }, "make-fetch-happen": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.3.tgz", - "integrity": "sha512-s/UjmGjUHn9m52cctFhN2ITObbT+axoUhgeir8xGrOlPbKDyJsdhQzb8PGncPQQ28uduHybFJ6Iumy2OZnreXw==", + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.5.tgz", + "integrity": "sha512-mucOj2H0Jn/ax7H9K9T1bf0p1nn/mBFa551Os7ed9xRfLEx20aZhZeLslmRYfAaAqXZUGipcs+m5KOKvOH0XKA==", "dev": true, "requires": { "agentkeepalive": "^4.2.1", - "cacache": "^16.0.2", + "cacache": "^16.1.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", @@ -6357,16 +6262,16 @@ } }, "markdown-it-anchor": { - "version": "8.6.3", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.3.tgz", - "integrity": "sha512-3IiHYh/kJHY2IcuKv5qv+IKNxDwXjVoYQ5FvbBUPywcwCQ4ICLIw5z0QrhYBtcD7h88MfFK3zKAkABTvPMxm7A==", + "version": "8.6.4", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.4.tgz", + "integrity": "sha512-Ul4YVYZNxMJYALpKtu+ZRdrryYt/GlQ5CK+4l1bp/gWXOG2QWElt6AqF3Mih/wfUKdZbNAZVXGR73/n6U/8img==", "dev": true, "requires": {} }, "marked": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", - "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.16.tgz", + "integrity": "sha512-wahonIQ5Jnyatt2fn8KqF/nIqZM8mh3oRu2+l5EANGMhu6RFjiSG52QNE2eWzFMI94HqYSgN184NurgNG6CztA==", "dev": true }, "mdurl": { @@ -6547,15 +6452,15 @@ }, "dependencies": { "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -6661,15 +6566,15 @@ } }, "npm-check-updates": { - "version": "12.5.11", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-12.5.11.tgz", - "integrity": "sha512-uS3yYYK/F1VvZlJRymuCkq+MY2R7v/WlORo5WPUTYx+1OwkqeDMC/CEEGfCN7ATwT2M+JxVVKk9Gq/TGiZjJOw==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-13.0.1.tgz", + "integrity": "sha512-DU0/pDWrc4kTgc9V5MtM7RPoUrMBfDzSxcCBt+hJjSyxQ47ULrjWhVwpNpUmHCAUfHYdzwYKGW/Z65/vKwWNag==", "dev": true, "requires": { "chalk": "^4.1.2", "cint": "^8.2.1", "cli-table": "^0.3.11", - "commander": "^9.1.0", + "commander": "^9.2.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", @@ -6682,19 +6587,19 @@ "lodash": "^4.17.21", "minimatch": "^5.0.1", "p-map": "^4.0.0", - "pacote": "^13.0.5", + "pacote": "^13.3.0", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts": "^2.4.2", "rc-config-loader": "^4.1.0", "remote-git-tags": "^3.0.0", "rimraf": "^3.0.2", - "semver": "^7.3.5", + "semver": "^7.3.7", "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", "spawn-please": "^1.0.0", "update-notifier": "^5.1.0", - "yaml": "^1.10.2" + "yaml": "^2.1.0" }, "dependencies": { "brace-expansion": { @@ -6732,9 +6637,9 @@ } }, "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -6827,9 +6732,9 @@ } }, "npm-packlist": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.3.tgz", - "integrity": "sha512-KuSbzgejxdsAWbNNyEs8EsyDHsO+nJF6k+9WuWzFbSNh5tFHs4lDApXw7kntKpuehfp8lKRzJkMtz0+WmGvTIw==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.4.tgz", + "integrity": "sha512-G4sCWzzHokHC5oxGD46Q9vCe+eN2tFb+3RfADD/eZbx4nKa7Y1eku1xvIWrw5R3F3hWX7IM2BgdqbQsyBUa3IA==", "dev": true, "requires": { "glob": "^8.0.1", @@ -6980,9 +6885,9 @@ } }, "pacote": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.3.0.tgz", - "integrity": "sha512-auhJAUlfC2TALo6I0s1vFoPvVFgWGx+uz/PnIojTTgkGwlK3Np8sGJ0ghfFhiuzJXTZoTycMLk8uLskdntPbDw==", + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.4.1.tgz", + "integrity": "sha512-FqlSWlD8n+ejCE17GF/lf0yasztMGFl4UFzYQk5njaK/qPPWfVDWnfQwqmqeXObWLSmIBew+O+CFD24vxkVDjg==", "dev": true, "requires": { "@npmcli/git": "^3.0.0", @@ -7127,14 +7032,6 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -7296,15 +7193,15 @@ }, "dependencies": { "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -7323,7 +7220,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -7360,14 +7258,6 @@ "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", "dev": true }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "requires": { - "randombytes": "^2.1.0" - } - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -7491,9 +7381,9 @@ "dev": true }, "ssri": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.0.tgz", - "integrity": "sha512-Y1Z6J8UYnexKFN1R/hxUaYoY2LVdKEzziPmVAFKiKX8fiwvCJTVzn/xYE9TEWod5OVyNfIHHuVfIEuBClL/uJQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", + "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", "dev": true, "requires": { "minipass": "^3.1.1" @@ -7890,9 +7780,9 @@ "dev": true }, "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.0.tgz", + "integrity": "sha512-OuAINfTsoJrY5H7CBWnKZhX6nZciXBydrMtTHr1dC4nP40X5jyTIVlogZHxSlVZM8zSgXRfgZGsaHF4+pV+JRw==", "dev": true }, "yocto-queue": { @@ -7900,11 +7790,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true - }, - "zod": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.15.1.tgz", - "integrity": "sha512-WAdjcoOxa4S9oc/u7fTbC3CC7uVqptLLU0LKqS8RDBOrCXp2t5avM8BUfgNVZJymGWAx6SEUYxWPPoYuQ5rgwQ==" } } } diff --git a/package.json b/package.json index e8678cf..d2d51ec 100644 --- a/package.json +++ b/package.json @@ -48,16 +48,15 @@ "artibot-localizer": "^1.0.2", "axios": "^0.27.2", "chalk": "^5.0.1", - "discord-api-types": "^0.32.1", - "discord-giveaways": "^5.1.1", - "discord.js": "^13.6.0", + "discord-api-types": "^0.33.0", + "discord.js": "^13.7.0", "figlet": "^1.5.2", "path": "^0.12.7" }, "devDependencies": { "jsdoc": "^3.6.10", "nodemon": "^2.0.16", - "npm-check-updates": "^12.5.11", + "npm-check-updates": "^13.0.1", "artibot-jsdoc-template": "GoudronViande24/artibot-jsdoc-template" } } From 5b0e54413efb3ff20faf5e3f8677dd9d58d732e0 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 19 May 2022 19:50:43 -0400 Subject: [PATCH 67/68] Try to always use latest LTS version --- .node-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.node-version b/.node-version index a1fe187..19c7bdb 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.14.2 \ No newline at end of file +16 \ No newline at end of file From 91cfed7f9ad1c8c94b1f0897a2d339122c8168c9 Mon Sep 17 00:00:00 2001 From: Thomas Fournier Date: Thu, 19 May 2022 19:52:08 -0400 Subject: [PATCH 68/68] Increment version number ready for beta testing I think --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6a47d69..e07ac27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "artibot", - "version": "3.0.8", + "version": "3.0.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "artibot", - "version": "3.0.8", + "version": "3.0.9", "license": "GPL-3.0-or-later", "dependencies": { "@discordjs/builders": "^0.13.0", diff --git a/package.json b/package.json index d2d51ec..829604a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artibot", - "version": "3.0.8", + "version": "3.0.9", "description": "Modern, fast and modular open-source Discord bot", "main": "index.js", "scripts": {