From 48e1f4033905ae66cc3e6b416547391dc26ecfa1 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 27 Jul 2022 23:11:38 +0200 Subject: [PATCH 01/54] add sub command awareness --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e455e8..2ba9277 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,12 @@ La norme pour les nom dans les fichiers est la suivante : - `c_NOM-COMMANDE_desc` : Description de la commande - `c_NOM-COMMANDE_optX_name` : Nom de l'option X - `c_NOM-COMMANDE_optX_desc` : Description de l'option X + - `c_NOM-COMMANDE_subX_name` : Nom de la sous-commande X + - `c_NOM-COMMANDE_subX_desc` : Description de la sous-commande X - `c_NOM-COMMANDEX` : `X` le numéro de la chaîne de caractère + + Évidemment ça peut s'additionner, + par exemple : `c_NOM-COMMANDE_subX_optX_desc`. - Chaîne de charactère des évènements : `e` est utilisé pour `E`vènements. - `e_NOM-EVENEMENT_N` : `N` le nom de la chaîne de caractère -- 2.45.2 From 12af018032ee141af9b1b4a14c45a545bd2f27c4 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 27 Jul 2022 23:11:46 +0200 Subject: [PATCH 02/54] update translations --- src/locales/fr.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/locales/fr.json b/src/locales/fr.json index 90fddc6..2ef013f 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -14,5 +14,14 @@ "c_help2": "`/help ` pour obtenir plus d'informations sur une commande.", "c_help3": "Impossible de trouver :", - "u_time_at": "à" + "u_time_at": "à", + + "c_reminder_name": "rappel", + "c_reminder_desc": "Commande relative aux rappels", + "c_reminder_sub1_name": "nouveau", + "c_reminder_sub1_desc": "Met en place un rappel", + "c_reminder_sub2_name": "liste", + "c_reminder_sub2_desc": "Affiche la liste des rappels d'un utilisateur", + "c_reminder_sub3_name": "efface", + "c_reminder_sub3_desc": "Supprime un rappel" } -- 2.45.2 From 86286a196d537256fc8cdd511e1f7e4c39fd40ff Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 00:17:39 +0200 Subject: [PATCH 03/54] update translations --- src/locales/fr.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/locales/fr.json b/src/locales/fr.json index 2ef013f..e47c1e2 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -20,8 +20,16 @@ "c_reminder_desc": "Commande relative aux rappels", "c_reminder_sub1_name": "nouveau", "c_reminder_sub1_desc": "Met en place un rappel", + "c_reminder_sub1_opt1_name": "temps", + "c_reminder_sub1_opt1_desc": "Temps désiré avant le rappel", + "c_reminder_sub1_opt2_name": "message", + "c_reminder_sub1_opt2_desc": "Message du rappel", "c_reminder_sub2_name": "liste", "c_reminder_sub2_desc": "Affiche la liste des rappels d'un utilisateur", + "c_reminder_sub2_opt1_name": "utilisateur", + "c_reminder_sub2_opt1_desc": "Affiche la liste de l'utilisateur en question", "c_reminder_sub3_name": "efface", - "c_reminder_sub3_desc": "Supprime un rappel" + "c_reminder_sub3_desc": "Supprime un rappel", + "c_reminder_sub3_opt1_name": "ID", + "c_reminder_sub3_opt1_desc": "Rappel à supprimé" } -- 2.45.2 From af5fc917e57e6fc13a30001415d8a53ee8191c20 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 00:18:16 +0200 Subject: [PATCH 04/54] use ChatInputCommandInteraction --- CONTRIBUTING.md | 8 ++++---- src/commands/misc/help.ts | 8 ++++---- src/commands/misc/ping.ts | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ba9277..68538c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,8 @@ une [Pull Request](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/pulls). ## Sommaire - [Recevoir de l'aide](#recevoir-de-laide) - [Langues](#langues) - - [Ajouter une langue](#ajouter-une-langue) - - [Mettre à jour une langue](#mettre-à-jour-une-langue) + - [Ajouter une langue](#ajouter-une-langue) + - [Mettre à jour une langue](#mettre-à-jour-une-langue) - [Projet](#projet) - [Ajouter une commande](#ajouter-une-commande) - [Ajouter un évènement](#ajouter-un-évènement) @@ -96,7 +96,7 @@ nouvelle catégorie si votre commande n'entre dans aucune qui existe déjà. Le contenu du fichier doit commencer comme suit : ```typescript import { SlashCommandBuilder } from '@discordjs/builders'; -import { Client, CommandInteraction } from 'discord.js'; +import { Client, ChatInputCommandInteraction } from 'discord.js'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; @@ -115,7 +115,7 @@ export default { ); }, - interaction: async (interaction: CommandInteraction, client: Client) => { + interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { const loc = getLocale(client, interaction.locale); /* Votre code ici */ diff --git a/src/commands/misc/help.ts b/src/commands/misc/help.ts index becd3ef..d43a792 100644 --- a/src/commands/misc/help.ts +++ b/src/commands/misc/help.ts @@ -1,6 +1,6 @@ import { SlashCommandBuilder } from '@discordjs/builders'; import { Locale } from 'discord-api-types/v9'; -import { Client, CommandInteraction, EmbedBuilder } from 'discord.js'; +import { Client, ChatInputCommandInteraction, EmbedBuilder } from 'discord.js'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import '../../modules/string'; @@ -31,12 +31,12 @@ export default { ); }, - interaction: async (interaction: CommandInteraction, client: Client) => { + interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { const loc = getLocale(client, interaction.locale); - const desired_command = interaction.options.get(client + const desired_command = interaction.options.getString(client .locales .get(client.config.default_lang) - ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '')?.value as string; + ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? ''); // If a command isn't specified if (!desired_command) { diff --git a/src/commands/misc/ping.ts b/src/commands/misc/ping.ts index 9f56312..1c938fc 100644 --- a/src/commands/misc/ping.ts +++ b/src/commands/misc/ping.ts @@ -1,5 +1,5 @@ import { SlashCommandBuilder } from '@discordjs/builders'; -import { Client, CommandInteraction, Message } from 'discord.js'; +import { ChatInputCommandInteraction, Client, Message } from 'discord.js'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; @@ -18,7 +18,7 @@ export default { ); }, - interaction: async (interaction: CommandInteraction, client: Client) => { + interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { const loc = getLocale(client, interaction.locale); const sent = await interaction.reply({ -- 2.45.2 From d4d3858ac750c11915e95f3c3bc5145bdf2ff81e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 00:18:43 +0200 Subject: [PATCH 05/54] add command builder --- src/commands/misc/reminder.ts | 144 ++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 src/commands/misc/reminder.ts diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts new file mode 100644 index 0000000..9b72e40 --- /dev/null +++ b/src/commands/misc/reminder.ts @@ -0,0 +1,144 @@ +import { SlashCommandBuilder } from '@discordjs/builders'; +import { Client, ChatInputCommandInteraction } from 'discord.js'; +import { getLocale, getLocalizations } from '../../utils/locales'; +import { getFilename } from '../../utils/misc'; + +export default { + data: (client: Client) => { + const filename = getFilename(__filename); + const loc_default = client.locales.get(client.config.default_lang); + if (!loc_default) { + return; + } + + return new SlashCommandBuilder() + // Command + .setName(filename.toLowerCase()) + .setDescription(loc_default.get(`c_${filename}_desc`) ?? '') + .setNameLocalizations( + getLocalizations(client, `c_${filename}_name`, true) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_desc`) + ) + + // New reminder + .addSubcommand(subcommand => subcommand + .setName( + loc_default.get(`c_${filename}_sub1_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub1_desc`) ?? '' + ).setNameLocalizations( + getLocalizations(client, `c_${filename}_sub1_name`, true) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub1_desc`) + ) + + // Specified Time + .addStringOption(option => option + .setName( + loc_default.get(`c_${filename}_sub1_opt1_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub1_opt1_desc`) ?? '' + ).setNameLocalizations( + getLocalizations( + client, + `c_${filename}_sub1_opt1_name`, + true + ) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub1_opt1_desc`) + ).setRequired(true) + ) + + // Specified message (not required) + .addStringOption(option => option + .setName( + loc_default.get(`c_${filename}_sub1_opt2_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub1_opt2_desc`) ?? '' + ).setNameLocalizations( + getLocalizations( + client, + `c_${filename}_sub1_opt2_name`, + true + ) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub1_opt2_desc`) + ) + ) + ) + + // List reminders + .addSubcommand(subcommand => subcommand + .setName( + loc_default.get(`c_${filename}_sub2_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub2_desc`) ?? '' + ).setNameLocalizations( + getLocalizations(client, `c_${filename}_sub2_name`, true) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub2_desc`) + ) + + // User + .addStringOption(option => option + .setName( + loc_default.get(`c_${filename}_sub2_opt1_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub2_opt1_desc`) ?? '' + ).setNameLocalizations( + getLocalizations( + client, + `c_${filename}_sub2_opt1_name`, + true + ) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub2_opt1_desc`) + ) + ) + ) + + // Delete a reminder + .addSubcommand(subcommand => subcommand + .setName( + loc_default.get(`c_${filename}_sub3_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub3_desc`) ?? '' + ).setNameLocalizations( + getLocalizations(client, `c_${filename}_sub3_name`, true) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub3_desc`) + ) + + // ID + .addStringOption(option => option + .setName( + loc_default.get(`c_${filename}_sub3_opt1_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub3_opt1_desc`) ?? '' + ).setNameLocalizations( + getLocalizations( + client, + `c_${filename}_sub3_opt1_name`, + true + ) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub3_opt1_desc`) + ).setRequired(true) + ), + ); + }, + + interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { + const loc = getLocale(client, interaction.locale); + + /* Votre code ici */ + }, +}; -- 2.45.2 From 74e626a158c0f1f0963047838e6e212b0f82f45a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 12:37:51 +0200 Subject: [PATCH 06/54] correct option --- src/commands/misc/reminder.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 9b72e40..3dd6b3a 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -49,7 +49,7 @@ export default { ) ).setDescriptionLocalizations( getLocalizations(client, `c_${filename}_sub1_opt1_desc`) - ).setRequired(true) + ) ) // Specified message (not required) @@ -85,7 +85,7 @@ export default { ) // User - .addStringOption(option => option + .addUserOption(option => option .setName( loc_default.get(`c_${filename}_sub2_opt1_name`) ?.toLowerCase() ?? '' @@ -117,7 +117,7 @@ export default { ) // ID - .addStringOption(option => option + .addIntegerOption(option => option .setName( loc_default.get(`c_${filename}_sub3_opt1_name`) ?.toLowerCase() ?? '' -- 2.45.2 From 1481614be60d5f9018c403276a67b7d782abe7db Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 12:58:07 +0200 Subject: [PATCH 07/54] install sqlite3 --- .gitignore | 3 + package-lock.json | 1605 +++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 + 3 files changed, 1545 insertions(+), 65 deletions(-) diff --git a/.gitignore b/.gitignore index 8517d76..f21d3b6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ docker-compose.yml # JS generated files dist/ + +# Databse +*.sqlite3 diff --git a/package-lock.json b/package-lock.json index 52741ad..e59c5d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,10 @@ "license": "GPL-3.0-only", "dependencies": { "@discordjs/rest": "^1.0.1", + "@types/sqlite3": "^3.1.8", "discord-api-types": "^0.36.0", "discord.js": "^14.0.3", + "sqlite3": "^5.0.10", "typescript": "^4.7.4" }, "devDependencies": { @@ -94,6 +96,12 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "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==", + "optional": true + }, "node_modules/@humanwhocodes/config-array": { "version": "0.9.5", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", @@ -139,6 +147,25 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", + "integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -174,6 +201,29 @@ "node": ">= 8" } }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@sapphire/async-queue": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.2.tgz", @@ -210,6 +260,15 @@ "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -241,9 +300,17 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz", - "integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg==" + "version": "18.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz", + "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ==" + }, + "node_modules/@types/sqlite3": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/sqlite3/-/sqlite3-3.1.8.tgz", + "integrity": "sha512-sQMt/qnyUWnqiTcJXm5ZfNPIBeJ/DVvJDwxw+0tAxPJvadzfiP1QhryO1JOR6t1yfb8NpzQb/Rud06mob5laIA==", + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/strip-bom": { "version": "3.0.0", @@ -449,6 +516,11 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "node_modules/acorn": { "version": "8.8.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", @@ -479,6 +551,44 @@ "node": ">=0.4.0" } }, + "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==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "optional": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "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==", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -499,7 +609,6 @@ "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" } @@ -532,6 +641,23 @@ "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==" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -556,8 +682,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -572,7 +697,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -596,6 +720,35 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -660,6 +813,23 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "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==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -678,11 +848,23 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "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==", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "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": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, "node_modules/create-require": { "version": "1.1.1", @@ -708,7 +890,6 @@ "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" }, @@ -727,6 +908,28 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -804,6 +1007,35 @@ "xtend": "^4.0.0" } }, + "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==" + }, + "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/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": 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==", + "optional": true + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -1126,11 +1358,21 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "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==", + "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": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.2", @@ -1158,11 +1400,29 @@ "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "dev": true }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/glob": { "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", @@ -1225,6 +1485,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "optional": true + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1246,6 +1512,64 @@ "node": ">=8" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "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==", + "optional": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "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==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": 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/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -1294,16 +1618,30 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, + "devOptional": 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==", + "optional": 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==", + "optional": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1314,6 +1652,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "optional": true + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1347,6 +1691,14 @@ "node": ">=0.10.0" } }, + "node_modules/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==", + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1359,6 +1711,12 @@ "node": ">=0.10.0" } }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1372,7 +1730,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "devOptional": true }, "node_modules/js-yaml": { "version": "4.1.0", @@ -1431,7 +1789,6 @@ "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" }, @@ -1439,12 +1796,61 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1471,7 +1877,6 @@ "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" }, @@ -1485,11 +1890,98 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "node_modules/minipass": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", + "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "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==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "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==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "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==", + "optional": 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==", + "optional": 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==", + "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" }, @@ -1500,8 +1992,7 @@ "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 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -1509,6 +2000,124 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "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==", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + }, + "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": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "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": ">= 10.12.0" + } + }, + "node_modules/node-gyp/node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "optional": 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/node-gyp/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==", + "optional": true, + "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/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1518,11 +2127,29 @@ "node": ">=0.10.0" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -1544,6 +2171,21 @@ "node": ">= 0.8.0" } }, + "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==", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -1560,7 +2202,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1622,6 +2263,25 @@ "node": ">= 0.8.0" } }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": 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==", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -1729,6 +2389,15 @@ "node": ">=4" } }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -1743,7 +2412,6 @@ "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" }, @@ -1796,11 +2464,16 @@ } ] }, + "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": "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" }, @@ -1811,6 +2484,11 @@ "node": ">=10" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1832,6 +2510,11 @@ "node": ">=8" } }, + "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==" + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -1841,6 +2524,44 @@ "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==", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", + "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "optional": true, + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1860,6 +2581,40 @@ "source-map": "^0.6.0" } }, + "node_modules/sqlite3": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.10.tgz", + "integrity": "sha512-xG4XPp7+b/lIlb/acs4XzBmmahI1Qq3Yhy+jZnZJivwB6DXpoOpGR6QinRbsQkHJIvMZyUsJDXouSva/JXcWFA==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^4.2.0", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1868,11 +2623,23 @@ "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==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1941,6 +2708,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dependencies": { + "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": ">= 10" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -1975,6 +2758,11 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -2169,6 +2957,24 @@ "node": ">=12.18" } }, + "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==", + "optional": 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==", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -2195,11 +3001,25 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "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, + "devOptional": true, "dependencies": { "isexe": "^2.0.0" }, @@ -2210,6 +3030,14 @@ "node": ">= 8" } }, + "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==", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -2222,8 +3050,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { "version": "8.8.1", @@ -2257,8 +3084,7 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yn": { "version": "3.1.1", @@ -2328,6 +3154,12 @@ "strip-json-comments": "^3.1.1" } }, + "@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==", + "optional": true + }, "@humanwhocodes/config-array": { "version": "0.9.5", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", @@ -2367,6 +3199,22 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@mapbox/node-pre-gyp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", + "integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==", + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2393,6 +3241,26 @@ "fastq": "^1.6.0" } }, + "@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "optional": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + } + }, "@sapphire/async-queue": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.2.tgz", @@ -2417,6 +3285,12 @@ "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true + }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -2448,9 +3322,17 @@ "dev": true }, "@types/node": { - "version": "18.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz", - "integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg==" + "version": "18.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz", + "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ==" + }, + "@types/sqlite3": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/sqlite3/-/sqlite3-3.1.8.tgz", + "integrity": "sha512-sQMt/qnyUWnqiTcJXm5ZfNPIBeJ/DVvJDwxw+0tAxPJvadzfiP1QhryO1JOR6t1yfb8NpzQb/Rud06mob5laIA==", + "requires": { + "@types/node": "*" + } }, "@types/strip-bom": { "version": "3.0.0", @@ -2567,6 +3449,11 @@ "eslint-visitor-keys": "^3.3.0" } }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "acorn": { "version": "8.8.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", @@ -2586,6 +3473,35 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "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==", + "requires": { + "debug": "4" + } + }, + "agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "optional": true, + "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2601,8 +3517,7 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", @@ -2623,6 +3538,20 @@ "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==" + }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2644,8 +3573,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "binary-extensions": { "version": "2.2.0", @@ -2657,7 +3585,6 @@ "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" @@ -2678,6 +3605,32 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "requires": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2721,6 +3674,17 @@ } } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2736,11 +3700,20 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "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==" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, "create-require": { "version": "1.1.1", @@ -2763,7 +3736,6 @@ "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" } @@ -2774,6 +3746,22 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "optional": true + }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -2836,6 +3824,32 @@ "xtend": "^4.0.0" } }, + "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==" + }, + "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" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": 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==", + "optional": true + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -3087,11 +4101,18 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "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==", + "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": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fsevents": { "version": "2.3.2", @@ -3112,11 +4133,26 @@ "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "dev": true }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "glob": { "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", @@ -3158,6 +4194,12 @@ "slash": "^3.0.0" } }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "optional": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -3173,6 +4215,55 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "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==", + "optional": true + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, + "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==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": 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" + } + }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -3198,13 +4289,24 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true + "devOptional": 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==", + "optional": 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==", + "optional": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -3215,6 +4317,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "optional": true + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -3239,6 +4347,11 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, + "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==" + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3248,6 +4361,12 @@ "is-extglob": "^2.1.1" } }, + "is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3258,7 +4377,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "devOptional": true }, "js-yaml": { "version": "4.1.0", @@ -3311,17 +4430,55 @@ "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" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "requires": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + } + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3342,7 +4499,6 @@ "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" } @@ -3353,17 +4509,80 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "minipass": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", + "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", + "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==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "requires": { + "encoding": "^0.1.12", + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + } + }, + "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==", + "optional": true, + "requires": { + "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==", + "optional": 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==", + "optional": 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==", + "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 + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "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 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "natural-compare": { "version": "1.4.0", @@ -3371,17 +4590,117 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "optional": true + }, + "node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + }, + "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": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "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": { + "are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + }, + "gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "optional": 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" + } + }, + "npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "optional": true, + "requires": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + } + } + } + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, "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 }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "requires": { "wrappy": "1" } @@ -3400,6 +4719,15 @@ "word-wrap": "^1.2.3" } }, + "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==", + "optional": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3412,8 +4740,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "3.1.1", @@ -3450,6 +4777,22 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": 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==", + "optional": true, + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -3512,6 +4855,12 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true + }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -3522,7 +4871,6 @@ "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" } @@ -3541,15 +4889,25 @@ "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": "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" } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3565,12 +4923,44 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "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==" + }, "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", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "optional": true + }, + "socks": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", + "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "optional": true, + "requires": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "requires": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3587,6 +4977,26 @@ "source-map": "^0.6.0" } }, + "sqlite3": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.10.tgz", + "integrity": "sha512-xG4XPp7+b/lIlb/acs4XzBmmahI1Qq3Yhy+jZnZJivwB6DXpoOpGR6QinRbsQkHJIvMZyUsJDXouSva/JXcWFA==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^4.2.0", + "node-gyp": "8.x", + "tar": "^6.1.11" + } + }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": 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", @@ -3595,11 +5005,20 @@ "safe-buffer": "~5.2.0" } }, + "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==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "strip-ansi": { "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" } @@ -3640,6 +5059,19 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, + "tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "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" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3664,6 +5096,11 @@ "ieee754": "^1.2.1" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -3792,6 +5229,24 @@ "resolved": "https://registry.npmjs.org/undici/-/undici-5.8.0.tgz", "integrity": "sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q==" }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "optional": 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==", + "optional": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3818,15 +5273,37 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "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, + "devOptional": true, "requires": { "isexe": "^2.0.0" } }, + "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==", + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -3836,8 +5313,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { "version": "8.8.1", @@ -3854,8 +5330,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yn": { "version": "3.1.1", diff --git a/package.json b/package.json index 48db05a..d2efb16 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,10 @@ "license": "GPL-3.0-only", "dependencies": { "@discordjs/rest": "^1.0.1", + "@types/sqlite3": "^3.1.8", "discord-api-types": "^0.36.0", "discord.js": "^14.0.3", + "sqlite3": "^5.0.10", "typescript": "^4.7.4" }, "devDependencies": { -- 2.45.2 From 008efd77a908bd94e1db9d755cb4d7374f55b38f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 15:31:11 +0200 Subject: [PATCH 08/54] * Add config/ folder and SQLITE database * Cleanup docker image and update node from 16 to 18 --- Dockerfile | 7 ++++++- README.md | 7 +++++++ src/index.ts | 8 +++++++- src/modules/client.ts | 6 ++++-- src/utils/client.ts | 15 +++++++++++++++ 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 584f105..fa5bdda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # syntax=docker/dockerfile:1 -FROM node:16.15.0-alpine3.15 +FROM node:18.7.0-alpine3.16 + +ENV DOCKERIZED=1 +RUN mkdir /config +RUN chown node:node /config RUN apk add dumb-init ENV NODE_ENV=production @@ -13,5 +17,6 @@ RUN npm ci --only=production RUN npx tsc RUN rm -r src/ tsconfig.json +RUN npm uninstall typescript discord-api-types @types/sqlite3 CMD ["dumb-init", "node", "./dist/index.js"] diff --git a/README.md b/README.md index 328433b..5cd5d24 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ services: container_name: Botanique environment: - TOKEN_DISCORD=ton-token-va-ici + volumes: + - /here/your/path:/config restart: unless-stopped ``` @@ -37,6 +39,11 @@ services: | TOKEN_DISCORD | Token Discord | Aucune | | DEFAULT_LANG | Langue par défaut | `fr` | Expérimental, si la langue par défaut n'est pas complète (càd 100%), le bot pourrait ne pas fonctionner correctement.
Liste des traductions disponibles [ici](./src/locales/). +## Volumes +| Chemin | Description +| :-------: | :-: +| `/config` | Dossier de configuration, par exemple, c'est ici que la base de donnée est. + # Contribuer Toute contribution est la bienvenue ! diff --git a/src/index.ts b/src/index.ts index 7b85203..3745384 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import loadClient from './utils/client'; +import loadClient, { quit } from './utils/client'; import loadEvents from './events/loader'; import loadCommands from './commands/loader'; @@ -41,6 +41,12 @@ const run = async () => { }); console.log(`Botanique "${client.user?.username}" v${client.config.version} started!`); + + // ^C + process.on('SIGINT', () => quit(client)); + + // Container force closed + process.on('SIGTERM', () => quit(client)); }) .catch(() => { throw logStart(client_name, false); diff --git a/src/modules/client.ts b/src/modules/client.ts index 8d0aa0e..b314580 100644 --- a/src/modules/client.ts +++ b/src/modules/client.ts @@ -1,5 +1,6 @@ import { Collection } from 'discord.js'; import { SlashCommandBuilder } from '@discordjs/builders'; +import { Database } from 'sqlite3'; export {}; @@ -34,8 +35,9 @@ declare module 'discord.js' { interaction: (interaction: CommandInteraction, client: Client) => unknown } >, - } + }, /** Store all the localizations */ - locales: Map> + locales: Map>, + db: Database, } } diff --git a/src/utils/client.ts b/src/utils/client.ts index 178ebe0..83ec57d 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -2,6 +2,7 @@ import { Client, Collection, GatewayIntentBits } from 'discord.js'; import { readFileSync } from 'fs'; import { loadLocales } from './locales'; import '../modules/client'; +import { Database } from 'sqlite3'; /** Creation of the client and definition of its properties. */ export default async () => { @@ -26,5 +27,19 @@ export default async () => { console.log('Translations progression :'); client.locales = await loadLocales(client.config.default_lang); + client.db = new Database(`${ + process.env.DOCKERIZED === '1' ? '/config' : './config' + }/db.sqlite3`); + return client; }; + +export const quit = (client: Client) => { + // Close DB + client.db.close(); + + // Close client + client.destroy(); + + console.log('ciao!'); +}; -- 2.45.2 From 641b559c9b5786709992d7084ebd2045c0617afe Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Jul 2022 15:34:01 +0200 Subject: [PATCH 09/54] remove debug log --- src/utils/client.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index 83ec57d..7ef2b74 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -40,6 +40,4 @@ export const quit = (client: Client) => { // Close client client.destroy(); - - console.log('ciao!'); }; -- 2.45.2 From cc5848b62531e84d3d984e319c57b2deb8f927ec Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 29 Jul 2022 00:23:19 +0200 Subject: [PATCH 10/54] switch for all the subcommands --- src/commands/misc/reminder.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 3dd6b3a..05da54c 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -137,8 +137,30 @@ export default { }, interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { - const loc = getLocale(client, interaction.locale); + const loc_default = client.locales.get(client.config.default_lang); + const filename = getFilename(__filename); /* Votre code ici */ + const subcommand = interaction.options.getSubcommand(); + switch (subcommand) { + // New reminder + case loc_default?.get(`c_${filename}_sub1_name`) + ?.toLowerCase() ?? '': + break; + + // List reminders + case loc_default?.get(`c_${filename}_sub2_name`) + ?.toLowerCase() ?? '': + break; + + // Delete a reminder + case loc_default?.get(`c_${filename}_sub3_name`) + ?.toLowerCase() ?? '': + break; + + default: + console.error(`${__filename}: unknown subcommand (${subcommand})`); + break; + } }, }; -- 2.45.2 From 09120af3baa1c5bc5d2ddd35f8e6f11f3699cca3 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 29 Jul 2022 00:34:22 +0200 Subject: [PATCH 11/54] add TODOs --- src/commands/misc/reminder.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 05da54c..9f5c81f 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -146,16 +146,38 @@ export default { // New reminder case loc_default?.get(`c_${filename}_sub1_name`) ?.toLowerCase() ?? '': + // TODO: Ici il y a 2 options, l'un pour le temps et l'autre + // pour le message, il faut tout le temps un temps, mais pas + // tout le temps de message (= message par défaut, le reminder + // fait office de compte à rebours tout simple dans ce cas là) + // Alors j'avais comme idée de pas mettre le temps comme requis, + // et quand pas de temps est spécifié dans la commande, on ouvre + // une boîte de dialogue : https://discordjs.guide/interactions/modals.html#building-and-responding-with-modals + // et on demande à l'utilisateur de remplir les champs comme ça. + // Avec cette technique on a les commandes pour les "poweruser" + // qui préfèrent tout faire en ligne de commandes et un truc + // plus user-friendly avec une interface (et en plus c'est + // nouveau et cool) break; // List reminders case loc_default?.get(`c_${filename}_sub2_name`) ?.toLowerCase() ?? '': + // TODO: Liste dans un embed, naviguez entre les pages à l'aide + // de boutons à la place d'utiliser des réactions + // cf. https://discordjs.guide/interactions/modals.html#building-and-responding-with-modals + // Une option pour renseigné un utilisateur est disponible. + // Quand aucun utilisateur est spécifié, il faut affiché ses + // rappels, sinon affiché les rappels de la personne qui fait + // la commande. break; // Delete a reminder case loc_default?.get(`c_${filename}_sub3_name`) ?.toLowerCase() ?? '': + // TODO: Message simple qui indique que l'on a supprimé + // le reminder. Penser à check l'appartenance du reminder. + // On donne l'ID du reminder en option. break; default: -- 2.45.2 From c6120bf8b4680b512ae5fcf431dc7f44863129e6 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 29 Jul 2022 00:52:58 +0200 Subject: [PATCH 12/54] * add padding for sticky-left languages * fix bar lenght by adding floor and ceil --- src/utils/locales.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/locales.ts b/src/utils/locales.ts index 1fd86fc..b960587 100644 --- a/src/utils/locales.ts +++ b/src/utils/locales.ts @@ -146,9 +146,9 @@ async (locales: Map>, default_lang: string) => { locales_size.forEach((size, lang) => { const percentage = (size / max_size) * 100; // Colored bar part - const blocks = ' '.repeat(percentage / bar_size); + const blocks = ' '.repeat(Math.floor(percentage / bar_size)); // Blank bar part - const blank = ' '.repeat((100 - percentage) / bar_size); + const blank = ' '.repeat(Math.ceil((100 - percentage) / bar_size)); const color = () => { switch (true) { case percentage <= 25: @@ -167,7 +167,8 @@ async (locales: Map>, default_lang: string) => { return ''; } }; + const padding = ' '.repeat(lang.length === 5 ? 1 : 4); - console.log(`${lang} | ${color()}${blocks}\x1b[0m${blank} | ${percentage.toPrecision(3)}%`); + console.log(`${padding}${lang} | ${color()}${blocks}\x1b[0m${blank} | ${percentage.toPrecision(3)}%`); }); }; -- 2.45.2 From 1c20997703f5426206dff62036ee8bbf48682a8b Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 23 Aug 2022 00:31:34 +0200 Subject: [PATCH 13/54] update packages --- package-lock.json | 226 +++++++++++++++++++++++++++------------------- package.json | 8 +- 2 files changed, 135 insertions(+), 99 deletions(-) diff --git a/package-lock.json b/package-lock.json index e59c5d1..3f7b501 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,11 @@ "version": "0.0.1", "license": "GPL-3.0-only", "dependencies": { - "@discordjs/rest": "^1.0.1", + "@discordjs/rest": "^1.1.0", "@types/sqlite3": "^3.1.8", - "discord-api-types": "^0.36.0", - "discord.js": "^14.0.3", - "sqlite3": "^5.0.10", + "discord-api-types": "^0.36.3", + "discord.js": "^14.3.0", + "sqlite3": "^5.0.11", "typescript": "^4.7.4" }, "devDependencies": { @@ -37,12 +37,12 @@ } }, "node_modules/@discordjs/builders": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.0.0.tgz", - "integrity": "sha512-8y91ZfpOHubiGJu5tVyGI9tQCEyHZDTeqUWVcJd0dq7B96xIf84S0L4fwmD1k9zTe1eqEFSk0gc7BpY+FKn7Ww==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", + "integrity": "sha512-ARy4BUTMU+S0ZI6605NDqfWO+qZqV2d/xfY32z3hVSsd9IaAKJBZ1ILTZLy87oIjW8+gUpQmk9Kt0ZP9bmmd8Q==", "dependencies": { "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.36.2", + "discord-api-types": "^0.37.3", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.4.0" @@ -51,31 +51,41 @@ "node": ">=16.9.0" } }, + "node_modules/@discordjs/builders/node_modules/discord-api-types": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", + "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + }, "node_modules/@discordjs/collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.0.1.tgz", - "integrity": "sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.1.0.tgz", + "integrity": "sha512-PQ2Bv6pnT7aGPCKWbvvNRww5tYCGpggIQVgpuF9TdDPeR6n6vQYxezXiLVOS9z2B62Dp4c+qepQ15SgJbLYtCQ==", "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.0.1.tgz", - "integrity": "sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.1.0.tgz", + "integrity": "sha512-yCrthRTQeUyNThQEpCk7bvQJlwQmz6kU0tf3dcWBv2WX3Bncl41x7Wc+v5b5OsIxfNYq38PvVtWircu9jtYZug==", "dependencies": { "@discordjs/collection": "^1.0.1", - "@sapphire/async-queue": "^1.3.2", + "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.36.3", - "file-type": "^17.1.4", + "discord-api-types": "^0.37.3", + "file-type": "^17.1.6", "tslib": "^2.4.0", - "undici": "^5.8.0" + "undici": "^5.9.1" }, "engines": { "node": ">=16.9.0" } }, + "node_modules/@discordjs/rest/node_modules/discord-api-types": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", + "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + }, "node_modules/@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", @@ -225,9 +235,9 @@ } }, "node_modules/@sapphire/async-queue": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.2.tgz", - "integrity": "sha512-rUpMLATsoAMnlN3gecAcr9Ecnw1vG7zi5Xr+IX22YzRzi1k9PF9vKzoT8RuEJbiIszjcimu3rveqUnvwDopz8g==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", + "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -957,26 +967,31 @@ "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "node_modules/discord.js": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.3.tgz", - "integrity": "sha512-wH/VQl4CqN8/+dcXEtYis1iurqxGlDpEe0O4CqH5FGqZGIjVpTdtK0STXXx7bVNX8MT/0GvLZLkmO/5gLDWZVg==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.3.0.tgz", + "integrity": "sha512-CpIwoAAuELiHSgVKRMzsCADS6ZlJwAZ9RlvcJYdEgS00aW36dSvXyBgE+S3pigkc7G+jU6BEalMUWIJFveqrBQ==", "dependencies": { - "@discordjs/builders": "^1.0.0", - "@discordjs/collection": "^1.0.0", - "@discordjs/rest": "^1.0.0", + "@discordjs/builders": "^1.2.0", + "@discordjs/collection": "^1.1.0", + "@discordjs/rest": "^1.1.0", "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.36.2", + "discord-api-types": "^0.37.3", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", "tslib": "^2.4.0", - "undici": "^5.8.0", + "undici": "^5.9.1", "ws": "^8.8.1" }, "engines": { "node": ">=16.9.0" } }, + "node_modules/discord.js/node_modules/discord-api-types": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", + "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1312,9 +1327,9 @@ } }, "node_modules/file-type": { - "version": "17.1.4", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.4.tgz", - "integrity": "sha512-3w/rJUUPBj6CYhVER3D5JCKwYJJiC36uj5dP+LnyubHI6H6FJo1TeWVCEA09YLVoZqV3/mLP26j9+Pz1GjAyjQ==", + "version": "17.1.6", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", + "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", "dependencies": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0-alpha.9", @@ -2231,11 +2246,11 @@ } }, "node_modules/peek-readable": { - "version": "5.0.0-alpha.5", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0-alpha.5.tgz", - "integrity": "sha512-pJohF/tDwV3ntnT5+EkUo4E700q/j/OCDuPxtM+5/kFGjyOai/sK4/We4Cy1MB2OiTQliWU5DxPvYIKQAdPqAA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" }, "funding": { "type": "github", @@ -2582,9 +2597,9 @@ } }, "node_modules/sqlite3": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.10.tgz", - "integrity": "sha512-xG4XPp7+b/lIlb/acs4XzBmmahI1Qq3Yhy+jZnZJivwB6DXpoOpGR6QinRbsQkHJIvMZyUsJDXouSva/JXcWFA==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.11.tgz", + "integrity": "sha512-4akFOr7u9lJEeAWLJxmwiV43DJcGV7w3ab7SjQFAFaTVyknY3rZjvXTKIVtWqUoY4xwhjwoHKYs2HDW2SoHVsA==", "hasInstallScript": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", @@ -2669,15 +2684,15 @@ } }, "node_modules/strtok3": { - "version": "7.0.0-alpha.9", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0-alpha.9.tgz", - "integrity": "sha512-G8WxjBFjTZ77toVElv1i7k3jCXNkBB14FVaZ/6LIOka/WGo4La5XHLrU7neFVLdKbXESZf4BejVKZu5maOmocA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", "dependencies": { "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.0.0-alpha.5" + "peek-readable": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" }, "funding": { "type": "github", @@ -2743,15 +2758,15 @@ } }, "node_modules/token-types": { - "version": "5.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.0-alpha.2.tgz", - "integrity": "sha512-EsG9UxAW4M6VATrEEjhPFTKEUi1OiJqTUMIZOGBN49fGxYjZB36k0p7to3HZSmWRoHm1QfZgrg3e02fpqAt5fQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", "dependencies": { "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" }, "funding": { "type": "github", @@ -2950,9 +2965,9 @@ } }, "node_modules/undici": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.8.0.tgz", - "integrity": "sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q==", + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.9.1.tgz", + "integrity": "sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg==", "engines": { "node": ">=12.18" } @@ -3107,34 +3122,48 @@ } }, "@discordjs/builders": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.0.0.tgz", - "integrity": "sha512-8y91ZfpOHubiGJu5tVyGI9tQCEyHZDTeqUWVcJd0dq7B96xIf84S0L4fwmD1k9zTe1eqEFSk0gc7BpY+FKn7Ww==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", + "integrity": "sha512-ARy4BUTMU+S0ZI6605NDqfWO+qZqV2d/xfY32z3hVSsd9IaAKJBZ1ILTZLy87oIjW8+gUpQmk9Kt0ZP9bmmd8Q==", "requires": { "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.36.2", + "discord-api-types": "^0.37.3", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.4.0" + }, + "dependencies": { + "discord-api-types": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", + "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + } } }, "@discordjs/collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.0.1.tgz", - "integrity": "sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.1.0.tgz", + "integrity": "sha512-PQ2Bv6pnT7aGPCKWbvvNRww5tYCGpggIQVgpuF9TdDPeR6n6vQYxezXiLVOS9z2B62Dp4c+qepQ15SgJbLYtCQ==" }, "@discordjs/rest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.0.1.tgz", - "integrity": "sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.1.0.tgz", + "integrity": "sha512-yCrthRTQeUyNThQEpCk7bvQJlwQmz6kU0tf3dcWBv2WX3Bncl41x7Wc+v5b5OsIxfNYq38PvVtWircu9jtYZug==", "requires": { "@discordjs/collection": "^1.0.1", - "@sapphire/async-queue": "^1.3.2", + "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.36.3", - "file-type": "^17.1.4", + "discord-api-types": "^0.37.3", + "file-type": "^17.1.6", "tslib": "^2.4.0", - "undici": "^5.8.0" + "undici": "^5.9.1" + }, + "dependencies": { + "discord-api-types": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", + "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + } } }, "@eslint/eslintrc": { @@ -3262,9 +3291,9 @@ } }, "@sapphire/async-queue": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.2.tgz", - "integrity": "sha512-rUpMLATsoAMnlN3gecAcr9Ecnw1vG7zi5Xr+IX22YzRzi1k9PF9vKzoT8RuEJbiIszjcimu3rveqUnvwDopz8g==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", + "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==" }, "@sapphire/shapeshift": { "version": "3.5.1", @@ -3783,21 +3812,28 @@ "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "discord.js": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.3.tgz", - "integrity": "sha512-wH/VQl4CqN8/+dcXEtYis1iurqxGlDpEe0O4CqH5FGqZGIjVpTdtK0STXXx7bVNX8MT/0GvLZLkmO/5gLDWZVg==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.3.0.tgz", + "integrity": "sha512-CpIwoAAuELiHSgVKRMzsCADS6ZlJwAZ9RlvcJYdEgS00aW36dSvXyBgE+S3pigkc7G+jU6BEalMUWIJFveqrBQ==", "requires": { - "@discordjs/builders": "^1.0.0", - "@discordjs/collection": "^1.0.0", - "@discordjs/rest": "^1.0.0", + "@discordjs/builders": "^1.2.0", + "@discordjs/collection": "^1.1.0", + "@discordjs/rest": "^1.1.0", "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.36.2", + "discord-api-types": "^0.37.3", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", "tslib": "^2.4.0", - "undici": "^5.8.0", + "undici": "^5.9.1", "ws": "^8.8.1" + }, + "dependencies": { + "discord-api-types": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", + "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + } } }, "doctrine": { @@ -4067,9 +4103,9 @@ } }, "file-type": { - "version": "17.1.4", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.4.tgz", - "integrity": "sha512-3w/rJUUPBj6CYhVER3D5JCKwYJJiC36uj5dP+LnyubHI6H6FJo1TeWVCEA09YLVoZqV3/mLP26j9+Pz1GjAyjQ==", + "version": "17.1.6", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", + "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", "requires": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0-alpha.9", @@ -4761,9 +4797,9 @@ "dev": true }, "peek-readable": { - "version": "5.0.0-alpha.5", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0-alpha.5.tgz", - "integrity": "sha512-pJohF/tDwV3ntnT5+EkUo4E700q/j/OCDuPxtM+5/kFGjyOai/sK4/We4Cy1MB2OiTQliWU5DxPvYIKQAdPqAA==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==" }, "picomatch": { "version": "2.3.1", @@ -4978,9 +5014,9 @@ } }, "sqlite3": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.10.tgz", - "integrity": "sha512-xG4XPp7+b/lIlb/acs4XzBmmahI1Qq3Yhy+jZnZJivwB6DXpoOpGR6QinRbsQkHJIvMZyUsJDXouSva/JXcWFA==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.11.tgz", + "integrity": "sha512-4akFOr7u9lJEeAWLJxmwiV43DJcGV7w3ab7SjQFAFaTVyknY3rZjvXTKIVtWqUoY4xwhjwoHKYs2HDW2SoHVsA==", "requires": { "@mapbox/node-pre-gyp": "^1.0.0", "node-addon-api": "^4.2.0", @@ -5036,12 +5072,12 @@ "dev": true }, "strtok3": { - "version": "7.0.0-alpha.9", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0-alpha.9.tgz", - "integrity": "sha512-G8WxjBFjTZ77toVElv1i7k3jCXNkBB14FVaZ/6LIOka/WGo4La5XHLrU7neFVLdKbXESZf4BejVKZu5maOmocA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", "requires": { "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.0.0-alpha.5" + "peek-readable": "^5.0.0" } }, "supports-color": { @@ -5088,9 +5124,9 @@ } }, "token-types": { - "version": "5.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.0-alpha.2.tgz", - "integrity": "sha512-EsG9UxAW4M6VATrEEjhPFTKEUi1OiJqTUMIZOGBN49fGxYjZB36k0p7to3HZSmWRoHm1QfZgrg3e02fpqAt5fQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", "requires": { "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" @@ -5225,9 +5261,9 @@ "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" }, "undici": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.8.0.tgz", - "integrity": "sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q==" + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.9.1.tgz", + "integrity": "sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg==" }, "unique-filename": { "version": "1.1.1", diff --git a/package.json b/package.json index d2efb16..1fa46dc 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,11 @@ "author": "La confrérie du Kassoulait", "license": "GPL-3.0-only", "dependencies": { - "@discordjs/rest": "^1.0.1", + "@discordjs/rest": "^1.1.0", "@types/sqlite3": "^3.1.8", - "discord-api-types": "^0.36.0", - "discord.js": "^14.0.3", - "sqlite3": "^5.0.10", + "discord-api-types": "^0.36.3", + "discord.js": "^14.3.0", + "sqlite3": "^5.0.11", "typescript": "^4.7.4" }, "devDependencies": { -- 2.45.2 From 1126072371f4dba9fe67285f917a2ae02e8a771f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 29 Aug 2022 18:37:49 +0200 Subject: [PATCH 14/54] fix eslint shadow with typescript --- .eslintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index e4ec140..10787ca 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -31,7 +31,8 @@ "no-lonely-if": "error", "no-multi-spaces": "error", "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], - "no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }], + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }], "no-trailing-spaces": ["error"], "no-var": "error", "object-curly-spacing": ["error", "always"], -- 2.45.2 From 47b00e8b95ac0b3ab1c23167cb8c8d0610946dc9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 29 Aug 2022 18:38:23 +0200 Subject: [PATCH 15/54] WIP: Handle reminder creation --- src/commands/misc/reminder.ts | 48 +++++++++++++++++++++++++++++------ src/locales/fr.json | 2 +- src/utils/time.ts | 9 +++++++ 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 9f5c81f..35ee7e0 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,7 +1,8 @@ import { SlashCommandBuilder } from '@discordjs/builders'; import { Client, ChatInputCommandInteraction } from 'discord.js'; -import { getLocale, getLocalizations } from '../../utils/locales'; +import { getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; +import { strToSeconds } from '../../utils/time'; export default { data: (client: Client) => { @@ -145,7 +146,7 @@ export default { switch (subcommand) { // New reminder case loc_default?.get(`c_${filename}_sub1_name`) - ?.toLowerCase() ?? '': + ?.toLowerCase() ?? '': { // TODO: Ici il y a 2 options, l'un pour le temps et l'autre // pour le message, il faut tout le temps un temps, mais pas // tout le temps de message (= message par défaut, le reminder @@ -158,11 +159,34 @@ export default { // qui préfèrent tout faire en ligne de commandes et un truc // plus user-friendly avec une interface (et en plus c'est // nouveau et cool) - break; + // eslint-disable-next-line no-case-declarations + let time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string); + const message = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string); + if (time != null) { + // Cli + let option = OptionReminder.Nothing; + + // Split time + if (time?.endsWith('@')) { + time = time.slice(0, -1); + option = OptionReminder.Mention; + } else if (time?.toLowerCase().endsWith('p')) { + time = time.slice(0, -1); + option = OptionReminder.DirectMessage; + } + + const seconds = strToSeconds(time); + await interaction.reply(`${option} - ${seconds}`); + } else { + // Boîte de dialogue + } + + break; + } // List reminders case loc_default?.get(`c_${filename}_sub2_name`) - ?.toLowerCase() ?? '': + ?.toLowerCase() ?? '': { // TODO: Liste dans un embed, naviguez entre les pages à l'aide // de boutons à la place d'utiliser des réactions // cf. https://discordjs.guide/interactions/modals.html#building-and-responding-with-modals @@ -171,18 +195,26 @@ export default { // rappels, sinon affiché les rappels de la personne qui fait // la commande. break; - + } // Delete a reminder case loc_default?.get(`c_${filename}_sub3_name`) - ?.toLowerCase() ?? '': + ?.toLowerCase() ?? '': { // TODO: Message simple qui indique que l'on a supprimé // le reminder. Penser à check l'appartenance du reminder. // On donne l'ID du reminder en option. break; - - default: + } + default: { console.error(`${__filename}: unknown subcommand (${subcommand})`); break; + } } }, }; + + +enum OptionReminder { + Nothing, + Mention, + DirectMessage, +} diff --git a/src/locales/fr.json b/src/locales/fr.json index e47c1e2..8d7bbd0 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -21,7 +21,7 @@ "c_reminder_sub1_name": "nouveau", "c_reminder_sub1_desc": "Met en place un rappel", "c_reminder_sub1_opt1_name": "temps", - "c_reminder_sub1_opt1_desc": "Temps désiré avant le rappel", + "c_reminder_sub1_opt1_desc": "Temps désiré avant le rappel, accolez un @ pour activer la mention ou un p pour envoyer en DM", "c_reminder_sub1_opt2_name": "message", "c_reminder_sub1_opt2_desc": "Message du rappel", "c_reminder_sub2_name": "liste", diff --git a/src/utils/time.ts b/src/utils/time.ts index b44614e..12434c1 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -14,3 +14,12 @@ export const showDate = ( locale.get('u_time_at') } `); }; + +/** + * Take a cooldown, for example 2min and transform it to seconds, here: 120s + * @param time time in human format + * @returns time in seconds + */ +export const strToSeconds = (time: string) => { + return 0; +}; -- 2.45.2 From b83a1d30537142569499eb0079128d88e6d1ddcc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 3 Nov 2022 16:13:08 +0100 Subject: [PATCH 16/54] update dependencies --- package-lock.json | 931 ++++++++++++++++++++++++++++++---------------- 1 file changed, 600 insertions(+), 331 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f7b501..454263f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,12 +37,13 @@ } }, "node_modules/@discordjs/builders": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", - "integrity": "sha512-ARy4BUTMU+S0ZI6605NDqfWO+qZqV2d/xfY32z3hVSsd9IaAKJBZ1ILTZLy87oIjW8+gUpQmk9Kt0ZP9bmmd8Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.3.0.tgz", + "integrity": "sha512-Pvca6Nw8Hp+n3N+Wp17xjygXmMvggbh5ywUsOYE2Et4xkwwVRwgzxDJiMUuYapPtnYt4w/8aKlf5khc8ipLvhg==", "dependencies": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.37.3", + "@discordjs/util": "^0.1.0", + "@sapphire/shapeshift": "^3.7.0", + "discord-api-types": "^0.37.12", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.4.0" @@ -52,49 +53,58 @@ } }, "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.37.4", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", - "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + "version": "0.37.16", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", + "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" }, "node_modules/@discordjs/collection": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.1.0.tgz", - "integrity": "sha512-PQ2Bv6pnT7aGPCKWbvvNRww5tYCGpggIQVgpuF9TdDPeR6n6vQYxezXiLVOS9z2B62Dp4c+qepQ15SgJbLYtCQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.2.0.tgz", + "integrity": "sha512-VvrrtGb7vbfPHzbhGq9qZB5o8FOB+kfazrxdt0OtxzSkoBuw9dURMkCwWizZ00+rDpiK2HmLHBZX+y6JsG9khw==", "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.1.0.tgz", - "integrity": "sha512-yCrthRTQeUyNThQEpCk7bvQJlwQmz6kU0tf3dcWBv2WX3Bncl41x7Wc+v5b5OsIxfNYq38PvVtWircu9jtYZug==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.3.0.tgz", + "integrity": "sha512-U6X5J+r/MxYpPTlHFuPxXEf92aKsBaD2teBC7sWkKILIr30O8c9+XshfL7KFBCavnAqS/qE+PF9fgRilO3N44g==", "dependencies": { - "@discordjs/collection": "^1.0.1", + "@discordjs/collection": "^1.2.0", + "@discordjs/util": "^0.1.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.3", - "file-type": "^17.1.6", + "discord-api-types": "^0.37.12", + "file-type": "^18.0.0", "tslib": "^2.4.0", - "undici": "^5.9.1" + "undici": "^5.11.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest/node_modules/discord-api-types": { - "version": "0.37.4", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", - "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + "version": "0.37.16", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", + "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + }, + "node_modules/@discordjs/util": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.1.0.tgz", + "integrity": "sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==", + "engines": { + "node": ">=16.9.0" + } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", + "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -104,6 +114,9 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@gar/promisify": { @@ -113,19 +126,32 @@ "optional": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", + "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -158,9 +184,9 @@ } }, "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", - "integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -244,9 +270,9 @@ } }, "node_modules/@sapphire/shapeshift": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz", - "integrity": "sha512-7JFsW5IglyOIUQI1eE0g6h06D/Far6HqpcowRScgCiLSqTf3hhkPWCWotVTtVycnDCMYIwPeaw6IEPBomKC8pA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.0.tgz", + "integrity": "sha512-A6vI1zJoxhjWo4grsxpBRBgk96SqSdjLX5WlzKp9H+bJbkM07mvwcbtbVAmUZHbi/OG3HLfiZ1rlw4BhH6tsBQ==", "dependencies": { "fast-deep-equal": "^3.1.3", "lodash.uniqwith": "^4.5.0" @@ -310,9 +336,15 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz", - "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ==" + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + }, + "node_modules/@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true }, "node_modules/@types/sqlite3": { "version": "3.1.8", @@ -343,17 +375,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.31.0.tgz", - "integrity": "sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz", + "integrity": "sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/type-utils": "5.31.0", - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/type-utils": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" @@ -376,14 +408,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.31.0.tgz", - "integrity": "sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.0.tgz", + "integrity": "sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "debug": "^4.3.4" }, "engines": { @@ -403,13 +435,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz", - "integrity": "sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", + "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0" + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -420,12 +452,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz", - "integrity": "sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz", + "integrity": "sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -446,9 +479,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.31.0.tgz", - "integrity": "sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", + "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -459,13 +492,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz", - "integrity": "sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", + "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -486,17 +519,19 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.31.0.tgz", - "integrity": "sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.42.0.tgz", + "integrity": "sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -510,12 +545,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz", - "integrity": "sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", + "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.31.0", + "@typescript-eslint/types": "5.42.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -532,9 +567,9 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -730,6 +765,17 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/cacache": { "version": "15.3.0", "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", @@ -967,30 +1013,31 @@ "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "node_modules/discord.js": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.3.0.tgz", - "integrity": "sha512-CpIwoAAuELiHSgVKRMzsCADS6ZlJwAZ9RlvcJYdEgS00aW36dSvXyBgE+S3pigkc7G+jU6BEalMUWIJFveqrBQ==", + "version": "14.6.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.6.0.tgz", + "integrity": "sha512-On1K7xpJZRe0KsziIaDih2ksYPhgxym/ZqV45i1f3yig4vUotikqs7qp5oXiTzQ/UTiNRCixUWFTh7vA1YBCqw==", "dependencies": { - "@discordjs/builders": "^1.2.0", - "@discordjs/collection": "^1.1.0", - "@discordjs/rest": "^1.1.0", + "@discordjs/builders": "^1.3.0", + "@discordjs/collection": "^1.2.0", + "@discordjs/rest": "^1.3.0", + "@discordjs/util": "^0.1.0", "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.3", + "discord-api-types": "^0.37.12", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", "tslib": "^2.4.0", - "undici": "^5.9.1", - "ws": "^8.8.1" + "undici": "^5.11.0", + "ws": "^8.9.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.4", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", - "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + "version": "0.37.16", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", + "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" }, "node_modules/doctrine": { "version": "3.0.0", @@ -1005,9 +1052,9 @@ } }, "node_modules/dotenv": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", - "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", "dev": true, "engines": { "node": ">=12" @@ -1064,13 +1111,15 @@ } }, "node_modules/eslint": { - "version": "8.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz", - "integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==", + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", + "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.11.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -1080,18 +1129,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.4.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", "globals": "^13.15.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -1102,8 +1154,7 @@ "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" @@ -1187,17 +1238,20 @@ } }, "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "dependencies": { - "acorn": "^8.7.1", + "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { @@ -1266,9 +1320,9 @@ "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==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -1327,16 +1381,16 @@ } }, "node_modules/file-type": { - "version": "17.1.6", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", - "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.0.0.tgz", + "integrity": "sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==", "dependencies": { "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0-alpha.9", - "token-types": "^5.0.0-alpha.2" + "strtok3": "^7.0.0", + "token-types": "^5.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/file-type?sponsor=1" @@ -1354,6 +1408,22 @@ "node": ">=8" } }, + "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/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -1368,9 +1438,9 @@ } }, "node_modules/flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "node_modules/fs-minipass": { @@ -1409,12 +1479,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/gauge": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", @@ -1506,6 +1570,12 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "optional": true }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1686,9 +1756,9 @@ } }, "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==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -1741,12 +1811,27 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "devOptional": true }, + "node_modules/js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1784,6 +1869,21 @@ "node": ">= 0.8.0" } }, + "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": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1900,10 +2000,13 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/minipass": { "version": "3.3.4", @@ -2015,6 +2118,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -2186,6 +2295,36 @@ "node": ">= 0.8.0" } }, + "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/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/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -2213,6 +2352,15 @@ "node": ">=6" } }, + "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==", + "dev": true, + "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", @@ -2486,9 +2634,9 @@ "optional": true }, "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==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -2550,9 +2698,9 @@ } }, "node_modules/socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "optional": true, "dependencies": { "ip": "^2.0.0", @@ -2597,9 +2745,9 @@ } }, "node_modules/sqlite3": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.11.tgz", - "integrity": "sha512-4akFOr7u9lJEeAWLJxmwiV43DJcGV7w3ab7SjQFAFaTVyknY3rZjvXTKIVtWqUoY4xwhjwoHKYs2HDW2SoHVsA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.2.tgz", + "integrity": "sha512-D0Reg6pRWAFXFUnZKsszCI67tthFD8fGPewRddDCX6w4cYwz3MbvuwRICbL+YQjBAh9zbw+lJ/V9oC8nG5j6eg==", "hasInstallScript": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", @@ -2630,6 +2778,14 @@ "node": ">= 8" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -2724,9 +2880,9 @@ } }, "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -2736,7 +2892,7 @@ "yallist": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">=10" } }, "node_modules/text-table": { @@ -2903,9 +3059,9 @@ } }, "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -2953,9 +3109,9 @@ } }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2965,9 +3121,12 @@ } }, "node_modules/undici": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.9.1.tgz", - "integrity": "sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.12.0.tgz", + "integrity": "sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==", + "dependencies": { + "busboy": "^1.6.0" + }, "engines": { "node": ">=12.18" } @@ -3004,12 +3163,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -3068,9 +3221,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", + "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", "engines": { "node": ">=10.0.0" }, @@ -3109,6 +3262,18 @@ "engines": { "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" + } } }, "dependencies": { @@ -3122,59 +3287,66 @@ } }, "@discordjs/builders": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", - "integrity": "sha512-ARy4BUTMU+S0ZI6605NDqfWO+qZqV2d/xfY32z3hVSsd9IaAKJBZ1ILTZLy87oIjW8+gUpQmk9Kt0ZP9bmmd8Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.3.0.tgz", + "integrity": "sha512-Pvca6Nw8Hp+n3N+Wp17xjygXmMvggbh5ywUsOYE2Et4xkwwVRwgzxDJiMUuYapPtnYt4w/8aKlf5khc8ipLvhg==", "requires": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.37.3", + "@discordjs/util": "^0.1.0", + "@sapphire/shapeshift": "^3.7.0", + "discord-api-types": "^0.37.12", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.4.0" }, "dependencies": { "discord-api-types": { - "version": "0.37.4", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", - "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + "version": "0.37.16", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", + "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" } } }, "@discordjs/collection": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.1.0.tgz", - "integrity": "sha512-PQ2Bv6pnT7aGPCKWbvvNRww5tYCGpggIQVgpuF9TdDPeR6n6vQYxezXiLVOS9z2B62Dp4c+qepQ15SgJbLYtCQ==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.2.0.tgz", + "integrity": "sha512-VvrrtGb7vbfPHzbhGq9qZB5o8FOB+kfazrxdt0OtxzSkoBuw9dURMkCwWizZ00+rDpiK2HmLHBZX+y6JsG9khw==" }, "@discordjs/rest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.1.0.tgz", - "integrity": "sha512-yCrthRTQeUyNThQEpCk7bvQJlwQmz6kU0tf3dcWBv2WX3Bncl41x7Wc+v5b5OsIxfNYq38PvVtWircu9jtYZug==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.3.0.tgz", + "integrity": "sha512-U6X5J+r/MxYpPTlHFuPxXEf92aKsBaD2teBC7sWkKILIr30O8c9+XshfL7KFBCavnAqS/qE+PF9fgRilO3N44g==", "requires": { - "@discordjs/collection": "^1.0.1", + "@discordjs/collection": "^1.2.0", + "@discordjs/util": "^0.1.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.3", - "file-type": "^17.1.6", + "discord-api-types": "^0.37.12", + "file-type": "^18.0.0", "tslib": "^2.4.0", - "undici": "^5.9.1" + "undici": "^5.11.0" }, "dependencies": { "discord-api-types": { - "version": "0.37.4", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", - "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + "version": "0.37.16", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", + "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" } } }, + "@discordjs/util": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.1.0.tgz", + "integrity": "sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==" + }, "@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", + "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -3190,16 +3362,22 @@ "optional": true }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", + "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" } }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -3229,9 +3407,9 @@ } }, "@mapbox/node-pre-gyp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz", - "integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", "requires": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -3296,9 +3474,9 @@ "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==" }, "@sapphire/shapeshift": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz", - "integrity": "sha512-7JFsW5IglyOIUQI1eE0g6h06D/Far6HqpcowRScgCiLSqTf3hhkPWCWotVTtVycnDCMYIwPeaw6IEPBomKC8pA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.0.tgz", + "integrity": "sha512-A6vI1zJoxhjWo4grsxpBRBgk96SqSdjLX5WlzKp9H+bJbkM07mvwcbtbVAmUZHbi/OG3HLfiZ1rlw4BhH6tsBQ==", "requires": { "fast-deep-equal": "^3.1.3", "lodash.uniqwith": "^4.5.0" @@ -3351,9 +3529,15 @@ "dev": true }, "@types/node": { - "version": "18.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz", - "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ==" + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + }, + "@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true }, "@types/sqlite3": { "version": "3.1.8", @@ -3384,69 +3568,70 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.31.0.tgz", - "integrity": "sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz", + "integrity": "sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/type-utils": "5.31.0", - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/type-utils": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.31.0.tgz", - "integrity": "sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.0.tgz", + "integrity": "sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz", - "integrity": "sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", + "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", "dev": true, "requires": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0" + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0" } }, "@typescript-eslint/type-utils": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz", - "integrity": "sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz", + "integrity": "sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.31.0.tgz", - "integrity": "sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", + "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz", - "integrity": "sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", + "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3455,26 +3640,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.31.0.tgz", - "integrity": "sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.42.0.tgz", + "integrity": "sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz", - "integrity": "sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", + "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.31.0", + "@typescript-eslint/types": "5.42.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -3484,9 +3671,9 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true }, "acorn-jsx": { @@ -3634,6 +3821,14 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "requires": { + "streamsearch": "^1.1.0" + } + }, "cacache": { "version": "15.3.0", "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", @@ -3812,27 +4007,28 @@ "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "discord.js": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.3.0.tgz", - "integrity": "sha512-CpIwoAAuELiHSgVKRMzsCADS6ZlJwAZ9RlvcJYdEgS00aW36dSvXyBgE+S3pigkc7G+jU6BEalMUWIJFveqrBQ==", + "version": "14.6.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.6.0.tgz", + "integrity": "sha512-On1K7xpJZRe0KsziIaDih2ksYPhgxym/ZqV45i1f3yig4vUotikqs7qp5oXiTzQ/UTiNRCixUWFTh7vA1YBCqw==", "requires": { - "@discordjs/builders": "^1.2.0", - "@discordjs/collection": "^1.1.0", - "@discordjs/rest": "^1.1.0", + "@discordjs/builders": "^1.3.0", + "@discordjs/collection": "^1.2.0", + "@discordjs/rest": "^1.3.0", + "@discordjs/util": "^0.1.0", "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.3", + "discord-api-types": "^0.37.12", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", "tslib": "^2.4.0", - "undici": "^5.9.1", - "ws": "^8.8.1" + "undici": "^5.11.0", + "ws": "^8.9.0" }, "dependencies": { "discord-api-types": { - "version": "0.37.4", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.4.tgz", - "integrity": "sha512-QgqYlUokWM++hdwvAtgVNLjmFumPBzFy+uWnnfVDiwBXKm+5jXHJPk2lx2eilkv/706UpAJPLSk/uVCY9NocjA==" + "version": "0.37.16", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", + "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" } } }, @@ -3846,9 +4042,9 @@ } }, "dotenv": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", - "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", "dev": true }, "dynamic-dedupe": { @@ -3893,13 +4089,15 @@ "dev": true }, "eslint": { - "version": "8.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz", - "integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==", + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", + "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.11.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -3909,18 +4107,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.4.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", "globals": "^13.15.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -3931,8 +4132,7 @@ "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "dependencies": { "eslint-scope": { @@ -3987,12 +4187,12 @@ "dev": true }, "espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "requires": { - "acorn": "^8.7.1", + "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } @@ -4049,9 +4249,9 @@ "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==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -4103,13 +4303,13 @@ } }, "file-type": { - "version": "17.1.6", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", - "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.0.0.tgz", + "integrity": "sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==", "requires": { "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0-alpha.9", - "token-types": "^5.0.0-alpha.2" + "strtok3": "^7.0.0", + "token-types": "^5.0.1" } }, "fill-range": { @@ -4121,6 +4321,16 @@ "to-regex-range": "^5.0.1" } }, + "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" + } + }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -4132,9 +4342,9 @@ } }, "flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "fs-minipass": { @@ -4163,12 +4373,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "gauge": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", @@ -4236,6 +4440,12 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "optional": true }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -4369,9 +4579,9 @@ } }, "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==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "requires": { "has": "^1.0.3" @@ -4409,12 +4619,24 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "devOptional": true }, + "js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true + }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -4446,6 +4668,15 @@ "type-check": "~0.4.0" } }, + "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" + } + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4540,9 +4771,9 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "minipass": { @@ -4626,6 +4857,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -4755,6 +4992,24 @@ "word-wrap": "^1.2.3" } }, + "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" + } + }, "p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -4773,6 +5028,12 @@ "callsites": "^3.0.0" } }, + "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==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -4932,9 +5193,9 @@ "optional": true }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "requires": { "lru-cache": "^6.0.0" } @@ -4977,9 +5238,9 @@ "optional": true }, "socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "optional": true, "requires": { "ip": "^2.0.0", @@ -5014,9 +5275,9 @@ } }, "sqlite3": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.11.tgz", - "integrity": "sha512-4akFOr7u9lJEeAWLJxmwiV43DJcGV7w3ab7SjQFAFaTVyknY3rZjvXTKIVtWqUoY4xwhjwoHKYs2HDW2SoHVsA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.2.tgz", + "integrity": "sha512-D0Reg6pRWAFXFUnZKsszCI67tthFD8fGPewRddDCX6w4cYwz3MbvuwRICbL+YQjBAh9zbw+lJ/V9oC8nG5j6eg==", "requires": { "@mapbox/node-pre-gyp": "^1.0.0", "node-addon-api": "^4.2.0", @@ -5033,6 +5294,11 @@ "minipass": "^3.1.1" } }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -5096,9 +5362,9 @@ "dev": true }, "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -5219,9 +5485,9 @@ } }, "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, "tsutils": { "version": "3.21.0", @@ -5256,14 +5522,17 @@ "dev": true }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==" }, "undici": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.9.1.tgz", - "integrity": "sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg==" + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.12.0.tgz", + "integrity": "sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==", + "requires": { + "busboy": "^1.6.0" + } }, "unique-filename": { "version": "1.1.1", @@ -5297,12 +5566,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -5352,9 +5615,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", + "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", "requires": {} }, "xtend": { @@ -5373,6 +5636,12 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true + }, + "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 } } } -- 2.45.2 From 0bdd2af66e29034bf67737b6f4c4cf15ab5bab41 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 3 Nov 2022 17:21:27 +0100 Subject: [PATCH 17/54] create table --- src/utils/client.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index 7ef2b74..f044399 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -27,9 +27,9 @@ export default async () => { console.log('Translations progression :'); client.locales = await loadLocales(client.config.default_lang); - client.db = new Database(`${ - process.env.DOCKERIZED === '1' ? '/config' : './config' - }/db.sqlite3`); + client.db = new Database(`${process.env.DOCKERIZED === '1' ? '/config' : './config'}/db.sqlite3`); + + initDatabase(client.db); return client; }; @@ -41,3 +41,19 @@ export const quit = (client: Client) => { // Close client client.destroy(); }; + + +const initDatabase = (db: Database) => { + // Table for reminders + db.run('CREATE TABLE IF NOT EXISTS reminder ( \ + id INTEGER PRIMARY KEY, \ + data TEXT, \ + expiration_date INTEGER, \ + message_id INTEGER, \ + option_id INTEGER, \ + channel_id INTEGER, \ + creation_date INTEGER, \ + user_id INTEGER, \ + guild_id INTEGER \ + );'); +}; -- 2.45.2 From 21e69cf0c2565599a887d1a25c7e0eaeab0a4993 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 3 Nov 2022 17:21:43 +0100 Subject: [PATCH 18/54] translate human time to seconds --- src/utils/time.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/utils/time.ts b/src/utils/time.ts index 12434c1..bbbc6f5 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -10,16 +10,34 @@ export const showDate = ( locale: Map, date: Date ) => { - return date.toLocaleString(tz).replace(' ', ` ${ - locale.get('u_time_at') - } `); + return date.toLocaleString(tz).replace(' ', ` ${locale.get('u_time_at')} `); }; +enum TimeSecond { + Year = 31536000, + Week = 604800, + Day = 86400, + Hour = 3600, + Minute = 60, + Second = 1 +} + /** * Take a cooldown, for example 2min and transform it to seconds, here: 120s * @param time time in human format * @returns time in seconds */ export const strToSeconds = (time: string) => { - return 0; + const regex = new RegExp(`(?<${TimeSecond[TimeSecond.Year]}>[0-9]+(?=[y|a]))|(?<${TimeSecond[TimeSecond.Week]}>[0-9]+(?=[w]))|(?<${TimeSecond[TimeSecond.Day]}>[0-9]+(?=[d|j]))|(?<${TimeSecond[TimeSecond.Hour]}>[0-9]+(?=[h]))|(?<${TimeSecond[TimeSecond.Minute]}>[0-9]+(?=[m]))|(?<${TimeSecond[TimeSecond.Second]}>[0-9]+(?=[s]?))`); + + const data = Object.assign({}, regex.exec(time)?.groups); + + let res = 0; + Object.entries(data).forEach(([key, value]) => { + if (value) { + res += +value * TimeSecond[key as keyof typeof TimeSecond]; + } + }); + + return res; }; -- 2.45.2 From a85157fe44b0ce36417eecfc72b76dbd7ec5aa91 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 3 Nov 2022 17:45:06 +0100 Subject: [PATCH 19/54] remove message id --- src/utils/client.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index f044399..c5dba9a 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -49,7 +49,6 @@ const initDatabase = (db: Database) => { id INTEGER PRIMARY KEY, \ data TEXT, \ expiration_date INTEGER, \ - message_id INTEGER, \ option_id INTEGER, \ channel_id INTEGER, \ creation_date INTEGER, \ -- 2.45.2 From 8c7b87dbacbcedf02b71883106c97c2c70dcb0d1 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 3 Nov 2022 17:45:14 +0100 Subject: [PATCH 20/54] push the reminder to the db --- src/commands/misc/reminder.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 35ee7e0..179c04d 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -163,9 +163,10 @@ export default { // eslint-disable-next-line no-case-declarations let time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string); const message = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string); + let option = OptionReminder.Nothing; + let seconds: number; if (time != null) { // Cli - let option = OptionReminder.Nothing; // Split time if (time?.endsWith('@')) { @@ -176,12 +177,17 @@ export default { option = OptionReminder.DirectMessage; } - const seconds = strToSeconds(time); + seconds = strToSeconds(time); await interaction.reply(`${option} - ${seconds}`); } else { // Boîte de dialogue + seconds = 0; } + client.db.run('INSERT INTO reminder ( \ + data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ + ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [message, interaction.createdAt.getTime() + seconds, option.valueOf(), interaction.channelId, interaction.createdAt.getTime(), interaction.user.id, interaction.guildId]); + break; } // List reminders -- 2.45.2 From 694d41a1281078fb581e639b7a8e506b7f9d5ac7 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 4 Nov 2022 21:10:56 +0100 Subject: [PATCH 21/54] * Better handle of errors * Add Modal support * Use modal for reminder * Add TODOs --- src/commands/misc/reminder.ts | 39 +++++++++++++++----- src/events/interactions/interactionCreate.ts | 36 +++++++++++++----- src/events/loader.ts | 1 + src/index.ts | 22 ++++++++--- src/modals/loader.ts | 36 ++++++++++++++++++ src/modals/misc/reminderGUI.ts | 21 +++++++++++ src/modules/client.ts | 22 +++++++++++ src/utils/client.ts | 5 +++ src/utils/misc.ts | 1 + 9 files changed, 159 insertions(+), 24 deletions(-) create mode 100644 src/modals/loader.ts create mode 100644 src/modals/misc/reminderGUI.ts diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 179c04d..8483331 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,5 +1,5 @@ -import { SlashCommandBuilder } from '@discordjs/builders'; -import { Client, ChatInputCommandInteraction } from 'discord.js'; +import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/builders'; +import { Client, ChatInputCommandInteraction, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } from 'discord.js'; import { getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { strToSeconds } from '../../utils/time'; @@ -160,7 +160,6 @@ export default { // plus user-friendly avec une interface (et en plus c'est // nouveau et cool) - // eslint-disable-next-line no-case-declarations let time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string); const message = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string); let option = OptionReminder.Nothing; @@ -178,16 +177,36 @@ export default { } seconds = strToSeconds(time); + + // Add the remind to the db + client.db.run('INSERT INTO reminder ( \ + data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ + ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [message, interaction.createdAt.getTime() + seconds, option.valueOf(), interaction.channelId, interaction.createdAt.getTime(), interaction.user.id, interaction.guildId]); + + // Send confirmation to user + // TODO: local await interaction.reply(`${option} - ${seconds}`); } else { - // Boîte de dialogue - seconds = 0; + // GUI + // TODO: local + const modal = new ModalBuilder() + .setCustomId('reminderGUI') + .setTitle('LOC_reminder'); + + // TODO: local + const timeGUI = new TextInputBuilder() + .setCustomId('timeGUI') + .setLabel('LOC_time') + .setStyle(TextInputStyle.Short) + .setPlaceholder('1h') + .setRequired(true); + + modal.addComponents(new ActionRowBuilder().addComponents(timeGUI)); + + await interaction.showModal(modal); + + // Response of the modal in /src/modals/misc/reminder } - - client.db.run('INSERT INTO reminder ( \ - data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ - ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [message, interaction.createdAt.getTime() + seconds, option.valueOf(), interaction.channelId, interaction.createdAt.getTime(), interaction.user.id, interaction.guildId]); - break; } // List reminders diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index b2b42e9..d6405ce 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -3,16 +3,34 @@ import { getLocale } from '../../utils/locales'; /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */ export default (interaction: Interaction, client: Client) => { - if (interaction.type === InteractionType.ApplicationCommand) { - const command = client.commands.list.get(interaction.commandName); - if (!command) { - const loc = getLocale(client, interaction.locale); - return interaction.reply({ - content: loc.get('e_interacreate_no_command'), - ephemeral: true, - }); + const loc = getLocale(client, interaction.locale); + switch (interaction.type) { + case InteractionType.ApplicationCommand: { + const command = client.commands.list.get(interaction.commandName); + if (!command) { + return interaction.reply({ + content: loc.get('e_interacreate_no_command'), + ephemeral: true, + }); + } + + return command.interaction(interaction, client); } - return command.interaction(interaction, client); + case InteractionType.ModalSubmit: { + const modal = client.modals.list.get(interaction.customId); + if (!modal) { + return interaction.reply({ + // TODO: locale + content: `can't find ${interaction.customId}`, + ephemeral: true, + }); + } + + return modal.interaction(interaction, client); + } + + default: + break; } }; diff --git a/src/events/loader.ts b/src/events/loader.ts index b33cb65..e8b2a69 100644 --- a/src/events/loader.ts +++ b/src/events/loader.ts @@ -18,6 +18,7 @@ export default async (client: Client) => { ); // Remove extension + // TODO: use utils functions const event_type_ext = event_file.split('.'); const ext = event_type_ext.pop(); if (!(ext === 'js' || ext === 'ts')) { diff --git a/src/index.ts b/src/index.ts index 3745384..80ddc0f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import loadClient, { quit } from './utils/client'; import loadEvents from './events/loader'; +import loadModals from './modals/loader'; import loadCommands from './commands/loader'; import { logStart } from './utils/misc'; @@ -19,27 +20,37 @@ const run = async () => { const client_name = 'Client'; await loadClient() .then(async client => { - console.log(logStart(client_name, true)); - // Events Discord.JS const events_name = 'Events'; await loadEvents(client) .then(() => console.log(logStart(events_name, true))) - .catch(() => { + .catch((err) => { + console.error(err); throw logStart(events_name, false); }); // Connect the bot to Discord.com await client.login(client.config.token_discord); + // Modals Discord.JS + const modals_name = 'Modals'; + await loadModals(client) + .then(() => console.log(logStart(modals_name, true))) + .catch((err) => { + console.error(err); + throw logStart(modals_name, false); + }); + // Commands Slash Discord.JS const commands_name = 'Commands'; await loadCommands(client) .then(() => console.log(logStart(commands_name, true))) - .catch(() => { + .catch((err) => { + console.error(err); throw logStart(commands_name, false); }); + console.log(logStart(client_name, true)); console.log(`Botanique "${client.user?.username}" v${client.config.version} started!`); // ^C @@ -48,7 +59,8 @@ const run = async () => { // Container force closed process.on('SIGTERM', () => quit(client)); }) - .catch(() => { + .catch((err) => { + console.error(err); throw logStart(client_name, false); }); }; diff --git a/src/modals/loader.ts b/src/modals/loader.ts new file mode 100644 index 0000000..56e2aea --- /dev/null +++ b/src/modals/loader.ts @@ -0,0 +1,36 @@ +import { readdir } from 'fs/promises'; +import { removeExtension } from '../utils/misc'; +import { Client } from 'discord.js'; + +export default async (client: Client) => { + // Dossier des modals + const modals_categories = (await readdir(__dirname)) + .filter(element => !element.endsWith('.js') && !element.endsWith('.ts')); + + await Promise.all( + // For each categorie + modals_categories.map(async modals_category => { + // Retrieve all the commands + const modal_files = await readdir(`${__dirname}/${modals_category}`); + + // Add the category to the collection for the help command + client.modals.categories.set( + modals_category, + modal_files.map(removeExtension), + ); + + // Add the modal + return Promise.all( + modal_files.map(async modal_file => { + const modal = ( + await import(`../modals/${modals_category}/${modal_file}`) + ).default; + + // Add it to the collection so the interaction will work + client.modals.list.set(modal.data.name, modal); + return modal.data; + }), + ); + }), + ); +}; diff --git a/src/modals/misc/reminderGUI.ts b/src/modals/misc/reminderGUI.ts new file mode 100644 index 0000000..b1078b1 --- /dev/null +++ b/src/modals/misc/reminderGUI.ts @@ -0,0 +1,21 @@ +import { ModalSubmitInteraction } from 'discord.js'; +import { getFilename } from '../../utils/misc'; + +export default { + data: { + name: getFilename(__filename), + }, + interaction: async (interaction: ModalSubmitInteraction) => { + if (!interaction.isModalSubmit()) { + console.log('not modal called modal :/'); + return; + } + + const time = interaction.fields.fields.get('timeGUI')?.value; + + return interaction.reply({ + content: `${time}`, + ephemeral: true, + }); + }, +}; diff --git a/src/modules/client.ts b/src/modules/client.ts index b314580..a70ae18 100644 --- a/src/modules/client.ts +++ b/src/modules/client.ts @@ -16,6 +16,28 @@ declare module 'discord.js' { /** Default lang used */ default_lang: string }, + /** Store all the modals */ + modals: { + categories: Collection< + /** Category name */ + string, + /** Name of the modals in the category */ + string[] + >, + list: Collection< + /** Modal name */ + string, + /** Modal itself */ + { + /** Data about the modal */ + data: { + name: string + }, + /** How the modal interact */ + interaction: (interaction: ModalSubmitInteraction, client: Client) => unknown + } + >, + } /** Store all the slash commands */ commands: { categories: Collection< diff --git a/src/utils/client.ts b/src/utils/client.ts index c5dba9a..9725d9c 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -19,6 +19,11 @@ export default async () => { default_lang: process.env.DEFAULT_LANG ?? 'fr', }; + client.modals = { + categories: new Collection(), + list: new Collection(), + }; + client.commands = { categories: new Collection(), list: new Collection(), diff --git a/src/utils/misc.ts b/src/utils/misc.ts index 0393cc0..2708b92 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -7,6 +7,7 @@ import { GuildMember } from 'discord.js'; * @returns String */ export const logStart = (name: string, status: boolean) => { + // TODO Handle precision about the error if status is false return `> ${name} ${status === true ? '✅' : '❌'}`; }; -- 2.45.2 From c7933d4aa922508e4cc9a8c0ac0bcdf7bc63fccc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 6 Nov 2022 01:23:49 +0100 Subject: [PATCH 22/54] * complete implementation of remind add * add locales --- src/commands/misc/reminder.ts | 82 +++++++------------- src/events/interactions/interactionCreate.ts | 3 +- src/locales/fr.json | 1 + src/modals/misc/reminderGUI.ts | 24 +++--- src/utils/reminder.ts | 52 +++++++++++++ 5 files changed, 92 insertions(+), 70 deletions(-) create mode 100644 src/utils/reminder.ts diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 8483331..3790630 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,8 +1,8 @@ import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/builders'; -import { Client, ChatInputCommandInteraction, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } from 'discord.js'; -import { getLocalizations } from '../../utils/locales'; +import { ActionRowBuilder, ChatInputCommandInteraction, Client, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; +import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; -import { strToSeconds } from '../../utils/time'; +import { newReminder } from '../../utils/reminder'; export default { data: (client: Client) => { @@ -140,6 +140,7 @@ export default { interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { const loc_default = client.locales.get(client.config.default_lang); const filename = getFilename(__filename); + const loc = getLocale(client, interaction.locale); /* Votre code ici */ const subcommand = interaction.options.getSubcommand(); @@ -147,67 +148,43 @@ export default { // New reminder case loc_default?.get(`c_${filename}_sub1_name`) ?.toLowerCase() ?? '': { - // TODO: Ici il y a 2 options, l'un pour le temps et l'autre - // pour le message, il faut tout le temps un temps, mais pas - // tout le temps de message (= message par défaut, le reminder - // fait office de compte à rebours tout simple dans ce cas là) - // Alors j'avais comme idée de pas mettre le temps comme requis, - // et quand pas de temps est spécifié dans la commande, on ouvre - // une boîte de dialogue : https://discordjs.guide/interactions/modals.html#building-and-responding-with-modals - // et on demande à l'utilisateur de remplir les champs comme ça. - // Avec cette technique on a les commandes pour les "poweruser" - // qui préfèrent tout faire en ligne de commandes et un truc - // plus user-friendly avec une interface (et en plus c'est - // nouveau et cool) - - let time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string); - const message = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string); - let option = OptionReminder.Nothing; - let seconds: number; + const time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string); if (time != null) { // Cli - - // Split time - if (time?.endsWith('@')) { - time = time.slice(0, -1); - option = OptionReminder.Mention; - } else if (time?.toLowerCase().endsWith('p')) { - time = time.slice(0, -1); - option = OptionReminder.DirectMessage; - } - - seconds = strToSeconds(time); - - // Add the remind to the db - client.db.run('INSERT INTO reminder ( \ - data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ - ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [message, interaction.createdAt.getTime() + seconds, option.valueOf(), interaction.channelId, interaction.createdAt.getTime(), interaction.user.id, interaction.guildId]); - - // Send confirmation to user - // TODO: local - await interaction.reply(`${option} - ${seconds}`); + return newReminder(client, time, { + message: interaction.options.getString(loc_default?.get('c_reminder_sub1_opt2_name') as string), + createdAt: interaction.createdAt.getTime(), + channelId: interaction.channelId, + userId: interaction.user.id, + guildId: interaction.guildId, + }).then((msg) => interaction.reply({ + content: msg as string, + ephemeral: true, + })); } else { // GUI - // TODO: local const modal = new ModalBuilder() .setCustomId('reminderGUI') - .setTitle('LOC_reminder'); + .setTitle(loc?.get('c_reminder_name').capitalize()); - // TODO: local const timeGUI = new TextInputBuilder() - .setCustomId('timeGUI') - .setLabel('LOC_time') + .setCustomId('reminderGUI-time') + .setLabel(loc?.get('c_reminder_sub1_opt1_name').capitalize()) .setStyle(TextInputStyle.Short) .setPlaceholder('1h') .setRequired(true); - modal.addComponents(new ActionRowBuilder().addComponents(timeGUI)); + const messageGUI = new TextInputBuilder() + .setCustomId('reminderGUI-message') + .setLabel(loc?.get('c_reminder_sub1_opt2_name').capitalize()) + .setStyle(TextInputStyle.Paragraph) + .setPlaceholder(loc?.get('c_reminder_sub1_opt2_desc')) + .setRequired(false); - await interaction.showModal(modal); + modal.addComponents(new ActionRowBuilder().addComponents(timeGUI), new ActionRowBuilder().addComponents(messageGUI)); - // Response of the modal in /src/modals/misc/reminder + return interaction.showModal(modal); } - break; } // List reminders case loc_default?.get(`c_${filename}_sub2_name`) @@ -236,10 +213,3 @@ export default { } }, }; - - -enum OptionReminder { - Nothing, - Mention, - DirectMessage, -} diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index d6405ce..cef1087 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -21,8 +21,7 @@ export default (interaction: Interaction, client: Client) => { const modal = client.modals.list.get(interaction.customId); if (!modal) { return interaction.reply({ - // TODO: locale - content: `can't find ${interaction.customId}`, + content: loc.get('e_interacreate_no_modal'), ephemeral: true, }); } diff --git a/src/locales/fr.json b/src/locales/fr.json index 8d7bbd0..a2774f5 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -1,5 +1,6 @@ { "e_interacreate_no_command": "Désolé, la commande n'existe plus...", + "e_interacreate_no_modal": "Désolé, le modèle n'existe plus...", "c_ping_name": "Ping", "c_ping_desc": "Pong!", diff --git a/src/modals/misc/reminderGUI.ts b/src/modals/misc/reminderGUI.ts index b1078b1..8b5b271 100644 --- a/src/modals/misc/reminderGUI.ts +++ b/src/modals/misc/reminderGUI.ts @@ -1,21 +1,21 @@ -import { ModalSubmitInteraction } from 'discord.js'; +import { Client, ModalSubmitInteraction } from 'discord.js'; import { getFilename } from '../../utils/misc'; +import { newReminder } from '../../utils/reminder'; export default { data: { name: getFilename(__filename), }, - interaction: async (interaction: ModalSubmitInteraction) => { - if (!interaction.isModalSubmit()) { - console.log('not modal called modal :/'); - return; - } - - const time = interaction.fields.fields.get('timeGUI')?.value; - - return interaction.reply({ - content: `${time}`, + interaction: async (interaction: ModalSubmitInteraction, client: Client) => { + return newReminder(client, interaction.fields.fields.get('reminderGUI-time')?.value as string, { + message: interaction.fields.fields.get('reminderGUI-message')?.value ?? null, + createdAt: interaction.createdAt.getTime(), + channelId: interaction.channelId, + userId: interaction.user.id, + guildId: interaction.guildId, + }).then((msg) => interaction.reply({ + content: msg as string, ephemeral: true, - }); + })); }, }; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts new file mode 100644 index 0000000..560162a --- /dev/null +++ b/src/utils/reminder.ts @@ -0,0 +1,52 @@ +import { Client } from 'discord.js'; +import { strToSeconds } from './time'; + +export enum OptionReminder { + Nothing, + Mention, + DirectMessage, +} + +export type infoReminder = { + message: string | null, + createdAt: number, + channelId: string | null, + userId: string, + guildId: string | null +} + +const splitTime = (time: string) => { + if (time?.endsWith('@')) { + return { time: time.slice(0, -1), option: OptionReminder.Mention }; + } else if (time?.toLowerCase().endsWith('p')) { + return { time: time.slice(0, -1), option: OptionReminder.DirectMessage }; + } + + return { time: time, option: OptionReminder.Nothing }; +}; + +export const newReminder = async (client: Client, time: string, info: infoReminder) => { + const data = splitTime(time); + + // Add the remind to the db + return new Promise((ok, ko) => { + const res = client.db.run('INSERT INTO reminder ( \ + data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ + ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [ + info.message, + info.createdAt + strToSeconds(data.time), + data.option.valueOf(), + info.channelId, + info.createdAt, + info.userId, + info.guildId], (err) => { + if (err) { + ko(err); + } + + // Send confirmation to user + // TODO: local + ok(`ratio: ${info.message}, ${data.time}=${strToSeconds(data.time)}, ${data.option}, ${res}`); + }); + }); +}; -- 2.45.2 From 024beb00b29c45461df9a0025620006a4af9422d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 6 Nov 2022 01:47:32 +0100 Subject: [PATCH 23/54] fix last translation --- src/commands/misc/reminder.ts | 18 +++++++++++++----- src/locales/fr.json | 3 ++- src/modals/misc/reminderGUI.ts | 9 +++++---- src/utils/reminder.ts | 20 +++++++++----------- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 3790630..f8f5444 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -148,10 +148,13 @@ export default { // New reminder case loc_default?.get(`c_${filename}_sub1_name`) ?.toLowerCase() ?? '': { + + // If time is already renseigned const time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string); if (time != null) { - // Cli + // Use the cli because we already have enough data return newReminder(client, time, { + locale: loc, message: interaction.options.getString(loc_default?.get('c_reminder_sub1_opt2_name') as string), createdAt: interaction.createdAt.getTime(), channelId: interaction.channelId, @@ -162,7 +165,7 @@ export default { ephemeral: true, })); } else { - // GUI + // Show modal to user to get at least the time const modal = new ModalBuilder() .setCustomId('reminderGUI') .setTitle(loc?.get('c_reminder_name').capitalize()); @@ -181,7 +184,10 @@ export default { .setPlaceholder(loc?.get('c_reminder_sub1_opt2_desc')) .setRequired(false); - modal.addComponents(new ActionRowBuilder().addComponents(timeGUI), new ActionRowBuilder().addComponents(messageGUI)); + modal.addComponents( + new ActionRowBuilder().addComponents(timeGUI), + new ActionRowBuilder().addComponents(messageGUI) + ); return interaction.showModal(modal); } @@ -196,7 +202,8 @@ export default { // Quand aucun utilisateur est spécifié, il faut affiché ses // rappels, sinon affiché les rappels de la personne qui fait // la commande. - break; + + return interaction.reply('TODO'); } // Delete a reminder case loc_default?.get(`c_${filename}_sub3_name`) @@ -204,7 +211,8 @@ export default { // TODO: Message simple qui indique que l'on a supprimé // le reminder. Penser à check l'appartenance du reminder. // On donne l'ID du reminder en option. - break; + + return interaction.reply('TODO'); } default: { console.error(`${__filename}: unknown subcommand (${subcommand})`); diff --git a/src/locales/fr.json b/src/locales/fr.json index a2774f5..1a6d224 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -32,5 +32,6 @@ "c_reminder_sub3_name": "efface", "c_reminder_sub3_desc": "Supprime un rappel", "c_reminder_sub3_opt1_name": "ID", - "c_reminder_sub3_opt1_desc": "Rappel à supprimé" + "c_reminder_sub3_opt1_desc": "Rappel à supprimé", + "c_reminder1": "Un rappel a été configuré pour dans" } diff --git a/src/modals/misc/reminderGUI.ts b/src/modals/misc/reminderGUI.ts index 8b5b271..43c9ece 100644 --- a/src/modals/misc/reminderGUI.ts +++ b/src/modals/misc/reminderGUI.ts @@ -1,4 +1,5 @@ import { Client, ModalSubmitInteraction } from 'discord.js'; +import { getLocale } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { newReminder } from '../../utils/reminder'; @@ -6,8 +7,9 @@ export default { data: { name: getFilename(__filename), }, - interaction: async (interaction: ModalSubmitInteraction, client: Client) => { - return newReminder(client, interaction.fields.fields.get('reminderGUI-time')?.value as string, { + interaction: async (interaction: ModalSubmitInteraction, client: Client) => + newReminder(client, interaction.fields.fields.get('reminderGUI-time')?.value as string, { + locale: getLocale(client, interaction.locale), message: interaction.fields.fields.get('reminderGUI-message')?.value ?? null, createdAt: interaction.createdAt.getTime(), channelId: interaction.channelId, @@ -16,6 +18,5 @@ export default { }).then((msg) => interaction.reply({ content: msg as string, ephemeral: true, - })); - }, + })), }; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index 560162a..cab23df 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -1,13 +1,14 @@ import { Client } from 'discord.js'; import { strToSeconds } from './time'; -export enum OptionReminder { +enum OptionReminder { Nothing, Mention, DirectMessage, } -export type infoReminder = { +type infoReminder = { + locale: Map>, message: string | null, createdAt: number, channelId: string | null, @@ -25,12 +26,11 @@ const splitTime = (time: string) => { return { time: time, option: OptionReminder.Nothing }; }; -export const newReminder = async (client: Client, time: string, info: infoReminder) => { - const data = splitTime(time); - - // Add the remind to the db - return new Promise((ok, ko) => { - const res = client.db.run('INSERT INTO reminder ( \ +export const newReminder = async (client: Client, time: string, info: infoReminder) => + new Promise((ok, ko) => { + const data = splitTime(time); + // Add the remind to the db + client.db.run('INSERT INTO reminder ( \ data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [ info.message, @@ -45,8 +45,6 @@ export const newReminder = async (client: Client, time: string, info: infoRemind } // Send confirmation to user - // TODO: local - ok(`ratio: ${info.message}, ${data.time}=${strToSeconds(data.time)}, ${data.option}, ${res}`); + ok(`${info.locale.get('c_reminder1')} ${data.time}.`); }); }); -}; -- 2.45.2 From d42fd9072b68e1037a5a7110d4c64d9708216118 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 6 Nov 2022 18:25:21 +0100 Subject: [PATCH 24/54] * add comments * add timeout when creating a reminder --- src/events/client/ready.ts | 3 ++ src/utils/client.ts | 3 +- src/utils/reminder.ts | 85 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 86 insertions(+), 5 deletions(-) diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index 4621ee6..75b3b63 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -3,4 +3,7 @@ export const once = true; /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-ready */ export default async () => { console.log('Connected to Discord!'); + + // Restart all the timeout about reminders here + // TODO: Reminders timeout }; diff --git a/src/utils/client.ts b/src/utils/client.ts index 9725d9c..91d5285 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -58,6 +58,7 @@ const initDatabase = (db: Database) => { channel_id INTEGER, \ creation_date INTEGER, \ user_id INTEGER, \ - guild_id INTEGER \ + guild_id INTEGER, \ + timeout_id INTEGER \ );'); }; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index cab23df..7c53755 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -1,12 +1,21 @@ import { Client } from 'discord.js'; import { strToSeconds } from './time'; +/** + * Option possible for reminders + */ enum OptionReminder { + /** No parameters */ Nothing, + /** @ */ Mention, + /** p */ DirectMessage, } +/** + * Store data about the remidner + */ type infoReminder = { locale: Map>, message: string | null, @@ -16,6 +25,11 @@ type infoReminder = { guildId: string | null } +/** + * Split the time and the extra args `p` and `@` + * @param time raw text from user + * @returns An object with the time and the option + */ const splitTime = (time: string) => { if (time?.endsWith('@')) { return { time: time.slice(0, -1), option: OptionReminder.Mention }; @@ -26,20 +40,31 @@ const splitTime = (time: string) => { return { time: time, option: OptionReminder.Nothing }; }; +/** + * Create a new reminder + * @param client Client + * @param time raw text from user about the time wanted + * @param info data about the context of the reminder + * @returns Promise resolution of the sql request + */ export const newReminder = async (client: Client, time: string, info: infoReminder) => new Promise((ok, ko) => { const data = splitTime(time); + const timeout = strToSeconds(data.time); + const timeoutId = setTimeoutReminder(client, info, data.option, timeout); + // Add the remind to the db client.db.run('INSERT INTO reminder ( \ - data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \ - ) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [ + data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id, timeout_id \ + ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? );', [ info.message, - info.createdAt + strToSeconds(data.time), + info.createdAt + timeout, data.option.valueOf(), info.channelId, info.createdAt, info.userId, - info.guildId], (err) => { + info.guildId, + timeoutId], (err) => { if (err) { ko(err); } @@ -48,3 +73,55 @@ export const newReminder = async (client: Client, time: string, info: infoRemind ok(`${info.locale.get('c_reminder1')} ${data.time}.`); }); }); + + +/** + * Create a timeout for a reminder + * @param client Client + * @param info info about the reminder + * @param option option used for this reminder (aka location of the response) + * @param timeout Amout of time before the reminder ends + * @returns timeout ID + */ +const setTimeoutReminder = (client: Client, info: infoReminder, option: OptionReminder, timeout: number) => { + // TODO: Reminders timeout + return Number(setTimeout(() => { + // Delete the reminder for the database + new Promise((ok, ko) => { + // Add the remind to the db + client.db.run('DELETE FROM reminder WHERE creation_date = ? AND user_id = ?', [info.createdAt, info.userId], (err) => { + if (err) { + ko(err); + } + + // Send confirmation to user + ok(true); + }); + }).then((val) => { + if (val != true) { + throw val; + } + + // Send the message in the appropriate channel + if (option == OptionReminder.DirectMessage) { + // Direct message + const user = client.users.cache.get(info.userId); + // TODO: Locales + user?.send(`Here your reminder: ${info.message} :)`); + } else { + // Channel + client.channels.fetch(info.channelId ?? '').then((channel) => { + if (channel?.isTextBased()) { + // TODO: Check if option == OptionReminder.Mention and mention + // everyone who are in the message + + // TODO: Test if a message exist + console.log(typeof info.message, info.message); + // TODO: Locales + channel.send(`Here your reminder: ${info.message} :)`); + } + }); + } + }); + }, timeout * 1000)); +}; -- 2.45.2 From 425eb9316868f78d050a9708d2239f6e0a1b7207 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 6 Nov 2022 18:29:58 +0100 Subject: [PATCH 25/54] Add comments --- src/utils/client.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index 91d5285..2505129 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -39,6 +39,10 @@ export default async () => { return client; }; +/** + * Quit gracefully the client + * @param client Client + */ export const quit = (client: Client) => { // Close DB client.db.close(); @@ -47,7 +51,10 @@ export const quit = (client: Client) => { client.destroy(); }; - +/** + * Initalize the database + * @param db Database + */ const initDatabase = (db: Database) => { // Table for reminders db.run('CREATE TABLE IF NOT EXISTS reminder ( \ -- 2.45.2 From c0ef16b74c5762badd2665262e6af9a88680516c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 19 Dec 2022 20:10:04 +0100 Subject: [PATCH 26/54] npm update --- package-lock.json | 604 ++++++++++++++++++++++++---------------------- 1 file changed, 315 insertions(+), 289 deletions(-) diff --git a/package-lock.json b/package-lock.json index 454263f..e95f2d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,56 +37,56 @@ } }, "node_modules/@discordjs/builders": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.3.0.tgz", - "integrity": "sha512-Pvca6Nw8Hp+n3N+Wp17xjygXmMvggbh5ywUsOYE2Et4xkwwVRwgzxDJiMUuYapPtnYt4w/8aKlf5khc8ipLvhg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.4.0.tgz", + "integrity": "sha512-nEeTCheTTDw5kO93faM1j8ZJPonAX86qpq/QVoznnSa8WWcCgJpjlu6GylfINTDW6o7zZY0my2SYdxx2mfNwGA==", "dependencies": { "@discordjs/util": "^0.1.0", - "@sapphire/shapeshift": "^3.7.0", - "discord-api-types": "^0.37.12", + "@sapphire/shapeshift": "^3.7.1", + "discord-api-types": "^0.37.20", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.2", + "tslib": "^2.4.1" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.37.16", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", - "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + "version": "0.37.24", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", + "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" }, "node_modules/@discordjs/collection": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.2.0.tgz", - "integrity": "sha512-VvrrtGb7vbfPHzbhGq9qZB5o8FOB+kfazrxdt0OtxzSkoBuw9dURMkCwWizZ00+rDpiK2HmLHBZX+y6JsG9khw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.3.0.tgz", + "integrity": "sha512-ylt2NyZ77bJbRij4h9u/wVy7qYw/aDqQLWnadjvDqW/WoWCxrsX6M3CIw9GVP5xcGCDxsrKj5e0r5evuFYwrKg==", "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.3.0.tgz", - "integrity": "sha512-U6X5J+r/MxYpPTlHFuPxXEf92aKsBaD2teBC7sWkKILIr30O8c9+XshfL7KFBCavnAqS/qE+PF9fgRilO3N44g==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.5.0.tgz", + "integrity": "sha512-lXgNFqHnbmzp5u81W0+frdXN6Etf4EUi8FAPcWpSykKd8hmlWh1xy6BmE0bsJypU1pxohaA8lQCgp70NUI3uzA==", "dependencies": { - "@discordjs/collection": "^1.2.0", + "@discordjs/collection": "^1.3.0", "@discordjs/util": "^0.1.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.12", + "discord-api-types": "^0.37.23", "file-type": "^18.0.0", - "tslib": "^2.4.0", - "undici": "^5.11.0" + "tslib": "^2.4.1", + "undici": "^5.13.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest/node_modules/discord-api-types": { - "version": "0.37.16", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", - "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + "version": "0.37.24", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", + "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" }, "node_modules/@discordjs/util": { "version": "0.1.0", @@ -97,15 +97,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", + "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -126,9 +126,9 @@ "optional": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", - "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -251,6 +251,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", "optional": true, "dependencies": { "mkdirp": "^1.0.4", @@ -270,12 +271,12 @@ } }, "node_modules/@sapphire/shapeshift": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.0.tgz", - "integrity": "sha512-A6vI1zJoxhjWo4grsxpBRBgk96SqSdjLX5WlzKp9H+bJbkM07mvwcbtbVAmUZHbi/OG3HLfiZ1rlw4BhH6tsBQ==", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz", + "integrity": "sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw==", "dependencies": { "fast-deep-equal": "^3.1.3", - "lodash.uniqwith": "^4.5.0" + "lodash": "^4.17.21" }, "engines": { "node": ">=v14.0.0", @@ -283,9 +284,9 @@ } }, "node_modules/@sapphire/snowflake": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", - "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.3.0.tgz", + "integrity": "sha512-Hec5N6zEkZuZFLybVKyLFLlcSgYmR6C1/+9NkIhxPwOf6tgX52ndJCSz8ADejmbrNE0VuNCNkpzhRZzenEC9vA==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -336,9 +337,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + "version": "18.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", + "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==" }, "node_modules/@types/semver": { "version": "7.3.13", @@ -375,14 +376,14 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz", - "integrity": "sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.47.0.tgz", + "integrity": "sha512-AHZtlXAMGkDmyLuLZsRpH3p4G/1iARIwc/T0vIem2YB+xW6pZaXYXzCBnZSF/5fdM97R9QqZWZ+h3iW10XgevQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.42.0", - "@typescript-eslint/type-utils": "5.42.0", - "@typescript-eslint/utils": "5.42.0", + "@typescript-eslint/scope-manager": "5.47.0", + "@typescript-eslint/type-utils": "5.47.0", + "@typescript-eslint/utils": "5.47.0", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -408,14 +409,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.0.tgz", - "integrity": "sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.47.0.tgz", + "integrity": "sha512-udPU4ckK+R1JWCGdQC4Qa27NtBg7w020ffHqGyAK8pAgOVuNw7YaKXGChk+udh+iiGIJf6/E/0xhVXyPAbsczw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.42.0", - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/scope-manager": "5.47.0", + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/typescript-estree": "5.47.0", "debug": "^4.3.4" }, "engines": { @@ -435,13 +436,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", - "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz", + "integrity": "sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0" + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/visitor-keys": "5.47.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -452,13 +453,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz", - "integrity": "sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.47.0.tgz", + "integrity": "sha512-1J+DFFrYoDUXQE1b7QjrNGARZE6uVhBqIvdaXTe5IN+NmEyD68qXR1qX1g2u4voA+nCaelQyG8w30SAOihhEYg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.42.0", - "@typescript-eslint/utils": "5.42.0", + "@typescript-eslint/typescript-estree": "5.47.0", + "@typescript-eslint/utils": "5.47.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -479,9 +480,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", - "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.47.0.tgz", + "integrity": "sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -492,13 +493,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", - "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.0.tgz", + "integrity": "sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0", + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/visitor-keys": "5.47.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -519,16 +520,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.42.0.tgz", - "integrity": "sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.47.0.tgz", + "integrity": "sha512-U9xcc0N7xINrCdGVPwABjbAKqx4GK67xuMV87toI+HUqgXj26m6RBp9UshEXcTrgCkdGYFzgKLt8kxu49RilDw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.42.0", - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/scope-manager": "5.47.0", + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/typescript-estree": "5.47.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -545,12 +546,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", - "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.0.tgz", + "integrity": "sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/types": "5.47.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -674,9 +675,9 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -1013,31 +1014,31 @@ "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "node_modules/discord.js": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.6.0.tgz", - "integrity": "sha512-On1K7xpJZRe0KsziIaDih2ksYPhgxym/ZqV45i1f3yig4vUotikqs7qp5oXiTzQ/UTiNRCixUWFTh7vA1YBCqw==", + "version": "14.7.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.7.1.tgz", + "integrity": "sha512-1FECvqJJjjeYcjSm0IGMnPxLqja/pmG1B0W2l3lUY2Gi4KXiyTeQmU1IxWcbXHn2k+ytP587mMWqva2IA87EbA==", "dependencies": { - "@discordjs/builders": "^1.3.0", - "@discordjs/collection": "^1.2.0", - "@discordjs/rest": "^1.3.0", + "@discordjs/builders": "^1.4.0", + "@discordjs/collection": "^1.3.0", + "@discordjs/rest": "^1.4.0", "@discordjs/util": "^0.1.0", "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.12", + "discord-api-types": "^0.37.20", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", - "tslib": "^2.4.0", - "undici": "^5.11.0", - "ws": "^8.9.0" + "tslib": "^2.4.1", + "undici": "^5.13.0", + "ws": "^8.11.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.16", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", - "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + "version": "0.37.24", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", + "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" }, "node_modules/doctrine": { "version": "3.0.0", @@ -1111,13 +1112,13 @@ } }, "node_modules/eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", - "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.0", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -1136,7 +1137,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -1238,9 +1239,9 @@ } }, "node_modules/espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "dependencies": { "acorn": "^8.8.0", @@ -1360,9 +1361,9 @@ "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==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", + "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -1530,9 +1531,9 @@ } }, "node_modules/globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1675,9 +1676,9 @@ ] }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -1827,10 +1828,14 @@ "devOptional": true }, "node_modules/js-sdsl": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", - "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", - "dev": true + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", + "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } }, "node_modules/js-yaml": { "version": "4.1.0", @@ -1884,6 +1889,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1895,11 +1905,6 @@ "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "node_modules/lodash.uniqwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", - "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==" - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -2009,9 +2014,9 @@ } }, "node_modules/minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dependencies": { "yallist": "^4.0.0" }, @@ -2745,9 +2750,9 @@ } }, "node_modules/sqlite3": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.2.tgz", - "integrity": "sha512-D0Reg6pRWAFXFUnZKsszCI67tthFD8fGPewRddDCX6w4cYwz3MbvuwRICbL+YQjBAh9zbw+lJ/V9oC8nG5j6eg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.4.tgz", + "integrity": "sha512-i0UlWAzPlzX3B5XP2cYuhWQJsTtlMD6obOa1PgeEQ4DHEXUuyJkgv50I3isqZAP5oFc2T8OFvakmDh2W6I+YpA==", "hasInstallScript": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", @@ -2880,13 +2885,13 @@ } }, "node_modules/tar": { - "version": "6.1.12", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", - "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", + "version": "6.1.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz", + "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", + "minipass": "^4.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" @@ -2895,6 +2900,17 @@ "node": ">=10" } }, + "node_modules/tar/node_modules/minipass": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.0.tgz", + "integrity": "sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -2944,9 +2960,9 @@ } }, "node_modules/ts-mixer": { - "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==" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.2.tgz", + "integrity": "sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==" }, "node_modules/ts-node": { "version": "10.9.1", @@ -3109,9 +3125,9 @@ } }, "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -3121,9 +3137,9 @@ } }, "node_modules/undici": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.12.0.tgz", - "integrity": "sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==", + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.14.0.tgz", + "integrity": "sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==", "dependencies": { "busboy": "^1.6.0" }, @@ -3221,9 +3237,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", - "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", "engines": { "node": ">=10.0.0" }, @@ -3287,49 +3303,49 @@ } }, "@discordjs/builders": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.3.0.tgz", - "integrity": "sha512-Pvca6Nw8Hp+n3N+Wp17xjygXmMvggbh5ywUsOYE2Et4xkwwVRwgzxDJiMUuYapPtnYt4w/8aKlf5khc8ipLvhg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.4.0.tgz", + "integrity": "sha512-nEeTCheTTDw5kO93faM1j8ZJPonAX86qpq/QVoznnSa8WWcCgJpjlu6GylfINTDW6o7zZY0my2SYdxx2mfNwGA==", "requires": { "@discordjs/util": "^0.1.0", - "@sapphire/shapeshift": "^3.7.0", - "discord-api-types": "^0.37.12", + "@sapphire/shapeshift": "^3.7.1", + "discord-api-types": "^0.37.20", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.2", + "tslib": "^2.4.1" }, "dependencies": { "discord-api-types": { - "version": "0.37.16", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", - "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + "version": "0.37.24", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", + "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" } } }, "@discordjs/collection": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.2.0.tgz", - "integrity": "sha512-VvrrtGb7vbfPHzbhGq9qZB5o8FOB+kfazrxdt0OtxzSkoBuw9dURMkCwWizZ00+rDpiK2HmLHBZX+y6JsG9khw==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.3.0.tgz", + "integrity": "sha512-ylt2NyZ77bJbRij4h9u/wVy7qYw/aDqQLWnadjvDqW/WoWCxrsX6M3CIw9GVP5xcGCDxsrKj5e0r5evuFYwrKg==" }, "@discordjs/rest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.3.0.tgz", - "integrity": "sha512-U6X5J+r/MxYpPTlHFuPxXEf92aKsBaD2teBC7sWkKILIr30O8c9+XshfL7KFBCavnAqS/qE+PF9fgRilO3N44g==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.5.0.tgz", + "integrity": "sha512-lXgNFqHnbmzp5u81W0+frdXN6Etf4EUi8FAPcWpSykKd8hmlWh1xy6BmE0bsJypU1pxohaA8lQCgp70NUI3uzA==", "requires": { - "@discordjs/collection": "^1.2.0", + "@discordjs/collection": "^1.3.0", "@discordjs/util": "^0.1.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.12", + "discord-api-types": "^0.37.23", "file-type": "^18.0.0", - "tslib": "^2.4.0", - "undici": "^5.11.0" + "tslib": "^2.4.1", + "undici": "^5.13.0" }, "dependencies": { "discord-api-types": { - "version": "0.37.16", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", - "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + "version": "0.37.24", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", + "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" } } }, @@ -3339,15 +3355,15 @@ "integrity": "sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==" }, "@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", + "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -3362,9 +3378,9 @@ "optional": true }, "@humanwhocodes/config-array": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", - "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -3474,18 +3490,18 @@ "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==" }, "@sapphire/shapeshift": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.0.tgz", - "integrity": "sha512-A6vI1zJoxhjWo4grsxpBRBgk96SqSdjLX5WlzKp9H+bJbkM07mvwcbtbVAmUZHbi/OG3HLfiZ1rlw4BhH6tsBQ==", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz", + "integrity": "sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw==", "requires": { "fast-deep-equal": "^3.1.3", - "lodash.uniqwith": "^4.5.0" + "lodash": "^4.17.21" } }, "@sapphire/snowflake": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", - "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.3.0.tgz", + "integrity": "sha512-Hec5N6zEkZuZFLybVKyLFLlcSgYmR6C1/+9NkIhxPwOf6tgX52ndJCSz8ADejmbrNE0VuNCNkpzhRZzenEC9vA==" }, "@tokenizer/token": { "version": "0.3.0", @@ -3529,9 +3545,9 @@ "dev": true }, "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + "version": "18.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", + "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==" }, "@types/semver": { "version": "7.3.13", @@ -3568,14 +3584,14 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz", - "integrity": "sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.47.0.tgz", + "integrity": "sha512-AHZtlXAMGkDmyLuLZsRpH3p4G/1iARIwc/T0vIem2YB+xW6pZaXYXzCBnZSF/5fdM97R9QqZWZ+h3iW10XgevQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.42.0", - "@typescript-eslint/type-utils": "5.42.0", - "@typescript-eslint/utils": "5.42.0", + "@typescript-eslint/scope-manager": "5.47.0", + "@typescript-eslint/type-utils": "5.47.0", + "@typescript-eslint/utils": "5.47.0", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -3585,53 +3601,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.0.tgz", - "integrity": "sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.47.0.tgz", + "integrity": "sha512-udPU4ckK+R1JWCGdQC4Qa27NtBg7w020ffHqGyAK8pAgOVuNw7YaKXGChk+udh+iiGIJf6/E/0xhVXyPAbsczw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.42.0", - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/scope-manager": "5.47.0", + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/typescript-estree": "5.47.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", - "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz", + "integrity": "sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0" + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/visitor-keys": "5.47.0" } }, "@typescript-eslint/type-utils": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz", - "integrity": "sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.47.0.tgz", + "integrity": "sha512-1J+DFFrYoDUXQE1b7QjrNGARZE6uVhBqIvdaXTe5IN+NmEyD68qXR1qX1g2u4voA+nCaelQyG8w30SAOihhEYg==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.42.0", - "@typescript-eslint/utils": "5.42.0", + "@typescript-eslint/typescript-estree": "5.47.0", + "@typescript-eslint/utils": "5.47.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", - "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.47.0.tgz", + "integrity": "sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", - "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.0.tgz", + "integrity": "sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0", + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/visitor-keys": "5.47.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3640,28 +3656,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.42.0.tgz", - "integrity": "sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.47.0.tgz", + "integrity": "sha512-U9xcc0N7xINrCdGVPwABjbAKqx4GK67xuMV87toI+HUqgXj26m6RBp9UshEXcTrgCkdGYFzgKLt8kxu49RilDw==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.42.0", - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/scope-manager": "5.47.0", + "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/typescript-estree": "5.47.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", - "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.0.tgz", + "integrity": "sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/types": "5.47.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -3745,9 +3761,9 @@ } }, "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -4007,28 +4023,28 @@ "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "discord.js": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.6.0.tgz", - "integrity": "sha512-On1K7xpJZRe0KsziIaDih2ksYPhgxym/ZqV45i1f3yig4vUotikqs7qp5oXiTzQ/UTiNRCixUWFTh7vA1YBCqw==", + "version": "14.7.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.7.1.tgz", + "integrity": "sha512-1FECvqJJjjeYcjSm0IGMnPxLqja/pmG1B0W2l3lUY2Gi4KXiyTeQmU1IxWcbXHn2k+ytP587mMWqva2IA87EbA==", "requires": { - "@discordjs/builders": "^1.3.0", - "@discordjs/collection": "^1.2.0", - "@discordjs/rest": "^1.3.0", + "@discordjs/builders": "^1.4.0", + "@discordjs/collection": "^1.3.0", + "@discordjs/rest": "^1.4.0", "@discordjs/util": "^0.1.0", "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.12", + "discord-api-types": "^0.37.20", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", - "tslib": "^2.4.0", - "undici": "^5.11.0", - "ws": "^8.9.0" + "tslib": "^2.4.1", + "undici": "^5.13.0", + "ws": "^8.11.0" }, "dependencies": { "discord-api-types": { - "version": "0.37.16", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.16.tgz", - "integrity": "sha512-H0FDY6+ww4YZe1+L+2ERWU3KsVSInWLvK0TeImhiTi49DXff8sFLnqqnEiEdMEhwFlkQMUIe4xL5Py046s+Ksg==" + "version": "0.37.24", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", + "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" } } }, @@ -4089,13 +4105,13 @@ "dev": true }, "eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", - "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.0", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -4114,7 +4130,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -4187,9 +4203,9 @@ "dev": true }, "espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "requires": { "acorn": "^8.8.0", @@ -4285,9 +4301,9 @@ "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==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", + "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -4412,9 +4428,9 @@ } }, "globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -4516,9 +4532,9 @@ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, "import-fresh": { @@ -4632,9 +4648,9 @@ "devOptional": true }, "js-sdsl": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", - "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", + "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", "dev": true }, "js-yaml": { @@ -4677,6 +4693,11 @@ "p-locate": "^5.0.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4688,11 +4709,6 @@ "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "lodash.uniqwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", - "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==" - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4777,9 +4793,9 @@ "dev": true }, "minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "requires": { "yallist": "^4.0.0" } @@ -5275,9 +5291,9 @@ } }, "sqlite3": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.2.tgz", - "integrity": "sha512-D0Reg6pRWAFXFUnZKsszCI67tthFD8fGPewRddDCX6w4cYwz3MbvuwRICbL+YQjBAh9zbw+lJ/V9oC8nG5j6eg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.4.tgz", + "integrity": "sha512-i0UlWAzPlzX3B5XP2cYuhWQJsTtlMD6obOa1PgeEQ4DHEXUuyJkgv50I3isqZAP5oFc2T8OFvakmDh2W6I+YpA==", "requires": { "@mapbox/node-pre-gyp": "^1.0.0", "node-addon-api": "^4.2.0", @@ -5362,16 +5378,26 @@ "dev": true }, "tar": { - "version": "6.1.12", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", - "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", + "version": "6.1.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz", + "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", + "minipass": "^4.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.0.tgz", + "integrity": "sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==", + "requires": { + "yallist": "^4.0.0" + } + } } }, "text-table": { @@ -5410,9 +5436,9 @@ "dev": true }, "ts-mixer": { - "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==" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.2.tgz", + "integrity": "sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==" }, "ts-node": { "version": "10.9.1", @@ -5522,14 +5548,14 @@ "dev": true }, "typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==" + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==" }, "undici": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.12.0.tgz", - "integrity": "sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==", + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.14.0.tgz", + "integrity": "sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==", "requires": { "busboy": "^1.6.0" } @@ -5615,9 +5641,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", - "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", "requires": {} }, "xtend": { -- 2.45.2 From 759f974e15770d024acda23381a9143eff08bf85 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 19 Dec 2022 22:42:27 +0100 Subject: [PATCH 27/54] wip: re init reminders after restart --- src/commands/misc/reminder.ts | 3 +- src/events/client/ready.ts | 55 +++++++++++++++++- src/modals/misc/reminderGUI.ts | 3 +- src/utils/client.ts | 2 +- src/utils/reminder.ts | 100 +++++++++++++++++++-------------- 5 files changed, 113 insertions(+), 50 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index f8f5444..0326690 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -142,7 +142,6 @@ export default { const filename = getFilename(__filename); const loc = getLocale(client, interaction.locale); - /* Votre code ici */ const subcommand = interaction.options.getSubcommand(); switch (subcommand) { // New reminder @@ -154,7 +153,7 @@ export default { if (time != null) { // Use the cli because we already have enough data return newReminder(client, time, { - locale: loc, + locale: interaction.locale, message: interaction.options.getString(loc_default?.get('c_reminder_sub1_opt2_name') as string), createdAt: interaction.createdAt.getTime(), channelId: interaction.channelId, diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index 75b3b63..08d6df7 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -1,9 +1,60 @@ +import { Client } from 'discord.js'; +import { deleteReminder, infoReminder, OptionReminder, sendReminder } from '../../utils/reminder'; + export const once = true; +type dbReminder = { + id: number, + data: string, + expiration_date: number, + option_id: number, + channel_id: number, + creation_date: number, + user_id: number, + guild_id: number, + locale: string +} + /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-ready */ -export default async () => { +export default async (client: Client) => { console.log('Connected to Discord!'); // Restart all the timeout about reminders here - // TODO: Reminders timeout + new Promise((ok, ko) => { + // Fetch all reminders + client.db.all('SELECT * FROM reminder', [], (err, row) => { + if (err) { + ko(err); + } + + // Send all the current reminders + ok(row); + }); + }).then((data) => { + const now = Date.now(); + (data as dbReminder[]).forEach((element) => { + if (element.expiration_date <= now) { + // Reminder expired + deleteReminder(client, element.creation_date, `${element.user_id}`).then((res) => { + if (res != true) { + throw res; + } + }); + const info = { + locale: element.locale, + message: element.data, + createdAt: element.creation_date, + channelId: `${element.channel_id}`, + userId: `${element.user_id}`, + guildId: `${element.guild_id}`, + } as infoReminder; + sendReminder(client, info, element.option_id as OptionReminder); + } else { + // Restart timeout + } + + }); + }).catch(err => { + throw err; + }); }; diff --git a/src/modals/misc/reminderGUI.ts b/src/modals/misc/reminderGUI.ts index 43c9ece..d848dd4 100644 --- a/src/modals/misc/reminderGUI.ts +++ b/src/modals/misc/reminderGUI.ts @@ -1,5 +1,4 @@ import { Client, ModalSubmitInteraction } from 'discord.js'; -import { getLocale } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { newReminder } from '../../utils/reminder'; @@ -9,7 +8,7 @@ export default { }, interaction: async (interaction: ModalSubmitInteraction, client: Client) => newReminder(client, interaction.fields.fields.get('reminderGUI-time')?.value as string, { - locale: getLocale(client, interaction.locale), + locale: interaction.locale, message: interaction.fields.fields.get('reminderGUI-message')?.value ?? null, createdAt: interaction.createdAt.getTime(), channelId: interaction.channelId, diff --git a/src/utils/client.ts b/src/utils/client.ts index 2505129..2aa27c3 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -66,6 +66,6 @@ const initDatabase = (db: Database) => { creation_date INTEGER, \ user_id INTEGER, \ guild_id INTEGER, \ - timeout_id INTEGER \ + locale TEXT \ );'); }; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index 7c53755..faa84fb 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -1,10 +1,11 @@ import { Client } from 'discord.js'; +import { getLocale } from './locales'; import { strToSeconds } from './time'; /** * Option possible for reminders */ -enum OptionReminder { +export enum OptionReminder { /** No parameters */ Nothing, /** @ */ @@ -16,8 +17,8 @@ enum OptionReminder { /** * Store data about the remidner */ -type infoReminder = { - locale: Map>, +export type infoReminder = { + locale: string, message: string | null, createdAt: number, channelId: string | null, @@ -51,11 +52,11 @@ export const newReminder = async (client: Client, time: string, info: infoRemind new Promise((ok, ko) => { const data = splitTime(time); const timeout = strToSeconds(data.time); - const timeoutId = setTimeoutReminder(client, info, data.option, timeout); + setTimeoutReminder(client, info, data.option, timeout); // Add the remind to the db client.db.run('INSERT INTO reminder ( \ - data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id, timeout_id \ + data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id, locale \ ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? );', [ info.message, info.createdAt + timeout, @@ -64,16 +65,61 @@ export const newReminder = async (client: Client, time: string, info: infoRemind info.createdAt, info.userId, info.guildId, - timeoutId], (err) => { + info.locale], (err) => { if (err) { ko(err); } // Send confirmation to user - ok(`${info.locale.get('c_reminder1')} ${data.time}.`); + const loc = getLocale(client, info.locale); + ok(`${loc.get('c_reminder1')} ${data.time}.`); }); }); +/** + * Delete a reminder + * @param client Client + * @param createdAt Creation of the reminder + * @param userId User ID who created the reminder + * @returns what the SQlite request sended + */ +export const deleteReminder = (client: Client, createdAt: number, userId: string) => { + // Delete the reminder for the database + return new Promise((ok, ko) => { + // Add the remind to the db + client.db.run('DELETE FROM reminder WHERE creation_date = ? AND user_id = ?', [createdAt, userId], (err) => { + if (err) { + ko(err); + } + + // Send confirmation to user + ok(true); + }); + }); +}; + +export const sendReminder = (client: Client, info: infoReminder, option: OptionReminder) => { + // Send the message in the appropriate channel + if (option == OptionReminder.DirectMessage) { + // Direct message + const user = client.users.cache.get(info.userId); + // TODO: Locales + user?.send(`Here your reminder: ${info.message} :)`); + } else { + // Channel + client.channels.fetch(info.channelId ?? '').then((channel) => { + if (channel?.isTextBased()) { + // TODO: Check if option == OptionReminder.Mention and mention + // everyone who are in the message + + // TODO: Test if a message exist + // TODO: Locales + // TODO: Embed + channel.send(`Here your reminder: ${info.message} :)`); + } + }); + } +}; /** * Create a timeout for a reminder @@ -81,47 +127,15 @@ export const newReminder = async (client: Client, time: string, info: infoRemind * @param info info about the reminder * @param option option used for this reminder (aka location of the response) * @param timeout Amout of time before the reminder ends - * @returns timeout ID */ const setTimeoutReminder = (client: Client, info: infoReminder, option: OptionReminder, timeout: number) => { - // TODO: Reminders timeout - return Number(setTimeout(() => { - // Delete the reminder for the database - new Promise((ok, ko) => { - // Add the remind to the db - client.db.run('DELETE FROM reminder WHERE creation_date = ? AND user_id = ?', [info.createdAt, info.userId], (err) => { - if (err) { - ko(err); - } - - // Send confirmation to user - ok(true); - }); - }).then((val) => { + setTimeout(() => { + deleteReminder(client, info.createdAt, info.userId).then((val) => { if (val != true) { throw val; } - // Send the message in the appropriate channel - if (option == OptionReminder.DirectMessage) { - // Direct message - const user = client.users.cache.get(info.userId); - // TODO: Locales - user?.send(`Here your reminder: ${info.message} :)`); - } else { - // Channel - client.channels.fetch(info.channelId ?? '').then((channel) => { - if (channel?.isTextBased()) { - // TODO: Check if option == OptionReminder.Mention and mention - // everyone who are in the message - - // TODO: Test if a message exist - console.log(typeof info.message, info.message); - // TODO: Locales - channel.send(`Here your reminder: ${info.message} :)`); - } - }); - } + sendReminder(client, info, option); }); - }, timeout * 1000)); + }, timeout * 1000); }; -- 2.45.2 From 4e38df8cc8e776ec689c19a1d84f62ed8b49d194 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 9 Jan 2023 17:07:14 +0100 Subject: [PATCH 28/54] npm update --- package-lock.json | 286 +++++++++++++++++++++++----------------------- 1 file changed, 143 insertions(+), 143 deletions(-) diff --git a/package-lock.json b/package-lock.json index e95f2d2..aa70c11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,9 +53,9 @@ } }, "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.27", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", + "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" }, "node_modules/@discordjs/collection": { "version": "1.3.0", @@ -84,9 +84,9 @@ } }, "node_modules/@discordjs/rest/node_modules/discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.27", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", + "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" }, "node_modules/@discordjs/util": { "version": "0.1.0", @@ -97,9 +97,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", - "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -284,9 +284,9 @@ } }, "node_modules/@sapphire/snowflake": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.3.0.tgz", - "integrity": "sha512-Hec5N6zEkZuZFLybVKyLFLlcSgYmR6C1/+9NkIhxPwOf6tgX52ndJCSz8ADejmbrNE0VuNCNkpzhRZzenEC9vA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", + "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -337,9 +337,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", - "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==" + "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" }, "node_modules/@types/semver": { "version": "7.3.13", @@ -368,22 +368,22 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "dependencies": { "@types/node": "*" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.47.0.tgz", - "integrity": "sha512-AHZtlXAMGkDmyLuLZsRpH3p4G/1iARIwc/T0vIem2YB+xW6pZaXYXzCBnZSF/5fdM97R9QqZWZ+h3iW10XgevQ==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", + "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.47.0", - "@typescript-eslint/type-utils": "5.47.0", - "@typescript-eslint/utils": "5.47.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/type-utils": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -409,14 +409,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.47.0.tgz", - "integrity": "sha512-udPU4ckK+R1JWCGdQC4Qa27NtBg7w020ffHqGyAK8pAgOVuNw7YaKXGChk+udh+iiGIJf6/E/0xhVXyPAbsczw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", + "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.47.0", - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/typescript-estree": "5.47.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "debug": "^4.3.4" }, "engines": { @@ -436,13 +436,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz", - "integrity": "sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", + "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/visitor-keys": "5.47.0" + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -453,13 +453,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.47.0.tgz", - "integrity": "sha512-1J+DFFrYoDUXQE1b7QjrNGARZE6uVhBqIvdaXTe5IN+NmEyD68qXR1qX1g2u4voA+nCaelQyG8w30SAOihhEYg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", + "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.47.0", - "@typescript-eslint/utils": "5.47.0", + "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -480,9 +480,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.47.0.tgz", - "integrity": "sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", + "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -493,13 +493,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.0.tgz", - "integrity": "sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", + "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/visitor-keys": "5.47.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -520,16 +520,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.47.0.tgz", - "integrity": "sha512-U9xcc0N7xINrCdGVPwABjbAKqx4GK67xuMV87toI+HUqgXj26m6RBp9UshEXcTrgCkdGYFzgKLt8kxu49RilDw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", + "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.47.0", - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/typescript-estree": "5.47.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -546,12 +546,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.0.tgz", - "integrity": "sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", + "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/types": "5.48.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1036,9 +1036,9 @@ } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.27", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", + "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" }, "node_modules/doctrine": { "version": "3.0.0", @@ -1112,12 +1112,12 @@ } }, "node_modules/eslint": { - "version": "8.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", - "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", + "version": "8.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", + "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.4.0", + "@eslint/eslintrc": "^1.4.1", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -1361,9 +1361,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", - "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3237,15 +3237,15 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -3316,9 +3316,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.27", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", + "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" } } }, @@ -3343,9 +3343,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.27", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", + "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" } } }, @@ -3355,9 +3355,9 @@ "integrity": "sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==" }, "@eslint/eslintrc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", - "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -3499,9 +3499,9 @@ } }, "@sapphire/snowflake": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.3.0.tgz", - "integrity": "sha512-Hec5N6zEkZuZFLybVKyLFLlcSgYmR6C1/+9NkIhxPwOf6tgX52ndJCSz8ADejmbrNE0VuNCNkpzhRZzenEC9vA==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", + "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==" }, "@tokenizer/token": { "version": "0.3.0", @@ -3545,9 +3545,9 @@ "dev": true }, "@types/node": { - "version": "18.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", - "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==" + "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" }, "@types/semver": { "version": "7.3.13", @@ -3576,22 +3576,22 @@ "dev": true }, "@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "requires": { "@types/node": "*" } }, "@typescript-eslint/eslint-plugin": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.47.0.tgz", - "integrity": "sha512-AHZtlXAMGkDmyLuLZsRpH3p4G/1iARIwc/T0vIem2YB+xW6pZaXYXzCBnZSF/5fdM97R9QqZWZ+h3iW10XgevQ==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", + "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.47.0", - "@typescript-eslint/type-utils": "5.47.0", - "@typescript-eslint/utils": "5.47.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/type-utils": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -3601,53 +3601,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.47.0.tgz", - "integrity": "sha512-udPU4ckK+R1JWCGdQC4Qa27NtBg7w020ffHqGyAK8pAgOVuNw7YaKXGChk+udh+iiGIJf6/E/0xhVXyPAbsczw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", + "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.47.0", - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/typescript-estree": "5.47.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz", - "integrity": "sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", + "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", "dev": true, "requires": { - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/visitor-keys": "5.47.0" + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0" } }, "@typescript-eslint/type-utils": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.47.0.tgz", - "integrity": "sha512-1J+DFFrYoDUXQE1b7QjrNGARZE6uVhBqIvdaXTe5IN+NmEyD68qXR1qX1g2u4voA+nCaelQyG8w30SAOihhEYg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", + "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.47.0", - "@typescript-eslint/utils": "5.47.0", + "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.47.0.tgz", - "integrity": "sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", + "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.0.tgz", - "integrity": "sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", + "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/visitor-keys": "5.47.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3656,28 +3656,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.47.0.tgz", - "integrity": "sha512-U9xcc0N7xINrCdGVPwABjbAKqx4GK67xuMV87toI+HUqgXj26m6RBp9UshEXcTrgCkdGYFzgKLt8kxu49RilDw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", + "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.47.0", - "@typescript-eslint/types": "5.47.0", - "@typescript-eslint/typescript-estree": "5.47.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.0.tgz", - "integrity": "sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", + "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.47.0", + "@typescript-eslint/types": "5.48.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -4042,9 +4042,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.27", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", + "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" } } }, @@ -4105,12 +4105,12 @@ "dev": true }, "eslint": { - "version": "8.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", - "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", + "version": "8.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", + "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.4.0", + "@eslint/eslintrc": "^1.4.1", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -4301,9 +4301,9 @@ "dev": true }, "fastq": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", - "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -5641,9 +5641,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "requires": {} }, "xtend": { -- 2.45.2 From 44adad28a97950ab6611c5490b1f62a64385158f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 9 Jan 2023 17:21:35 +0100 Subject: [PATCH 29/54] use text instead of integer for long integers --- src/utils/client.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index 2aa27c3..9c98aae 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -60,12 +60,12 @@ const initDatabase = (db: Database) => { db.run('CREATE TABLE IF NOT EXISTS reminder ( \ id INTEGER PRIMARY KEY, \ data TEXT, \ - expiration_date INTEGER, \ + expiration_date TEXT, \ option_id INTEGER, \ - channel_id INTEGER, \ - creation_date INTEGER, \ - user_id INTEGER, \ - guild_id INTEGER, \ + channel_id TEXT, \ + creation_date TEXT, \ + user_id TEXT, \ + guild_id TEXT, \ locale TEXT \ );'); }; -- 2.45.2 From 8b05c26dab44ea21a9a12b00bec11623ca9832a9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 9 Jan 2023 17:56:32 +0100 Subject: [PATCH 30/54] complete reminders --- src/events/client/ready.ts | 22 ++++++++++++---------- src/utils/reminder.ts | 6 +++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index 08d6df7..e2b47d3 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -1,5 +1,5 @@ import { Client } from 'discord.js'; -import { deleteReminder, infoReminder, OptionReminder, sendReminder } from '../../utils/reminder'; +import { deleteReminder, infoReminder, OptionReminder, sendReminder, setTimeoutReminder } from '../../utils/reminder'; export const once = true; @@ -33,6 +33,15 @@ export default async (client: Client) => { }).then((data) => { const now = Date.now(); (data as dbReminder[]).forEach((element) => { + const info = { + locale: element.locale, + message: element.data, + createdAt: element.creation_date, + channelId: `${element.channel_id}`, + userId: `${element.user_id}`, + guildId: `${element.guild_id}`, + } as infoReminder; + if (element.expiration_date <= now) { // Reminder expired deleteReminder(client, element.creation_date, `${element.user_id}`).then((res) => { @@ -40,19 +49,12 @@ export default async (client: Client) => { throw res; } }); - const info = { - locale: element.locale, - message: element.data, - createdAt: element.creation_date, - channelId: `${element.channel_id}`, - userId: `${element.user_id}`, - guildId: `${element.guild_id}`, - } as infoReminder; + client.channels.fetch(`${info.channelId}`).then((val) => console.log(val?.url)); sendReminder(client, info, element.option_id as OptionReminder); } else { // Restart timeout + setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000); } - }); }).catch(err => { throw err; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index faa84fb..e2983c9 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -59,10 +59,10 @@ export const newReminder = async (client: Client, time: string, info: infoRemind data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id, locale \ ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? );', [ info.message, - info.createdAt + timeout, + `${info.createdAt + (timeout * 1000)}`, data.option.valueOf(), info.channelId, - info.createdAt, + `${info.createdAt}`, info.userId, info.guildId, info.locale], (err) => { @@ -128,7 +128,7 @@ export const sendReminder = (client: Client, info: infoReminder, option: OptionR * @param option option used for this reminder (aka location of the response) * @param timeout Amout of time before the reminder ends */ -const setTimeoutReminder = (client: Client, info: infoReminder, option: OptionReminder, timeout: number) => { +export const setTimeoutReminder = (client: Client, info: infoReminder, option: OptionReminder, timeout: number) => { setTimeout(() => { deleteReminder(client, info.createdAt, info.userId).then((val) => { if (val != true) { -- 2.45.2 From f9625db2c275aef6130194a9d2b3c6935740ad1a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 15 Jan 2023 20:27:21 +0100 Subject: [PATCH 31/54] add reminder delete --- src/commands/misc/reminder.ts | 23 +++++-- src/events/client/ready.ts | 26 ++++---- src/locales/fr.json | 64 +++++++++--------- src/utils/client.ts | 3 +- src/utils/reminder.ts | 118 ++++++++++++++++++++++++++++++++-- 5 files changed, 175 insertions(+), 59 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 0326690..5f67f60 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -2,7 +2,7 @@ import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/ import { ActionRowBuilder, ChatInputCommandInteraction, Client, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; -import { newReminder } from '../../utils/reminder'; +import { checkOwnershipReminder, deleteReminder, getReminderInfo, newReminder } from '../../utils/reminder'; export default { data: (client: Client) => { @@ -207,11 +207,24 @@ export default { // Delete a reminder case loc_default?.get(`c_${filename}_sub3_name`) ?.toLowerCase() ?? '': { - // TODO: Message simple qui indique que l'on a supprimé - // le reminder. Penser à check l'appartenance du reminder. - // On donne l'ID du reminder en option. + const id = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub3_opt1_name`) as string); + if (id === null) { + return interaction.reply({ content: loc?.get('c_reminder2'), ephemeral: true }); + } - return interaction.reply('TODO'); + // Check if the ID exists and belongs to the user + if (await checkOwnershipReminder(client, id, interaction.user.id, interaction.guildId ?? '0')) { + return interaction.reply({ content: loc?.get('c_reminder3'), ephemeral: true }); + } + + // Stop timeout + const reminderInfo = await getReminderInfo(client, id); + clearTimeout(reminderInfo.timeout_id); + + // Delete from database + deleteReminder(client, reminderInfo.creation_date, reminderInfo.user_id); + + return interaction.reply({ content: `Reminder **#${id}** supprimé !`, ephemeral: true }); } default: { console.error(`${__filename}: unknown subcommand (${subcommand})`); diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index e2b47d3..1a20b80 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -1,20 +1,8 @@ import { Client } from 'discord.js'; -import { deleteReminder, infoReminder, OptionReminder, sendReminder, setTimeoutReminder } from '../../utils/reminder'; +import { dbReminder, deleteReminder, infoReminder, OptionReminder, sendReminder, setTimeoutReminder, updateReminder } from '../../utils/reminder'; export const once = true; -type dbReminder = { - id: number, - data: string, - expiration_date: number, - option_id: number, - channel_id: number, - creation_date: number, - user_id: number, - guild_id: number, - locale: string -} - /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-ready */ export default async (client: Client) => { console.log('Connected to Discord!'); @@ -49,11 +37,19 @@ export default async (client: Client) => { throw res; } }); - client.channels.fetch(`${info.channelId}`).then((val) => console.log(val?.url)); + sendReminder(client, info, element.option_id as OptionReminder); } else { // Restart timeout - setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000); + const timeoutId = setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000); + + // Update timeout in database + element.timeout_id = timeoutId; + updateReminder(client, element).then((res) => { + if (res != true) { + throw res; + } + }); } }); }).catch(err => { diff --git a/src/locales/fr.json b/src/locales/fr.json index 1a6d224..f98ff2c 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -1,37 +1,39 @@ { - "e_interacreate_no_command": "Désolé, la commande n'existe plus...", - "e_interacreate_no_modal": "Désolé, le modèle n'existe plus...", + "e_interacreate_no_command": "Désolé, la commande n'existe plus...", + "e_interacreate_no_modal": "Désolé, le modèle n'existe plus...", - "c_ping_name": "Ping", - "c_ping_desc": "Pong!", - "c_ping1": "Latence totale", - "c_ping2": "Latence du Websocket", + "c_ping_name": "Ping", + "c_ping_desc": "Pong!", + "c_ping1": "Latence totale", + "c_ping2": "Latence du Websocket", - "c_help_name": "Aide", - "c_help_desc": "Informations sur les commandes", - "c_help_opt1_name": "commande", - "c_help_opt1_desc": "Commande voulu en détail.", - "c_help1": "Liste des catégories et des commandes associées", - "c_help2": "`/help ` pour obtenir plus d'informations sur une commande.", - "c_help3": "Impossible de trouver :", + "c_help_name": "Aide", + "c_help_desc": "Informations sur les commandes", + "c_help_opt1_name": "commande", + "c_help_opt1_desc": "Commande voulu en détail.", + "c_help1": "Liste des catégories et des commandes associées", + "c_help2": "`/help ` pour obtenir plus d'informations sur une commande.", + "c_help3": "Impossible de trouver :", - "u_time_at": "à", + "u_time_at": "à", - "c_reminder_name": "rappel", - "c_reminder_desc": "Commande relative aux rappels", - "c_reminder_sub1_name": "nouveau", - "c_reminder_sub1_desc": "Met en place un rappel", - "c_reminder_sub1_opt1_name": "temps", - "c_reminder_sub1_opt1_desc": "Temps désiré avant le rappel, accolez un @ pour activer la mention ou un p pour envoyer en DM", - "c_reminder_sub1_opt2_name": "message", - "c_reminder_sub1_opt2_desc": "Message du rappel", - "c_reminder_sub2_name": "liste", - "c_reminder_sub2_desc": "Affiche la liste des rappels d'un utilisateur", - "c_reminder_sub2_opt1_name": "utilisateur", - "c_reminder_sub2_opt1_desc": "Affiche la liste de l'utilisateur en question", - "c_reminder_sub3_name": "efface", - "c_reminder_sub3_desc": "Supprime un rappel", - "c_reminder_sub3_opt1_name": "ID", - "c_reminder_sub3_opt1_desc": "Rappel à supprimé", - "c_reminder1": "Un rappel a été configuré pour dans" + "c_reminder_name": "rappel", + "c_reminder_desc": "Commande relative aux rappels", + "c_reminder_sub1_name": "nouveau", + "c_reminder_sub1_desc": "Met en place un rappel", + "c_reminder_sub1_opt1_name": "temps", + "c_reminder_sub1_opt1_desc": "Temps désiré avant le rappel, accolez un @ pour activer la mention ou un p pour envoyer en DM", + "c_reminder_sub1_opt2_name": "message", + "c_reminder_sub1_opt2_desc": "Message du rappel", + "c_reminder_sub2_name": "liste", + "c_reminder_sub2_desc": "Affiche la liste des rappels d'un utilisateur", + "c_reminder_sub2_opt1_name": "utilisateur", + "c_reminder_sub2_opt1_desc": "Affiche la liste de l'utilisateur en question", + "c_reminder_sub3_name": "efface", + "c_reminder_sub3_desc": "Supprime un rappel", + "c_reminder_sub3_opt1_name": "id", + "c_reminder_sub3_opt1_desc": "Rappel à supprimé", + "c_reminder1": "Un rappel a été configuré pour dans", + "c_reminder2": "L'ID renseigné n'est pas valide.", + "c_reminder3": "Rappel non trouvé, pas sur le bon serveur ou qui ne vous appartiens pas." } diff --git a/src/utils/client.ts b/src/utils/client.ts index 9c98aae..84bd16a 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -66,6 +66,7 @@ const initDatabase = (db: Database) => { creation_date TEXT, \ user_id TEXT, \ guild_id TEXT, \ - locale TEXT \ + locale TEXT, \ + timeout_id TEXT \ );'); }; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index e2983c9..ad23b2c 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -26,6 +26,19 @@ export type infoReminder = { guildId: string | null } +export type dbReminder = { + id: number, + data: string | null, + expiration_date: number, + option_id: OptionReminder, + channel_id: string | null, + creation_date: number, + user_id: string, + guild_id: string | null, + locale: string, + timeout_id: number +} + /** * Split the time and the extra args `p` and `@` * @param time raw text from user @@ -52,12 +65,12 @@ export const newReminder = async (client: Client, time: string, info: infoRemind new Promise((ok, ko) => { const data = splitTime(time); const timeout = strToSeconds(data.time); - setTimeoutReminder(client, info, data.option, timeout); + const timeoutId = setTimeoutReminder(client, info, data.option, timeout); // Add the remind to the db client.db.run('INSERT INTO reminder ( \ - data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id, locale \ - ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? );', [ + data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id, locale, timeout_id \ + ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? );', [ info.message, `${info.createdAt + (timeout * 1000)}`, data.option.valueOf(), @@ -65,7 +78,8 @@ export const newReminder = async (client: Client, time: string, info: infoRemind `${info.createdAt}`, info.userId, info.guildId, - info.locale], (err) => { + info.locale, + timeoutId], (err) => { if (err) { ko(err); } @@ -77,7 +91,7 @@ export const newReminder = async (client: Client, time: string, info: infoRemind }); /** - * Delete a reminder + * Delete a reminder from the database * @param client Client * @param createdAt Creation of the reminder * @param userId User ID who created the reminder @@ -127,9 +141,10 @@ export const sendReminder = (client: Client, info: infoReminder, option: OptionR * @param info info about the reminder * @param option option used for this reminder (aka location of the response) * @param timeout Amout of time before the reminder ends + * @returns Timeout's ID */ export const setTimeoutReminder = (client: Client, info: infoReminder, option: OptionReminder, timeout: number) => { - setTimeout(() => { + return Number(setTimeout(() => { deleteReminder(client, info.createdAt, info.userId).then((val) => { if (val != true) { throw val; @@ -137,5 +152,94 @@ export const setTimeoutReminder = (client: Client, info: infoReminder, option: O sendReminder(client, info, option); }); - }, timeout * 1000); + }, timeout * 1000)); +}; + +/** + * Check the owernship of a reminder by a user + * @param client Client + * @param id ID of the reminder + * @param userId user ID to check + * @param guildId guild ID where the ownership request as been send, 0 if DM + */ +export const checkOwnershipReminder = async (client: Client, id: number, userId: string, guildId: string) => { + const data = await new Promise((ok, ko) => { + // Check the ownership + client.db.all('SELECT EXISTS ( \ + SELECT 1 FROM reminder \ + WHERE id = ? \ + AND user_id = ? \ + AND (guild_id = ? OR guild_id = 0) \ + )', [ + id, userId, guildId, + ], (err, row) => { + if (err) { + ko(err); + } + + // Send all the current reminders + ok(row[0]); + }); + }) as { [key: string]: number }; + return Object.keys(data).map((key) => data[key])[0] === 0 ? true : false; +}; + +/** + * Retrieve info about a reminder + * @param client Client + * @param id Reminder's ID + */ +export const getReminderInfo = async (client: Client, id: number) => { + return await new Promise((ok, ko) => { + // Check the ownership + client.db.all('SELECT * FROM reminder \ + WHERE id = ?', [ + id], (err, row) => { + if (err) { + ko(err); + } + + // Send all the current reminders + ok(row[0]); + }); + }) as dbReminder; +}; + +/** + * Update an entry of the database + * @param client Client + * @param data Data who will override the data in database + */ +export const updateReminder = (client: Client, data: dbReminder) => { + // Delete the reminder for the database + return new Promise((ok, ko) => { + // Update the db + client.db.run('UPDATE reminder \ + SET data = ?, \ + expiration_date = ?, \ + option_id = ?, \ + channel_id = ?, \ + creation_date = ?, \ + user_id = ?, \ + guild_id = ?, \ + locale = ?, \ + timeout_id = ? \ + WHERE ID = ?', [ + data.data, + data.expiration_date, + data.option_id, + data.channel_id, + data.creation_date, + data.user_id, + data.guild_id, + data.locale, + data.timeout_id, + data.id], (err) => { + if (err) { + ko(err); + } + + ok(true); + }); + }); }; -- 2.45.2 From 10d462295d5a6cc8aee41e40712d75795ee1d08d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 15 Jan 2023 20:29:35 +0100 Subject: [PATCH 32/54] fix link --- src/commands/misc/reminder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 5f67f60..a3fcb9d 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -196,7 +196,7 @@ export default { ?.toLowerCase() ?? '': { // TODO: Liste dans un embed, naviguez entre les pages à l'aide // de boutons à la place d'utiliser des réactions - // cf. https://discordjs.guide/interactions/modals.html#building-and-responding-with-modals + // cf. https://discordjs.guide/interactions/buttons.html#building-and-sending-buttons // Une option pour renseigné un utilisateur est disponible. // Quand aucun utilisateur est spécifié, il faut affiché ses // rappels, sinon affiché les rappels de la personne qui fait -- 2.45.2 From b70f4e5680b024e89fcabbb81617bbeb40de9f5b Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 15 Jan 2023 20:35:32 +0100 Subject: [PATCH 33/54] hide reminder list since its not done yet --- src/commands/misc/reminder.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index a3fcb9d..b276203 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -72,8 +72,8 @@ export default { ) ) - // List reminders - .addSubcommand(subcommand => subcommand + // List reminders + /* .addSubcommand(subcommand => subcommand .setName( loc_default.get(`c_${filename}_sub2_name`) ?.toLowerCase() ?? '' @@ -102,7 +102,7 @@ export default { getLocalizations(client, `c_${filename}_sub2_opt1_desc`) ) ) - ) + ) */ // Delete a reminder .addSubcommand(subcommand => subcommand @@ -202,6 +202,9 @@ export default { // rappels, sinon affiché les rappels de la personne qui fait // la commande. + // TODO: Penser à décommenter l'envoie de la sous commande à + // l'API de Discord + return interaction.reply('TODO'); } // Delete a reminder -- 2.45.2 From e6d8bd72659cd509ef54eaf019bc38595b446556 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 09:41:57 +0100 Subject: [PATCH 34/54] Revert "hide reminder list since its not done yet" This reverts commit b70f4e5680b024e89fcabbb81617bbeb40de9f5b. --- src/commands/misc/reminder.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index b276203..a3fcb9d 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -72,8 +72,8 @@ export default { ) ) - // List reminders - /* .addSubcommand(subcommand => subcommand + // List reminders + .addSubcommand(subcommand => subcommand .setName( loc_default.get(`c_${filename}_sub2_name`) ?.toLowerCase() ?? '' @@ -102,7 +102,7 @@ export default { getLocalizations(client, `c_${filename}_sub2_opt1_desc`) ) ) - ) */ + ) // Delete a reminder .addSubcommand(subcommand => subcommand @@ -202,9 +202,6 @@ export default { // rappels, sinon affiché les rappels de la personne qui fait // la commande. - // TODO: Penser à décommenter l'envoie de la sous commande à - // l'API de Discord - return interaction.reply('TODO'); } // Delete a reminder -- 2.45.2 From 0299770ec1be379bde2f9b1c6aa3cc1c20e1cc85 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 09:53:26 +0100 Subject: [PATCH 35/54] init: buttons --- src/buttons/loader.ts | 36 ++++++++++++++++++++++++++++++++++++ src/index.ts | 10 ++++++++++ src/modules/client.ts | 26 ++++++++++++++++++++++++-- src/utils/client.ts | 5 +++++ 4 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 src/buttons/loader.ts diff --git a/src/buttons/loader.ts b/src/buttons/loader.ts new file mode 100644 index 0000000..521263c --- /dev/null +++ b/src/buttons/loader.ts @@ -0,0 +1,36 @@ +import { readdir } from 'fs/promises'; +import { removeExtension } from '../utils/misc'; +import { Client } from 'discord.js'; + +export default async (client: Client) => { + // Dossier des buttons + const buttons_categories = (await readdir(__dirname)) + .filter(element => !element.endsWith('.js') && !element.endsWith('.ts')); + + await Promise.all( + // For each categorie + buttons_categories.map(async buttons_category => { + // Retrieve all the commands + const button_files = await readdir(`${__dirname}/${buttons_category}`); + + // Add the category to the collection for the help command + client.buttons.categories.set( + buttons_category, + button_files.map(removeExtension), + ); + + // Add the button + return Promise.all( + button_files.map(async button_file => { + const button = ( + await import(`../buttons/${buttons_category}/${button_file}`) + ).default; + + // Add it to the collection so the interaction will work + client.buttons.list.set(button.data.name, button); + return button.data; + }), + ); + }), + ); +}; diff --git a/src/index.ts b/src/index.ts index 80ddc0f..7ce6835 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import loadClient, { quit } from './utils/client'; import loadEvents from './events/loader'; import loadModals from './modals/loader'; +import loadButtons from './buttons/loader'; import loadCommands from './commands/loader'; import { logStart } from './utils/misc'; @@ -41,6 +42,15 @@ const run = async () => { throw logStart(modals_name, false); }); + // Buttons Discord.JS + const buttons_name = 'Buttons'; + await loadButtons(client) + .then(() => console.log(logStart(buttons_name, true))) + .catch((err) => { + console.error(err); + throw logStart(buttons_name, false); + }); + // Commands Slash Discord.JS const commands_name = 'Commands'; await loadCommands(client) diff --git a/src/modules/client.ts b/src/modules/client.ts index a70ae18..1e6aeb8 100644 --- a/src/modules/client.ts +++ b/src/modules/client.ts @@ -2,7 +2,7 @@ import { Collection } from 'discord.js'; import { SlashCommandBuilder } from '@discordjs/builders'; import { Database } from 'sqlite3'; -export {}; +export { }; declare module 'discord.js' { // eslint-disable-next-line no-shadow @@ -37,7 +37,29 @@ declare module 'discord.js' { interaction: (interaction: ModalSubmitInteraction, client: Client) => unknown } >, - } + }, + /** Store all the buttons */ + buttons: { + categories: Collection< + /** Category name */ + string, + /** Name of the buttons in the category */ + string[] + >, + list: Collection< + /** Button name */ + string, + /** Button itself */ + { + /** Data about the button */ + data: { + name: string + }, + /** How the button interact */ + interaction: (interaction: ButtonInteraction, client: Client) => unknown + } + >, + }, /** Store all the slash commands */ commands: { categories: Collection< diff --git a/src/utils/client.ts b/src/utils/client.ts index 84bd16a..916c85b 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -24,6 +24,11 @@ export default async () => { list: new Collection(), }; + client.buttons = { + categories: new Collection(), + list: new Collection(), + }; + client.commands = { categories: new Collection(), list: new Collection(), -- 2.45.2 From eb741f409a5ce9a99d86ce54a440ee603d4874c9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 10:17:32 +0100 Subject: [PATCH 36/54] feat: support of buttons --- src/events/interactions/interactionCreate.ts | 17 ++++++++++++++++- src/locales/fr.json | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index cef1087..0d2a5a5 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -1,4 +1,4 @@ -import { Client, Interaction, InteractionType } from 'discord.js'; +import { Client, ComponentType, Interaction, InteractionType } from 'discord.js'; import { getLocale } from '../../utils/locales'; /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */ @@ -29,6 +29,21 @@ export default (interaction: Interaction, client: Client) => { return modal.interaction(interaction, client); } + case InteractionType.MessageComponent: + if (interaction.componentType == ComponentType.Button) { + const button = client.buttons.list.get(interaction.customId); + if (!button) { + return interaction.reply({ + content: loc.get('e_interacreate_no_button'), + }); + } + + return interaction; + } + + // Handle only buttons for now + throw RangeError; + default: break; } diff --git a/src/locales/fr.json b/src/locales/fr.json index f98ff2c..453fb72 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -1,6 +1,7 @@ { "e_interacreate_no_command": "Désolé, la commande n'existe plus...", "e_interacreate_no_modal": "Désolé, le modèle n'existe plus...", + "e_interacreate_no_button": "Désolé, le bouton n'existe plus...", "c_ping_name": "Ping", "c_ping_desc": "Pong!", -- 2.45.2 From 159d3b15281a9c9aae6067a5d1f02e298da423d0 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 10:43:49 +0100 Subject: [PATCH 37/54] fix button interaction --- src/events/interactions/interactionCreate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index 0d2a5a5..1b83778 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -38,7 +38,7 @@ export default (interaction: Interaction, client: Client) => { }); } - return interaction; + return button.interaction(interaction, client); } // Handle only buttons for now -- 2.45.2 From 4bac943011a39e14ed2aa422427824b80d2b314f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 10:49:57 +0100 Subject: [PATCH 38/54] init: reminder list --- src/buttons/misc/reminderList-next.ts | 36 +++++++++++++++++++++++++++ src/buttons/misc/reminderList-prec.ts | 36 +++++++++++++++++++++++++++ src/commands/misc/reminder.ts | 35 +++++++++++++++++++------- src/locales/fr.json | 3 ++- 4 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 src/buttons/misc/reminderList-next.ts create mode 100644 src/buttons/misc/reminderList-prec.ts diff --git a/src/buttons/misc/reminderList-next.ts b/src/buttons/misc/reminderList-next.ts new file mode 100644 index 0000000..9f57205 --- /dev/null +++ b/src/buttons/misc/reminderList-next.ts @@ -0,0 +1,36 @@ +import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, Client, Colors, EmbedBuilder } from 'discord.js'; +import { getFilename } from '../../utils/misc'; + +export default { + data: { + name: getFilename(__filename), + }, + interaction: async (interaction: ButtonInteraction, client: Client) => { + await interaction.deferReply({ ephemeral: true }); + + const row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId('reminderList-prec') + .setLabel('Prec') + .setStyle(ButtonStyle.Primary)) + .addComponents( + new ButtonBuilder() + .setCustomId('reminderList-next') + .setLabel('Next') + .setStyle(ButtonStyle.Primary) + .setDisabled(true), + ); + + + const list = new EmbedBuilder() + .setColor(Colors.DarkGrey) + .setTitle('List title') + .setDescription('List desc'); + + return interaction.editReply({ + embeds: [list], + components: [row], + }); + }, +}; diff --git a/src/buttons/misc/reminderList-prec.ts b/src/buttons/misc/reminderList-prec.ts new file mode 100644 index 0000000..9057896 --- /dev/null +++ b/src/buttons/misc/reminderList-prec.ts @@ -0,0 +1,36 @@ +import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, Client, Colors, EmbedBuilder } from 'discord.js'; +import { getFilename } from '../../utils/misc'; + +export default { + data: { + name: getFilename(__filename), + }, + interaction: async (interaction: ButtonInteraction, client: Client) => { + await interaction.deferReply({ ephemeral: true }); + + const row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId('reminderList-prec') + .setLabel('Prec') + .setStyle(ButtonStyle.Primary) + .setDisabled(true)) + .addComponents( + new ButtonBuilder() + .setCustomId('reminderList-next') + .setLabel('Next') + .setStyle(ButtonStyle.Primary), + ); + + + const list = new EmbedBuilder() + .setColor(Colors.DarkGrey) + .setTitle('List title') + .setDescription('List desc'); + + return interaction.editReply({ + embeds: [list], + components: [row], + }); + }, +}; diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index a3fcb9d..f465f72 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,5 +1,5 @@ import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/builders'; -import { ActionRowBuilder, ChatInputCommandInteraction, Client, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, Client, Colors, EmbedBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { checkOwnershipReminder, deleteReminder, getReminderInfo, newReminder } from '../../utils/reminder'; @@ -194,15 +194,32 @@ export default { // List reminders case loc_default?.get(`c_${filename}_sub2_name`) ?.toLowerCase() ?? '': { - // TODO: Liste dans un embed, naviguez entre les pages à l'aide - // de boutons à la place d'utiliser des réactions - // cf. https://discordjs.guide/interactions/buttons.html#building-and-sending-buttons - // Une option pour renseigné un utilisateur est disponible. - // Quand aucun utilisateur est spécifié, il faut affiché ses - // rappels, sinon affiché les rappels de la personne qui fait - // la commande. + // Which user to show + let user = interaction.options.getUser(loc_default?.get(`c_${filename}_sub2_opt1_name`) as string); + if (user == null) { + user = interaction.user; + } - return interaction.reply('TODO'); + const row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId('reminderList-prec') + .setLabel('Prec') + .setStyle(ButtonStyle.Primary) + .setDisabled(true)) + .addComponents( + new ButtonBuilder() + .setCustomId('reminderList-next') + .setLabel('Next') + .setStyle(ButtonStyle.Primary), + ); + + const list = new EmbedBuilder() + .setColor(Colors.DarkGrey) + .setTitle(`List title of ${user.tag}`) + .setDescription('List desc'); + + return await interaction.reply({ ephemeral: true, embeds: [list], components: [row] }); } // Delete a reminder case loc_default?.get(`c_${filename}_sub3_name`) diff --git a/src/locales/fr.json b/src/locales/fr.json index 453fb72..71b13b9 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -36,5 +36,6 @@ "c_reminder_sub3_opt1_desc": "Rappel à supprimé", "c_reminder1": "Un rappel a été configuré pour dans", "c_reminder2": "L'ID renseigné n'est pas valide.", - "c_reminder3": "Rappel non trouvé, pas sur le bon serveur ou qui ne vous appartiens pas." + "c_reminder3": "Rappel non trouvé, pas sur le bon serveur ou qui ne vous appartiens pas.", + "c_reminder4": "Utilisateur inconnu." } -- 2.45.2 From ffc395b4aa5160fc72c7430f43219334f1aab75d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 12:02:04 +0100 Subject: [PATCH 39/54] fix button implementation for updates --- src/buttons/loader.ts | 33 +++++++++++++++++++- src/events/interactions/interactionCreate.ts | 17 +--------- src/modules/client.ts | 2 +- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/buttons/loader.ts b/src/buttons/loader.ts index 521263c..1a54878 100644 --- a/src/buttons/loader.ts +++ b/src/buttons/loader.ts @@ -1,6 +1,7 @@ import { readdir } from 'fs/promises'; import { removeExtension } from '../utils/misc'; -import { Client } from 'discord.js'; +import { ChatInputCommandInteraction, Client, MessageComponentInteraction } from 'discord.js'; +import { getLocale } from '../utils/locales'; export default async (client: Client) => { // Dossier des buttons @@ -34,3 +35,33 @@ export default async (client: Client) => { }), ); }; + +/** + * Collect interactions for buttons + * @param client Client + * @param interaction Chat interaction + * @param id Button ID + * @param deferUpdate defer update in case update take time + */ +export const collect = (client: Client, interaction: ChatInputCommandInteraction, id: string, deferUpdate = false) => { + const loc = getLocale(client, interaction.locale); + const button = client.buttons.list.get(id); + + if (!button) { + interaction.reply({ + content: loc.get('e_interacreate_no_button'), + }); + } + + const filter = (i: MessageComponentInteraction) => i.customId === id; + const collector = interaction.channel?.createMessageComponentCollector({ filter }); + collector?.on('collect', async (i) => { + if (deferUpdate) { + await i.deferUpdate(); + } + const msg = await button?.interaction(i, client); + if (msg !== undefined) { + await i.update(msg); + } + }); +}; diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index 1b83778..cef1087 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -1,4 +1,4 @@ -import { Client, ComponentType, Interaction, InteractionType } from 'discord.js'; +import { Client, Interaction, InteractionType } from 'discord.js'; import { getLocale } from '../../utils/locales'; /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */ @@ -29,21 +29,6 @@ export default (interaction: Interaction, client: Client) => { return modal.interaction(interaction, client); } - case InteractionType.MessageComponent: - if (interaction.componentType == ComponentType.Button) { - const button = client.buttons.list.get(interaction.customId); - if (!button) { - return interaction.reply({ - content: loc.get('e_interacreate_no_button'), - }); - } - - return button.interaction(interaction, client); - } - - // Handle only buttons for now - throw RangeError; - default: break; } diff --git a/src/modules/client.ts b/src/modules/client.ts index 1e6aeb8..9af4913 100644 --- a/src/modules/client.ts +++ b/src/modules/client.ts @@ -56,7 +56,7 @@ declare module 'discord.js' { name: string }, /** How the button interact */ - interaction: (interaction: ButtonInteraction, client: Client) => unknown + interaction: (interaction: MessageComponentInteraction, client: Client) => Promise } >, }, -- 2.45.2 From ff8561070a501276d988cf3ffafb396853fb671d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 12:04:57 +0100 Subject: [PATCH 40/54] * update buttons of reminder for the collect * add a page arg --- src/buttons/misc/reminderList-next.ts | 18 +++++++++++------ src/buttons/misc/reminderList-prec.ts | 17 ++++++++++------ src/commands/misc/reminder.ts | 29 +++++++++++++++++++++++++-- src/locales/fr.json | 2 ++ 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/src/buttons/misc/reminderList-next.ts b/src/buttons/misc/reminderList-next.ts index 9f57205..e19e134 100644 --- a/src/buttons/misc/reminderList-next.ts +++ b/src/buttons/misc/reminderList-next.ts @@ -1,12 +1,17 @@ -import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, Client, Colors, EmbedBuilder } from 'discord.js'; +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, Colors, EmbedBuilder, MessageComponentInteraction } from 'discord.js'; import { getFilename } from '../../utils/misc'; export default { data: { name: getFilename(__filename), }, - interaction: async (interaction: ButtonInteraction, client: Client) => { - await interaction.deferReply({ ephemeral: true }); + interaction: async (_: MessageComponentInteraction, client: Client) => { + // TODO: Dynamically change that + const pageMax = 1; + const page = 1; + + // Fetch list + client.db; const row = new ActionRowBuilder() .addComponents( @@ -19,7 +24,7 @@ export default { .setCustomId('reminderList-next') .setLabel('Next') .setStyle(ButtonStyle.Primary) - .setDisabled(true), + .setDisabled(page === pageMax ? true : false), ); @@ -28,9 +33,10 @@ export default { .setTitle('List title') .setDescription('List desc'); - return interaction.editReply({ + return { + content: 'next', embeds: [list], components: [row], - }); + }; }, }; diff --git a/src/buttons/misc/reminderList-prec.ts b/src/buttons/misc/reminderList-prec.ts index 9057896..da2bec8 100644 --- a/src/buttons/misc/reminderList-prec.ts +++ b/src/buttons/misc/reminderList-prec.ts @@ -1,12 +1,16 @@ -import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, Client, Colors, EmbedBuilder } from 'discord.js'; +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, Colors, EmbedBuilder, MessageComponentInteraction } from 'discord.js'; import { getFilename } from '../../utils/misc'; export default { data: { name: getFilename(__filename), }, - interaction: async (interaction: ButtonInteraction, client: Client) => { - await interaction.deferReply({ ephemeral: true }); + interaction: async (_: MessageComponentInteraction, client: Client) => { + // TODO: Dynamically change that + const page = 1; + + // Fetch list + client.db; const row = new ActionRowBuilder() .addComponents( @@ -14,7 +18,7 @@ export default { .setCustomId('reminderList-prec') .setLabel('Prec') .setStyle(ButtonStyle.Primary) - .setDisabled(true)) + .setDisabled(page === 1 ? true : false)) .addComponents( new ButtonBuilder() .setCustomId('reminderList-next') @@ -28,9 +32,10 @@ export default { .setTitle('List title') .setDescription('List desc'); - return interaction.editReply({ + return { + content: 'prec', embeds: [list], components: [row], - }); + }; }, }; diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index f465f72..a5a824b 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,5 +1,6 @@ import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/builders'; import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, Client, Colors, EmbedBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; +import { collect } from '../../buttons/loader'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { checkOwnershipReminder, deleteReminder, getReminderInfo, newReminder } from '../../utils/reminder'; @@ -102,6 +103,24 @@ export default { getLocalizations(client, `c_${filename}_sub2_opt1_desc`) ) ) + + // Page + .addIntegerOption(option => option + .setName( + loc_default.get(`c_${filename}_sub2_opt2_name`) + ?.toLowerCase() ?? '' + ).setDescription( + loc_default.get(`c_${filename}_sub2_opt2_desc`) ?? '' + ).setNameLocalizations( + getLocalizations( + client, + `c_${filename}_sub2_opt2_name`, + true + ) + ).setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_sub2_opt2_desc`) + ) + ) ) // Delete a reminder @@ -200,19 +219,25 @@ export default { user = interaction.user; } + const idPrec = 'reminderList-prec'; + const idNext = 'reminderList-next'; + const row = new ActionRowBuilder() .addComponents( new ButtonBuilder() - .setCustomId('reminderList-prec') + .setCustomId(idPrec) .setLabel('Prec') .setStyle(ButtonStyle.Primary) .setDisabled(true)) .addComponents( new ButtonBuilder() - .setCustomId('reminderList-next') + .setCustomId(idNext) .setLabel('Next') .setStyle(ButtonStyle.Primary), ); + // Buttons interactions + collect(client, interaction, idPrec); + collect(client, interaction, idNext); const list = new EmbedBuilder() .setColor(Colors.DarkGrey) diff --git a/src/locales/fr.json b/src/locales/fr.json index 71b13b9..4c38ffd 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -30,6 +30,8 @@ "c_reminder_sub2_desc": "Affiche la liste des rappels d'un utilisateur", "c_reminder_sub2_opt1_name": "utilisateur", "c_reminder_sub2_opt1_desc": "Affiche la liste de l'utilisateur en question", + "c_reminder_sub2_opt2_name": "page", + "c_reminder_sub2_opt2_desc": "Page à afficher", "c_reminder_sub3_name": "efface", "c_reminder_sub3_desc": "Supprime un rappel", "c_reminder_sub3_opt1_name": "id", -- 2.45.2 From 2b0524069da2f9619c49576ca67844c6cb052274 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 14:58:54 +0100 Subject: [PATCH 41/54] ephemeral error message for buttons --- src/buttons/loader.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/buttons/loader.ts b/src/buttons/loader.ts index 1a54878..39a4630 100644 --- a/src/buttons/loader.ts +++ b/src/buttons/loader.ts @@ -50,6 +50,7 @@ export const collect = (client: Client, interaction: ChatInputCommandInteraction if (!button) { interaction.reply({ content: loc.get('e_interacreate_no_button'), + ephemeral: true, }); } -- 2.45.2 From ec0098e3d0db4bd431a8ebe2fb959ab8f79e8190 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 17:16:47 +0100 Subject: [PATCH 42/54] add some layout for lists --- src/commands/misc/reminder.ts | 25 ++++++------ src/locales/fr.json | 7 +++- src/utils/reminder.ts | 72 +++++++++++++++++++++++++++++++++-- src/utils/time.ts | 11 ++++++ 4 files changed, 97 insertions(+), 18 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index a5a824b..e01db9f 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,9 +1,9 @@ import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/builders'; -import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, Client, Colors, EmbedBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, Client, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; import { collect } from '../../buttons/loader'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; -import { checkOwnershipReminder, deleteReminder, getReminderInfo, newReminder } from '../../utils/reminder'; +import { checkOwnershipReminder, deleteReminder, embedListReminders, getReminderInfo, newReminder } from '../../utils/reminder'; export default { data: (client: Client) => { @@ -186,20 +186,20 @@ export default { // Show modal to user to get at least the time const modal = new ModalBuilder() .setCustomId('reminderGUI') - .setTitle(loc?.get('c_reminder_name').capitalize()); + .setTitle(loc.get('c_reminder_name').capitalize()); const timeGUI = new TextInputBuilder() .setCustomId('reminderGUI-time') - .setLabel(loc?.get('c_reminder_sub1_opt1_name').capitalize()) + .setLabel(loc.get('c_reminder_sub1_opt1_name').capitalize()) .setStyle(TextInputStyle.Short) .setPlaceholder('1h') .setRequired(true); const messageGUI = new TextInputBuilder() .setCustomId('reminderGUI-message') - .setLabel(loc?.get('c_reminder_sub1_opt2_name').capitalize()) + .setLabel(loc.get('c_reminder_sub1_opt2_name').capitalize()) .setStyle(TextInputStyle.Paragraph) - .setPlaceholder(loc?.get('c_reminder_sub1_opt2_desc')) + .setPlaceholder(loc.get('c_reminder_sub1_opt2_desc')) .setRequired(false); modal.addComponents( @@ -239,10 +239,9 @@ export default { collect(client, interaction, idPrec); collect(client, interaction, idNext); - const list = new EmbedBuilder() - .setColor(Colors.DarkGrey) - .setTitle(`List title of ${user.tag}`) - .setDescription('List desc'); + const page = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub2_opt2_name`) as string) ?? 1; + + const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); return await interaction.reply({ ephemeral: true, embeds: [list], components: [row] }); } @@ -251,12 +250,12 @@ export default { ?.toLowerCase() ?? '': { const id = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub3_opt1_name`) as string); if (id === null) { - return interaction.reply({ content: loc?.get('c_reminder2'), ephemeral: true }); + return interaction.reply({ content: loc.get('c_reminder2'), ephemeral: true }); } // Check if the ID exists and belongs to the user if (await checkOwnershipReminder(client, id, interaction.user.id, interaction.guildId ?? '0')) { - return interaction.reply({ content: loc?.get('c_reminder3'), ephemeral: true }); + return interaction.reply({ content: loc.get('c_reminder3'), ephemeral: true }); } // Stop timeout @@ -264,7 +263,7 @@ export default { clearTimeout(reminderInfo.timeout_id); // Delete from database - deleteReminder(client, reminderInfo.creation_date, reminderInfo.user_id); + deleteReminder(client, Number(reminderInfo.creation_date), reminderInfo.user_id); return interaction.reply({ content: `Reminder **#${id}** supprimé !`, ephemeral: true }); } diff --git a/src/locales/fr.json b/src/locales/fr.json index 4c38ffd..632114d 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -39,5 +39,10 @@ "c_reminder1": "Un rappel a été configuré pour dans", "c_reminder2": "L'ID renseigné n'est pas valide.", "c_reminder3": "Rappel non trouvé, pas sur le bon serveur ou qui ne vous appartiens pas.", - "c_reminder4": "Utilisateur inconnu." + "c_reminder4": "Utilisateur inconnu.", + "c_reminder5": "Rappels de", + "c_reminder6": "Page ", + "c_reminder7": "Pas de message", + "c_reminder8": "Expire dans", + "c_reminder9": "Fais le" } diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index ad23b2c..0e455b8 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -1,6 +1,6 @@ -import { Client } from 'discord.js'; +import { Client, Colors, EmbedBuilder, User } from 'discord.js'; import { getLocale } from './locales'; -import { strToSeconds } from './time'; +import { showDate, strToSeconds, timeDeltaToString } from './time'; /** * Option possible for reminders @@ -32,11 +32,11 @@ export type dbReminder = { expiration_date: number, option_id: OptionReminder, channel_id: string | null, - creation_date: number, + creation_date: string, user_id: string, guild_id: string | null, locale: string, - timeout_id: number + timeout_id: string } /** @@ -243,3 +243,67 @@ export const updateReminder = (client: Client, data: dbReminder) => { }); }); }; + +/** + * Return a list of reminders for a user in a specified context + * @param client Client + * @param userId user ID + * @param guildId guild ID + * @returns List of reminders of a user in a guild + */ +const listReminders = async (client: Client, userId: string, guildId: string | null) => { + return await new Promise((ok, ko) => { + // Check the ownership + client.db.all('SELECT data, creation_date, expiration_date, id FROM reminder \ + WHERE user_id = ? AND (guild_id = ? OR guild_id = 0)', [ + userId, guildId ?? 0], (err, row) => { + if (err) { + ko(err); + } + + // Send all the current reminders + ok(row); + }); + }) as dbReminder[]; +}; + +export const embedListReminders = async (client: Client, user: User, guildId: string | null, page: number, local: string) => { + const loc = getLocale(client, local); + const reminders = await listReminders(client, user.id, guildId); + + const elementPerPage = 5; + let pageMax = Math.floor(reminders.length / elementPerPage); + + if (pageMax <= 1) { + page = 1; + pageMax = 1; + } + const embed = new EmbedBuilder() + .setColor(Colors.DarkGrey) + .setDescription(`${loc.get('c_reminder5')} ${user} • ${loc.get('c_reminder6')} ${page}/${pageMax}`) + .setThumbnail(user.displayAvatarURL()); + + const limit = elementPerPage * page; + + if (reminders.length > 0 && page <= pageMax) { + let curseur = limit - elementPerPage - 1; + reminders.forEach((remind) => { + if (curseur <= limit) { + let text = remind.data ?? loc.get('c_reminder7'); + if (text.length > 1024) { + text = `${text.substring(0, 1021)}...`; + } + const expiration = `${loc.get('c_reminder8')} ${timeDeltaToString(remind.expiration_date)}`; + embed.addFields({ + name: `#${remind.id} • ${loc.get('c_reminder9')} ${showDate(local, loc, new Date(Number(remind.creation_date)))}\n${expiration}`, + value: text, + inline: false, + }); + + curseur++; + } + }); + } + + return embed; +}; diff --git a/src/utils/time.ts b/src/utils/time.ts index bbbc6f5..4618b8b 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -41,3 +41,14 @@ export const strToSeconds = (time: string) => { return res; }; + +/** + * Calculating the difference between a date and now + * @param time Time + * @returns Delta between the time and now + */ +export const timeDeltaToString = (time: number) => { + const now = Date.now(); + // TODO adapt the output and not always parse the time as seconds + return `${strToSeconds(`${now - time}`)} secs`; +}; -- 2.45.2 From 2593f92dad9a33dd80592ab6aa2a9473448437b5 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 17:16:58 +0100 Subject: [PATCH 43/54] fix types --- src/events/client/ready.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index 1a20b80..220d367 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -24,7 +24,7 @@ export default async (client: Client) => { const info = { locale: element.locale, message: element.data, - createdAt: element.creation_date, + createdAt: Number(element.creation_date), channelId: `${element.channel_id}`, userId: `${element.user_id}`, guildId: `${element.guild_id}`, @@ -32,7 +32,7 @@ export default async (client: Client) => { if (element.expiration_date <= now) { // Reminder expired - deleteReminder(client, element.creation_date, `${element.user_id}`).then((res) => { + deleteReminder(client, Number(element.creation_date), `${element.user_id}`).then((res) => { if (res != true) { throw res; } @@ -44,7 +44,7 @@ export default async (client: Client) => { const timeoutId = setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000); // Update timeout in database - element.timeout_id = timeoutId; + element.timeout_id = String(timeoutId); updateReminder(client, element).then((res) => { if (res != true) { throw res; -- 2.45.2 From 5c7ede0033062234c6c911380ff3dfdf6e9d4551 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 18:06:30 +0100 Subject: [PATCH 44/54] * fix display of time * add message when the list is empty * wip: add button to update when the list is empty * fix reminder deletion --- src/commands/misc/reminder.ts | 56 +++++++++++++++++++++-------------- src/events/client/ready.ts | 2 +- src/locales/fr.json | 4 ++- src/utils/reminder.ts | 17 +++++++++-- src/utils/time.ts | 2 +- 5 files changed, 52 insertions(+), 29 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index e01db9f..7504afd 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -219,29 +219,39 @@ export default { user = interaction.user; } - const idPrec = 'reminderList-prec'; - const idNext = 'reminderList-next'; - - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId(idPrec) - .setLabel('Prec') - .setStyle(ButtonStyle.Primary) - .setDisabled(true)) - .addComponents( - new ButtonBuilder() - .setCustomId(idNext) - .setLabel('Next') - .setStyle(ButtonStyle.Primary), - ); - // Buttons interactions - collect(client, interaction, idPrec); - collect(client, interaction, idNext); - const page = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub2_opt2_name`) as string) ?? 1; + const { remindersExists, list } = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); - const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); + let row; + if (remindersExists) { + const idPrec = 'reminderList-prec'; + const idNext = 'reminderList-next'; + row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId(idPrec) + .setLabel('Prec') + .setStyle(ButtonStyle.Primary) + .setDisabled(true)) + .addComponents( + new ButtonBuilder() + .setCustomId(idNext) + .setLabel('Next') + .setStyle(ButtonStyle.Primary), + ); + // Buttons interactions + collect(client, interaction, idPrec); + collect(client, interaction, idNext); + } else { + const idUpdate = 'reminderList-update'; + row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId(idUpdate) + .setLabel('Update') + .setStyle(ButtonStyle.Primary) + ); + } return await interaction.reply({ ephemeral: true, embeds: [list], components: [row] }); } @@ -263,9 +273,9 @@ export default { clearTimeout(reminderInfo.timeout_id); // Delete from database - deleteReminder(client, Number(reminderInfo.creation_date), reminderInfo.user_id); + return deleteReminder(client, reminderInfo.creation_date, reminderInfo.user_id) + .then(() => interaction.reply({ content: `Reminder **#${id}** supprimé !`, ephemeral: true })); - return interaction.reply({ content: `Reminder **#${id}** supprimé !`, ephemeral: true }); } default: { console.error(`${__filename}: unknown subcommand (${subcommand})`); diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index 220d367..a72c0af 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -32,7 +32,7 @@ export default async (client: Client) => { if (element.expiration_date <= now) { // Reminder expired - deleteReminder(client, Number(element.creation_date), `${element.user_id}`).then((res) => { + deleteReminder(client, element.creation_date, `${element.user_id}`).then((res) => { if (res != true) { throw res; } diff --git a/src/locales/fr.json b/src/locales/fr.json index 632114d..4093ba7 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -44,5 +44,7 @@ "c_reminder6": "Page ", "c_reminder7": "Pas de message", "c_reminder8": "Expire dans", - "c_reminder9": "Fais le" + "c_reminder9": "Fais le", + "c_reminder10": "L'utilisateur n'a aucun rappel en attente ou page n°", + "c_reminder11": "vide !" } diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index 0e455b8..dfc507d 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -97,7 +97,7 @@ export const newReminder = async (client: Client, time: string, info: infoRemind * @param userId User ID who created the reminder * @returns what the SQlite request sended */ -export const deleteReminder = (client: Client, createdAt: number, userId: string) => { +export const deleteReminder = (client: Client, createdAt: string, userId: string) => { // Delete the reminder for the database return new Promise((ok, ko) => { // Add the remind to the db @@ -145,7 +145,7 @@ export const sendReminder = (client: Client, info: infoReminder, option: OptionR */ export const setTimeoutReminder = (client: Client, info: infoReminder, option: OptionReminder, timeout: number) => { return Number(setTimeout(() => { - deleteReminder(client, info.createdAt, info.userId).then((val) => { + deleteReminder(client, String(info.createdAt), info.userId).then((val) => { if (val != true) { throw val; } @@ -267,6 +267,15 @@ const listReminders = async (client: Client, userId: string, guildId: string | n }) as dbReminder[]; }; +/** + * Return the embed of the reminders + * @param client Client + * @param user User + * @param guildId Guild ID + * @param page Page requested + * @param local Lang + * @returns Pretty embed who list reminders + */ export const embedListReminders = async (client: Client, user: User, guildId: string | null, page: number, local: string) => { const loc = getLocale(client, local); const reminders = await listReminders(client, user.id, guildId); @@ -303,7 +312,9 @@ export const embedListReminders = async (client: Client, user: User, guildId: st curseur++; } }); + } else { + embed.addFields({ name: '\u200b', value: `${loc.get('c_reminder10')}${page} ${loc.get('c_reminder11')}` }); } - return embed; + return { remindersExists: reminders.length > 0 ? true : false, list: embed }; }; diff --git a/src/utils/time.ts b/src/utils/time.ts index 4618b8b..6e54c22 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -50,5 +50,5 @@ export const strToSeconds = (time: string) => { export const timeDeltaToString = (time: number) => { const now = Date.now(); // TODO adapt the output and not always parse the time as seconds - return `${strToSeconds(`${now - time}`)} secs`; + return `${strToSeconds(`${(now - time) / 1000}`)} secs`; }; -- 2.45.2 From 8ebc926d970497109d24bd33529e4ccd5b62d16b Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 18:14:58 +0100 Subject: [PATCH 45/54] remove the update button --- src/commands/misc/reminder.ts | 51 ++++++++++++++--------------------- src/locales/fr.json | 4 ++- src/utils/reminder.ts | 4 +-- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 7504afd..e6de2ad 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -220,38 +220,27 @@ export default { } const page = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub2_opt2_name`) as string) ?? 1; - const { remindersExists, list } = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); + const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); - let row; - if (remindersExists) { - const idPrec = 'reminderList-prec'; - const idNext = 'reminderList-next'; - row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId(idPrec) - .setLabel('Prec') - .setStyle(ButtonStyle.Primary) - .setDisabled(true)) - .addComponents( - new ButtonBuilder() - .setCustomId(idNext) - .setLabel('Next') - .setStyle(ButtonStyle.Primary), - ); - // Buttons interactions - collect(client, interaction, idPrec); - collect(client, interaction, idNext); - } else { - const idUpdate = 'reminderList-update'; - row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId(idUpdate) - .setLabel('Update') - .setStyle(ButtonStyle.Primary) - ); - } + const idPrec = 'reminderList-prec'; + const idNext = 'reminderList-next'; + const row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId(idPrec) + .setLabel(loc.get('c_reminder12')) + .setStyle(ButtonStyle.Primary) + .setDisabled(true)) + .addComponents( + new ButtonBuilder() + .setCustomId(idNext) + .setLabel(loc.get('c_reminder13')) + .setStyle(ButtonStyle.Primary), + ); + + // Buttons interactions + collect(client, interaction, idPrec); + collect(client, interaction, idNext); return await interaction.reply({ ephemeral: true, embeds: [list], components: [row] }); } diff --git a/src/locales/fr.json b/src/locales/fr.json index 4093ba7..59f925a 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -46,5 +46,7 @@ "c_reminder8": "Expire dans", "c_reminder9": "Fais le", "c_reminder10": "L'utilisateur n'a aucun rappel en attente ou page n°", - "c_reminder11": "vide !" + "c_reminder11": "vide", + "c_reminder12": "Précédent", + "c_reminder13": "Suivant" } diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index dfc507d..9dad47a 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -313,8 +313,8 @@ export const embedListReminders = async (client: Client, user: User, guildId: st } }); } else { - embed.addFields({ name: '\u200b', value: `${loc.get('c_reminder10')}${page} ${loc.get('c_reminder11')}` }); + embed.addFields({ name: '\u200b', value: `${loc.get('c_reminder10')}${page} ${loc.get('c_reminder11')}.` }); } - return { remindersExists: reminders.length > 0 ? true : false, list: embed }; + return embed; }; -- 2.45.2 From 2e1b350e151654ed6922098fa74af6f4b0d04abe Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 18:43:07 +0100 Subject: [PATCH 46/54] add buttons logic --- src/buttons/misc/reminderList-next.ts | 40 +++++++++++++++------------ src/buttons/misc/reminderList-prec.ts | 39 +++++++++++++++----------- src/commands/misc/reminder.ts | 3 +- src/locales/fr.json | 2 +- 4 files changed, 48 insertions(+), 36 deletions(-) diff --git a/src/buttons/misc/reminderList-next.ts b/src/buttons/misc/reminderList-next.ts index e19e134..1d23761 100644 --- a/src/buttons/misc/reminderList-next.ts +++ b/src/buttons/misc/reminderList-next.ts @@ -1,40 +1,46 @@ -import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, Colors, EmbedBuilder, MessageComponentInteraction } from 'discord.js'; +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, MessageComponentInteraction, User } from 'discord.js'; +import { getLocale } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; +import { embedListReminders } from '../../utils/reminder'; export default { data: { name: getFilename(__filename), }, - interaction: async (_: MessageComponentInteraction, client: Client) => { - // TODO: Dynamically change that - const pageMax = 1; - const page = 1; + interaction: async (interaction: MessageComponentInteraction, client: Client) => { + const loc = getLocale(client, interaction.locale); + const embed_desc = interaction.message.embeds.at(0)?.description as string; + + // Retrieve Pages + const pageMax = Number(/(\d+)(?!.*\d)/gm.exec(embed_desc)?.[0]); + let page = Number(/(?!• \s+)\d(?=\/)/gm.exec(embed_desc)?.[0]); + if (page + 1 > pageMax) { + page = 1; + } else { + page++; + } + + // Retrieve user + const userId = /(?!<@)\d+(?=>)/gm.exec(embed_desc)?.[0] as string; + const user = client.users.cache.get(userId) as User; // Fetch list - client.db; + const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); const row = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('reminderList-prec') - .setLabel('Prec') + .setLabel(loc.get('c_reminder12')) .setStyle(ButtonStyle.Primary)) .addComponents( new ButtonBuilder() .setCustomId('reminderList-next') - .setLabel('Next') - .setStyle(ButtonStyle.Primary) - .setDisabled(page === pageMax ? true : false), + .setLabel(loc.get('c_reminder13')) + .setStyle(ButtonStyle.Primary), ); - - const list = new EmbedBuilder() - .setColor(Colors.DarkGrey) - .setTitle('List title') - .setDescription('List desc'); - return { - content: 'next', embeds: [list], components: [row], }; diff --git a/src/buttons/misc/reminderList-prec.ts b/src/buttons/misc/reminderList-prec.ts index da2bec8..71e5cf4 100644 --- a/src/buttons/misc/reminderList-prec.ts +++ b/src/buttons/misc/reminderList-prec.ts @@ -1,39 +1,46 @@ -import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, Colors, EmbedBuilder, MessageComponentInteraction } from 'discord.js'; +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, MessageComponentInteraction, User } from 'discord.js'; +import { getLocale } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; +import { embedListReminders } from '../../utils/reminder'; export default { data: { name: getFilename(__filename), }, - interaction: async (_: MessageComponentInteraction, client: Client) => { - // TODO: Dynamically change that - const page = 1; + interaction: async (interaction: MessageComponentInteraction, client: Client) => { + const loc = getLocale(client, interaction.locale); + const embed_desc = interaction.message.embeds.at(0)?.description as string; + + // Retrieve Pages + const pageMax = Number(/(\d+)(?!.*\d)/gm.exec(embed_desc)?.[0]); + let page = Number(/(?!• \s+)\d(?=\/)/gm.exec(embed_desc)?.[0]); + if (page - 1 == 0) { + page = pageMax; + } else { + page--; + } + + // Retrieve user + const userId = /(?!<@)\d+(?=>)/gm.exec(embed_desc)?.[0] as string; + const user = client.users.cache.get(userId) as User; // Fetch list - client.db; + const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); const row = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('reminderList-prec') - .setLabel('Prec') - .setStyle(ButtonStyle.Primary) - .setDisabled(page === 1 ? true : false)) + .setLabel(loc.get('c_reminder12')) + .setStyle(ButtonStyle.Primary)) .addComponents( new ButtonBuilder() .setCustomId('reminderList-next') - .setLabel('Next') + .setLabel(loc.get('c_reminder13')) .setStyle(ButtonStyle.Primary), ); - - const list = new EmbedBuilder() - .setColor(Colors.DarkGrey) - .setTitle('List title') - .setDescription('List desc'); - return { - content: 'prec', embeds: [list], components: [row], }; diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index e6de2ad..b6f2313 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -229,8 +229,7 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get('c_reminder12')) - .setStyle(ButtonStyle.Primary) - .setDisabled(true)) + .setStyle(ButtonStyle.Primary)) .addComponents( new ButtonBuilder() .setCustomId(idNext) diff --git a/src/locales/fr.json b/src/locales/fr.json index 59f925a..b24a301 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -41,7 +41,7 @@ "c_reminder3": "Rappel non trouvé, pas sur le bon serveur ou qui ne vous appartiens pas.", "c_reminder4": "Utilisateur inconnu.", "c_reminder5": "Rappels de", - "c_reminder6": "Page ", + "c_reminder6": "Page", "c_reminder7": "Pas de message", "c_reminder8": "Expire dans", "c_reminder9": "Fais le", -- 2.45.2 From 240b0d0422075ef1e48d7951f585ad550428411f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 18:59:17 +0100 Subject: [PATCH 47/54] fix pages --- src/utils/reminder.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index 9dad47a..77eb5cc 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -281,11 +281,10 @@ export const embedListReminders = async (client: Client, user: User, guildId: st const reminders = await listReminders(client, user.id, guildId); const elementPerPage = 5; - let pageMax = Math.floor(reminders.length / elementPerPage); + const pageMax = Math.ceil(reminders.length / elementPerPage); if (pageMax <= 1) { page = 1; - pageMax = 1; } const embed = new EmbedBuilder() .setColor(Colors.DarkGrey) @@ -295,9 +294,10 @@ export const embedListReminders = async (client: Client, user: User, guildId: st const limit = elementPerPage * page; if (reminders.length > 0 && page <= pageMax) { - let curseur = limit - elementPerPage - 1; + let curseur = limit - elementPerPage; + reminders.splice(0, limit - elementPerPage); reminders.forEach((remind) => { - if (curseur <= limit) { + if (curseur < limit) { let text = remind.data ?? loc.get('c_reminder7'); if (text.length > 1024) { text = `${text.substring(0, 1021)}...`; -- 2.45.2 From 9cb94f5f0afd097558f3983da0f2245ea015d4df Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 16 Jan 2023 19:13:47 +0100 Subject: [PATCH 48/54] use unique ID for buttons --- package-lock.json | 29 ++++++++++++++++++++++++++- package.json | 4 +++- src/buttons/loader.ts | 6 +++--- src/buttons/misc/reminderList-next.ts | 12 +++++++++-- src/buttons/misc/reminderList-prec.ts | 12 +++++++++-- src/commands/misc/reminder.ts | 5 +++-- 6 files changed, 57 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa70c11..8c10078 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,11 @@ "discord-api-types": "^0.36.3", "discord.js": "^14.3.0", "sqlite3": "^5.0.11", - "typescript": "^4.7.4" + "typescript": "^4.7.4", + "uuid": "^9.0.0" }, "devDependencies": { + "@types/uuid": "^9.0.0", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.7", "dotenv": "^16.0.1", @@ -367,6 +369,12 @@ "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", "dev": true }, + "node_modules/@types/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-kr90f+ERiQtKWMz5rP32ltJ/BtULDI5RVO0uavn1HQUOwjx0R1h0rnDYNL0CepF1zL5bSY6FISAfd9tOdDhU5Q==", + "dev": true + }, "node_modules/@types/ws": { "version": "8.5.4", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", @@ -3179,6 +3187,14 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -3575,6 +3591,12 @@ "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", "dev": true }, + "@types/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-kr90f+ERiQtKWMz5rP32ltJ/BtULDI5RVO0uavn1HQUOwjx0R1h0rnDYNL0CepF1zL5bSY6FISAfd9tOdDhU5Q==", + "dev": true + }, "@types/ws": { "version": "8.5.4", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", @@ -5592,6 +5614,11 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index 1fa46dc..658a33d 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,11 @@ "discord-api-types": "^0.36.3", "discord.js": "^14.3.0", "sqlite3": "^5.0.11", - "typescript": "^4.7.4" + "typescript": "^4.7.4", + "uuid": "^9.0.0" }, "devDependencies": { + "@types/uuid": "^9.0.0", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.7", "dotenv": "^16.0.1", diff --git a/src/buttons/loader.ts b/src/buttons/loader.ts index 39a4630..0dbad68 100644 --- a/src/buttons/loader.ts +++ b/src/buttons/loader.ts @@ -43,9 +43,9 @@ export default async (client: Client) => { * @param id Button ID * @param deferUpdate defer update in case update take time */ -export const collect = (client: Client, interaction: ChatInputCommandInteraction, id: string, deferUpdate = false) => { +export const collect = (client: Client, interaction: ChatInputCommandInteraction | MessageComponentInteraction, id: string, deferUpdate = false) => { const loc = getLocale(client, interaction.locale); - const button = client.buttons.list.get(id); + const button = client.buttons.list.get(id.split('_')[0]); if (!button) { interaction.reply({ @@ -55,7 +55,7 @@ export const collect = (client: Client, interaction: ChatInputCommandInteraction } const filter = (i: MessageComponentInteraction) => i.customId === id; - const collector = interaction.channel?.createMessageComponentCollector({ filter }); + const collector = interaction.channel?.createMessageComponentCollector({ filter, max: 1 }); collector?.on('collect', async (i) => { if (deferUpdate) { await i.deferUpdate(); diff --git a/src/buttons/misc/reminderList-next.ts b/src/buttons/misc/reminderList-next.ts index 1d23761..76cc5ae 100644 --- a/src/buttons/misc/reminderList-next.ts +++ b/src/buttons/misc/reminderList-next.ts @@ -1,7 +1,9 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, MessageComponentInteraction, User } from 'discord.js'; +import { v4 as uuidv4 } from 'uuid'; import { getLocale } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { embedListReminders } from '../../utils/reminder'; +import { collect } from '../loader'; export default { data: { @@ -27,19 +29,25 @@ export default { // Fetch list const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); + const idPrec = 'reminderList-prec_' + uuidv4(); + const idNext = 'reminderList-next_' + uuidv4(); const row = new ActionRowBuilder() .addComponents( new ButtonBuilder() - .setCustomId('reminderList-prec') + .setCustomId(idPrec) .setLabel(loc.get('c_reminder12')) .setStyle(ButtonStyle.Primary)) .addComponents( new ButtonBuilder() - .setCustomId('reminderList-next') + .setCustomId(idNext) .setLabel(loc.get('c_reminder13')) .setStyle(ButtonStyle.Primary), ); + // Buttons interactions + collect(client, interaction, idPrec); + collect(client, interaction, idNext); + return { embeds: [list], components: [row], diff --git a/src/buttons/misc/reminderList-prec.ts b/src/buttons/misc/reminderList-prec.ts index 71e5cf4..06a1019 100644 --- a/src/buttons/misc/reminderList-prec.ts +++ b/src/buttons/misc/reminderList-prec.ts @@ -1,7 +1,9 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, MessageComponentInteraction, User } from 'discord.js'; +import { v4 as uuidv4 } from 'uuid'; import { getLocale } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; import { embedListReminders } from '../../utils/reminder'; +import { collect } from '../loader'; export default { data: { @@ -27,19 +29,25 @@ export default { // Fetch list const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); + const idPrec = 'reminderList-prec_' + uuidv4(); + const idNext = 'reminderList-next_' + uuidv4(); const row = new ActionRowBuilder() .addComponents( new ButtonBuilder() - .setCustomId('reminderList-prec') + .setCustomId(idPrec) .setLabel(loc.get('c_reminder12')) .setStyle(ButtonStyle.Primary)) .addComponents( new ButtonBuilder() - .setCustomId('reminderList-next') + .setCustomId(idNext) .setLabel(loc.get('c_reminder13')) .setStyle(ButtonStyle.Primary), ); + // Buttons interactions + collect(client, interaction, idPrec); + collect(client, interaction, idNext); + return { embeds: [list], components: [row], diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index b6f2313..ee298db 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -1,5 +1,6 @@ import { ModalActionRowComponentBuilder, SlashCommandBuilder } from '@discordjs/builders'; import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, Client, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js'; +import { v4 as uuidv4 } from 'uuid'; import { collect } from '../../buttons/loader'; import { getLocale, getLocalizations } from '../../utils/locales'; import { getFilename } from '../../utils/misc'; @@ -222,8 +223,8 @@ export default { const page = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub2_opt2_name`) as string) ?? 1; const list = await embedListReminders(client, user, interaction.guildId, page, interaction.locale); - const idPrec = 'reminderList-prec'; - const idNext = 'reminderList-next'; + const idPrec = 'reminderList-prec_' + uuidv4(); + const idNext = 'reminderList-next_' + uuidv4(); const row = new ActionRowBuilder() .addComponents( new ButtonBuilder() -- 2.45.2 From 706713a8fbb7dc6724adcf2def5896855072f0e5 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Jan 2023 10:46:26 +0100 Subject: [PATCH 49/54] * chore: format * add: buttons and modals --- CONTRIBUTING.md | 208 +++++++++++++++++++++++++++++------------------- 1 file changed, 125 insertions(+), 83 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68538c8..afc94ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,5 @@ # Comment contribuer ? + Ce guide contient méthodes et conseils sur comment aider le projet. Lisez attentivement si vous êtes un nouveau contributeur. @@ -9,6 +10,7 @@ d'un [ticket](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/issues) ou une [Pull Request](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/pulls). ## Sommaire + - [Recevoir de l'aide](#recevoir-de-laide) - [Langues](#langues) - [Ajouter une langue](#ajouter-une-langue) @@ -16,15 +18,19 @@ une [Pull Request](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/pulls). - [Projet](#projet) - [Ajouter une commande](#ajouter-une-commande) - [Ajouter un évènement](#ajouter-un-évènement) +- [Modèles](#modèles) +- [Boutons](#boutons) - [Modifier du code](#modifier-du-code) - [Soumettre ses modifications](#soumettre-ses-modifications) - [Gestion du dépôt](#gestion-du-dépôt) ## Recevoir de l'aide + Si tu as besoin d'aide, tu peux poser ta question sur le [Discord](https://discord.gg/Z5ePxH4). ## Langues + La langue par défaut est définie dans [`src/utils/client.ts`](src/utils/client.ts) dans `client.config.default_lang`. @@ -33,95 +39,111 @@ traduction est incomplète. On part donc du postulat que la langue par défaut contient toujours toutes les chaînes de caractère dont le bot a besoin. La norme pour les nom dans les fichiers est la suivante : -- Chaîne de charactère des commandes : - `c` est utilisé pour `C`ommande. - - `c_NOM-COMMANDE_name` : Nom de la commande - - `c_NOM-COMMANDE_desc` : Description de la commande - - `c_NOM-COMMANDE_optX_name` : Nom de l'option X - - `c_NOM-COMMANDE_optX_desc` : Description de l'option X - - `c_NOM-COMMANDE_subX_name` : Nom de la sous-commande X - - `c_NOM-COMMANDE_subX_desc` : Description de la sous-commande X - - `c_NOM-COMMANDEX` : `X` le numéro de la chaîne de caractère - Évidemment ça peut s'additionner, - par exemple : `c_NOM-COMMANDE_subX_optX_desc`. -- Chaîne de charactère des évènements : - `e` est utilisé pour `E`vènements. - - `e_NOM-EVENEMENT_N` : `N` le nom de la chaîne de caractère -- Chaîne de charactère des utils : - `u` est utilisé pour `U`tilitaires. - - `u_NOM-FICHIER-UTILS_N` : `N` le nom de la chaîne de caractère +- Chaîne de charactère des commandes : + `c` est utilisé pour `C`ommande. + + - `c_NOM-COMMANDE_name` : Nom de la commande + - `c_NOM-COMMANDE_desc` : Description de la commande + - `c_NOM-COMMANDE_optX_name` : Nom de l'option X + - `c_NOM-COMMANDE_optX_desc` : Description de l'option X + - `c_NOM-COMMANDE_subX_name` : Nom de la sous-commande X + - `c_NOM-COMMANDE_subX_desc` : Description de la sous-commande X + - `c_NOM-COMMANDEX` : `X` le numéro de la chaîne de caractère + + Évidemment ça peut s'additionner, + par exemple : `c_NOM-COMMANDE_subX_optX_desc`. + +- Chaîne de charactère des évènements : + `e` est utilisé pour `E`vènements. + - `e_NOM-EVENEMENT_N` : `N` le nom de la chaîne de caractère +- Chaîne de charactère des utils : + `u` est utilisé pour `U`tilitaires. + - `u_NOM-FICHIER-UTILS_N` : `N` le nom de la chaîne de caractère ### Ajouter une langue + 1. Créer un nouveau fichier dans [src/locales/](./src/locales/), le fichier -doit être nommé `langue.json` avec `langue` suivant -[cette liste](https://discord.com/developers/docs/reference#locales). + doit être nommé `langue.json` avec `langue` suivant + [cette liste](https://discord.com/developers/docs/reference#locales). 2. Le contenu du fichier peut être copié du fichier de la langue par défaut, -[cf. au dessus](#langues). + [cf. au dessus](#langues). 3. Ce sont les valeurs des clés (le texte à gauche des `:`) qui doivent -être traduits. Merci par avance ! - > Ne vous forcez pas à tout traduire. Même une contribution avec - > une seule variable de modifiée compte ! + être traduits. Merci par avance ! + > Ne vous forcez pas à tout traduire. Même une contribution avec + > une seule variable de modifiée compte ! 4. Une fois terminée, [ouvrez une Pull Request](#soumettre-ses-modifications). ### Mettre à jour une langue + 1. Rechercher la langue dans le dossier [src/locales/](./src/locales/). 2. Modifier/Ajouter des traductions comme -[expliquer au dessus](#ajouter-une-langue) (à partir du `3.`). - > Pensez à vérifier si de nouvelles valeurs n'ont pas été ajouté dans - le fichier langue par défaut, [cf. au dessus](#langues). + [expliquer au dessus](#ajouter-une-langue) (à partir du `3.`). + > Pensez à vérifier si de nouvelles valeurs n'ont pas été ajouté dans + > le fichier langue par défaut, [cf. au dessus](#langues). ## Projet + Le code se trouve dans le dosier [src/](./src/). Dans ce dossier il y a : -- [commands/](./src/commands/) qui contient toutes les commandes, rangés par -catégories -- [events/](./src/events/) qui contient tous les évènements, rangés par -catégories -- [locales/](./src/locales/) qui contient tous les fichiers de langue -- [modules/](./src/modules/) qui contient les extensions utilisé, - par exemple, pour utiliser la fonction `capitalize()` d'un string, il faut - importer le fichier `string.ts` qui se trouve dans le dossier -- [utils/](./src/utils/) qui contient toutes les fonctions utilitaires, rangés -par fichiers + +- [commands/](./src/commands/) qui contient toutes les commandes, rangés par + catégories +- [events/](./src/events/) qui contient tous les évènements, rangés par + catégories +- [locales/](./src/locales/) qui contient tous les fichiers de langue +- [modules/](./src/modules/) qui contient les extensions utilisé, + par exemple, pour utiliser la fonction `capitalize()` d'un string, il faut + importer le fichier `string.ts` qui se trouve dans le dossier +- [utils/](./src/utils/) qui contient toutes les fonctions utilitaires, rangés + par fichiers Les dossiers [commands/](./src/commands/) et [events/](./src/events/) contiennent chaquin un fichier `loader.js` qui charge respectivement les commandes et les évènements dans le bot. ## Ajouter une commande + Pour ajouter une commande au bot, créez un fichier `nom-de-la-commande.ts` dans un sous dossier de [`src/commands/`](./src/commands/). Vous pouvez créer une nouvelle catégorie si votre commande n'entre dans aucune qui existe déjà. Le contenu du fichier doit commencer comme suit : + ```typescript -import { SlashCommandBuilder } from '@discordjs/builders'; -import { Client, ChatInputCommandInteraction } from 'discord.js'; -import { getLocale, getLocalizations } from '../../utils/locales'; -import { getFilename } from '../../utils/misc'; +import { SlashCommandBuilder } from "@discordjs/builders"; +import { Client, ChatInputCommandInteraction } from "discord.js"; +import { getLocale, getLocalizations } from "../../utils/locales"; +import { getFilename } from "../../utils/misc"; export default { - data: (client: Client) => { - const filename = getFilename(__filename); - return new SlashCommandBuilder() - .setName( - filename.toLowerCase()) - .setDescription(client.locales.get(client.config.default_lang) - ?.get(`c_${filename}_desc`) ?? '') - .setNameLocalizations( - getLocalizations(client, `c_${filename}_name`, true)) - .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_desc`) - ); - }, + data: (client: Client) => { + const filename = getFilename(__filename); + return new SlashCommandBuilder() + .setName(filename.toLowerCase()) + .setDescription( + client.locales + .get(client.config.default_lang) + ?.get(`c_${filename}_desc`) ?? "" + ) + .setNameLocalizations( + getLocalizations(client, `c_${filename}_name`, true) + ) + .setDescriptionLocalizations( + getLocalizations(client, `c_${filename}_desc`) + ); + }, - interaction: async (interaction: ChatInputCommandInteraction, client: Client) => { - const loc = getLocale(client, interaction.locale); + interaction: async ( + interaction: ChatInputCommandInteraction, + client: Client + ) => { + const loc = getLocale(client, interaction.locale); - /* Votre code ici */ - }, + /* Votre code ici */ + }, }; ``` + Ce template vous permet de commencé rapidement votre commande car il contient déjà tout ce qu'il faut pour le support des langues. Pensez bien à ne pas écrire directement vos chaînes de caractères ici mais bien dans @@ -129,18 +151,21 @@ les [fichiers de langues](./src/locales/), c'est à ça que la variable `loc` sert. Vous devez aussi ajouter **obligatoirement** : -- `"c_COMMANDE_name": "NOM"` au fichier de langue, avec `COMMANDE` le nom de -la commande et `NOM` le nom de votre commande. -- `"c_COMMANDE_desc": "DESCRIPTION"` au fichier de langue, avec `COMMANDE` -le nom de la commande et `DESCRIPTION` la description de votre commande. + +- `"c_COMMANDE_name": "NOM"` au fichier de langue, avec `COMMANDE` le nom de + la commande et `NOM` le nom de votre commande. +- `"c_COMMANDE_desc": "DESCRIPTION"` au fichier de langue, avec `COMMANDE` + le nom de la commande et `DESCRIPTION` la description de votre commande. ## Ajouter un évènement + Pour ajouter le support d'un évènement au bot, créez un fichier `nom-evenement.ts` dans un sous dossier de [`src/events/`](./src/events/). Vous pouvez créer une nouvelle catégorie si votre commande n'entre dans aucune qui existe déjà. Vous pouvez préciser que l'évènement ne sera déclenché qu'une seule fois avec + ```typescript export const once = true; ``` @@ -149,39 +174,55 @@ De préférence, merci de mettre un lien en commentaire vers la documentation de discord.js de l'évènement ([exemple ici pour l'évènement `ready`](./src/events/client/ready.ts#L3)) +## Modèles + +Les modèles sont gérés [en dehors séparément du reste](./src/modals/). + +## Boutons + +Les boutons sont gérés [en dehors séparément du reste](./src/buttons/) + +Chaque bouton à une implémentation séparée des autres, même si ils sont dans le +même message. + +Contrairement aux autres éléments, les boutons doivent se faire collecter via +la fonction [`collect`](./src/buttons/loader.ts#L46) juste après leur déclaration. + ## Modifier du code + Quand vous modifiez quelque chose, pensez à mettre-à-jour les langues. Si vous ne savez pas traduire dans une langue, ne vous forcez pas, supprimer simplement la traduction. -- [Créez un fork](https://git.kennel.ml/repo/fork/76) et poussez -vos modifications dans ce dernier. +- [Créez un fork](https://git.kennel.ml/repo/fork/76) et poussez + vos modifications dans ce dernier. Pour commencer, vous pouvez jeté un oeil aux [tickets facilement résolvable](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/issues?state=open&labels=82). -- De préférences, les fonctions, méthodes et variables seront écrites -en anglais, ainsi que les commits afin que chacun puisse contribuer. +- De préférences, les fonctions, méthodes et variables seront écrites + en anglais, ainsi que les commits afin que chacun puisse contribuer. ## Soumettre ses modifications + 1. Pensez à bien commenter votre code (en anglais) pour que n'importe qui -comprennent vos modifications. Vérifier bien dans tout les fichiers si ce que -vous avez modifié n'est pas référencer ailleurs (exemple : si vous modifier -une variable d'environnement, il faut penser à mettre à jour le -[`README`](./README.md#variables-denvironnements)). + comprennent vos modifications. Vérifier bien dans tout les fichiers si ce que + vous avez modifié n'est pas référencer ailleurs (exemple : si vous modifier + une variable d'environnement, il faut penser à mettre à jour le + [`README`](./README.md#variables-denvironnements)). 2. N'oubliez pas d'utiliser [les fichiers de langues](./src/locales/) pour vos -chaînes de caractère, [cf. cette partie](#langues) pour plus de précisions. + chaînes de caractère, [cf. cette partie](#langues) pour plus de précisions. 3. Veuillez tester vos modifications avant de les soumettre. **Attention**, ce -n'est pas parce que vos modifications fonctionnent avec `npm run debug` qu'elles -fonctionneront avec `npm run main`, ainsi que dans l'image Docker. + n'est pas parce que vos modifications fonctionnent avec `npm run debug` qu'elles + fonctionneront avec `npm run main`, ainsi que dans l'image Docker. 4. Lorsque vous vous sentez confiant dans vos modifications, ouvrez -une [Pull Request](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/pulls) -afin que votre code puisse être revu et fusionné. Vous pouvez suivre cette -[condition de nommage](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716#example), -ça aide à s'y retrouver plus rapidement. + une [Pull Request](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/pulls) + afin que votre code puisse être revu et fusionné. Vous pouvez suivre cette + [condition de nommage](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716#example), + ça aide à s'y retrouver plus rapidement. > **Explication** > @@ -192,10 +233,11 @@ afin que votre code puisse être revu et fusionné. Vous pouvez suivre cette > supprimé. ## Gestion du dépôt -- On ne push jamais directement sur la branche `main`. -- Quand on merge des modifications vers `main`, on fait un *squash*, -l'historique des modifications reste disponible dans -[le graph](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/graph). -- De préférences, suivre les indications de -[ce post](https://gist.github.com/revett/88ee5abf5a9a097b4c88) (c'est un peu la -même que dans le `4.` de [la partie précédente](#soumettre-ses-modifications)). + +- On ne push jamais directement sur la branche `main`. +- Quand on merge des modifications vers `main`, on fait un _squash_, + l'historique des modifications reste disponible dans + [le graph](https://git.kennel.ml/ConfrerieDuKassoulait/Botanique/graph). +- De préférences, suivre les indications de + [ce post](https://gist.github.com/revett/88ee5abf5a9a097b4c88) (c'est un peu la + même que dans le `4.` de [la partie précédente](#soumettre-ses-modifications)). -- 2.45.2 From 41a32f9d97baac0339a0f08cd75878aa03eabe7c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Jan 2023 10:47:07 +0100 Subject: [PATCH 50/54] update --- Dockerfile | 2 +- package-lock.json | 256 +++++++++++++++++++++++----------------------- 2 files changed, 129 insertions(+), 129 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa5bdda..c15f051 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM node:18.7.0-alpine3.16 +FROM node:19.4.0-alpine3.16 ENV DOCKERIZED=1 RUN mkdir /config diff --git a/package-lock.json b/package-lock.json index 8c10078..29a6e0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,9 +55,9 @@ } }, "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.37.27", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", - "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" + "version": "0.37.28", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.28.tgz", + "integrity": "sha512-K0fw7m7km9th3dCQ2AR90q/FwX3uAj+OLc+Zuo39VY9vCn0Ux/iObM4y1zJYIH3vTc+QlrksVErUvyeONjOKMQ==" }, "node_modules/@discordjs/collection": { "version": "1.3.0", @@ -86,9 +86,9 @@ } }, "node_modules/@discordjs/rest/node_modules/discord-api-types": { - "version": "0.37.27", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", - "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" + "version": "0.37.28", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.28.tgz", + "integrity": "sha512-K0fw7m7km9th3dCQ2AR90q/FwX3uAj+OLc+Zuo39VY9vCn0Ux/iObM4y1zJYIH3vTc+QlrksVErUvyeONjOKMQ==" }, "node_modules/@discordjs/util": { "version": "0.1.0", @@ -384,14 +384,14 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", - "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.2.tgz", + "integrity": "sha512-sR0Gja9Ky1teIq4qJOl0nC+Tk64/uYdX+mi+5iB//MH8gwyx8e3SOyhEzeLZEFEEfCaLf8KJq+Bd/6je1t+CAg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/type-utils": "5.48.0", - "@typescript-eslint/utils": "5.48.0", + "@typescript-eslint/scope-manager": "5.48.2", + "@typescript-eslint/type-utils": "5.48.2", + "@typescript-eslint/utils": "5.48.2", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -417,14 +417,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", - "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.2.tgz", + "integrity": "sha512-38zMsKsG2sIuM5Oi/olurGwYJXzmtdsHhn5mI/pQogP+BjYVkK5iRazCQ8RGS0V+YLk282uWElN70zAAUmaYHw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/scope-manager": "5.48.2", + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/typescript-estree": "5.48.2", "debug": "^4.3.4" }, "engines": { @@ -444,13 +444,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", - "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.2.tgz", + "integrity": "sha512-zEUFfonQid5KRDKoI3O+uP1GnrFd4tIHlvs+sTJXiWuypUWMuDaottkJuR612wQfOkjYbsaskSIURV9xo4f+Fw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0" + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/visitor-keys": "5.48.2" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -461,13 +461,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", - "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.2.tgz", + "integrity": "sha512-QVWx7J5sPMRiOMJp5dYshPxABRoZV1xbRirqSk8yuIIsu0nvMTZesKErEA3Oix1k+uvsk8Cs8TGJ6kQ0ndAcew==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.48.0", - "@typescript-eslint/utils": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.2", + "@typescript-eslint/utils": "5.48.2", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -488,9 +488,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", - "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.2.tgz", + "integrity": "sha512-hE7dA77xxu7ByBc6KCzikgfRyBCTst6dZQpwaTy25iMYOnbNljDT4hjhrGEJJ0QoMjrfqrx+j1l1B9/LtKeuqA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -501,13 +501,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", - "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.2.tgz", + "integrity": "sha512-bibvD3z6ilnoVxUBFEgkO0k0aFvUc4Cttt0dAreEr+nrAHhWzkO83PEVVuieK3DqcgL6VAK5dkzK8XUVja5Zcg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0", + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/visitor-keys": "5.48.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -528,16 +528,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", - "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.2.tgz", + "integrity": "sha512-2h18c0d7jgkw6tdKTlNaM7wyopbLRBiit8oAxoP89YnuBOzCZ8g8aBCaCqq7h208qUTroL7Whgzam7UY3HVLow==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/scope-manager": "5.48.2", + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/typescript-estree": "5.48.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -554,12 +554,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", - "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.2.tgz", + "integrity": "sha512-z9njZLSkwmjFWUelGEwEbdf4NwKvfHxvGC0OcGN1Hp/XNDIcJ7D5DpPNPv6x6/mFvc1tQHsaWmpD/a4gOvvCJQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/types": "5.48.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1044,9 +1044,9 @@ } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.27", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", - "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" + "version": "0.37.28", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.28.tgz", + "integrity": "sha512-K0fw7m7km9th3dCQ2AR90q/FwX3uAj+OLc+Zuo39VY9vCn0Ux/iObM4y1zJYIH3vTc+QlrksVErUvyeONjOKMQ==" }, "node_modules/doctrine": { "version": "3.0.0", @@ -1120,9 +1120,9 @@ } }, "node_modules/eslint": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", - "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.4.1", @@ -1390,9 +1390,9 @@ } }, "node_modules/file-type": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.0.0.tgz", - "integrity": "sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.0.tgz", + "integrity": "sha512-M3RQMWY3F2ykyWZ+IHwNCjpnUmukYhtdkGGC1ZVEUb0ve5REGF7NNJ4Q9ehCUabtQKtSVFOMbFTXgJlFb0DQIg==", "dependencies": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -2152,9 +2152,9 @@ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" }, "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==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.8.tgz", + "integrity": "sha512-RZ6dBYuj8dRSfxpUSu+NsdF1dpPpluJxwOp+6IoDp/sH2QNDSvurYsAa+F1WxY2RjA1iP93xhcsUoYbF2XBqVg==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -2459,9 +2459,9 @@ } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", + "integrity": "sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw==", "dev": true, "engines": { "node": ">=6" @@ -3145,9 +3145,9 @@ } }, "node_modules/undici": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.14.0.tgz", - "integrity": "sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.15.0.tgz", + "integrity": "sha512-wCAZJDyjw9Myv+Ay62LAoB+hZLPW9SmKbQkbHIhMw/acKSlpn7WohdMUc/Vd4j1iSMBO0hWwU8mjB7a5p5bl8g==", "dependencies": { "busboy": "^1.6.0" }, @@ -3332,9 +3332,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.27", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", - "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" + "version": "0.37.28", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.28.tgz", + "integrity": "sha512-K0fw7m7km9th3dCQ2AR90q/FwX3uAj+OLc+Zuo39VY9vCn0Ux/iObM4y1zJYIH3vTc+QlrksVErUvyeONjOKMQ==" } } }, @@ -3359,9 +3359,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.27", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", - "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" + "version": "0.37.28", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.28.tgz", + "integrity": "sha512-K0fw7m7km9th3dCQ2AR90q/FwX3uAj+OLc+Zuo39VY9vCn0Ux/iObM4y1zJYIH3vTc+QlrksVErUvyeONjOKMQ==" } } }, @@ -3606,14 +3606,14 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", - "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.2.tgz", + "integrity": "sha512-sR0Gja9Ky1teIq4qJOl0nC+Tk64/uYdX+mi+5iB//MH8gwyx8e3SOyhEzeLZEFEEfCaLf8KJq+Bd/6je1t+CAg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/type-utils": "5.48.0", - "@typescript-eslint/utils": "5.48.0", + "@typescript-eslint/scope-manager": "5.48.2", + "@typescript-eslint/type-utils": "5.48.2", + "@typescript-eslint/utils": "5.48.2", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -3623,53 +3623,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", - "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.2.tgz", + "integrity": "sha512-38zMsKsG2sIuM5Oi/olurGwYJXzmtdsHhn5mI/pQogP+BjYVkK5iRazCQ8RGS0V+YLk282uWElN70zAAUmaYHw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/scope-manager": "5.48.2", + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/typescript-estree": "5.48.2", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", - "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.2.tgz", + "integrity": "sha512-zEUFfonQid5KRDKoI3O+uP1GnrFd4tIHlvs+sTJXiWuypUWMuDaottkJuR612wQfOkjYbsaskSIURV9xo4f+Fw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0" + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/visitor-keys": "5.48.2" } }, "@typescript-eslint/type-utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", - "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.2.tgz", + "integrity": "sha512-QVWx7J5sPMRiOMJp5dYshPxABRoZV1xbRirqSk8yuIIsu0nvMTZesKErEA3Oix1k+uvsk8Cs8TGJ6kQ0ndAcew==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.48.0", - "@typescript-eslint/utils": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.2", + "@typescript-eslint/utils": "5.48.2", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", - "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.2.tgz", + "integrity": "sha512-hE7dA77xxu7ByBc6KCzikgfRyBCTst6dZQpwaTy25iMYOnbNljDT4hjhrGEJJ0QoMjrfqrx+j1l1B9/LtKeuqA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", - "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.2.tgz", + "integrity": "sha512-bibvD3z6ilnoVxUBFEgkO0k0aFvUc4Cttt0dAreEr+nrAHhWzkO83PEVVuieK3DqcgL6VAK5dkzK8XUVja5Zcg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0", + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/visitor-keys": "5.48.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3678,28 +3678,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", - "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.2.tgz", + "integrity": "sha512-2h18c0d7jgkw6tdKTlNaM7wyopbLRBiit8oAxoP89YnuBOzCZ8g8aBCaCqq7h208qUTroL7Whgzam7UY3HVLow==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/scope-manager": "5.48.2", + "@typescript-eslint/types": "5.48.2", + "@typescript-eslint/typescript-estree": "5.48.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", - "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", + "version": "5.48.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.2.tgz", + "integrity": "sha512-z9njZLSkwmjFWUelGEwEbdf4NwKvfHxvGC0OcGN1Hp/XNDIcJ7D5DpPNPv6x6/mFvc1tQHsaWmpD/a4gOvvCJQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/types": "5.48.2", "eslint-visitor-keys": "^3.3.0" } }, @@ -4064,9 +4064,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.27", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.27.tgz", - "integrity": "sha512-rfB4zT9gkKgIfLOgXQZPUXaaKY9gwQhyhiir5TU/GN+38E39NNasRPYOcAeM4JPGAuDrHDvPtYiZGa0GfT60ww==" + "version": "0.37.28", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.28.tgz", + "integrity": "sha512-K0fw7m7km9th3dCQ2AR90q/FwX3uAj+OLc+Zuo39VY9vCn0Ux/iObM4y1zJYIH3vTc+QlrksVErUvyeONjOKMQ==" } } }, @@ -4127,9 +4127,9 @@ "dev": true }, "eslint": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", - "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", "dev": true, "requires": { "@eslint/eslintrc": "^1.4.1", @@ -4341,9 +4341,9 @@ } }, "file-type": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.0.0.tgz", - "integrity": "sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.0.tgz", + "integrity": "sha512-M3RQMWY3F2ykyWZ+IHwNCjpnUmukYhtdkGGC1ZVEUb0ve5REGF7NNJ4Q9ehCUabtQKtSVFOMbFTXgJlFb0DQIg==", "requires": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -4913,9 +4913,9 @@ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" }, "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.8.tgz", + "integrity": "sha512-RZ6dBYuj8dRSfxpUSu+NsdF1dpPpluJxwOp+6IoDp/sH2QNDSvurYsAa+F1WxY2RjA1iP93xhcsUoYbF2XBqVg==", "requires": { "whatwg-url": "^5.0.0" } @@ -5129,9 +5129,9 @@ } }, "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", + "integrity": "sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw==", "dev": true }, "queue-microtask": { @@ -5575,9 +5575,9 @@ "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==" }, "undici": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.14.0.tgz", - "integrity": "sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.15.0.tgz", + "integrity": "sha512-wCAZJDyjw9Myv+Ay62LAoB+hZLPW9SmKbQkbHIhMw/acKSlpn7WohdMUc/Vd4j1iSMBO0hWwU8mjB7a5p5bl8g==", "requires": { "busboy": "^1.6.0" } -- 2.45.2 From ffa92bbd5f03b6b12de2bbc2a40fd02f09185200 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Jan 2023 10:52:34 +0100 Subject: [PATCH 51/54] better startup logs --- src/events/client/ready.ts | 3 ++- src/utils/misc.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index a72c0af..764a4bd 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -1,11 +1,12 @@ import { Client } from 'discord.js'; +import { logStart } from '../../utils/misc'; import { dbReminder, deleteReminder, infoReminder, OptionReminder, sendReminder, setTimeoutReminder, updateReminder } from '../../utils/reminder'; export const once = true; /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-ready */ export default async (client: Client) => { - console.log('Connected to Discord!'); + console.log(logStart('Connection', true)); // Restart all the timeout about reminders here new Promise((ok, ko) => { diff --git a/src/utils/misc.ts b/src/utils/misc.ts index 2708b92..9dbc8b1 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -8,7 +8,7 @@ import { GuildMember } from 'discord.js'; */ export const logStart = (name: string, status: boolean) => { // TODO Handle precision about the error if status is false - return `> ${name} ${status === true ? '✅' : '❌'}`; + return `> ${name}\t${status === true ? '✅' : '❌'}`; }; /** -- 2.45.2 From 43e7eba319cabd3030368872d9f3cfe89ba5589d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Jan 2023 10:55:50 +0100 Subject: [PATCH 52/54] uniform naming --- src/commands/misc/reminder.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index ee298db..3a0baa9 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -174,7 +174,7 @@ export default { // Use the cli because we already have enough data return newReminder(client, time, { locale: interaction.locale, - message: interaction.options.getString(loc_default?.get('c_reminder_sub1_opt2_name') as string), + message: interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string), createdAt: interaction.createdAt.getTime(), channelId: interaction.channelId, userId: interaction.user.id, @@ -187,20 +187,20 @@ export default { // Show modal to user to get at least the time const modal = new ModalBuilder() .setCustomId('reminderGUI') - .setTitle(loc.get('c_reminder_name').capitalize()); + .setTitle(loc.get(`c_${filename}_name`).capitalize()); const timeGUI = new TextInputBuilder() .setCustomId('reminderGUI-time') - .setLabel(loc.get('c_reminder_sub1_opt1_name').capitalize()) + .setLabel(loc.get(`c_${filename}_sub1_opt1_name`).capitalize()) .setStyle(TextInputStyle.Short) .setPlaceholder('1h') .setRequired(true); const messageGUI = new TextInputBuilder() .setCustomId('reminderGUI-message') - .setLabel(loc.get('c_reminder_sub1_opt2_name').capitalize()) + .setLabel(loc.get(`c_${filename}_sub1_opt2_name`).capitalize()) .setStyle(TextInputStyle.Paragraph) - .setPlaceholder(loc.get('c_reminder_sub1_opt2_desc')) + .setPlaceholder(loc.get(`c_${filename}_sub1_opt2_desc`)) .setRequired(false); modal.addComponents( @@ -229,12 +229,12 @@ export default { .addComponents( new ButtonBuilder() .setCustomId(idPrec) - .setLabel(loc.get('c_reminder12')) + .setLabel(loc.get(`c_${filename}12`)) .setStyle(ButtonStyle.Primary)) .addComponents( new ButtonBuilder() .setCustomId(idNext) - .setLabel(loc.get('c_reminder13')) + .setLabel(loc.get(`c_${filename}13`)) .setStyle(ButtonStyle.Primary), ); @@ -249,12 +249,12 @@ export default { ?.toLowerCase() ?? '': { const id = interaction.options.getInteger(loc_default?.get(`c_${filename}_sub3_opt1_name`) as string); if (id === null) { - return interaction.reply({ content: loc.get('c_reminder2'), ephemeral: true }); + return interaction.reply({ content: loc.get(`c_${filename}2`), ephemeral: true }); } // Check if the ID exists and belongs to the user if (await checkOwnershipReminder(client, id, interaction.user.id, interaction.guildId ?? '0')) { - return interaction.reply({ content: loc.get('c_reminder3'), ephemeral: true }); + return interaction.reply({ content: loc.get(`c_${filename}3`), ephemeral: true }); } // Stop timeout -- 2.45.2 From 5d4a8beb1498e064e86dfc323f5861c71428ea95 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Jan 2023 10:59:04 +0100 Subject: [PATCH 53/54] add a todo --- src/events/message/messageCreate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/events/message/messageCreate.ts b/src/events/message/messageCreate.ts index c5f7b13..1dafda4 100644 --- a/src/events/message/messageCreate.ts +++ b/src/events/message/messageCreate.ts @@ -76,7 +76,7 @@ export default async (message: Message, client: Client) => { return quoted_message; }) ) - // Remove undefined elements + // Remove undefined elements ).filter(Boolean); const loc = getLocale(client, client.config.default_lang); @@ -105,6 +105,7 @@ export default async (message: Message, client: Client) => { ); embed.addFields({ // TODO: Don't pluralize when there is only one file. + // TODO: Locales name: 'Fichiers joints', // TODO: Check if don't exceed char limit, if yes, split // files into multiples field. -- 2.45.2 From a52644e380f38c7d36ec2b8e0c6d2c68402d788a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Jan 2023 12:11:47 +0100 Subject: [PATCH 54/54] * add reminder message format --- src/locales/fr.json | 7 ++++- src/utils/misc.ts | 24 +++++++++++++++++ src/utils/reminder.ts | 61 ++++++++++++++++++++++++++++++++++++------- 3 files changed, 82 insertions(+), 10 deletions(-) diff --git a/src/locales/fr.json b/src/locales/fr.json index b24a301..061291e 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -48,5 +48,10 @@ "c_reminder10": "L'utilisateur n'a aucun rappel en attente ou page n°", "c_reminder11": "vide", "c_reminder12": "Précédent", - "c_reminder13": "Suivant" + "c_reminder13": "Suivant", + "c_reminder14": "Message envoyé en DM car le salon n'est plus disponible.", + "c_reminder15": "Message envoyé en DM car vous avez quitté", + "c_reminder16": "Message envoyé en DM car le serveur Discord n'est plus disponible.", + "c_reminder17": "Message d'il y a", + "c_reminder18": "Pas de message" } diff --git a/src/utils/misc.ts b/src/utils/misc.ts index 9dbc8b1..ae42ef5 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -77,3 +77,27 @@ export const userWithNickname = (member: GuildMember) => { return member.user.tag; } }; + +/** + * Move the text into backtick text, preserving mentions and links + * @param text Text + * @returns Formatted text + */ +export const cleanCodeBlock = (text: string) => { + text = `\`${text.trim()}\``; + + // Keep mentions + text = text.replace(/(<@\d+>)/g, function(mention: string) { + return `\`${mention}\``; + }); + + // Keep links + text = text.replace(/(http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)/g, function(url: string) { + return `\`${url}\``; + }); + + // Fix issues + text = text.replace('``', ''); + + return text; +}; diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index 77eb5cc..7200bcd 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -1,5 +1,6 @@ import { Client, Colors, EmbedBuilder, User } from 'discord.js'; import { getLocale } from './locales'; +import { cleanCodeBlock } from './misc'; import { showDate, strToSeconds, timeDeltaToString } from './time'; /** @@ -113,23 +114,64 @@ export const deleteReminder = (client: Client, createdAt: string, userId: string }; export const sendReminder = (client: Client, info: infoReminder, option: OptionReminder) => { + const loc = getLocale(client, info.locale); // Send the message in the appropriate channel - if (option == OptionReminder.DirectMessage) { + // TODO: Embed + let message: string; + if (info.message === null) { + message = loc.get('c_reminder18'); + } else { + message = cleanCodeBlock(info.message); + } + const embed = new EmbedBuilder() + .setColor('Random') + .setDescription(message) + .setTimestamp(info.createdAt); + + let channelOk = false; + if (info.channelId !== null) { + if (client.channels.cache.get(info.channelId) !== undefined) { + channelOk = true; + } else { + embed.setFooter({ text: loc.get('c_reminder14') }); + } + } + + let guildOk = false; + if (info.guildId !== null) { + const guild = client.guilds.cache.get(info.guildId); + if (guild !== undefined) { + if (guild.members.cache.get(info.userId) !== undefined) { + guildOk = true; + } else { + embed.setFooter({ text: `${loc.get('c_reminder15')} ${guild.name}.` }); + } + } else { + embed.setFooter({ text: loc.get('c_reminder16') }); + } + } + + if (option == OptionReminder.DirectMessage || !channelOk || !guildOk) { // Direct message const user = client.users.cache.get(info.userId); - // TODO: Locales - user?.send(`Here your reminder: ${info.message} :)`); + if (user !== undefined) { + user.send({ embeds: [embed] }); + } } else { // Channel client.channels.fetch(info.channelId ?? '').then((channel) => { if (channel?.isTextBased()) { - // TODO: Check if option == OptionReminder.Mention and mention - // everyone who are in the message + let content = `<@${info.userId}>`; + embed.setFooter({ text: `${loc.get('c_reminder17')} ${timeDeltaToString(info.createdAt)}` }); - // TODO: Test if a message exist - // TODO: Locales - // TODO: Embed - channel.send(`Here your reminder: ${info.message} :)`); + // Mention everybody if needed + if (option == OptionReminder.Mention) { + (info.message?.match(/<@\d+>/g) ?? []).forEach(mention => { + content += ' ' + mention; + }); + } + + channel.send({ content, embeds: [embed] }); } }); } @@ -286,6 +328,7 @@ export const embedListReminders = async (client: Client, user: User, guildId: st if (pageMax <= 1) { page = 1; } + // TODO: Use Random color or force a color from args const embed = new EmbedBuilder() .setColor(Colors.DarkGrey) .setDescription(`${loc.get('c_reminder5')} ${user} • ${loc.get('c_reminder6')} ${page}/${pageMax}`) -- 2.45.2