From acba68a2d1c79909e26e1db077116f3e00c6e540 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 6 Dec 2022 09:44:25 +1100 Subject: [PATCH 01/65] bandaged up for d.js 14 --- .gitignore | 3 +- bot/index.js | 27 +- package-lock.json | 2615 ++++++++++++++++++++++----------------------- package.json | 10 +- 4 files changed, 1293 insertions(+), 1362 deletions(-) diff --git a/.gitignore b/.gitignore index 17fb94e..be0efa3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ botconfig.json Lavalink.jar logs *.log -node_modules \ No newline at end of file +node_modules +.vscode \ No newline at end of file diff --git a/bot/index.js b/bot/index.js index 93f8003..2df2429 100644 --- a/bot/index.js +++ b/bot/index.js @@ -6,12 +6,11 @@ const EventLoader = require('./util/eventLoader'); const EventHandler = require('./util/handlers/eventHandler'); const MessageHandler = require('./util/handlers/messageHandler'); const Functions = require('./util/functions'); -const Database = require('./util/database'); +// const Database = require('./util/database'); const Logger = require('./util/logger'); const sentry = require('@sentry/node'); const config = require('../botconfig.json'); const version = require('../package.json').version; - class WoomyClient extends Discord.Client { constructor (options) { super(options); @@ -24,7 +23,7 @@ class WoomyClient extends Discord.Client { // Essential modules this.logger = Logger; this.MessageEmbed = Discord.MessageEmbed; - this.db = new Database(this); + //this.db = new Database(this); this.functions = new Functions(this); this.commandLoader = new CommandLoader(this); this.eventLoader = new EventLoader(this); @@ -50,7 +49,7 @@ class WoomyClient extends Discord.Client { this.on('voiceStateUpdate', this.runVoiceStateUpdateModules); } - // Recieves information from the per-event listeners, and passes on needed information to the handler + // Receives information from the per-event listeners, and passes on needed information to the handler mainEventListener (wsEvent, param_1, param_2) { try { this.eventHandler.handle(wsEvent, param_1, param_2); @@ -97,16 +96,20 @@ class WoomyClient extends Discord.Client { // Initialize our client const client = new WoomyClient({ shards: 'auto', + partials: [ + Discord.Partials.Reaction, + ], intents: [ - 'GUILDS', - 'GUILD_MEMBERS', - 'GUILD_EMOJIS', - 'GUILD_VOICE_STATES', - 'GUILD_MESSAGES', - 'DIRECT_MESSAGES', - 'GUILD_MESSAGE_REACTIONS', + Discord.GatewayIntentBits.Guilds, + Discord.GatewayIntentBits.GuildMembers, + Discord.GatewayIntentBits.GuildEmojisAndStickers, + Discord.GatewayIntentBits.GuildVoiceStates, + Discord.GatewayIntentBits.GuildMessages, + Discord.GatewayIntentBits.MessageContent, + Discord.GatewayIntentBits.GuildMessageReactions, ] }); + // Extensions of native javascript types, *not good practice* but they're useful require('./util/prototypes'); @@ -115,7 +118,7 @@ client.commandLoader.loadCommands(); client.eventLoader.loadEventModules(); client.createEventListeners(); -// Development mode is set in botconfig.yml, and disables some stuff if enabled. Imagine how messy Sentry would be without this! +// Development mode is set in botconfig.json if (client.config.developmentMode === false) { try { sentry.init({ dsn: client.config.keys.sentry }); diff --git a/package-lock.json b/package-lock.json index 39e3e79..47fad63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,15 +9,15 @@ "version": "2.0.0", "license": "AGPL-3.0", "dependencies": { - "@sentry/node": "^6.9.0", + "@sentry/node": "^7.23.0", "bufferutil": "^4.0.3", - "chalk": "^4.1.0", + "chalk": "^4.1.2", "dayjs": "^1.10.6", - "discord.js": "^13.0.0-dev.1dcad05.1626134620", + "discord.js": "^14.7.1", "erlpack": "^0.1.3", - "eslint": "^7.30.0", + "eslint": "^8.29.0", "fs-readdir-recursive": "^1.1.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.6.7", "pg": "^8.5.1", "pg-format": "^1.0.4", "pretty-ms": "^7.0.1", @@ -26,298 +26,253 @@ "zlib-sync": "^0.1.7" } }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" - }, - "node_modules/@babel/highlight": { - "version": "7.13.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", - "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@discordjs/builders": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.2.0.tgz", - "integrity": "sha512-TVq7NZBCJrrTRc3CfxOr3IdgY5nrtqVxZ7qDUF1mN6LgxIiOldmFxsSwMrQBzLFVmOwqFyNLKCeblley8UpEuw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.4.0.tgz", + "integrity": "sha512-nEeTCheTTDw5kO93faM1j8ZJPonAX86qpq/QVoznnSa8WWcCgJpjlu6GylfINTDW6o7zZY0my2SYdxx2mfNwGA==", "dependencies": { - "discord-api-types": "^0.18.1", - "tslib": "^2.3.0" + "@discordjs/util": "^0.1.0", + "@sapphire/shapeshift": "^3.7.1", + "discord-api-types": "^0.37.20", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.2", + "tslib": "^2.4.1" }, "engines": { - "node": ">=14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.18.1.tgz", - "integrity": "sha512-hNC38R9ZF4uaujaZQtQfm5CdQO58uhdkoHQAVvMfIL0LgOSZeW575W8H6upngQOuoxWd8tiRII3LLJm9zuQKYg==", - "engines": { - "node": ">=12" + "node": ">=16.9.0" } }, "node_modules/@discordjs/builders/node_modules/tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, "node_modules/@discordjs/collection": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", - "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" + "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/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "node_modules/@discordjs/rest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.4.0.tgz", + "integrity": "sha512-k3Ip7ffFSAfp7Mu4H/3BEXFvFz+JsbXRrRtpeBMnSp1LefhtlZWJE6xdXzNlblktKNQltnRwY+z0NZrGQdxAMw==", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "@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.20", + "file-type": "^18.0.0", + "tslib": "^2.4.1", + "undici": "^5.13.0" }, "engines": { - "node": ">= 6" + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/rest/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + }, + "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": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "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==", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", + "@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==", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", - "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } }, "node_modules/@sapphire/async-queue": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz", - "integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", + "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==", "engines": { - "node": ">=14", - "npm": ">=6" + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/shapeshift": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.1.tgz", + "integrity": "sha512-JmYN/0GW49Vl8Hi4PwrsDBNjcuCylH78vWYolVys74LRIzilAAMINxx4RHQOdvYoz+ceJKVp4+zBbQ5kuIFOLw==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lodash.uniqwith": "^4.5.0" + }, + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/snowflake": { + "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" } }, "node_modules/@sentry/core": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.9.0.tgz", - "integrity": "sha512-oFX2qQcMLujCeIuCQGlhpTUIOXiU5n6V2lqDnvMXUV8gKpplBPalwdlR9bgbSi+VO8u7LjHR1IKM0RAPWgNHWw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.23.0.tgz", + "integrity": "sha512-oNLGsscSdMs1urCbpwe868NsoJWyeTOQXOm5w2e78yE7G6zm2Ra473NQio3lweaEvjQgSGpFyEfAn/3ubZbtPw==", "dependencies": { - "@sentry/hub": "6.9.0", - "@sentry/minimal": "6.9.0", - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", + "@sentry/types": "7.23.0", + "@sentry/utils": "7.23.0", "tslib": "^1.9.3" }, "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/hub": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.9.0.tgz", - "integrity": "sha512-5mors7ojbo7G85ZmoVPQBgFBMONAJwyZfV0LNLy14GenoaVNuxTPyvAQiJb1FYq+x6YZ3CvqGX6r74KRKQU87w==", - "dependencies": { - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/minimal": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.9.0.tgz", - "integrity": "sha512-GBZ6wG2Rc1wInYEl2BZTZc/t57O1Da876ifLsSPpEQAEnGWbqZWb8RLjZskH09ZIL/K4XCIDDi5ySzN8kFUWJw==", - "dependencies": { - "@sentry/hub": "6.9.0", - "@sentry/types": "6.9.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@sentry/node": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-6.9.0.tgz", - "integrity": "sha512-hYb5NFS/3piGzGyV7V0pe7Z7ijEiFJb3Ey3iPbbje0aREUD8aUI7OVSJBctRLqEBQNCX9wX8fCHf5QNxRTUeqA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.23.0.tgz", + "integrity": "sha512-w6J+5YRsQEn55508yQYT43ahMP5IHruxq8XnFqYMFZvRohVxrZ1qTz7AMoSgc8fDcHr+LKhs1PxJIqqNwkWrFA==", "dependencies": { - "@sentry/core": "6.9.0", - "@sentry/hub": "6.9.0", - "@sentry/tracing": "6.9.0", - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", + "@sentry/core": "7.23.0", + "@sentry/types": "7.23.0", + "@sentry/utils": "7.23.0", "cookie": "^0.4.1", "https-proxy-agent": "^5.0.0", "lru_map": "^0.3.3", "tslib": "^1.9.3" }, "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/tracing": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.9.0.tgz", - "integrity": "sha512-gogVTypolhPazXr3Lue8HgzBg5Sy1cQpEp5Iq9LtECs+TlOlxJ+S+P+EIjEZ0f1AHVu706jr5cY2G2Shluli9g==", - "dependencies": { - "@sentry/hub": "6.9.0", - "@sentry/minimal": "6.9.0", - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@sentry/types": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.9.0.tgz", - "integrity": "sha512-v52HJqLoLapEnqS2NdVtUXPvT+aezQgNXQkp8hiQ3RUdTm5cffwBVG7wlbpE6OsOOIZxd6p1zKylFkwCypiIIA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.23.0.tgz", + "integrity": "sha512-fZ5XfVRswVZhKoCutQ27UpIHP16tvyc6ws+xq+njHv8Jg8gFBCoOxlJxuFhegD2xxylAn1aiSHNAErFWdajbpA==", "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@sentry/utils": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.9.0.tgz", - "integrity": "sha512-PimDr6KAi4cCp5hQZ8Az2/pDcdfhTu7WAU30Dd9MZwknpHSTmD4G6QvkdrB5er6kMMnNQOC7rMo6w/Do3m6X3w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.23.0.tgz", + "integrity": "sha512-ad/XXH03MfgDH/7N7FjKEOVaKrfQWdMaE0nCxZCr2RrvlitlmGQmPpms95epr1CpzSU3BDRImlILx6+TlrXOgg==", "dependencies": { - "@sentry/types": "6.9.0", + "@sentry/types": "7.23.0", "tslib": "^1.9.3" }, "engines": { - "node": ">=6" + "node": ">=8" } }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + }, "node_modules/@types/node": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.3.1.tgz", - "integrity": "sha512-N87VuQi7HEeRJkhzovao/JviiqKjDKMVKxKMfUvSKw+MbkbW8R0nA3fi/MQhhlxV2fQ+2ReM+/Nt4efdrJx3zA==" + "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/ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-ijZ1vzRawI7QoWnTNL8KpHixd2b2XVb9I9HAqI3triPsh1EC0xH0Eg6w2O3TKbDCgiNNlJqfrof6j4T2I+l9vw==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", "dependencies": { "@types/node": "*" } }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "bin": { "acorn": "bin/acorn" }, @@ -359,18 +314,10 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { "node": ">=8" } @@ -390,25 +337,9 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -441,12 +372,26 @@ } }, "node_modules/bufferutil": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", - "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", + "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", "hasInstallScript": true, "dependencies": { - "node-gyp-build": "^4.2.0" + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "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/callsites": { @@ -458,9 +403,9 @@ } }, "node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -488,26 +433,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "engines": { "node": ">= 0.6" } @@ -526,14 +460,14 @@ } }, "node_modules/dayjs": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz", - "integrity": "sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==" + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz", + "integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==" }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -547,47 +481,42 @@ } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "engines": { - "node": ">=0.4.0" - } + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/discord-api-types": { - "version": "0.19.0-next.f393ba520d7d6d2aacaca7b3ca5d355fab614f6e", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.19.0-next.f393ba520d7d6d2aacaca7b3ca5d355fab614f6e.tgz", - "integrity": "sha512-ttRA/8e/WKHDbGFfED5WlS7gID+kalmNr6iMiWBCvkphQ7kFHiTOVbnj/zX9ksaRaYXp/I38SCQ+qZvLu8DJZg==", - "deprecated": "No longer supported. Install the latest @next release", - "engines": { - "node": ">=12" - } + "version": "0.37.21", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.21.tgz", + "integrity": "sha512-GB4ThibZEzWXcvgL2QfjKoDX5j1sNLWtgibodiJ9M9PM0u9bdR2t3vZ24oQWLKlksJehSJmZDtRsAibhcr46vw==" }, "node_modules/discord.js": { - "version": "13.0.0-dev.1dcad05.1626134620", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.1dcad05.1626134620.tgz", - "integrity": "sha512-2pbZRe77sgk4wYBANEAhzIIXFCIeNlezP/nApBjkxV2ffX5pKSxhSmDQ7rOtFKkIDyOEawOJcNA5SJsMYCi9HQ==", + "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": "^0.2.0", - "@discordjs/collection": "^0.1.6", - "@discordjs/form-data": "^3.0.1", - "@sapphire/async-queue": "^1.1.4", - "@types/ws": "^7.4.5", - "abort-controller": "^3.0.0", - "discord-api-types": "^0.19.0-next.f393ba520d7d6d2aacaca7b3ca5d355fab614f6e", - "node-fetch": "^2.6.1", - "ws": "^7.5.1" + "@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.20", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.4.1", + "undici": "^5.13.0", + "ws": "^8.11.0" }, "engines": { - "node": ">=14.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, + "node_modules/discord.js/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -599,139 +528,17 @@ "node": ">=6.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/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/erlpack": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/erlpack/-/erlpack-0.1.3.tgz", - "integrity": "sha512-QeG9v8CVsY/a/IoQi8zjn23aYKcziOihAxwjUl3tI/KB4R1FjTtctDAAMovgtpC16S+WiOauers2oWwIOQtKBQ==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/erlpack/-/erlpack-0.1.4.tgz", + "integrity": "sha512-CJYbkEvsB5FqCCu2tLxF1eYKi28PvemC12oqzJ9oO6mDFrFO9G9G7nNJUHhiAyyL9zfXTOJx/tOcrQk+ncD65w==", "hasInstallScript": true, "dependencies": { "bindings": "^1.5.0", - "nan": "^2.14.0" + "nan": "^2.15.0" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint": { - "version": "7.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", - "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "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": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", @@ -742,37 +549,120 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "node_modules/eslint": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", + "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "@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", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^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", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "eslint": "bin/eslint.js" }, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dependencies": { + "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": { @@ -786,14 +676,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -805,18 +687,10 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "engines": { - "node": ">=4.0" - } - }, "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "engines": { "node": ">=4.0" } @@ -829,14 +703,6 @@ "node": ">=0.10.0" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -850,7 +716,15 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + }, + "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==", + "dependencies": { + "reusify": "^1.0.4" + } }, "node_modules/file-entry-cache": { "version": "6.0.1", @@ -863,11 +737,42 @@ "node": "^10.12.0 || >=12.0.0" } }, + "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==", + "dependencies": { + "readable-web-to-node-stream": "^3.0.2", + "strtok3": "^7.0.0", + "token-types": "^5.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "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==", + "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", @@ -881,9 +786,9 @@ } }, "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, "node_modules/fs-readdir-recursive": { "version": "1.1.0", @@ -893,22 +798,17 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "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": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -920,20 +820,20 @@ } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/globals": { - "version": "13.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", - "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", + "version": "13.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", + "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", "dependencies": { "type-fest": "^0.20.2" }, @@ -944,16 +844,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globals/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "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==" }, "node_modules/has-flag": { "version": "4.0.0", @@ -964,9 +858,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "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" @@ -975,10 +869,29 @@ "node": ">= 6" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "engines": { "node": ">= 4" } @@ -1001,7 +914,7 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "engines": { "node": ">=0.8.19" } @@ -1009,7 +922,7 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1023,23 +936,15 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "engines": { "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.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1047,23 +952,30 @@ "node": ">=0.10.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==", + "engines": { + "node": ">=8" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "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==" }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -1077,7 +989,7 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, "node_modules/levn": { "version": "0.4.1", @@ -1091,65 +1003,44 @@ "node": ">= 0.8.0" } }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + "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==", + "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", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=" + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "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_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mime-db": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", - "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.31", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", - "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", - "dependencies": { - "mime-db": "1.48.0" - }, - "engines": { - "node": ">= 0.6" - } + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==" }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1163,27 +1054,38 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "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-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -1193,7 +1095,7 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dependencies": { "wrappy": "1" } @@ -1214,6 +1116,34 @@ "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==", + "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==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/packet-reader": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", @@ -1238,10 +1168,18 @@ "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==", + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "engines": { "node": ">=0.10.0" } @@ -1254,15 +1192,27 @@ "node": ">=8" } }, + "node_modules/peek-readable": { + "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": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/pg": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.6.0.tgz", - "integrity": "sha512-qNS9u61lqljTDFvmk/N66EeGq3n6Ujzj0FFyNMGQr6XuEv4tgNTXvJQTfJdcvGit5p5/DWPu+wj920hAJFI+QQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", + "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", "pg-connection-string": "^2.5.0", - "pg-pool": "^3.3.0", + "pg-pool": "^3.5.2", "pg-protocol": "^1.5.0", "pg-types": "^2.1.0", "pgpass": "1.x" @@ -1271,7 +1221,7 @@ "node": ">= 8.0.0" }, "peerDependencies": { - "pg-native": ">=2.0.0" + "pg-native": ">=3.0.1" }, "peerDependenciesMeta": { "pg-native": { @@ -1287,7 +1237,7 @@ "node_modules/pg-format": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/pg-format/-/pg-format-1.0.4.tgz", - "integrity": "sha1-J3NCNsKtP05QZJFaWTNOIAQKgo4=", + "integrity": "sha512-YyKEF78pEA6wwTAqOUaHIN/rWpfzzIuMh9KdAhc3rSLQ/7zkRFcCgYBAEGatDstLyZw4g0s9SNICmaTGnBVeyw==", "engines": { "node": ">=4.0" } @@ -1301,9 +1251,9 @@ } }, "node_modules/pg-pool": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.3.0.tgz", - "integrity": "sha512-0O5huCql8/D6PIRFAlmccjphLYWC+JIzvUhSzXSpGaf+tjTZc4nn+Lr7mLXBbFJfvwbP0ywDv73EiaBsxn7zdg==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", + "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", "peerDependencies": { "pg": ">=8.0" } @@ -1329,11 +1279,11 @@ } }, "node_modules/pgpass": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz", - "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", "dependencies": { - "split2": "^3.1.1" + "split2": "^4.1.0" } }, "node_modules/postgres-array": { @@ -1347,7 +1297,7 @@ "node_modules/postgres-bytea": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", "engines": { "node": ">=0.10.0" } @@ -1393,14 +1343,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -1409,6 +1351,25 @@ "node": ">=6" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -1422,10 +1383,25 @@ "node": ">= 6" } }, + "node_modules/readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "engines": { "node": ">=8" }, @@ -1433,14 +1409,6 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1449,6 +1417,15 @@ "node": ">=4" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1463,6 +1440,28 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1482,20 +1481,6 @@ } ] }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1515,34 +1500,21 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, "node_modules/split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "dependencies": { - "readable-stream": "^3.0.0" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", + "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", + "engines": { + "node": ">= 10.x" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "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", @@ -1552,25 +1524,12 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -1587,6 +1546,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strtok3": { + "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" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -1598,47 +1573,36 @@ "node": ">=8" } }, - "node_modules/table": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.6.0.tgz", - "integrity": "sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==", - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", - "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + }, + "node_modules/token-types": { + "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": ">=14.16" + }, + "funding": { + "type": "github", + "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/ts-mixer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.2.tgz", + "integrity": "sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==" }, "node_modules/tslib": { "version": "1.14.1", @@ -1656,6 +1620,28 @@ "node": ">= 0.8.0" } }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.13.0.tgz", + "integrity": "sha512-UDZKtwb2k7KRsK4SdXWG7ErXiL7yTGgLWvk2AXO1JMjgjh404nFo6tWSCM2xMpJwMPx3J8i/vfqEh1zOqvj82Q==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.18" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -1665,23 +1651,35 @@ } }, "node_modules/utf-8-validate": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz", - "integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "hasInstallScript": true, "dependencies": { - "node-gyp-build": "^4.2.0" + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" } }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "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==" + "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", @@ -1713,14 +1711,14 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", - "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==", + "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": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", @@ -1743,10 +1741,16 @@ "node": ">=0.4" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "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==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/zlib-sync": { "version": "0.1.7", @@ -1759,246 +1763,196 @@ } }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" - }, - "@babel/highlight": { - "version": "7.13.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", - "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", - "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "@discordjs/builders": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.2.0.tgz", - "integrity": "sha512-TVq7NZBCJrrTRc3CfxOr3IdgY5nrtqVxZ7qDUF1mN6LgxIiOldmFxsSwMrQBzLFVmOwqFyNLKCeblley8UpEuw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.4.0.tgz", + "integrity": "sha512-nEeTCheTTDw5kO93faM1j8ZJPonAX86qpq/QVoznnSa8WWcCgJpjlu6GylfINTDW6o7zZY0my2SYdxx2mfNwGA==", "requires": { - "discord-api-types": "^0.18.1", - "tslib": "^2.3.0" + "@discordjs/util": "^0.1.0", + "@sapphire/shapeshift": "^3.7.1", + "discord-api-types": "^0.37.20", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.2", + "tslib": "^2.4.1" }, "dependencies": { - "discord-api-types": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.18.1.tgz", - "integrity": "sha512-hNC38R9ZF4uaujaZQtQfm5CdQO58uhdkoHQAVvMfIL0LgOSZeW575W8H6upngQOuoxWd8tiRII3LLJm9zuQKYg==" - }, "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" } } }, "@discordjs/collection": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", - "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.3.0.tgz", + "integrity": "sha512-ylt2NyZ77bJbRij4h9u/wVy7qYw/aDqQLWnadjvDqW/WoWCxrsX6M3CIw9GVP5xcGCDxsrKj5e0r5evuFYwrKg==" }, - "@discordjs/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "@discordjs/rest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.4.0.tgz", + "integrity": "sha512-k3Ip7ffFSAfp7Mu4H/3BEXFvFz+JsbXRrRtpeBMnSp1LefhtlZWJE6xdXzNlblktKNQltnRwY+z0NZrGQdxAMw==", "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "@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.20", + "file-type": "^18.0.0", + "tslib": "^2.4.1", + "undici": "^5.13.0" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + } } }, + "@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": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "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==", "requires": { - "@humanwhocodes/object-schema": "^1.2.0", + "@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==" + }, "@humanwhocodes/object-schema": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", - "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } }, "@sapphire/async-queue": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz", - "integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA==" + "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.7.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.1.tgz", + "integrity": "sha512-JmYN/0GW49Vl8Hi4PwrsDBNjcuCylH78vWYolVys74LRIzilAAMINxx4RHQOdvYoz+ceJKVp4+zBbQ5kuIFOLw==", + "requires": { + "fast-deep-equal": "^3.1.3", + "lodash.uniqwith": "^4.5.0" + } + }, + "@sapphire/snowflake": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.3.0.tgz", + "integrity": "sha512-Hec5N6zEkZuZFLybVKyLFLlcSgYmR6C1/+9NkIhxPwOf6tgX52ndJCSz8ADejmbrNE0VuNCNkpzhRZzenEC9vA==" }, "@sentry/core": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.9.0.tgz", - "integrity": "sha512-oFX2qQcMLujCeIuCQGlhpTUIOXiU5n6V2lqDnvMXUV8gKpplBPalwdlR9bgbSi+VO8u7LjHR1IKM0RAPWgNHWw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.23.0.tgz", + "integrity": "sha512-oNLGsscSdMs1urCbpwe868NsoJWyeTOQXOm5w2e78yE7G6zm2Ra473NQio3lweaEvjQgSGpFyEfAn/3ubZbtPw==", "requires": { - "@sentry/hub": "6.9.0", - "@sentry/minimal": "6.9.0", - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", - "tslib": "^1.9.3" - } - }, - "@sentry/hub": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.9.0.tgz", - "integrity": "sha512-5mors7ojbo7G85ZmoVPQBgFBMONAJwyZfV0LNLy14GenoaVNuxTPyvAQiJb1FYq+x6YZ3CvqGX6r74KRKQU87w==", - "requires": { - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", - "tslib": "^1.9.3" - } - }, - "@sentry/minimal": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.9.0.tgz", - "integrity": "sha512-GBZ6wG2Rc1wInYEl2BZTZc/t57O1Da876ifLsSPpEQAEnGWbqZWb8RLjZskH09ZIL/K4XCIDDi5ySzN8kFUWJw==", - "requires": { - "@sentry/hub": "6.9.0", - "@sentry/types": "6.9.0", + "@sentry/types": "7.23.0", + "@sentry/utils": "7.23.0", "tslib": "^1.9.3" } }, "@sentry/node": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-6.9.0.tgz", - "integrity": "sha512-hYb5NFS/3piGzGyV7V0pe7Z7ijEiFJb3Ey3iPbbje0aREUD8aUI7OVSJBctRLqEBQNCX9wX8fCHf5QNxRTUeqA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.23.0.tgz", + "integrity": "sha512-w6J+5YRsQEn55508yQYT43ahMP5IHruxq8XnFqYMFZvRohVxrZ1qTz7AMoSgc8fDcHr+LKhs1PxJIqqNwkWrFA==", "requires": { - "@sentry/core": "6.9.0", - "@sentry/hub": "6.9.0", - "@sentry/tracing": "6.9.0", - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", + "@sentry/core": "7.23.0", + "@sentry/types": "7.23.0", + "@sentry/utils": "7.23.0", "cookie": "^0.4.1", "https-proxy-agent": "^5.0.0", "lru_map": "^0.3.3", "tslib": "^1.9.3" } }, - "@sentry/tracing": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.9.0.tgz", - "integrity": "sha512-gogVTypolhPazXr3Lue8HgzBg5Sy1cQpEp5Iq9LtECs+TlOlxJ+S+P+EIjEZ0f1AHVu706jr5cY2G2Shluli9g==", - "requires": { - "@sentry/hub": "6.9.0", - "@sentry/minimal": "6.9.0", - "@sentry/types": "6.9.0", - "@sentry/utils": "6.9.0", - "tslib": "^1.9.3" - } - }, "@sentry/types": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.9.0.tgz", - "integrity": "sha512-v52HJqLoLapEnqS2NdVtUXPvT+aezQgNXQkp8hiQ3RUdTm5cffwBVG7wlbpE6OsOOIZxd6p1zKylFkwCypiIIA==" + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.23.0.tgz", + "integrity": "sha512-fZ5XfVRswVZhKoCutQ27UpIHP16tvyc6ws+xq+njHv8Jg8gFBCoOxlJxuFhegD2xxylAn1aiSHNAErFWdajbpA==" }, "@sentry/utils": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.9.0.tgz", - "integrity": "sha512-PimDr6KAi4cCp5hQZ8Az2/pDcdfhTu7WAU30Dd9MZwknpHSTmD4G6QvkdrB5er6kMMnNQOC7rMo6w/Do3m6X3w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.23.0.tgz", + "integrity": "sha512-ad/XXH03MfgDH/7N7FjKEOVaKrfQWdMaE0nCxZCr2RrvlitlmGQmPpms95epr1CpzSU3BDRImlILx6+TlrXOgg==", "requires": { - "@sentry/types": "6.9.0", + "@sentry/types": "7.23.0", "tslib": "^1.9.3" } }, + "@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + }, "@types/node": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.3.1.tgz", - "integrity": "sha512-N87VuQi7HEeRJkhzovao/JviiqKjDKMVKxKMfUvSKw+MbkbW8R0nA3fi/MQhhlxV2fQ+2ReM+/Nt4efdrJx3zA==" + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" }, "@types/ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-ijZ1vzRawI7QoWnTNL8KpHixd2b2XVb9I9HAqI3triPsh1EC0xH0Eg6w2O3TKbDCgiNNlJqfrof6j4T2I+l9vw==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", "requires": { "@types/node": "*" } }, - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } - }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==" }, "acorn-jsx": { "version": "5.3.2", @@ -2025,15 +1979,10 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" - }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", @@ -2044,22 +1993,9 @@ } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "balanced-match": { "version": "1.0.2", @@ -2089,11 +2025,19 @@ "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" }, "bufferutil": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", - "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", + "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", "requires": { - "node-gyp-build": "^4.2.0" + "node-gyp-build": "^4.3.0" + } + }, + "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" } }, "callsites": { @@ -2102,9 +2046,9 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2123,23 +2067,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" }, "cross-spawn": { "version": "7.0.3", @@ -2152,47 +2088,52 @@ } }, "dayjs": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz", - "integrity": "sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==" + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz", + "integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==" }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "discord-api-types": { - "version": "0.19.0-next.f393ba520d7d6d2aacaca7b3ca5d355fab614f6e", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.19.0-next.f393ba520d7d6d2aacaca7b3ca5d355fab614f6e.tgz", - "integrity": "sha512-ttRA/8e/WKHDbGFfED5WlS7gID+kalmNr6iMiWBCvkphQ7kFHiTOVbnj/zX9ksaRaYXp/I38SCQ+qZvLu8DJZg==" + "version": "0.37.21", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.21.tgz", + "integrity": "sha512-GB4ThibZEzWXcvgL2QfjKoDX5j1sNLWtgibodiJ9M9PM0u9bdR2t3vZ24oQWLKlksJehSJmZDtRsAibhcr46vw==" }, "discord.js": { - "version": "13.0.0-dev.1dcad05.1626134620", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.1dcad05.1626134620.tgz", - "integrity": "sha512-2pbZRe77sgk4wYBANEAhzIIXFCIeNlezP/nApBjkxV2ffX5pKSxhSmDQ7rOtFKkIDyOEawOJcNA5SJsMYCi9HQ==", + "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": "^0.2.0", - "@discordjs/collection": "^0.1.6", - "@discordjs/form-data": "^3.0.1", - "@sapphire/async-queue": "^1.1.4", - "@types/ws": "^7.4.5", - "abort-controller": "^3.0.0", - "discord-api-types": "^0.19.0-next.f393ba520d7d6d2aacaca7b3ca5d355fab614f6e", - "node-fetch": "^2.6.1", - "ws": "^7.5.1" + "@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.20", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.4.1", + "undici": "^5.13.0", + "ws": "^8.11.0" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + } } }, "doctrine": { @@ -2203,151 +2144,111 @@ "esutils": "^2.0.2" } }, - "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==" - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "requires": { - "ansi-colors": "^4.1.1" - } - }, "erlpack": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/erlpack/-/erlpack-0.1.3.tgz", - "integrity": "sha512-QeG9v8CVsY/a/IoQi8zjn23aYKcziOihAxwjUl3tI/KB4R1FjTtctDAAMovgtpC16S+WiOauers2oWwIOQtKBQ==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/erlpack/-/erlpack-0.1.4.tgz", + "integrity": "sha512-CJYbkEvsB5FqCCu2tLxF1eYKi28PvemC12oqzJ9oO6mDFrFO9G9G7nNJUHhiAyyL9zfXTOJx/tOcrQk+ncD65w==", "requires": { "bindings": "^1.5.0", - "nan": "^2.14.0" + "nan": "^2.15.0" } }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint": { - "version": "7.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", - "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", + "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", - "@humanwhocodes/config-array": "^0.5.0", + "@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", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "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": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "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", - "js-yaml": "^3.13.1", + "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", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" - } + "text-table": "^0.2.0" } }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" } }, "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "requires": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" } } }, "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==" }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - } + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - } } }, "esrecurse": { @@ -2356,30 +2257,18 @@ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" - } } }, "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2393,7 +2282,15 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "requires": { + "reusify": "^1.0.4" + } }, "file-entry-cache": { "version": "6.0.1", @@ -2403,11 +2300,30 @@ "flat-cache": "^3.0.4" } }, + "file-type": { + "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", + "token-types": "^5.0.1" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "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==", + "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", @@ -2418,9 +2334,9 @@ } }, "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, "fs-readdir-recursive": { "version": "1.1.0", @@ -2430,67 +2346,65 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "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": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "globals": { - "version": "13.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", - "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", + "version": "13.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", + "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", "requires": { "type-fest": "^0.20.2" - }, - "dependencies": { - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" - } } }, + "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==" + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "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" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "import-fresh": { "version": "3.3.0", @@ -2504,12 +2418,12 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "requires": { "once": "^1.3.0", "wrappy": "1" @@ -2523,38 +2437,37 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "requires": { "is-extglob": "^2.1.1" } }, + "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==" + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==" }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "json-schema-traverse": { @@ -2565,7 +2478,7 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, "levn": { "version": "0.4.1", @@ -2576,56 +2489,38 @@ "type-check": "~0.4.0" } }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + "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==", + "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", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=" + "lodash.snakecase": { + "version": "4.1.1", + "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_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "mime-db": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", - "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==" - }, - "mime-types": { - "version": "2.1.31", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", - "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", - "requires": { - "mime-db": "1.48.0" - } + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==" }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } @@ -2636,29 +2531,32 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "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-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "requires": { "wrappy": "1" } @@ -2676,6 +2574,22 @@ "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==", + "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==", + "requires": { + "p-limit": "^3.0.2" + } + }, "packet-reader": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", @@ -2694,25 +2608,35 @@ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==" }, + "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==" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, + "peek-readable": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==" + }, "pg": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.6.0.tgz", - "integrity": "sha512-qNS9u61lqljTDFvmk/N66EeGq3n6Ujzj0FFyNMGQr6XuEv4tgNTXvJQTfJdcvGit5p5/DWPu+wj920hAJFI+QQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", + "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", "requires": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", "pg-connection-string": "^2.5.0", - "pg-pool": "^3.3.0", + "pg-pool": "^3.5.2", "pg-protocol": "^1.5.0", "pg-types": "^2.1.0", "pgpass": "1.x" @@ -2726,7 +2650,7 @@ "pg-format": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/pg-format/-/pg-format-1.0.4.tgz", - "integrity": "sha1-J3NCNsKtP05QZJFaWTNOIAQKgo4=" + "integrity": "sha512-YyKEF78pEA6wwTAqOUaHIN/rWpfzzIuMh9KdAhc3rSLQ/7zkRFcCgYBAEGatDstLyZw4g0s9SNICmaTGnBVeyw==" }, "pg-int8": { "version": "1.0.1", @@ -2734,9 +2658,9 @@ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" }, "pg-pool": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.3.0.tgz", - "integrity": "sha512-0O5huCql8/D6PIRFAlmccjphLYWC+JIzvUhSzXSpGaf+tjTZc4nn+Lr7mLXBbFJfvwbP0ywDv73EiaBsxn7zdg==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", + "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", "requires": {} }, "pg-protocol": { @@ -2757,11 +2681,11 @@ } }, "pgpass": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz", - "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", "requires": { - "split2": "^3.1.1" + "split2": "^4.1.0" } }, "postgres-array": { @@ -2772,7 +2696,7 @@ "postgres-bytea": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=" + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==" }, "postgres-date": { "version": "1.0.7", @@ -2800,16 +2724,16 @@ "parse-ms": "^2.1.0" } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -2820,21 +2744,29 @@ "util-deprecate": "^1.0.1" } }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" + "readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "requires": { + "readable-stream": "^3.6.0" + } }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==" }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -2843,19 +2775,19 @@ "glob": "^7.1.3" } }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2869,28 +2801,15 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, "split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "requires": { - "readable-stream": "^3.0.0" - } + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", + "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "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", @@ -2900,22 +2819,12 @@ "safe-buffer": "~5.2.0" } }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-json-comments": { @@ -2923,6 +2832,15 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, + "strtok3": { + "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" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2931,42 +2849,29 @@ "has-flag": "^4.0.0" } }, - "table": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.6.0.tgz", - "integrity": "sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==", - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", - "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - } - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + }, + "token-types": { + "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" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "ts-mixer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.2.tgz", + "integrity": "sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==" }, "tslib": { "version": "1.14.1", @@ -2981,6 +2886,19 @@ "prelude-ls": "^1.2.1" } }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + }, + "undici": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.13.0.tgz", + "integrity": "sha512-UDZKtwb2k7KRsK4SdXWG7ErXiL7yTGgLWvk2AXO1JMjgjh404nFo6tWSCM2xMpJwMPx3J8i/vfqEh1zOqvj82Q==", + "requires": { + "busboy": "^1.6.0" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -2990,22 +2908,31 @@ } }, "utf-8-validate": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz", - "integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "requires": { - "node-gyp-build": "^4.2.0" + "node-gyp-build": "^4.3.0" } }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "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==" + "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", @@ -3028,12 +2955,12 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", - "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==", + "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": { @@ -3041,10 +2968,10 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "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==" }, "zlib-sync": { "version": "0.1.7", diff --git a/package.json b/package.json index 205149d..15c5220 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "description": "Made with <3 by mudkipscience", "main": "index.js", "dependencies": { - "@sentry/node": "^6.9.0", + "@sentry/node": "^7.23.0", "bufferutil": "^4.0.3", - "chalk": "^4.1.0", + "chalk": "^4.1.2", "dayjs": "^1.10.6", - "discord.js": "^13.0.0-dev.1dcad05.1626134620", + "discord.js": "^14.7.1", "erlpack": "^0.1.3", - "eslint": "^7.30.0", + "eslint": "^8.29.0", "fs-readdir-recursive": "^1.1.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.6.7", "pg": "^8.5.1", "pg-format": "^1.0.4", "pretty-ms": "^7.0.1", From dfc19783688ca6688f37a3254715c5090f94cc46 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 9 Dec 2022 23:40:41 +1100 Subject: [PATCH 02/65] oopsie comma was missing --- botconfig.json.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botconfig.json.example b/botconfig.json.example index bcb6497..1fb7e72 100644 --- a/botconfig.json.example +++ b/botconfig.json.example @@ -18,7 +18,7 @@ "database": "", "password": "", "port": 0000 - } + }, "emojis": { "success": "<:success:466995111885144095>", From b94fc32f46d5ad6a8f0a786feecb884a7ed8abce Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 9 Dec 2022 23:41:29 +1100 Subject: [PATCH 03/65] file layout changes + interaction passoff --- bot/event_modules/eventHandler.js | 68 ++++++++++ .../interactionCreate/messageHandler.js | 121 ++++++++++++++++++ bot/index.js | 18 ++- 3 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 bot/event_modules/eventHandler.js create mode 100644 bot/event_modules/interactionCreate/messageHandler.js diff --git a/bot/event_modules/eventHandler.js b/bot/event_modules/eventHandler.js new file mode 100644 index 0000000..a943203 --- /dev/null +++ b/bot/event_modules/eventHandler.js @@ -0,0 +1,68 @@ +/* eslint-disable indent */ + +class EventHandler { + constructor (client) { + this.client = client; + } + + handle (wsEvent, param_1, param_2) { + switch (wsEvent) { + case 'ready': { + const readyModules = this.client.eventModules.filter(module => module.wsEvent === 'ready'); + readyModules.forEach(module => module.run(this.client)); + break; + } + + // param_1 - error message + case 'error': { + const errorModules = this.client.eventModules.filter(module => module.wsEvent === 'error'); + errorModules.forEach(module => module.run(this.client, param_1)); + break; + } + + // param_1 - message object + case 'messageCreate': { + const mCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'messageCreate'); + mCreateModules.forEach(module => module.run(this.client, param_1)); + break; + } + + // param_1 - guild object + case 'guildCreate': { + const gCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'guildCreate'); + gCreateModules.forEach(module => module.run(this.client, param_1)); + break; + } + + // param_1 - guild object + case 'guildDelete': { + const gDeleteModules = this.client.eventModules.filter(module => module.wsEvent === 'guildDelete'); + gDeleteModules.forEach(module => module.run(this.client, param_1)); + break; + } + + // param_1 - guild object | param_2 - member object + case 'guildMemberAdd': { + const gMemberAddModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberAdd'); + gMemberAddModules.forEach(module => module.run(this.client, param_1, param_2)); + break; + } + + // param_1 - guild object | param_2 - member object + case 'guildMemberRemove': { + const gMemberRemoveModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberRemove'); + gMemberRemoveModules.forEach(module => module.run(this.client, param_1, param_2)); + break; + } + + // param_1 - old voice state | param_2 - new voice state + case 'voiceStateUpdate': { + const vStateUpdateModules = this.client.eventModules.filter(module => module.wsEvent === 'voiceStateUpdate'); + vStateUpdateModules.forEach(module => module.run(this.client)); + break; + } + } + } +} + +module.exports = EventHandler; \ No newline at end of file diff --git a/bot/event_modules/interactionCreate/messageHandler.js b/bot/event_modules/interactionCreate/messageHandler.js new file mode 100644 index 0000000..29da3c1 --- /dev/null +++ b/bot/event_modules/interactionCreate/messageHandler.js @@ -0,0 +1,121 @@ +class MessageHandler { + constructor (client) { + this.client = client; + } + + async handle (message) { + // Ignore messages from bots, and messages in DM's + if (message.author.bot) return; + if (!message.guild) return; + + // Request all the data we need from the database + const data = {}; + data.user = await this.client.db.getUser(message.author.id); + data.guild = await this.client.db.getGuild(message.guild.id); + data.member = await this.client.db.getMember(message.guild.id, message.author.id); + + // Ignore users on the guild blocklist + if (data.guild.blocklist.includes(message.author.id)) return; + + // If a user pings Woomy, respond to them with the prefixes they can use + if (message.content === `<@${this.client.user.id}>` || message.content === `<@!${this.client.user.id}>`) { + return message.channel.send( + `Hi! The prefix for this server is \`${data.guild.prefix}\`, and your personal prefix is \`${data.user.prefix}\`. You can also ping me ^-^` + ); + } + + // All the prefixes Woomy will respond to + const prefixes = [ + data.user.prefix, + data.guild.prefix, + `<@${this.client.user.id}> `, + `<@!${this.client.user.id}> ` + ]; + + let prefix; + + // Check the message content to see if it starts with one of our prefixes + for (const thisPrefix of prefixes) { + if (message.content.startsWith(thisPrefix)) { + prefix = thisPrefix; + break; + } + } + + // Ignore the message if it doesn't start with a valid prefix + if (!prefix) return; + + // Save prefix so we can use it later (mostly for help command) + if (prefix === `<@${this.client.user.id}> ` || prefix === `<@!${this.client.user.id}> `) { + message.prefix = '@Woomy '; + } else (message.prefix = prefix); + + // Turn the message content into an array (excluding the prefix) + const args = message.content.slice(prefix.length).trim().split(/ +/g); + + // Find the command + const commandName = args.shift().toLowerCase(); + const command = this.client.commands.get(commandName) || this.client.commands.get(this.client.aliases.get(commandName)); + + // Return if a command (or its aliases) are not found + if (!command) return; + + // Both of these blocks check if the command is disabled/in a disabled category + if (data.guild.disabledcommands.includes(command.name)) return message.channel.send( + this.client.config.emojis.permError + ' This command has been disabled by a server administrator.' + ); + + if (data.guild.disabledcategories.includes(command.category)) return message.channel.send( + this.client.config.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' + ); + + // Both of these blocks check the permissions of the user, and reply with missing perms if any are found + const missingUserPerms = this.client.functions.checkPermissions(message.channel, message.author.id, command.userPerms); + if (missingUserPerms) return message.channel.send( + `${this.client.config.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` + ); + + const missingBotPerms = this.client.functions.checkPermissions(message.channel, this.client.user.id, command.botPerms); + if (missingBotPerms) return message.channel.send( + `${this.client.config.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` + ); + + // Return if the command is disabled globally + if (command.enabled === false) return message.channel.send( + this.client.config.emojis.permError + ' This command has been disabled by my developers.' + ); + + // Return if the command is restricted to developers (and the user is not a developer) + if (command.devOnly === true && this.client.config.ownerIDs.includes(message.author.id) !== true) { + return message.channel.send( + `${this.client.config.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` + ); + } + + // Cooldown + if (this.client.cooldowns.get(command.name).has(message.author.id)) { + const timestamp = this.client.cooldowns.get(command.name).get(message.author.id); + const currentTime = Date.now(); + const cooldown = command.cooldown / 1000; + const timePassed = Math.floor((currentTime - timestamp) / 1000); + return message.channel.send( + `${this.client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` + ); + } else { + this.client.cooldowns.get(command.name).set(message.author.id, new Date()); + setTimeout(() => { + this.client.cooldowns.get(command.name).delete(message.author.id); + }, this.client.commands.get(command.name).cooldown); + } + + try { + command.run(this.client, message, args, data); + this.client.logger.command(`Ran ${command.name}`); + } catch (error) { + this.client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); + message.channel.send(`${this.client.config.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); + } + } +} + +module.exports = MessageHandler; \ No newline at end of file diff --git a/bot/index.js b/bot/index.js index 2df2429..56670d1 100644 --- a/bot/index.js +++ b/bot/index.js @@ -3,10 +3,10 @@ const Discord = require('discord.js'); const CommandLoader = require('./util/commandLoader'); const EventLoader = require('./util/eventLoader'); -const EventHandler = require('./util/handlers/eventHandler'); -const MessageHandler = require('./util/handlers/messageHandler'); +const EventHandler = require('./event_modules/eventHandler'); +const MessageHandler = require('./event_modules/interactionCreate/messageHandler'); const Functions = require('./util/functions'); -// const Database = require('./util/database'); +const Database = require('./util/database'); const Logger = require('./util/logger'); const sentry = require('@sentry/node'); const config = require('../botconfig.json'); @@ -23,7 +23,7 @@ class WoomyClient extends Discord.Client { // Essential modules this.logger = Logger; this.MessageEmbed = Discord.MessageEmbed; - //this.db = new Database(this); + this.db = new Database(this); this.functions = new Functions(this); this.commandLoader = new CommandLoader(this); this.eventLoader = new EventLoader(this); @@ -41,7 +41,8 @@ class WoomyClient extends Discord.Client { createEventListeners () { this.on('ready', this.runReadyModules); this.on('error', this.runErrorModules); - this.on('messageCreate', this.runMessageCreateModules); + this.on('interactionCreate', this.runInteractionModules); + /// this.on('messageCreate', this.runMessageCreateModules); this.on('guildCreate', this.runGuildCreateModules); this.on('guildDelete', this.runGuildDeleteModules); this.on('guildMemberAdd', this.runGuildMemberAddModules); @@ -67,8 +68,11 @@ class WoomyClient extends Discord.Client { this.mainEventListener('error', error); } + runInteractionCreateModules (interaction) { + this.mainEventListener('interactionCreate', interaction); + } + runMessageCreateModules (message) { - this.messageHandler.handle(message); this.mainEventListener('messageCreate', message); } @@ -142,7 +146,7 @@ process.on('unhandledRejection', err => { client.logger.error('UNHANDLED_PROMISE_ERROR', err.stack); }); -// Shut down gracefully when SIGINT is recieved +// Shut down gracefully when SIGINT is received process.on('SIGINT', () => { client.functions.shutdown(); }); \ No newline at end of file From 7e623c36fd0cc94f214859b72c59c8866dfecb53 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 9 Dec 2022 23:41:47 +1100 Subject: [PATCH 04/65] oopsie cant spell --- bot/commands/Developer/restart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/commands/Developer/restart.js b/bot/commands/Developer/restart.js index 54d55dd..8b9bb8e 100644 --- a/bot/commands/Developer/restart.js +++ b/bot/commands/Developer/restart.js @@ -20,7 +20,7 @@ module.exports = class { } run (client, message, args, data) { //eslint-disable-line no-unused-vars - client.logger.success('RESTART', 'Restart command recieved. ' + exitQuotes.random()); + client.logger.success('RESTART', 'Restart command received. ' + exitQuotes.random()); client.disconnect(); client.functions.wait(); From dfc1674bad56bbb6c9072369db071f06b5586b8f Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 9 Dec 2022 23:42:09 +1100 Subject: [PATCH 05/65] i cant remember what half of these were even for --- bot/util/dbvalidator.js | 0 bot/util/handlers/botListHandler.js | 0 bot/util/handlers/eventHandler.js | 68 ---------------- bot/util/handlers/messageHandler.js | 121 ---------------------------- 4 files changed, 189 deletions(-) delete mode 100644 bot/util/dbvalidator.js delete mode 100644 bot/util/handlers/botListHandler.js delete mode 100644 bot/util/handlers/eventHandler.js delete mode 100644 bot/util/handlers/messageHandler.js diff --git a/bot/util/dbvalidator.js b/bot/util/dbvalidator.js deleted file mode 100644 index e69de29..0000000 diff --git a/bot/util/handlers/botListHandler.js b/bot/util/handlers/botListHandler.js deleted file mode 100644 index e69de29..0000000 diff --git a/bot/util/handlers/eventHandler.js b/bot/util/handlers/eventHandler.js deleted file mode 100644 index a943203..0000000 --- a/bot/util/handlers/eventHandler.js +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint-disable indent */ - -class EventHandler { - constructor (client) { - this.client = client; - } - - handle (wsEvent, param_1, param_2) { - switch (wsEvent) { - case 'ready': { - const readyModules = this.client.eventModules.filter(module => module.wsEvent === 'ready'); - readyModules.forEach(module => module.run(this.client)); - break; - } - - // param_1 - error message - case 'error': { - const errorModules = this.client.eventModules.filter(module => module.wsEvent === 'error'); - errorModules.forEach(module => module.run(this.client, param_1)); - break; - } - - // param_1 - message object - case 'messageCreate': { - const mCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'messageCreate'); - mCreateModules.forEach(module => module.run(this.client, param_1)); - break; - } - - // param_1 - guild object - case 'guildCreate': { - const gCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'guildCreate'); - gCreateModules.forEach(module => module.run(this.client, param_1)); - break; - } - - // param_1 - guild object - case 'guildDelete': { - const gDeleteModules = this.client.eventModules.filter(module => module.wsEvent === 'guildDelete'); - gDeleteModules.forEach(module => module.run(this.client, param_1)); - break; - } - - // param_1 - guild object | param_2 - member object - case 'guildMemberAdd': { - const gMemberAddModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberAdd'); - gMemberAddModules.forEach(module => module.run(this.client, param_1, param_2)); - break; - } - - // param_1 - guild object | param_2 - member object - case 'guildMemberRemove': { - const gMemberRemoveModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberRemove'); - gMemberRemoveModules.forEach(module => module.run(this.client, param_1, param_2)); - break; - } - - // param_1 - old voice state | param_2 - new voice state - case 'voiceStateUpdate': { - const vStateUpdateModules = this.client.eventModules.filter(module => module.wsEvent === 'voiceStateUpdate'); - vStateUpdateModules.forEach(module => module.run(this.client)); - break; - } - } - } -} - -module.exports = EventHandler; \ No newline at end of file diff --git a/bot/util/handlers/messageHandler.js b/bot/util/handlers/messageHandler.js deleted file mode 100644 index 29da3c1..0000000 --- a/bot/util/handlers/messageHandler.js +++ /dev/null @@ -1,121 +0,0 @@ -class MessageHandler { - constructor (client) { - this.client = client; - } - - async handle (message) { - // Ignore messages from bots, and messages in DM's - if (message.author.bot) return; - if (!message.guild) return; - - // Request all the data we need from the database - const data = {}; - data.user = await this.client.db.getUser(message.author.id); - data.guild = await this.client.db.getGuild(message.guild.id); - data.member = await this.client.db.getMember(message.guild.id, message.author.id); - - // Ignore users on the guild blocklist - if (data.guild.blocklist.includes(message.author.id)) return; - - // If a user pings Woomy, respond to them with the prefixes they can use - if (message.content === `<@${this.client.user.id}>` || message.content === `<@!${this.client.user.id}>`) { - return message.channel.send( - `Hi! The prefix for this server is \`${data.guild.prefix}\`, and your personal prefix is \`${data.user.prefix}\`. You can also ping me ^-^` - ); - } - - // All the prefixes Woomy will respond to - const prefixes = [ - data.user.prefix, - data.guild.prefix, - `<@${this.client.user.id}> `, - `<@!${this.client.user.id}> ` - ]; - - let prefix; - - // Check the message content to see if it starts with one of our prefixes - for (const thisPrefix of prefixes) { - if (message.content.startsWith(thisPrefix)) { - prefix = thisPrefix; - break; - } - } - - // Ignore the message if it doesn't start with a valid prefix - if (!prefix) return; - - // Save prefix so we can use it later (mostly for help command) - if (prefix === `<@${this.client.user.id}> ` || prefix === `<@!${this.client.user.id}> `) { - message.prefix = '@Woomy '; - } else (message.prefix = prefix); - - // Turn the message content into an array (excluding the prefix) - const args = message.content.slice(prefix.length).trim().split(/ +/g); - - // Find the command - const commandName = args.shift().toLowerCase(); - const command = this.client.commands.get(commandName) || this.client.commands.get(this.client.aliases.get(commandName)); - - // Return if a command (or its aliases) are not found - if (!command) return; - - // Both of these blocks check if the command is disabled/in a disabled category - if (data.guild.disabledcommands.includes(command.name)) return message.channel.send( - this.client.config.emojis.permError + ' This command has been disabled by a server administrator.' - ); - - if (data.guild.disabledcategories.includes(command.category)) return message.channel.send( - this.client.config.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' - ); - - // Both of these blocks check the permissions of the user, and reply with missing perms if any are found - const missingUserPerms = this.client.functions.checkPermissions(message.channel, message.author.id, command.userPerms); - if (missingUserPerms) return message.channel.send( - `${this.client.config.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` - ); - - const missingBotPerms = this.client.functions.checkPermissions(message.channel, this.client.user.id, command.botPerms); - if (missingBotPerms) return message.channel.send( - `${this.client.config.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` - ); - - // Return if the command is disabled globally - if (command.enabled === false) return message.channel.send( - this.client.config.emojis.permError + ' This command has been disabled by my developers.' - ); - - // Return if the command is restricted to developers (and the user is not a developer) - if (command.devOnly === true && this.client.config.ownerIDs.includes(message.author.id) !== true) { - return message.channel.send( - `${this.client.config.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` - ); - } - - // Cooldown - if (this.client.cooldowns.get(command.name).has(message.author.id)) { - const timestamp = this.client.cooldowns.get(command.name).get(message.author.id); - const currentTime = Date.now(); - const cooldown = command.cooldown / 1000; - const timePassed = Math.floor((currentTime - timestamp) / 1000); - return message.channel.send( - `${this.client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` - ); - } else { - this.client.cooldowns.get(command.name).set(message.author.id, new Date()); - setTimeout(() => { - this.client.cooldowns.get(command.name).delete(message.author.id); - }, this.client.commands.get(command.name).cooldown); - } - - try { - command.run(this.client, message, args, data); - this.client.logger.command(`Ran ${command.name}`); - } catch (error) { - this.client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); - message.channel.send(`${this.client.config.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); - } - } -} - -module.exports = MessageHandler; \ No newline at end of file From b561f808354e276247323c4af209cb568b8ee486 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 00:13:08 +1100 Subject: [PATCH 06/65] use camel case properly --- bot/commands/Configuration/blocklist.js | 4 ++-- bot/commands/Utility/serverinfo.js | 2 +- bot/commands/Utility/userinfo.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/commands/Configuration/blocklist.js b/bot/commands/Configuration/blocklist.js index e6628dc..adbfd4b 100644 --- a/bot/commands/Configuration/blocklist.js +++ b/bot/commands/Configuration/blocklist.js @@ -71,7 +71,7 @@ module.exports = class { const blocklist = data.guild.blocklist; if (action === 'add') { - if (member.id === message.guild.ownerID) return message.channel.send( + if (member.id === message.guild.ownerId) return message.channel.send( `${client.config.emojis.userError} You can't block the owner, silly!` ); @@ -96,7 +96,7 @@ module.exports = class { } if (action === 'remove') { - if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.guild.ownerID) { + if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.guild.ownerId) { return message.channel.send(`${client.config.emojis.userError} This user has a higher role than you, you can't remove them to the blocklist!`); } diff --git a/bot/commands/Utility/serverinfo.js b/bot/commands/Utility/serverinfo.js index ddba662..17dac6d 100644 --- a/bot/commands/Utility/serverinfo.js +++ b/bot/commands/Utility/serverinfo.js @@ -24,7 +24,7 @@ module.exports = class { .setTitle(guild.name) .setThumbnail(guild.iconURL) .addField('ID', guild.id, true) - .addField('Owner', `<@${guild.ownerID}>`, true) + .addField('Owner', `<@${guild.ownerId}>`, true) .addField('Region', guild.region.toProperCase(), true) .addField('Boosts', `${guild.premiumSubscriptionCount} (Level ${guild.premiumTier})`, true) .addField('Member Count (Approximate)', `${guild.memberCount} (${guild.memberCount - guild.members.filter(member => member.user.bot).length} humans, ${guild.members.filter(member => member.user.bot).length} bots)`, true) diff --git a/bot/commands/Utility/userinfo.js b/bot/commands/Utility/userinfo.js index 376ca5d..69ca67d 100644 --- a/bot/commands/Utility/userinfo.js +++ b/bot/commands/Utility/userinfo.js @@ -47,7 +47,7 @@ module.exports = class { const badges = []; if (client.config.ownerIDs.includes(member.id)) badges.push('<:Woomy_Developer:816822318289518622> '); - if (member.id === member.guild.ownerID) badges.push('<:owner:685703193694306331>'); + if (member.id === member.guild.ownerId) badges.push('<:owner:685703193694306331>'); if (member.bot) badges.push('<:bot:686489601678114859>'); const roles = []; From 1f2fd34ac512c16ee53f70906642ecfd97f1394c Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 00:14:24 +1100 Subject: [PATCH 07/65] disallow @everyone --- bot/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bot/index.js b/bot/index.js index 56670d1..0bf0431 100644 --- a/bot/index.js +++ b/bot/index.js @@ -101,7 +101,7 @@ class WoomyClient extends Discord.Client { const client = new WoomyClient({ shards: 'auto', partials: [ - Discord.Partials.Reaction, + Discord.Partials.Reaction ], intents: [ Discord.GatewayIntentBits.Guilds, @@ -110,8 +110,14 @@ const client = new WoomyClient({ Discord.GatewayIntentBits.GuildVoiceStates, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.MessageContent, - Discord.GatewayIntentBits.GuildMessageReactions, - ] + Discord.GatewayIntentBits.GuildMessageReactions + ], + allowedMentions: { + parse: [ + 'users', + 'roles' + ] + } }); // Extensions of native javascript types, *not good practice* but they're useful From 003712fe7f92d13bae014657ee6ae8a2fd884a3b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 00:14:31 +1100 Subject: [PATCH 08/65] placeholder --- .../interactionCreate/interactionHandler.js | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 bot/event_modules/interactionCreate/interactionHandler.js diff --git a/bot/event_modules/interactionCreate/interactionHandler.js b/bot/event_modules/interactionCreate/interactionHandler.js new file mode 100644 index 0000000..29da3c1 --- /dev/null +++ b/bot/event_modules/interactionCreate/interactionHandler.js @@ -0,0 +1,121 @@ +class MessageHandler { + constructor (client) { + this.client = client; + } + + async handle (message) { + // Ignore messages from bots, and messages in DM's + if (message.author.bot) return; + if (!message.guild) return; + + // Request all the data we need from the database + const data = {}; + data.user = await this.client.db.getUser(message.author.id); + data.guild = await this.client.db.getGuild(message.guild.id); + data.member = await this.client.db.getMember(message.guild.id, message.author.id); + + // Ignore users on the guild blocklist + if (data.guild.blocklist.includes(message.author.id)) return; + + // If a user pings Woomy, respond to them with the prefixes they can use + if (message.content === `<@${this.client.user.id}>` || message.content === `<@!${this.client.user.id}>`) { + return message.channel.send( + `Hi! The prefix for this server is \`${data.guild.prefix}\`, and your personal prefix is \`${data.user.prefix}\`. You can also ping me ^-^` + ); + } + + // All the prefixes Woomy will respond to + const prefixes = [ + data.user.prefix, + data.guild.prefix, + `<@${this.client.user.id}> `, + `<@!${this.client.user.id}> ` + ]; + + let prefix; + + // Check the message content to see if it starts with one of our prefixes + for (const thisPrefix of prefixes) { + if (message.content.startsWith(thisPrefix)) { + prefix = thisPrefix; + break; + } + } + + // Ignore the message if it doesn't start with a valid prefix + if (!prefix) return; + + // Save prefix so we can use it later (mostly for help command) + if (prefix === `<@${this.client.user.id}> ` || prefix === `<@!${this.client.user.id}> `) { + message.prefix = '@Woomy '; + } else (message.prefix = prefix); + + // Turn the message content into an array (excluding the prefix) + const args = message.content.slice(prefix.length).trim().split(/ +/g); + + // Find the command + const commandName = args.shift().toLowerCase(); + const command = this.client.commands.get(commandName) || this.client.commands.get(this.client.aliases.get(commandName)); + + // Return if a command (or its aliases) are not found + if (!command) return; + + // Both of these blocks check if the command is disabled/in a disabled category + if (data.guild.disabledcommands.includes(command.name)) return message.channel.send( + this.client.config.emojis.permError + ' This command has been disabled by a server administrator.' + ); + + if (data.guild.disabledcategories.includes(command.category)) return message.channel.send( + this.client.config.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' + ); + + // Both of these blocks check the permissions of the user, and reply with missing perms if any are found + const missingUserPerms = this.client.functions.checkPermissions(message.channel, message.author.id, command.userPerms); + if (missingUserPerms) return message.channel.send( + `${this.client.config.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` + ); + + const missingBotPerms = this.client.functions.checkPermissions(message.channel, this.client.user.id, command.botPerms); + if (missingBotPerms) return message.channel.send( + `${this.client.config.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` + ); + + // Return if the command is disabled globally + if (command.enabled === false) return message.channel.send( + this.client.config.emojis.permError + ' This command has been disabled by my developers.' + ); + + // Return if the command is restricted to developers (and the user is not a developer) + if (command.devOnly === true && this.client.config.ownerIDs.includes(message.author.id) !== true) { + return message.channel.send( + `${this.client.config.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` + ); + } + + // Cooldown + if (this.client.cooldowns.get(command.name).has(message.author.id)) { + const timestamp = this.client.cooldowns.get(command.name).get(message.author.id); + const currentTime = Date.now(); + const cooldown = command.cooldown / 1000; + const timePassed = Math.floor((currentTime - timestamp) / 1000); + return message.channel.send( + `${this.client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` + ); + } else { + this.client.cooldowns.get(command.name).set(message.author.id, new Date()); + setTimeout(() => { + this.client.cooldowns.get(command.name).delete(message.author.id); + }, this.client.commands.get(command.name).cooldown); + } + + try { + command.run(this.client, message, args, data); + this.client.logger.command(`Ran ${command.name}`); + } catch (error) { + this.client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); + message.channel.send(`${this.client.config.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); + } + } +} + +module.exports = MessageHandler; \ No newline at end of file From d1a4b2cf5c03f3cf7e61564ac337db2fc3726ae2 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 00:21:45 +1100 Subject: [PATCH 09/65] patching back in the message handler --- .../{interactionCreate => messageCreate}/messageHandler.js | 0 bot/index.js | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) rename bot/event_modules/{interactionCreate => messageCreate}/messageHandler.js (100%) diff --git a/bot/event_modules/interactionCreate/messageHandler.js b/bot/event_modules/messageCreate/messageHandler.js similarity index 100% rename from bot/event_modules/interactionCreate/messageHandler.js rename to bot/event_modules/messageCreate/messageHandler.js diff --git a/bot/index.js b/bot/index.js index 0bf0431..a1c0286 100644 --- a/bot/index.js +++ b/bot/index.js @@ -4,7 +4,7 @@ const Discord = require('discord.js'); const CommandLoader = require('./util/commandLoader'); const EventLoader = require('./util/eventLoader'); const EventHandler = require('./event_modules/eventHandler'); -const MessageHandler = require('./event_modules/interactionCreate/messageHandler'); +const MessageHandler = require('./event_modules/messageCreate/messageHandler'); const Functions = require('./util/functions'); const Database = require('./util/database'); const Logger = require('./util/logger'); @@ -41,8 +41,8 @@ class WoomyClient extends Discord.Client { createEventListeners () { this.on('ready', this.runReadyModules); this.on('error', this.runErrorModules); - this.on('interactionCreate', this.runInteractionModules); - /// this.on('messageCreate', this.runMessageCreateModules); + this.on('interactionCreate', this.runInteractionCreateModules); + this.on('messageCreate', this.runMessageCreateModules); this.on('guildCreate', this.runGuildCreateModules); this.on('guildDelete', this.runGuildDeleteModules); this.on('guildMemberAdd', this.runGuildMemberAddModules); @@ -73,6 +73,7 @@ class WoomyClient extends Discord.Client { } runMessageCreateModules (message) { + this.messageHandler.handle(message); this.mainEventListener('messageCreate', message); } From 9e47046c7b8c222890bf4fe863d9abac317524fb Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 00:22:48 +1100 Subject: [PATCH 10/65] cleaned up var names --- bot/event_modules/eventHandler.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/bot/event_modules/eventHandler.js b/bot/event_modules/eventHandler.js index a943203..eb8f53e 100644 --- a/bot/event_modules/eventHandler.js +++ b/bot/event_modules/eventHandler.js @@ -13,52 +13,45 @@ class EventHandler { break; } - // param_1 - error message case 'error': { const errorModules = this.client.eventModules.filter(module => module.wsEvent === 'error'); - errorModules.forEach(module => module.run(this.client, param_1)); + errorModules.forEach(module => module.run(this.client, error)); break; } - // param_1 - message object case 'messageCreate': { const mCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'messageCreate'); - mCreateModules.forEach(module => module.run(this.client, param_1)); + mCreateModules.forEach(module => module.run(this.client, message)); break; } - // param_1 - guild object case 'guildCreate': { const gCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'guildCreate'); - gCreateModules.forEach(module => module.run(this.client, param_1)); + gCreateModules.forEach(module => module.run(this.client, guild)); break; } - // param_1 - guild object case 'guildDelete': { const gDeleteModules = this.client.eventModules.filter(module => module.wsEvent === 'guildDelete'); - gDeleteModules.forEach(module => module.run(this.client, param_1)); + gDeleteModules.forEach(module => module.run(this.client, guild)); break; } - // param_1 - guild object | param_2 - member object case 'guildMemberAdd': { const gMemberAddModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberAdd'); - gMemberAddModules.forEach(module => module.run(this.client, param_1, param_2)); + gMemberAddModules.forEach(module => module.run(this.client, guild, member)); break; } - // param_1 - guild object | param_2 - member object case 'guildMemberRemove': { const gMemberRemoveModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberRemove'); - gMemberRemoveModules.forEach(module => module.run(this.client, param_1, param_2)); + gMemberRemoveModules.forEach(module => module.run(this.client, guild, member)); break; } - // param_1 - old voice state | param_2 - new voice state case 'voiceStateUpdate': { const vStateUpdateModules = this.client.eventModules.filter(module => module.wsEvent === 'voiceStateUpdate'); - vStateUpdateModules.forEach(module => module.run(this.client)); + vStateUpdateModules.forEach(module => module.run(this.client, oVoiceState, nVoiceState)); break; } } From a8660cfb9613891ff4970322729178f80679eba1 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 14:58:21 +1100 Subject: [PATCH 11/65] all of this is useless ill fix it later --- bot/commands/Bot/about.js | 22 --- bot/commands/Bot/help.js | 95 ------------ bot/commands/Bot/ping.js | 27 ---- bot/commands/Configuration/autorole.js | 22 --- bot/commands/Configuration/blocklist.js | 119 --------------- bot/commands/Configuration/disable.js | 95 ------------ bot/commands/Configuration/enable.js | 22 --- bot/commands/Configuration/farewell.js | 22 --- bot/commands/Configuration/prefix.js | 22 --- bot/commands/Configuration/starboard.js | 22 --- bot/commands/Configuration/userprefix.js | 32 ---- bot/commands/Configuration/welcome.js | 22 --- bot/commands/Developer/eval.js | 39 ----- bot/commands/Developer/reload.js | 24 --- bot/commands/Developer/restart.js | 33 ----- bot/commands/Fun/colour.js | 46 ------ bot/commands/Fun/garfield.js | 39 ----- bot/commands/Fun/inspire.js | 31 ---- bot/commands/Moderation/kick.js | 22 --- bot/commands/Pokemon/ability.js | 85 ----------- bot/commands/Pokemon/effective.js | 140 ------------------ bot/commands/Pokemon/item.js | 82 ----------- bot/commands/Pokemon/move.js | 119 --------------- bot/commands/Pokemon/pokemon.js | 180 ----------------------- bot/commands/Splatoon/salmonrun.js | 74 ---------- bot/commands/Splatoon/splatnet.js | 50 ------- bot/commands/Splatoon/splatoonmaps.js | 56 ------- 27 files changed, 1542 deletions(-) delete mode 100644 bot/commands/Bot/about.js delete mode 100644 bot/commands/Bot/help.js delete mode 100644 bot/commands/Bot/ping.js delete mode 100644 bot/commands/Configuration/autorole.js delete mode 100644 bot/commands/Configuration/blocklist.js delete mode 100644 bot/commands/Configuration/disable.js delete mode 100644 bot/commands/Configuration/enable.js delete mode 100644 bot/commands/Configuration/farewell.js delete mode 100644 bot/commands/Configuration/prefix.js delete mode 100644 bot/commands/Configuration/starboard.js delete mode 100644 bot/commands/Configuration/userprefix.js delete mode 100644 bot/commands/Configuration/welcome.js delete mode 100644 bot/commands/Developer/eval.js delete mode 100644 bot/commands/Developer/reload.js delete mode 100644 bot/commands/Developer/restart.js delete mode 100644 bot/commands/Fun/colour.js delete mode 100644 bot/commands/Fun/garfield.js delete mode 100644 bot/commands/Fun/inspire.js delete mode 100644 bot/commands/Moderation/kick.js delete mode 100644 bot/commands/Pokemon/ability.js delete mode 100644 bot/commands/Pokemon/effective.js delete mode 100644 bot/commands/Pokemon/item.js delete mode 100644 bot/commands/Pokemon/move.js delete mode 100644 bot/commands/Pokemon/pokemon.js delete mode 100644 bot/commands/Splatoon/salmonrun.js delete mode 100644 bot/commands/Splatoon/splatnet.js delete mode 100644 bot/commands/Splatoon/splatoonmaps.js diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Bot/about.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Bot/help.js b/bot/commands/Bot/help.js deleted file mode 100644 index b1cbdab..0000000 --- a/bot/commands/Bot/help.js +++ /dev/null @@ -1,95 +0,0 @@ -const prettified = require ('../../assets/categories.json'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'meta :P', - arguments: '[command/category]', - details: 'details', - examples: 'examples' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - const commands = client.commands; - const categories = []; - - commands.forEach(cmd => { - if (!categories.includes(cmd.category)) { - if (cmd.category === 'Developer' && !client.config.ownerIDs.includes(message.author.id)) return; - categories.push(cmd.category); - } - }); - - if (!args[0]) { - const embed = new client.MessageEmbed(); - embed.setTitle('Help & Commands'); - embed.setColor(client.functions.embedColor(message.guild)); - embed.setDescription( - ` - » Use \`${message.prefix}help [category]\` to get basic information on all commands in the category. - » Use \`${message.prefix}help [command]\` to get full information on a specific command. - » [Click here](https://discord.gg/HCF8mdv) to join my Discord server if you need help, or just want to hang out! - » [Click here](https://discord.com/oauth2/authorize?client_id=${client.user.id}&permissions=2134240503&scope=bot) to invite me to your server! - \n**News:** - A massive update has just been released! Lots of commands and features have been added or redone and my code has been rewritten to use lots of cool new stuff. To view the full changelog, run \`changelog\` - ‏‏‎ ‎` - ); - categories.forEach(category => { - embed.addField(`${prettified[category].emoji} ${category}`, `*${prettified[category].description}*\n${client.commands.filter(cmd => cmd.category === category).length} commands`, true); - }); - embed.setFooter('<> = required, / = either/or, [] = optional'); - - return message.channel.send({ embeds: [embed] }); - } - - const cat = args[0].toProperCase(); - const cmd = args[0].toLowerCase(); - - if (categories.includes(cat)) { - let cmds = ''; - const filteredCmds = client.commands.filter(cmd => cmd.category === cat); - - filteredCmds.forEach(cmd => { - let params = ''; - if (cmd.help.arguments.length > 0) params = '`' + cmd.help.arguments + '`'; - cmds += `**${message.prefix + cmd.name}** ${params} ✦ ${cmd.help.description}\n`; - }); - - const embed = new client.MessageEmbed() - .setTitle(prettified[cat].emoji + ' ' + cat) - .setColor(client.functions.embedColor(message.guild)) - .setDescription(cmds) - .setFooter('<> = required, / = either/or, [] = optional'); - - return message.channel.send({ embeds: [embed] }); - } - - if (client.commands.has(cmd) || client.aliases.has(cmd)) { - const command = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd)); - const embed = new client.MessageEmbed() - .setTitle(prettified[command.category].emoji + ' ' + command.category + ' -> ' + command.name.toProperCase()) - .setColor(client.functions.embedColor(message.guild)) - .setDescription(command.help.description) - .addField('Format:', `\`${message.prefix + command.name} ${command.help.arguments}`.trim() + '`'); - if (command.help.details.length > 0) embed.addField('Parameters:', command.help.details); - if (command.help.examples.length > 0) embed.addField('Examples', command.help.examples); - if (command.aliases.length > 0) embed.addField('Aliases:', '`' + command.aliases.join('`, `') + '`'); - if (command.userPerms.length > 0) embed.addField('User permissions:', command.userPerms.join(', '), true); - if (command.botPerms.length > 0) embed.addField('Bot permissions:', command.botPerms.join(', '), true); - embed.addField('Cooldown:', `${command.cooldown / 1000} seconds`, true); - embed.setFooter('<> = required, / = either/or, [] = optional'); - return message.channel.send({ embeds: [embed] }); - } - - return message.channel.send(`${client.config.emojis.userError} ${cmd} doesn't appear to be a command, alias, or category. Are you sure you spelt it right?`); - } -}; \ No newline at end of file diff --git a/bot/commands/Bot/ping.js b/bot/commands/Bot/ping.js deleted file mode 100644 index f7bfd3a..0000000 --- a/bot/commands/Bot/ping.js +++ /dev/null @@ -1,27 +0,0 @@ -const replies = require('../../assets/replies.json'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Test response time between Woomy and Discord.', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - message.channel.send(replies.ping.random()) - .then(m => { - m.edit(`${m.content} \`roundtrip: ${m.timestamp - message.timestamp}ms | websocket: ${message.guild.shard.latency}ms\``); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/autorole.js b/bot/commands/Configuration/autorole.js deleted file mode 100644 index 5ec01d8..0000000 --- a/bot/commands/Configuration/autorole.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { - - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/blocklist.js b/bot/commands/Configuration/blocklist.js deleted file mode 100644 index adbfd4b..0000000 --- a/bot/commands/Configuration/blocklist.js +++ /dev/null @@ -1,119 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = ['administrator'], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Add, remove or list users on the blocklist for this server. User\'s on the blocklist cannot use my commands.', - arguments: ' ', - details: '', - examples: 'blocklist list\nblocklist add @Veemo\nblocklist remove emily' - }; - } - - async run (client, message, [action, ...user], data) { - if (!action || action.toLowerCase() === 'list') { - const list = []; - for (const userID of data.guild.blocklist) { - const user = await client.users.fetch(userID); - list.push(`${user.username}#${user.discriminator}`); - } - - if (list.length === 0) return message.channel.send('The server blocklist is currently empty. Use `blocklist add ` to add people to the blocklist!'); - - const embed = new client.MessageEmbed() - .setTitle('Users on blocklist: ' + data.guild.blocklist.length) - .setDescription('```' + list.join(', ') + '```') - .setColor(client.functions.embedColor(message.guild)); - - message.channel.send({ embeds: [embed] }); - - return; - } - - action = action.toLowerCase(); - - if (action !== 'add' & action !== 'remove') { - return message.channel.send(`${client.config.emojis.userError} You didn't specify a valid action. Usage: \`${this.help.usage}\``); - } - - if (!user) return message.channel.send( - `${client.config.emojis.userError} You didn't specify a user. Usage: \`${message.prefix + this.help.usage}\`` - ); - - let member; - - if (message.mentions.length > 0) { - member = await message.guild.members.fetch(message.mentions[0].id); - } else { - member = await client.functions.validateUserID(message.guild, user[0]); - - if (!member) { - member = await message.guild.searchMembers(user.join(' '), 2); - - if (member.length === 0) return message.channel.send( - `${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.` - ); - - if (member.length > 1) return message.channel.send( - `${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` - ); - - member = member[0]; - } - } - - const blocklist = data.guild.blocklist; - - if (action === 'add') { - if (member.id === message.guild.ownerId) return message.channel.send( - `${client.config.emojis.userError} You can't block the owner, silly!` - ); - - if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.guild.ownerID) { - return message.channel.send(`${client.config.emojis.userError} This user has a higher role than you, you can't add them to the blocklist!`); - } - - if (blocklist.includes(member.id)) return message.channel.send( - `${client.config.emojis.userError} This user is already on the blocklist, you can't add them twice!` - ); - - blocklist.push(member.id); - - client.db.updateGuild(message.guild.id, 'blocklist', blocklist).then(() => { - message.channel.send(`${client.config.emojis.success} Added \`${member.username}#${member.discriminator}\` to the blocklist.`); - }).catch(error => { - client.logger.error('GUILD_UPDATE_ERROR', error); - message.channel.send(`${client.config.emojis.botError} An error occured while adding this user to the blocklist, please try again! **Error:** ${error}`); - }) ; - - return; - } - - if (action === 'remove') { - if (client.functions.highestRole(member).position >= client.functions.highestRole(message.member).position && message.member.id !== message.guild.ownerId) { - return message.channel.send(`${client.config.emojis.userError} This user has a higher role than you, you can't remove them to the blocklist!`); - } - - if (!blocklist.includes(member.id)) return message.channel.send( - `${client.config.emojis.userError} This user isn't on the blocklist.` - ); - - blocklist.remove(member.id); - - client.db.updateGuild(message.guild.id, 'blocklist', blocklist).then(() => { - message.channel.send(`${client.config.emojis.success} Removed \`${member.username}#${member.discriminator}\` from the blocklist.`); - }).catch(error => { - client.logger.error('GUILD_UPDATE_ERROR', error); - message.channel.send(`${client.config.emojis.botError} An error occured while removing this user from the blocklist, please try again! **Error:** ${error}`); - }) ; - - return; - } - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/disable.js b/bot/commands/Configuration/disable.js deleted file mode 100644 index e619715..0000000 --- a/bot/commands/Configuration/disable.js +++ /dev/null @@ -1,95 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['disabled'], - this.userPerms = ['administrator'], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'description', - arguments: '[command/category]', - details: '`command/category` - choose whether to disable a command or a category.', - examples: 'examples' - }; - } - - async run (client, message, args, data) { - const essential = { - categories: ['Configuration', 'Developer'], - commands: ['help'] - }; - - if (!args[0] || args[0].toLowerCase() === 'list') { - return; - } - - if (!args[1]) return message.channel.send( - `${client.config.emojis.userError} You didn't specify what command/category to disable. Usage: \`${this.help.usage}\`` - ); - - if (args[0].toLowerCase() === 'command' || args[0].toLowerCase() === 'cmd') { - const disabled = data.guild.disabledcommands; - - let command; - - if (client.commands.has(args[1])) { - command = client.commands.get(args[1]); - } else if (client.aliases.has(args[1])) { - command = client.commands.get(client.aliases.get(args[1])); - } - - if (!command) return message.channel.send( - `${client.config.emojis.userError} ${args[1]} isn't a command or an alias, are you sure you spelt it correctly?` - ); - - if (essential.commands.includes(command.name) || essential.categories.includes(command.category)) { - return message.channel.send( - `${client.config.emojis.userError} This command is essential and cannot be disabled. Sorry!` - ); - } - - if (disabled.includes(command.name)) return message.channel.send( - `${client.config.emojis.userError} This command is already disabled.` - ); - - disabled.push(command.name); - - await client.db.updateGuild(message.guild.id, 'disabledcommands', disabled); - - return message.channel.send( - `${client.config.emojis.success} Added **${args[1]}** to the list of disabled commands for this server.` - ); - } - - if (args[0].toLowerCase() === 'category' || args[0].toLowerCase() === 'cat') { - const disabled = data.guild.disabledcommands; - - let command; - - if (client.commands.has(args[1])) { - command = client.commands.get(args[1]); - } else if (client.aliases.has(args[1])) { - command = client.commands.get(client.aliases.get(args[1])); - } - - if (!command) return message.channel.send( - `${client.config.emojis.userError} ${args[1]} isn't a category, are you sure you spelt it correctly?` - ); - - if (!disabled.includes(command.name)) return message.channel.send( - `${client.config.emojis.userError} This category isn't disabled.` - ); - - disabled.remove(command.name); - - await client.db.updateGuild(message.guild.id, 'disabledcommands', disabled); - - return message.channel.send( - `${client.config.emojis.success} Added **${args[1]}** to the list of disabled category for this server!` - ); - } - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/enable.js b/bot/commands/Configuration/enable.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Configuration/enable.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/farewell.js b/bot/commands/Configuration/farewell.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Configuration/farewell.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/prefix.js b/bot/commands/Configuration/prefix.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Configuration/prefix.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/starboard.js b/bot/commands/Configuration/starboard.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Configuration/starboard.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/userprefix.js b/bot/commands/Configuration/userprefix.js deleted file mode 100644 index 1e465f6..0000000 --- a/bot/commands/Configuration/userprefix.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 5000, - this.help = { - description: 'Sets your own personal prefix for woomy, that works across all the servers you\'re in!', - arguments: '[new prefix]', - details: '', - examples: 'userprefix w! - sets your personal prefix to woomy' - }; - } - - async run (client, message, args, data) { - if (!args[0]) { - return message.channel.send( - `Your prefix for Woomy is currently: \`${data.user.prefix}\`` - ); - } - - await client.db.updateUser(message.author.id, 'prefix', args[0]); - - message.channel.send( - `${client.config.emojis.success} Your personal prefix has been set to: \`${args[0]}\`` - ); - } -}; \ No newline at end of file diff --git a/bot/commands/Configuration/welcome.js b/bot/commands/Configuration/welcome.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Configuration/welcome.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Developer/eval.js b/bot/commands/Developer/eval.js deleted file mode 100644 index c1462fb..0000000 --- a/bot/commands/Developer/eval.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = true, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 0, - this.help = { - description: 'Evalutes and executes JavaScript code.', - arguments: '', - details: '', - examples: 'eval this.client.deleteCapitalism()' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - const code = args.join(' '); - try { - const evaled = eval(code); - const clean = await client.functions.clean(evaled); - const MAX_CHARS = 3 + 2 + clean.length + 3; - if (MAX_CHARS > 2000) { - return message.channel.send(undefined, { file: Buffer.from(clean), name: 'EVAL_SUCCESS.js' }); - } - message.channel.send(`\`\`\`js\n${clean}\n\`\`\``); - } catch (err) { - const e = await client.functions.clean(err); - const MAX_CHARS = 3 + 2 + e.length + 3; - if (MAX_CHARS > 2000) { - return message.channel.send(undefined, { file: Buffer.from(e), name: 'EVAL_ERROR.txt' }); - } - - message.channel.send(`\`\`\`xl\n${e}\n\`\`\``); - } - } -}; \ No newline at end of file diff --git a/bot/commands/Developer/reload.js b/bot/commands/Developer/reload.js deleted file mode 100644 index 2e73b0f..0000000 --- a/bot/commands/Developer/reload.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = true, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 0, - this.help = { - description: 'Reloads all commands and event modules.', - arguments: '', - details: '', - examples: '', - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - client.commandLoader.reloadCommands(); - client.eventLoader.reloadEventModules(); - message.channel.send('All commands and event modules have been reloaded!'); - } -}; \ No newline at end of file diff --git a/bot/commands/Developer/restart.js b/bot/commands/Developer/restart.js deleted file mode 100644 index 8b9bb8e..0000000 --- a/bot/commands/Developer/restart.js +++ /dev/null @@ -1,33 +0,0 @@ -const fetch = require('node-fetch'); -const exitQuotes = require('../../assets/exitQuotes.json'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = true, - this.aliases = ['reboot'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 0, - this.help = { - description: 'Restarts Woomy.', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - client.logger.success('RESTART', 'Restart command received. ' + exitQuotes.random()); - client.disconnect(); - client.functions.wait(); - - fetch('https://gamecp.apex.to/api/client/servers/1fc76afa-9a4d-497b-983a-a898795ab5b5/power', { - method: 'post', - body: JSON.stringify({ 'signal': 'restart' }), - headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${client.config.server}`, 'User-Agent': client.config.userAgent } - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Fun/colour.js b/bot/commands/Fun/colour.js deleted file mode 100644 index f67e129..0000000 --- a/bot/commands/Fun/colour.js +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['color'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Shows you colours that can be random, a hex code or generated from the words you type into the command.', - arguments: '[hexcode/text]', - details: '', - examples: '`colour` - generates a random colour\n`colour #ee79ff` - Displays the colour of this hexcode\n`colour alpaca` - Generates a colour from the word alpaca' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - let colour; - - if (!args[0]) { - colour = client.functions.randomColour(); - } else if (args[0].match(/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)) { - colour = args[0]; - } else { - let hash = 0; - const string = args.join(' '); - for (let i = 0; i < string.length; i++) { - hash = string.charCodeAt(i) + ((hash << 5) - hash); - } - colour = '#'; - for (let i = 0; i < 3; i++) { - const value = (hash >> (i * 8)) & 0xFF; - colour += ('00' + value.toString(16)).substr(-2); - } - } - - const embed = new client.MessageEmbed() - .setTitle(colour) - .setColor(colour) - .setImage(`https://fakeimg.pl/256x256/${colour.replace('#', '')}/?text=%20`); - - message.channel.send({ embeds: [embed] }); - } -}; \ No newline at end of file diff --git a/bot/commands/Fun/garfield.js b/bot/commands/Fun/garfield.js deleted file mode 100644 index 57fdf66..0000000 --- a/bot/commands/Fun/garfield.js +++ /dev/null @@ -1,39 +0,0 @@ -const fetch = require('node-fetch'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Sends you a strip from the best comic ever', - arguments: '[daily]', - details: '', - examples: '`garfield` - sends a random garfield comic strip\n`garfield daily` - sends the daily strip' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - let date = 'xxxx'; - if (args[0] && args[0].toLowerCase() === 'daily') date = new Date(); - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - fetch('`https://garfield-comics.glitch.me/`~SRoMG/?date=' + date, { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.json()) - .then(json => { - const embed = new client.MessageEmbed() - .setTitle(`${json.data.name} (No. ${json.data.number})`) - .setColor(client.functions.embedColor(message.guild)) - .setURL('https://www.mezzacotta.net/garfield/?comic=' + json.data.number) - .setImage(json.data.image.src); - editMessage.edit({ embeds: [embed] }); - }) - .catch(err => { - editMessage.edit(`${client.config.emojis.botError} An error has occurred: ${err}`); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Fun/inspire.js b/bot/commands/Fun/inspire.js deleted file mode 100644 index d2552d8..0000000 --- a/bot/commands/Fun/inspire.js +++ /dev/null @@ -1,31 +0,0 @@ -const fetch = require('node-fetch'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Generates a random (and likely terrible) inspirational quote.', - arguments: '', - details: '', - examples: null - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - try { - fetch('http://inspirobot.me/api?generate=true', { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.text()) - .then(body => editMessage.edit(body)); - } catch (err) { - editMessage.edit(`${client.config.emojis.botError} An error has occurred: ${err}`); - } - } -}; \ No newline at end of file diff --git a/bot/commands/Moderation/kick.js b/bot/commands/Moderation/kick.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/bot/commands/Moderation/kick.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/bot/commands/Pokemon/ability.js b/bot/commands/Pokemon/ability.js deleted file mode 100644 index 4cc6af9..0000000 --- a/bot/commands/Pokemon/ability.js +++ /dev/null @@ -1,85 +0,0 @@ -const fetch = require('node-fetch'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Get data on a Pokemon ability.', - arguments: '', - details: '', - examples: '`ability intimidate`\n`ability moxie`' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - if (!args[0]) return message.channel.send( - `${client.config.emojis.userError} You didn't give me an ability to look up!` - ); - - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - - const query = args.join(' ').toLowerCase(); - - fetch('https://graphqlpokemon.favware.tech/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'User-Agent': client.config.userAgent - }, - body: JSON.stringify({ query: ` - { - getAbilityDetailsByFuzzy(ability: "${query}") { - name - desc - shortDesc - bulbapediaPage - serebiiPage - smogonPage - isFieldAbility - } - } - `}) - }) - .then((res) => res.json()) - .then((json) => { - if (json.errors) { - json.errors.forEach(error => { - if (error.message.startsWith('Failed to get data for ability')) { - editMessage.edit( - `${client.config.emojis.userError} I couldn't find any abilities with names similar to ${query}. Check your spelling, maybe?` - ); - } else { - client.logger.error('POKEMON_API_ERROR', error.message); - } - }); - - return; - } - - const ability = json.data.getAbilityDetailsByFuzzy; - - let fieldEffects = ''; - if (ability.isFieldAbility) { - fieldEffects = ` Outside of battle, ${ability.isFieldAbility}`; - } - - const embed = new client.MessageEmbed() - .setColor(client.functions.embedColor(message.guild)) - .setTitle(ability.name.toProperCase()); - if (ability.desc) { - embed.setDescription(ability.desc + fieldEffects); - } else { - embed.setDescription(ability.shortDesc + fieldEffects); - } - embed.addField('External Resources:', `[Bulbapedia](${ability.bulbapediaPage}) • [Serebii](${ability.serebiiPage}) • [Smogon](${ability.smogonPage})`); - editMessage.edit({ content: null, embeds: [embed] }); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Pokemon/effective.js b/bot/commands/Pokemon/effective.js deleted file mode 100644 index b14ee4e..0000000 --- a/bot/commands/Pokemon/effective.js +++ /dev/null @@ -1,140 +0,0 @@ -const { typeArray, colours } = require('../../assets/pokemon.json'); -const fetch = require('node-fetch'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['type', 'typematchup'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 5000, - this.help = { - description: 'Get the strengths and weaknesses of a pokemon type/type combination', - arguments: ' [type2]', - details: 'The type2 argument is only needed if you are submitting two types, not a pokemon or singular type.', - examples: '`effective ghost dragon`\n`effective ribombee`' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - if (!args[0]) return message.channel.send( - `${client.config.emojis.userError} You didn't give me a pokemon or type combination to look up! Usage: \`${message.prefix + this.name + ' ' + this.help.arguments}\`` - ); - - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - - let types; - - if (!typeArray.includes(args[0].toProperCase())) { - const res = await fetch('https://graphqlpokemon.favware.tech/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'User-Agent': client.config.userAgent - }, - body: JSON.stringify({ query: ` - { - getPokemonDetailsByFuzzy(pokemon: "${args.join(' ').toLowerCase()}") { - types - } - } - `}) - }); - const json = await res.json(); - if (json.errors) { - json.errors.forEach(error => { - if (error.message.startsWith('No Pokémon found')) { - message.channel.send( - `${client.config.emojis.userError} I couldn't find any Pokemon with names similar to ${args.join(' ').toLowerCase()}. Check your spelling, maybe?` - ); - } else { - client.logger.error('MATCHUP_API_ERROR', error.message); - } - }); - - return; - } - types = json.data.getPokemonDetailsByFuzzy.types.map(type => type.toLowerCase()); - } else { - types = args.map(type => type.toLowerCase()); - } - - fetch('https://graphqlpokemon.favware.tech/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ query: ` - { - getTypeMatchup(types: [${types.join(', ')}]) { - attacking { doubleEffectiveTypes effectiveTypes normalTypes resistedTypes doubleResistedTypes effectlessTypes } - defending { doubleEffectiveTypes effectiveTypes normalTypes resistedTypes doubleResistedTypes effectlessTypes } - } - } - `}) - }) - .then(res => res.json()) - .then(json => { - if (json.errors) { - json.errors.forEach(error => { - if (error.message.includes('does not exist in "Types')) { - message.channel.send( - `${client.config.emojis.userError} One or more of the types you gave me are invalid. Check your spelling, maybe?` - ); - } else { - client.logger.error('MATCHUP_FETCH_ERROR', error.message); - } - }); - return; - } - - const typeMatchup = json.data.getTypeMatchup; - - let effectless = ''; - if (typeMatchup.attacking.effectlessTypes.length > 0) effectless = ` - **Doesn't effect:** - ${typeMatchup.attacking.effectlessTypes.map(type => `\`${type.toProperCase()}\``).join(' ')} - `; - - let immune = ''; - if (typeMatchup.defending.effectlessTypes.length > 0) immune = ` - **Immunities:** - ${typeMatchup.defending.effectlessTypes.map(type => `\`${type.toProperCase()}\``).join(' ')} - `; - - const embed = new client.MessageEmbed() - .setColor(colours[types[0].toProperCase()]) - .setTitle('Type effectiveness of ' + types.map(type => type.toProperCase()).join(' and ')) - .addField('Offensive:', ` - **Super-effective:** - ${this.parseEffectiveTypes(typeMatchup.attacking.effectiveTypes, typeMatchup.attacking.doubleEffectiveTypes)} - **Not very effective:** - ${this.parseResistedTypes(typeMatchup.attacking.resistedTypes, typeMatchup.attacking.doubleResistedTypes)}${effectless} - `) - .addField('Defensive:', ` - **Weaknesses:** - ${this.parseEffectiveTypes(typeMatchup.defending.effectiveTypes, typeMatchup.defending.doubleEffectiveTypes)} - **Resistances:** - ${this.parseResistedTypes(typeMatchup.defending.resistedTypes, typeMatchup.defending.doubleResistedTypes)}${immune} - `); - editMessage.edit({ content: null, embeds: [embed] }); - }); - } - - parseEffectiveTypes (effective, doubleEffective) { - return doubleEffective - .map(type => `\`${type.toProperCase()} (x4)\``) - .concat(effective.map(type => `\`${type.toProperCase()} (x2)\``)) - .join(' '); - } - - parseResistedTypes (resisted, doubleResisted) { - return doubleResisted - .map(type => `\`${type.toProperCase()} (x0.25)\``) - .concat(resisted.map(type => `\`${type.toProperCase()} (x0.5)\``)) - .join(' '); - } -}; \ No newline at end of file diff --git a/bot/commands/Pokemon/item.js b/bot/commands/Pokemon/item.js deleted file mode 100644 index da347ce..0000000 --- a/bot/commands/Pokemon/item.js +++ /dev/null @@ -1,82 +0,0 @@ -const fetch = require('node-fetch'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Gets information on a held item.', - arguments: '', - details: '', - examples: 'item life orb\nitem griseous orb' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - if (!args[0]) return message.channel.send( - `${client.config.emojis.userError} You didn't give me an item to look up!` - ); - - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - - const query = args.join(' ').toLowerCase(); - - fetch('https://graphqlpokemon.favware.tech/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'User-Agent': client.config.userAgent - }, - body: JSON.stringify({ query: ` - { - getItemDetailsByFuzzy(item: "${query}") { - name - desc - shortDesc - sprite - generationIntroduced - bulbapediaPage - serebiiPage - smogonPage - } - } - `}) - }) - .then((res) => res.json()) - .then((json) => { - if (json.errors) { - json.errors.forEach(error => { - if (error.message.startsWith('Failed to get data for item')) { - message.channel.send( - `${client.config.emojis.userError} I couldn't find any items with names similar to ${query}. Check your spelling, maybe?` - ); - } else { - client.logger.error('POKEMON_API_ERROR', error.message); - } - }); - - return; - } - - const item = json.data.getItemDetailsByFuzzy; - - const embed = new client.MessageEmbed() - .setColor(client.functions.embedColor(message.guild)) - .setTitle(item.name) - .setThumbnail(item.sprite) - .addField('External Resources:', `[Bulbapedia](${item.bulbapediaPage}) • [Serebii](${item.serebiiPage}) • [Smogon](${item.smogonPage})`); - if (item.desc) { - embed.setDescription(`${item.desc} Added in Generation ${item.generationIntroduced}.`); - } else { - embed.setDescription(`${item.shortDesc} Added in Generation ${item.generationIntroduced}.`); - } - editMessage.edit({ content: null, embeds: [embed] }); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Pokemon/move.js b/bot/commands/Pokemon/move.js deleted file mode 100644 index 62dc56f..0000000 --- a/bot/commands/Pokemon/move.js +++ /dev/null @@ -1,119 +0,0 @@ -const fetch = require('node-fetch'); -const { colours } = require('../../assets/pokemon.json'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Gets information on a pokemon move.', - arguments: '', - details: '', - examples: `${this.name} roar of time\n${this.name} shadow ball` - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - if (!args[0]) return message.channel.send( - `${client.config.emojis.userError} You didn't give me a pokemon move to look up!` - ); - - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - - const query = args.join(' ').toLowerCase(); - - fetch('https://graphqlpokemon.favware.tech/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'User-Agent': client.config.userAgent - }, - body: JSON.stringify({ query: ` - { - getMoveDetailsByFuzzy(move: "${query}") { - name - desc - shortDesc - type - basePower - zMovePower - maxMovePower - pp - category - accuracy - priority - target - isZ - isGMax - contestType - bulbapediaPage - serebiiPage - smogonPage - isFieldMove - } - } - `}) - }) - .then((res) => res.json()) - .then((json) => { - if (json.errors) { - json.errors.forEach(error => { - if (error.message.startsWith('Failed to get data for move')) { - message.channel.send( - `${client.config.emojis.userError} I couldn't find any moves with names similar to ${query}. Check your spelling, maybe?` - ); - } else { - client.logger.error('POKEMON_API_ERROR', error.message); - } - }); - - return; - } - - const move = json.data.getMoveDetailsByFuzzy; - - let suffix = ''; - - if (move.isZ) { - suffix = ' (Z-Move)'; - } else if (!move.maxMovePower && move.basePower > 0) { - suffix = ' (Max Move)'; - } else if (move.isGMax) { - suffix = ' (G-Max Move)'; - } - - let fieldEffects = ''; - if (move.isFieldMove) fieldEffects = ' Outside of battle, ' + move.isFieldMove; - - const embed = new client.MessageEmbed() - .setColor(colours[move.type]) - .setTitle(move.name.toProperCase() + suffix); - if (move.desc) { - embed.setDescription(move.desc + fieldEffects); - } else { - embed.setDescription(move.shortDesc + fieldEffects); - } - - embed.addField('Type:', move.type, true); - embed.addField('Category:', move.category, true); - embed.addField('Target:', move.target, true); - if (!move.isZ || move.maxMovePower) embed.addField('Base Power:', move.basePower.toString(), true); - if (!move.isZ || move.maxMovePower) embed.addField('Z Power:', move.zMovePower.toString(), true); - if (move.maxMovePower) embed.addField('Max Power:', move.maxMovePower.toString(), true); - if (!move.isZ) embed.addField('Base PP:', move.pp.toString(), true); - embed.addField('Accuracy:', move.accuracy.toString(), true); - embed.addField('Priority:', move.priority.toString(), true); - if (move.isZ) embed.addField('Z-Crystal:', move.isZ, true); - if (move.isGMax) embed.addField('G-Max Pokemon:', move.isGMax, true); - if (move.contestType !== null) embed.addField('Contest Type', move.contestType, true); - embed.addField('External Resources:', `[Bulbapedia](${move.bulbapediaPage}) • [Serebii](${move.serebiiPage}) • [Smogon](${move.smogonPage})`); - editMessage.edit({ content: null, embeds: [embed] }); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Pokemon/pokemon.js b/bot/commands/Pokemon/pokemon.js deleted file mode 100644 index d890ea9..0000000 --- a/bot/commands/Pokemon/pokemon.js +++ /dev/null @@ -1,180 +0,0 @@ -const { colours } = require('../../assets/pokemon.json'); -const fetch = require('node-fetch'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['pokedex', 'dex'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 5000, - this.help = { - description: 'Get useful data on any pokemon you ask me to!', - arguments: '', - details: '', - examples: '`pokemon mudkip`\n`pokemon alolan ninetales`' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - if (!args[0]) return message.channel.send( - `${client.config.emojis.userError} You didn't give me a pokemon to look up!` - ); - - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - - const query = args.join(' ').toLowerCase(); - - fetch('https://graphqlpokemon.favware.tech/', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'User-Agent': client.config.userAgent - }, - body: JSON.stringify({ query: ` - { - getPokemonDetailsByFuzzy(pokemon: "${query}" reverse: true) { - num - species - types - abilities { first second hidden special } - baseStats { hp attack defense specialattack specialdefense speed } - eggGroups - evolutionLevel - evolutions { species evolutionLevel evolutions { species evolutionLevel } } - preevolutions { species evolutionLevel preevolutions { species evolutionLevel } } - gender { male female } - height - weight - otherFormes - cosmeticFormes - baseStatsTotal - flavorTexts { game flavor } - sprite - shinySprite - smogonTier - bulbapediaPage - serebiiPage - smogonPage - } - } - `}) - }) - .then((res) => res.json()) - .then((json) => { - if (json.errors) { - json.errors.forEach(error => { - if (error.message.startsWith('No Pokémon found')) { - message.channel.send( - `${client.config.emojis.userError} I couldn't find any Pokemon with names similar to ${query}. Check your spelling, maybe?` - ); - } else { - client.logger.error('POKEMON_API_ERROR', error.message); - } - }); - - return; - } - - const pokemon = json.data.getPokemonDetailsByFuzzy; - const evoChain = this.parseEvoChain(pokemon); - const genderRatio = this.parseGenderRatio(pokemon.gender); - const abilities = this.parseAbilities(pokemon.abilities); - let sprite = pokemon.sprite; - if (Math.floor((Math.random() * 100) + 1) === 69) sprite = pokemon.shinySprite; - let formes; - if (pokemon.otherFormes) { - formes = pokemon.otherFormes.join(', '); - if (pokemon.cosmeticFormes) { - formes = formes.split().concat(pokemon.cosmeticFormes); - } - } - const embed = new client.MessageEmbed() - .setColor(colours[pokemon.types[0]]) - .setTitle(`${pokemon.species.toProperCase()} (No. ${pokemon.num})`) - .setDescription(pokemon.flavorTexts[0].flavor) - .setThumbnail(sprite) - .addField('Types:', pokemon.types.join(', '), true) - .addField('Abilities:', abilities.join(', '), true) - .addField('Gender Ratio:', genderRatio, true) - .addField('Base Stats:', `HP: ${pokemon.baseStats.hp} Atk: ${pokemon.baseStats.attack} Def: ${pokemon.baseStats.defense} SpA: ${pokemon.baseStats.specialattack} SpD: ${pokemon.baseStats.specialdefense} Spe: ${pokemon.baseStats.speed} BST: ${pokemon.baseStatsTotal}`); - if (evoChain) embed.addField('Evolution Chain:', evoChain); - if (formes) embed.addField('Other Formes:', formes); - embed.addField('Height:', `${pokemon.height}m`, true); - embed.addField('Weight:', `${pokemon.weight}kg`, true); - embed.addField('Egg Groups:', pokemon.eggGroups.join(', '), true); - embed.addField('Smogon Tier:', pokemon.smogonTier, true); - embed.addField('External Resources:', `[Bulbapedia](${pokemon.bulbapediaPage}) • [Serebii](${pokemon.serebiiPage}) • [Smogon](${pokemon.smogonPage})`); - editMessage.edit({ content: null, embeds: [embed] }); - }); - } - - constructEvoLink (species, level, evoChain, isEvo = true) { - if (isEvo) { - return `${evoChain} → \`${species.toProperCase()}\` ${level ? `(${level})` : ''}`; - } - return `\`${species.toProperCase()}\` ${level ? `(${level})` : ''} → ${evoChain}`; - } - - parseEvoChain (pokeDetails) { - // Set evochain if there are no evolutions - let evoChain = `**${pokeDetails.species.toProperCase()} ${pokeDetails.evolutionLevel ? `(${pokeDetails.evolutionLevel})` : ''}**`; - if (!pokeDetails.evolutions && !pokeDetails.preevolutions) { - evoChain = null; - } - - // Parse pre-evolutions and add to evochain - if (pokeDetails.preevolutions) { - const { evolutionLevel } = pokeDetails.preevolutions[0]; - evoChain = this.constructEvoLink(pokeDetails.preevolutions[0].species, evolutionLevel, evoChain, false); - - // If the direct pre-evolution has another pre-evolution (charizard -> charmeleon -> charmander) - if (pokeDetails.preevolutions[0].preevolutions) { - evoChain = this.constructEvoLink(pokeDetails.preevolutions[0].preevolutions[0].species, null, evoChain, false); - } - } - - // Parse evolution chain and add to evochain - if (pokeDetails.evolutions) { - evoChain = this.constructEvoLink(pokeDetails.evolutions[0].species, pokeDetails.evolutions[0].evolutionLevel, evoChain); - - // In case there are multiple evolutionary paths - const otherFormeEvos = pokeDetails.evolutions.slice(1); - if (otherFormeEvos) { - evoChain = `${evoChain}, ${otherFormeEvos.map((oevo) => `\`${oevo.species}\` (${oevo.evolutionLevel})`).join(', ')}`; - } - - // If the direct evolution has another evolution (charmander -> charmeleon -> charizard) - if (pokeDetails.evolutions[0].evolutions) { - evoChain = this.constructEvoLink( - pokeDetails.evolutions[0].evolutions[0].species, - pokeDetails.evolutions[0].evolutions[0].evolutionLevel, - evoChain - ); - } - } - - return evoChain; - } - - parseGenderRatio (genderRatio) { - if (genderRatio.male === '0%' && genderRatio.female === '0%') { - return 'Genderless'; - } - - return `${genderRatio.male} ♂ | ${genderRatio.female} ♀`; - } - - parseAbilities (abilitiesData) { - const abilities = []; - for (const [type, ability] of Object.entries(abilitiesData)) { - if (!ability) continue; - abilities.push(type === 'hidden' ? `*${ability}*` : ability); - } - - return abilities; - } -}; \ No newline at end of file diff --git a/bot/commands/Splatoon/salmonrun.js b/bot/commands/Splatoon/salmonrun.js deleted file mode 100644 index 9c9331f..0000000 --- a/bot/commands/Splatoon/salmonrun.js +++ /dev/null @@ -1,74 +0,0 @@ -const fetch = require('node-fetch'); -const prettifyMiliseconds = require('pretty-ms'); -const { createPaginationEmbed } = require('eris-pagination'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 30000, - this.help = { - description: 'Get current map, weapons and gear for salmon run.', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - message.channel.sendTyping(); - fetch('https://splatoon2.ink/data/coop-schedules.json', { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.json()) - .then(json => { - fetch('https://splatoon2.ink/data/timeline.json', { headers: { 'User-Agent': client.config.userAgent }}) - .then(timelineRes => timelineRes.json()) - .then(timelineJson => { - - const embeds = []; - - if ((json.details[0].start_time * 1000) > Date.now() === true) { - embeds.push( - new client.MessageEmbed() - .setTitle('Upcoming Salmon Run') - .setColor(client.functions.embedColor(message.guild)) - .setImage('https://splatoon2.ink/assets/splatnet/'+json.details[0].stage.image) - .addField('Map', json.details[0].stage.name, true) - .setFooter(`Starting in ${prettifyMiliseconds(json.details[0].start_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`) - ); - } else { - embeds.push( - new client.MessageEmbed() - .setTitle('Current Salmon Run') - .setColor(client.functions.embedColor(message.guild)) - .setThumbnail('https://splatoon2.ink/assets/splatnet'+timelineJson.coop.reward_gear.gear.image) - .setImage('https://splatoon2.ink/assets/splatnet/'+json.details[0].stage.image) - .addField('Map', json.details[0].stage.name, true) - .addField('Reward Gear', timelineJson.coop.reward_gear.gear.name, true) - .addField('Weapons', json.details[0].weapons[0].weapon.name+', '+json.details[0].weapons[1].weapon.name+', '+json.details[0].weapons[2].weapon.name+', '+json.details[0].weapons[3].weapon.name) - .setFooter(`Ending in ${prettifyMiliseconds((json.details[0].end_time * 1000) - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`) - ); - } - - embeds.push( - new client.MessageEmbed() - .setTitle('Upcoming Salmon Run') - .setColor(client.functions.embedColor(message.guild)) - .setImage('https://splatoon2.ink/assets/splatnet/'+json.details[1].stage.image) - .addField('Map', json.details[1].stage.name, true) - .addField('Weapons', json.details[1].weapons[1].weapon.name+', '+json.details[1].weapons[1].weapon.name+', '+json.details[1].weapons[2].weapon.name+', '+json.details[1].weapons[3].weapon.name) - .setFooter(`Starting in ${prettifyMiliseconds(json.details[1].start_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`) - ); - - createPaginationEmbed(message, embeds); - }); - }) - .catch(err => { - message.channel.send(`${client.config.emojis.botError} An error has occurred: ${err}`); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Splatoon/splatnet.js b/bot/commands/Splatoon/splatnet.js deleted file mode 100644 index ea35b0d..0000000 --- a/bot/commands/Splatoon/splatnet.js +++ /dev/null @@ -1,50 +0,0 @@ -const fetch = require('node-fetch'); -const prettifyMiliseconds = require('pretty-ms'); -const { createPaginationEmbed } = require('eris-pagination'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 30000, - this.help = { - description: 'See what is currently on offer in the splatnet shop', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - message.channel.sendTyping(); - fetch('https://splatoon2.ink//data/merchandises.json', { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.json()) - .then(json => { - const embeds = []; - - for ( let i = 0; i < json.merchandises.length; i++ ) { - const embed = new client.MessageEmbed() - .setTitle(json.merchandises[i].gear.name) - .setThumbnail('https://splatoon2.ink/assets/splatnet' + json.merchandises[i].gear.image) - .setColor(client.functions.embedColor(message.guild)) - .addField('Price', (json.merchandises[i].price).toString(), true) - .addField('Brand', json.merchandises[i].gear.brand.name, true) - .addField('Ability Slots', (json.merchandises[i].gear.rarity + 1).toString(), true) - .addField('Main Ability', json.merchandises[i].skill.name, true) - .addField('Common Ability', json.merchandises[i].gear.brand.frequent_skill.name, true) - .setFooter('Out of stock in ' + prettifyMiliseconds(json.merchandises[i].end_time * 1000 - Date.now()) + ' | Data provided by splatoon2.ink'); - embeds.push(embed); - } - - createPaginationEmbed(message, embeds); - }) - .catch(err => { - message.channel.send(`${client.config.emojis.botError} An error has occurred: ${err}`); - }); - } -}; \ No newline at end of file diff --git a/bot/commands/Splatoon/splatoonmaps.js b/bot/commands/Splatoon/splatoonmaps.js deleted file mode 100644 index 62c54ee..0000000 --- a/bot/commands/Splatoon/splatoonmaps.js +++ /dev/null @@ -1,56 +0,0 @@ -const fetch = require('node-fetch'); -const prettifyMiliseconds = require('pretty-ms'); -const { createPaginationEmbed } = require('eris-pagination'); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['splatoonmodes'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 30000, - this.help = { - description: 'Get current and upcoming maps and modes for regular, ranked and league battles.', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - message.channel.sendTyping(); - fetch('https://splatoon2.ink/data/schedules.json', { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.json()) - .then(json => { - - const embeds = [ - new client.MessageEmbed() - .setTitle('Current Splatoon 2 Maps') - .setColor(client.functions.embedColor(message.guild)) - .addField('<:turf_war:814651383911153692> Turf War', `${json.regular[0].stage_a.name}\n${json.regular[0].stage_b.name}`, true) - .addField(`<:ranked:814651402479468544> Ranked: ${json.gachi[0].rule.name}`, `${json.gachi[0].stage_a.name}\n${json.gachi[0].stage_b.name}`, true) - .addField(`<:league:814651415409590363> League: ${json.league[0].rule.name}`, `${json.league[0].stage_a.name}\n${json.league[0].stage_b.name}`, true) - .setFooter(`Maps changing in ${prettifyMiliseconds(json.league[0].end_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`) - ]; - - for ( let i = 1; i < json.regular.length; i++ ) { - const embed = new client.MessageEmbed() - .setTitle('Upcoming Splatoon 2 Maps') - .setColor(client.functions.embedColor(message.guild)) - .addField('<:turf_war:814651383911153692> Turf War', `${json.regular[i].stage_a.name}\n${json.regular[i].stage_b.name}`, true) - .addField(`<:ranked:814651402479468544> Ranked: ${json.gachi[i].rule.name}`, `${json.gachi[i].stage_a.name}\n${json.gachi[i].stage_b.name}`, true) - .addField(`<:league:814651415409590363> League: ${json.league[i].rule.name}`, `${json.league[i].stage_a.name}\n${json.league[i].stage_b.name}`, true) - .setFooter(`Available in ${prettifyMiliseconds(json.league[i].start_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`); - embeds.push(embed); - } - - createPaginationEmbed(message, embeds); - }) - .catch(err => { - message.channel.send(`${client.config.emojis.botError} An error has occurred: ${err}`); - }); - } -}; \ No newline at end of file From 03692a6f7b3d85fbb27eb4893ec53a26f07c2d01 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 23:18:00 +1100 Subject: [PATCH 12/65] added bot id to config (deployment stuff) --- botconfig.json.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/botconfig.json.example b/botconfig.json.example index 1fb7e72..96a9682 100644 --- a/botconfig.json.example +++ b/botconfig.json.example @@ -5,7 +5,9 @@ "userAgent": "", - "ownerIDs": [""], + "devIds": [""], + + "clientId": "", "keys": { "sentry": "", From 7683e56bb6b11e009c5712af8cf515e66c36ffa6 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 10 Dec 2022 23:18:14 +1100 Subject: [PATCH 13/65] move schemas --- {templates/schemas => schemas}/guilds.sql | 0 {templates/schemas => schemas}/members.sql | 0 {templates/schemas => schemas}/users.sql | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {templates/schemas => schemas}/guilds.sql (100%) rename {templates/schemas => schemas}/members.sql (100%) rename {templates/schemas => schemas}/users.sql (100%) diff --git a/templates/schemas/guilds.sql b/schemas/guilds.sql similarity index 100% rename from templates/schemas/guilds.sql rename to schemas/guilds.sql diff --git a/templates/schemas/members.sql b/schemas/members.sql similarity index 100% rename from templates/schemas/members.sql rename to schemas/members.sql diff --git a/templates/schemas/users.sql b/schemas/users.sql similarity index 100% rename from templates/schemas/users.sql rename to schemas/users.sql From 1102f0f4e5ae8557543bc6967d6f73a13dc4b973 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:22:11 +1100 Subject: [PATCH 14/65] register commands with api --- bot/deploy.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bot/deploy.js diff --git a/bot/deploy.js b/bot/deploy.js new file mode 100644 index 0000000..6407f6b --- /dev/null +++ b/bot/deploy.js @@ -0,0 +1,36 @@ +// taken from https://discordjs.guide/ + +const { REST, Routes } = require('discord.js'); +const { clientId, token } = require('../botconfig.json'); +const guildId = "413591792185769984"; +const read = require('fs-readdir-recursive'); +const commands = []; +const commandFiles = read('./commands').filter(file => file.endsWith('.js')); + +for (const file of commandFiles) { + const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/'))); + commands.push({ + name: command.name, + description: command.description, + options: command.options, + permissions: command.permissions, + dm_permission: command.dm_permission + }); +} + +const rest = new REST({ version: '10' }).setToken(token); + +(async () => { + try { + console.log(`Started refreshing ${commands.length} application (/) commands.`); + + const data = await rest.put( + Routes.applicationGuildCommands(clientId, guildId), + { body: commands }, + ); + + console.log(`Successfully reloaded ${data.length} application (/) commands.`); + } catch (error) { + console.error(error); + } +})(); From a4618d9e6374fec4db0bc0af6039eabac77abd03 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:23:28 +1100 Subject: [PATCH 15/65] remove messageCreate events --- .../messageCreate/messageHandler.js | 121 ------------------ bot/index.js | 9 -- 2 files changed, 130 deletions(-) delete mode 100644 bot/event_modules/messageCreate/messageHandler.js diff --git a/bot/event_modules/messageCreate/messageHandler.js b/bot/event_modules/messageCreate/messageHandler.js deleted file mode 100644 index 29da3c1..0000000 --- a/bot/event_modules/messageCreate/messageHandler.js +++ /dev/null @@ -1,121 +0,0 @@ -class MessageHandler { - constructor (client) { - this.client = client; - } - - async handle (message) { - // Ignore messages from bots, and messages in DM's - if (message.author.bot) return; - if (!message.guild) return; - - // Request all the data we need from the database - const data = {}; - data.user = await this.client.db.getUser(message.author.id); - data.guild = await this.client.db.getGuild(message.guild.id); - data.member = await this.client.db.getMember(message.guild.id, message.author.id); - - // Ignore users on the guild blocklist - if (data.guild.blocklist.includes(message.author.id)) return; - - // If a user pings Woomy, respond to them with the prefixes they can use - if (message.content === `<@${this.client.user.id}>` || message.content === `<@!${this.client.user.id}>`) { - return message.channel.send( - `Hi! The prefix for this server is \`${data.guild.prefix}\`, and your personal prefix is \`${data.user.prefix}\`. You can also ping me ^-^` - ); - } - - // All the prefixes Woomy will respond to - const prefixes = [ - data.user.prefix, - data.guild.prefix, - `<@${this.client.user.id}> `, - `<@!${this.client.user.id}> ` - ]; - - let prefix; - - // Check the message content to see if it starts with one of our prefixes - for (const thisPrefix of prefixes) { - if (message.content.startsWith(thisPrefix)) { - prefix = thisPrefix; - break; - } - } - - // Ignore the message if it doesn't start with a valid prefix - if (!prefix) return; - - // Save prefix so we can use it later (mostly for help command) - if (prefix === `<@${this.client.user.id}> ` || prefix === `<@!${this.client.user.id}> `) { - message.prefix = '@Woomy '; - } else (message.prefix = prefix); - - // Turn the message content into an array (excluding the prefix) - const args = message.content.slice(prefix.length).trim().split(/ +/g); - - // Find the command - const commandName = args.shift().toLowerCase(); - const command = this.client.commands.get(commandName) || this.client.commands.get(this.client.aliases.get(commandName)); - - // Return if a command (or its aliases) are not found - if (!command) return; - - // Both of these blocks check if the command is disabled/in a disabled category - if (data.guild.disabledcommands.includes(command.name)) return message.channel.send( - this.client.config.emojis.permError + ' This command has been disabled by a server administrator.' - ); - - if (data.guild.disabledcategories.includes(command.category)) return message.channel.send( - this.client.config.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' - ); - - // Both of these blocks check the permissions of the user, and reply with missing perms if any are found - const missingUserPerms = this.client.functions.checkPermissions(message.channel, message.author.id, command.userPerms); - if (missingUserPerms) return message.channel.send( - `${this.client.config.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` - ); - - const missingBotPerms = this.client.functions.checkPermissions(message.channel, this.client.user.id, command.botPerms); - if (missingBotPerms) return message.channel.send( - `${this.client.config.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` - ); - - // Return if the command is disabled globally - if (command.enabled === false) return message.channel.send( - this.client.config.emojis.permError + ' This command has been disabled by my developers.' - ); - - // Return if the command is restricted to developers (and the user is not a developer) - if (command.devOnly === true && this.client.config.ownerIDs.includes(message.author.id) !== true) { - return message.channel.send( - `${this.client.config.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` - ); - } - - // Cooldown - if (this.client.cooldowns.get(command.name).has(message.author.id)) { - const timestamp = this.client.cooldowns.get(command.name).get(message.author.id); - const currentTime = Date.now(); - const cooldown = command.cooldown / 1000; - const timePassed = Math.floor((currentTime - timestamp) / 1000); - return message.channel.send( - `${this.client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` - ); - } else { - this.client.cooldowns.get(command.name).set(message.author.id, new Date()); - setTimeout(() => { - this.client.cooldowns.get(command.name).delete(message.author.id); - }, this.client.commands.get(command.name).cooldown); - } - - try { - command.run(this.client, message, args, data); - this.client.logger.command(`Ran ${command.name}`); - } catch (error) { - this.client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); - message.channel.send(`${this.client.config.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); - } - } -} - -module.exports = MessageHandler; \ No newline at end of file diff --git a/bot/index.js b/bot/index.js index a1c0286..1fe4bb4 100644 --- a/bot/index.js +++ b/bot/index.js @@ -42,7 +42,6 @@ class WoomyClient extends Discord.Client { this.on('ready', this.runReadyModules); this.on('error', this.runErrorModules); this.on('interactionCreate', this.runInteractionCreateModules); - this.on('messageCreate', this.runMessageCreateModules); this.on('guildCreate', this.runGuildCreateModules); this.on('guildDelete', this.runGuildDeleteModules); this.on('guildMemberAdd', this.runGuildMemberAddModules); @@ -72,11 +71,6 @@ class WoomyClient extends Discord.Client { this.mainEventListener('interactionCreate', interaction); } - runMessageCreateModules (message) { - this.messageHandler.handle(message); - this.mainEventListener('messageCreate', message); - } - runGuildCreateModules (guild) { this.mainEventListener('guildCreate', guild); } @@ -101,9 +95,6 @@ class WoomyClient extends Discord.Client { // Initialize our client const client = new WoomyClient({ shards: 'auto', - partials: [ - Discord.Partials.Reaction - ], intents: [ Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers, From a2fe5d4dca25946b72322bc5683dc9a5c4c0d0ba Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:36:50 +1100 Subject: [PATCH 16/65] prevent avatar from loading for now --- bot/commands/Utility/{avatar.js => avatar.js.du} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bot/commands/Utility/{avatar.js => avatar.js.du} (100%) diff --git a/bot/commands/Utility/avatar.js b/bot/commands/Utility/avatar.js.du similarity index 100% rename from bot/commands/Utility/avatar.js rename to bot/commands/Utility/avatar.js.du From 7038dc1c6f6d58f575a6d3b9cd0b1cba4bcc1db6 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:37:30 +1100 Subject: [PATCH 17/65] remove legacy commands --- bot/commands/Utility/serverinfo.js | 34 ------------ bot/commands/Utility/userinfo.js | 78 --------------------------- bot/commands/Utility/weather.js | 85 ------------------------------ 3 files changed, 197 deletions(-) delete mode 100644 bot/commands/Utility/serverinfo.js delete mode 100644 bot/commands/Utility/userinfo.js delete mode 100644 bot/commands/Utility/weather.js diff --git a/bot/commands/Utility/serverinfo.js b/bot/commands/Utility/serverinfo.js deleted file mode 100644 index 17dac6d..0000000 --- a/bot/commands/Utility/serverinfo.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - const guild = message.guild; - - const embed = new client.MessageEmbed() - .setColor(client.functions.embedColor(message.guild)) - .setTitle(guild.name) - .setThumbnail(guild.iconURL) - .addField('ID', guild.id, true) - .addField('Owner', `<@${guild.ownerId}>`, true) - .addField('Region', guild.region.toProperCase(), true) - .addField('Boosts', `${guild.premiumSubscriptionCount} (Level ${guild.premiumTier})`, true) - .addField('Member Count (Approximate)', `${guild.memberCount} (${guild.memberCount - guild.members.filter(member => member.user.bot).length} humans, ${guild.members.filter(member => member.user.bot).length} bots)`, true) - .addField('Channels', `${guild.channels.size} ()`) - message.channel.send({ embeds: [embed] }); - } -}; \ No newline at end of file diff --git a/bot/commands/Utility/userinfo.js b/bot/commands/Utility/userinfo.js deleted file mode 100644 index 69ca67d..0000000 --- a/bot/commands/Utility/userinfo.js +++ /dev/null @@ -1,78 +0,0 @@ -const dayjs = require('dayjs'); -dayjs.extend(require('dayjs/plugin/relativeTime')); - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['user'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Get information on a user.', - arguments: '[user]', - details: '', - examples: 'userinfo\nuserinfo Octavia\nuserinfo @Animals' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - let member = message.member; - - if (args[0]) { - if (message.mentions.length > 0) { - member = await message.guild.members.fetch(message.mentions[0].id) - } else { - member = await client.functions.validateUserID(message.guild, args[0]); - - if (!member) { - member = await message.guild.searchMembers(args.join(' '), 2); - - if (member.length === 0) return message.channel.send( - `${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.` - ); - - if (member.length > 1) return message.channel.send( - `${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` - ); - - member = member[0]; - } - } - } - - const badges = []; - - if (client.config.ownerIDs.includes(member.id)) badges.push('<:Woomy_Developer:816822318289518622> '); - if (member.id === member.guild.ownerId) badges.push('<:owner:685703193694306331>'); - if (member.bot) badges.push('<:bot:686489601678114859>'); - - const roles = []; - - for (const roleID of member.roles) { - if (roles.length === 45) { - roles.push(`and ${member.roles.length - 45} more`); - break; - } - - roles.push(`<@&${roleID}>`); - } - - const embed = new client.MessageEmbed() - .setTitle(member.user.username + '#' + member.user.discriminator) - .setColor(client.functions.embedColor(message.guild, member)) - .setThumbnail(member.user.avatarURL || member.user.defaultAvatarURL) - .addField('Display Name', member.nick || member.user.username, true) - .addField('User ID', member.id, true) - .addField('Highest Role', `<@&${client.functions.highestRole(member).id}>`, true) - .addField('Roles:', roles.join(' ')) - .addField('Joined Server', `${dayjs(member.joinedAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.joinedAt)}*`, true) - .addField('Joined Discord', `${dayjs(member.user.createdAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.user.createdAt)}*`, true); - if (badges.length > 0) embed.setDescription(badges.join(' ')); - - message.channel.send({ embeds: [embed] }); - } -}; \ No newline at end of file diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js deleted file mode 100644 index 21d7f33..0000000 --- a/bot/commands/Utility/weather.js +++ /dev/null @@ -1,85 +0,0 @@ -const fetch = require('node-fetch'); -const windrose = require('windrose'); -const ISO2 = require('../../assets/ISO2.json'); - - -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'Gives you the weather for the specified city. You can also specify a country code with a comma.', - arguments: ', [code]', - details: '`` - name of a city\n`[code]` - country code (USA = US, Australia = AU, etc.)', - examples: 'w!weather Minneapolis\nw!weather Melbourne, AU' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - if (!args[0]) return; - - let city = args.join(' ').toProperCase(); - let countryCode = ','; - - if (args.join(' ').indexOf(',') > -1) { - const params = city.split(','); - city = params[0].trim().toProperCase(); - if (ISO2.country[params[1].toProperCase().trim()]) { - countryCode += ISO2.country[params[1].toProperCase().trim()]; - } else { - countryCode += params[1].trim(); - } - } - - const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`); - fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city + countryCode}&appid=${client.config.keys.weather}`, { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.json()) - .then(json => { - if (json.cod >= 200 && json.cod <= 299) { - const tempCelcius = Math.round(json.main.temp - 273.15); - let embedColour; - if (tempCelcius < 0) { - embedColour = '#addeff'; - } else if (tempCelcius < 20) { - embedColour = '#4fb8ff'; - } else if (tempCelcius < 26) { - embedColour = '#ffea4f'; - } else if (tempCelcius < 31) { - embedColour = '#ffa14f'; - } else { - embedColour = '#ff614f'; - } - - const embed = new client.MessageEmbed() - .setTitle(`Weather for ${city + ', ' + ISO2.code[json.sys.country]}`) - .setThumbnail(`https://openweathermap.org/img/wn/${json.weather[0].icon}@4x.png`) - .setColor(embedColour) - .addField('Condition:', json.weather[0].main, true) - .addField('Temperature:', `${tempCelcius}°C | ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, true) - .addField('Min/Max:', ` - ${Math.round(json.main.temp_min - 273.15)}°C - ${Math.round(json.main.temp_max - 273.15)}°C - ${Math.round(json.main.temp_min * 9/5 - 459.67)}°F - ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F - `, true) - .addField('Humidity:', `${json.main.humidity}%`, true) - .addField('Wind Speed:', `${Math.round(json.wind.speed * 10) / 10}km/h | ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, true) - .addField('Wind Direction:', windrose.getPoint(json.wind.deg).name, true) - .setFooter('Powered by openweathermap.org'); - return editMessage.edit({ content: null, embeds: [embed] }); - } else { - if (json.message && json.message === 'city not found') { - return message.channel.send(`${client.config.emojis.userError} You provided an invalid city name. Maybe check your spelling?`); - } - return message.channel.send(`${client.config.emojis.botError} API error occured: \`code ${json.cod}: ${json.message}\``); - } - }) - .catch(err => { - return message.channel.send(`${client.config.emojis.botError} An error has occured: \`${err.stack}\``); - }); - } -}; \ No newline at end of file From 79cfe4c57d670c82cb2b65cd0cda09f4e95e5265 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:38:42 +1100 Subject: [PATCH 18/65] test command --- bot/commands/Bot/ping.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bot/commands/Bot/ping.js diff --git a/bot/commands/Bot/ping.js b/bot/commands/Bot/ping.js new file mode 100644 index 0000000..9bce46a --- /dev/null +++ b/bot/commands/Bot/ping.js @@ -0,0 +1,14 @@ +const Command = require("../../base/Command.js"); + +module.exports = class Ping extends Command { + constructor (name, category) { + super (name, category) + this.name = name, + this.description = 'Check response time between Woomy and Discord', + this.category = category + } + + run (client, interaction, data) { //eslint-disable-line no-unused-vars + return interaction.reply('Pong! Did I do this right?'); + } +}; \ No newline at end of file From fb5d8cf7b19943ec7df29a3ecff033bb55431446 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:39:03 +1100 Subject: [PATCH 19/65] remove message handling + unneeded intents --- bot/index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bot/index.js b/bot/index.js index 1fe4bb4..340a4fc 100644 --- a/bot/index.js +++ b/bot/index.js @@ -4,7 +4,6 @@ const Discord = require('discord.js'); const CommandLoader = require('./util/commandLoader'); const EventLoader = require('./util/eventLoader'); const EventHandler = require('./event_modules/eventHandler'); -const MessageHandler = require('./event_modules/messageCreate/messageHandler'); const Functions = require('./util/functions'); const Database = require('./util/database'); const Logger = require('./util/logger'); @@ -28,7 +27,6 @@ class WoomyClient extends Discord.Client { this.commandLoader = new CommandLoader(this); this.eventLoader = new EventLoader(this); this.eventHandler = new EventHandler(this); - this.messageHandler = new MessageHandler(this); // Collections to store our successfully loaded events and commands in, as well as cooldowns. this.commands = new Discord.Collection(); @@ -100,9 +98,6 @@ const client = new WoomyClient({ Discord.GatewayIntentBits.GuildMembers, Discord.GatewayIntentBits.GuildEmojisAndStickers, Discord.GatewayIntentBits.GuildVoiceStates, - Discord.GatewayIntentBits.GuildMessages, - Discord.GatewayIntentBits.MessageContent, - Discord.GatewayIntentBits.GuildMessageReactions ], allowedMentions: { parse: [ From c929e8b949905f8a87eebb4dc5d29f030d30d1d0 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:39:40 +1100 Subject: [PATCH 20/65] move to base + extend so we can have default props --- bot/base/Command.js | 23 +++++++++++++++++++++++ bot/base/Event.js | 9 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 bot/base/Command.js create mode 100644 bot/base/Event.js diff --git a/bot/base/Command.js b/bot/base/Command.js new file mode 100644 index 0000000..f8573bc --- /dev/null +++ b/bot/base/Command.js @@ -0,0 +1,23 @@ +module.exports = class Command { + constructor (name, category) { + // Gateway stuff + this.name = name, + this.description = "No description provided.", + this.options = [], + this.permissions = { + DEFAULT_MEMBER_PERMISSIONS: "SendMessages" + } + this.dm_permission = false, + // Extra stuff Woomy uses internally + this.category = category, + this.usage = "No usage information provided.", + this.friendlyOptions = "No options provided." + this.enabled = true, + this.devOnly = false, + this.cooldown = 2000 + } + + run (client, interaction, data) { //eslint-disable-line no-unused-vars + + } +}; \ No newline at end of file diff --git a/bot/base/Event.js b/bot/base/Event.js new file mode 100644 index 0000000..b725fed --- /dev/null +++ b/bot/base/Event.js @@ -0,0 +1,9 @@ +module.exports = class { + constructor (wsEvent) { + this.wsEvent = wsEvent; + } + + async run (client) { //eslint-disable-line no-unused-vars + + } +}; \ No newline at end of file From 3b8fdb61b80fdb5766e39944c273f447ee06e3dd Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:39:56 +1100 Subject: [PATCH 21/65] add interaction passoff --- bot/event_modules/eventHandler.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/bot/event_modules/eventHandler.js b/bot/event_modules/eventHandler.js index eb8f53e..a0faafe 100644 --- a/bot/event_modules/eventHandler.js +++ b/bot/event_modules/eventHandler.js @@ -15,43 +15,49 @@ class EventHandler { case 'error': { const errorModules = this.client.eventModules.filter(module => module.wsEvent === 'error'); - errorModules.forEach(module => module.run(this.client, error)); + errorModules.forEach(module => module.run(this.client, param_1)); break; } case 'messageCreate': { const mCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'messageCreate'); - mCreateModules.forEach(module => module.run(this.client, message)); + mCreateModules.forEach(module => module.run(this.client, param_1)); + break; + } + + case 'interactionCreate': { + const iCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'interactionCreate'); + iCreateModules.forEach(module => module.run(this.client, param_1)); break; } case 'guildCreate': { const gCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'guildCreate'); - gCreateModules.forEach(module => module.run(this.client, guild)); + gCreateModules.forEach(module => module.run(this.client, param_1)); break; } case 'guildDelete': { const gDeleteModules = this.client.eventModules.filter(module => module.wsEvent === 'guildDelete'); - gDeleteModules.forEach(module => module.run(this.client, guild)); + gDeleteModules.forEach(module => module.run(this.client, param_1)); break; } case 'guildMemberAdd': { const gMemberAddModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberAdd'); - gMemberAddModules.forEach(module => module.run(this.client, guild, member)); + gMemberAddModules.forEach(module => module.run(this.client, param_1, param_2)); break; } case 'guildMemberRemove': { const gMemberRemoveModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberRemove'); - gMemberRemoveModules.forEach(module => module.run(this.client, guild, member)); + gMemberRemoveModules.forEach(module => module.run(this.client, param_1, param_2)); break; } case 'voiceStateUpdate': { const vStateUpdateModules = this.client.eventModules.filter(module => module.wsEvent === 'voiceStateUpdate'); - vStateUpdateModules.forEach(module => module.run(this.client, oVoiceState, nVoiceState)); + vStateUpdateModules.forEach(module => module.run(this.client, param_1, param_2)); break; } } From abca96068d3c969180bac3c41230b87ad5336c8b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:40:15 +1100 Subject: [PATCH 22/65] functional interaction handler --- .../interactionCreate/interactionHandler.js | 126 ++++-------------- 1 file changed, 29 insertions(+), 97 deletions(-) diff --git a/bot/event_modules/interactionCreate/interactionHandler.js b/bot/event_modules/interactionCreate/interactionHandler.js index 29da3c1..50dc4ab 100644 --- a/bot/event_modules/interactionCreate/interactionHandler.js +++ b/bot/event_modules/interactionCreate/interactionHandler.js @@ -1,121 +1,53 @@ -class MessageHandler { - constructor (client) { - this.client = client; +module.exports = class { + constructor (wsEvent) { + this.wsEvent = wsEvent; } - async handle (message) { - // Ignore messages from bots, and messages in DM's - if (message.author.bot) return; - if (!message.guild) return; + async run (client, interaction) { + if (!interaction.isChatInputCommand()) return; // Request all the data we need from the database const data = {}; - data.user = await this.client.db.getUser(message.author.id); - data.guild = await this.client.db.getGuild(message.guild.id); - data.member = await this.client.db.getMember(message.guild.id, message.author.id); + data.user = await client.db.getUser(interaction.user.id); + data.guild = await client.db.getGuild(interaction.guild.id); + data.member = await client.db.getMember(interaction.guild.id, interaction.user.id); - // Ignore users on the guild blocklist - if (data.guild.blocklist.includes(message.author.id)) return; - - // If a user pings Woomy, respond to them with the prefixes they can use - if (message.content === `<@${this.client.user.id}>` || message.content === `<@!${this.client.user.id}>`) { - return message.channel.send( - `Hi! The prefix for this server is \`${data.guild.prefix}\`, and your personal prefix is \`${data.user.prefix}\`. You can also ping me ^-^` - ); - } - - // All the prefixes Woomy will respond to - const prefixes = [ - data.user.prefix, - data.guild.prefix, - `<@${this.client.user.id}> `, - `<@!${this.client.user.id}> ` - ]; - - let prefix; - - // Check the message content to see if it starts with one of our prefixes - for (const thisPrefix of prefixes) { - if (message.content.startsWith(thisPrefix)) { - prefix = thisPrefix; - break; - } - } - - // Ignore the message if it doesn't start with a valid prefix - if (!prefix) return; - - // Save prefix so we can use it later (mostly for help command) - if (prefix === `<@${this.client.user.id}> ` || prefix === `<@!${this.client.user.id}> `) { - message.prefix = '@Woomy '; - } else (message.prefix = prefix); - - // Turn the message content into an array (excluding the prefix) - const args = message.content.slice(prefix.length).trim().split(/ +/g); - - // Find the command - const commandName = args.shift().toLowerCase(); - const command = this.client.commands.get(commandName) || this.client.commands.get(this.client.aliases.get(commandName)); - - // Return if a command (or its aliases) are not found - if (!command) return; - - // Both of these blocks check if the command is disabled/in a disabled category - if (data.guild.disabledcommands.includes(command.name)) return message.channel.send( - this.client.config.emojis.permError + ' This command has been disabled by a server administrator.' - ); - - if (data.guild.disabledcategories.includes(command.category)) return message.channel.send( - this.client.config.emojis.permError + ' The category this command is apart of has been disabled by a server administrator.' - ); - - // Both of these blocks check the permissions of the user, and reply with missing perms if any are found - const missingUserPerms = this.client.functions.checkPermissions(message.channel, message.author.id, command.userPerms); - if (missingUserPerms) return message.channel.send( - `${this.client.config.emojis.permError} You can't use this command because you lack these permissions: \`${missingUserPerms.join('`, `')}\`` - ); - - const missingBotPerms = this.client.functions.checkPermissions(message.channel, this.client.user.id, command.botPerms); - if (missingBotPerms) return message.channel.send( - `${this.client.config.emojis.permError} I can't run this command because I lack these permissions: \`${missingBotPerms.join('`, `')}\`` - ); + const command = client.commands.get(interaction.commandName); // Return if the command is disabled globally - if (command.enabled === false) return message.channel.send( - this.client.config.emojis.permError + ' This command has been disabled by my developers.' + if (command.enabled === false) interaction.reply( + client.config.emojis.permError + ' This command has been disabled by my developers.' ); - + // Return if the command is restricted to developers (and the user is not a developer) - if (command.devOnly === true && this.client.config.ownerIDs.includes(message.author.id) !== true) { - return message.channel.send( - `${this.client.config.emojis.permError} ${message.author.username} is not in the sudoers file. This incident will be reported.` + if (command.devOnly === true && client.config.devIds.includes(interaction.user.id) !== true) { + return interaction.reply( + `${client.config.emojis.permError} ${interaction.user.username} is not in the sudoers file. This incident will be reported.` ); - } + } // Cooldown - if (this.client.cooldowns.get(command.name).has(message.author.id)) { - const timestamp = this.client.cooldowns.get(command.name).get(message.author.id); + if (client.cooldowns.get(command.name).has(interaction.user.id)) { + const timestamp = client.cooldowns.get(command.name).get(interaction.user.id); const currentTime = Date.now(); const cooldown = command.cooldown / 1000; const timePassed = Math.floor((currentTime - timestamp) / 1000); - return message.channel.send( - `${this.client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` + return interaction.reply( + `${client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` ); } else { - this.client.cooldowns.get(command.name).set(message.author.id, new Date()); + client.cooldowns.get(command.name).set(interaction.user.id, new Date()); setTimeout(() => { - this.client.cooldowns.get(command.name).delete(message.author.id); - }, this.client.commands.get(command.name).cooldown); - } + client.cooldowns.get(command.name).delete(interaction.user.id); + }, client.commands.get(command.name).cooldown); + } try { - command.run(this.client, message, args, data); - this.client.logger.command(`Ran ${command.name}`); + command.run(client, interaction, data); + client.logger.command(`Ran ${command.name}`); } catch (error) { - this.client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); - message.channel.send(`${this.client.config.emojis.botError} An error occured when I was trying to run this command. I've sent through the details of the error to my developers.`); + client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); + interaction.reply(`${client.config.emojis.botError} An error occurred when I was trying to run this command. I've sent through the details of the error to my developers.`); } } -} - -module.exports = MessageHandler; \ No newline at end of file +}; \ No newline at end of file From 133625c0f61484d0e9c3d081b24d6bb408796446 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:41:25 +1100 Subject: [PATCH 23/65] remove alias support --- bot/util/commandLoader.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/util/commandLoader.js b/bot/util/commandLoader.js index 3560425..e7d77dd 100644 --- a/bot/util/commandLoader.js +++ b/bot/util/commandLoader.js @@ -13,12 +13,8 @@ class CommandLoader { const name = file.substr(file.indexOf('/') + 1).slice(0, -3); const category = file.substr(0, file.indexOf('/')); const command = new (require(this.client.path + '/commands/' + file))(name, category); - this.client.commands.set(command.name, command); this.client.cooldowns.set(command.name, new Map()); - command.aliases.forEach(alias => { - this.client.aliases.set(alias, command.name); - }); } catch (error) { this.client.logger.error('COMMAND_LOADER_ERROR', `Failed to load ${file}: ${error}`); } From 56ce10d4204f0b0e431762a391df23d987aa34f2 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 13:41:42 +1100 Subject: [PATCH 24/65] moved --- templates/exampleCommand.js | 22 ---------------------- templates/exampleEvent.js | 9 --------- 2 files changed, 31 deletions(-) delete mode 100644 templates/exampleCommand.js delete mode 100644 templates/exampleEvent.js diff --git a/templates/exampleCommand.js b/templates/exampleCommand.js deleted file mode 100644 index 8f5bbf8..0000000 --- a/templates/exampleCommand.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = [], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: '', - arguments: '', - details: '', - examples: '' - }; - } - - run (client, message, args, data) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file diff --git a/templates/exampleEvent.js b/templates/exampleEvent.js deleted file mode 100644 index b725fed..0000000 --- a/templates/exampleEvent.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = class { - constructor (wsEvent) { - this.wsEvent = wsEvent; - } - - async run (client) { //eslint-disable-line no-unused-vars - - } -}; \ No newline at end of file From c7b87dc4bf4f1cf506f60f830bac365f2540a4dd Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 17:22:31 +1100 Subject: [PATCH 25/65] update EmbedBuilder --- bot/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/index.js b/bot/index.js index 340a4fc..80c1bbb 100644 --- a/bot/index.js +++ b/bot/index.js @@ -21,7 +21,7 @@ class WoomyClient extends Discord.Client { // Essential modules this.logger = Logger; - this.MessageEmbed = Discord.MessageEmbed; + this.EmbedBuilder = Discord.EmbedBuilder; this.db = new Database(this); this.functions = new Functions(this); this.commandLoader = new CommandLoader(this); From f812359b422ab2ec15cdebe8fcfc853e95c06e59 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 17:22:57 +1100 Subject: [PATCH 26/65] oops forgot to change the cooldown warn from msg --- bot/event_modules/interactionCreate/interactionHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/event_modules/interactionCreate/interactionHandler.js b/bot/event_modules/interactionCreate/interactionHandler.js index 50dc4ab..4b3afe6 100644 --- a/bot/event_modules/interactionCreate/interactionHandler.js +++ b/bot/event_modules/interactionCreate/interactionHandler.js @@ -33,7 +33,7 @@ module.exports = class { const cooldown = command.cooldown / 1000; const timePassed = Math.floor((currentTime - timestamp) / 1000); return interaction.reply( - `${client.config.emojis.wait} ${message.author.mention}, you need to wait ${cooldown - timePassed} seconds before using this command again.` + `${client.config.emojis.wait} <@${interaction.user.id}>, you need to wait ${cooldown - timePassed} seconds before using this command again.` ); } else { client.cooldowns.get(command.name).set(interaction.user.id, new Date()); @@ -42,6 +42,7 @@ module.exports = class { }, client.commands.get(command.name).cooldown); } + // Try to execute the command, if it fails return error stack and inform the user try { command.run(client, interaction, data); client.logger.command(`Ran ${command.name}`); From c33e02e06dbe8b3d0b5b0e9192a8b9793f6f98d8 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 17:23:07 +1100 Subject: [PATCH 27/65] ping command actually pings --- bot/commands/Bot/ping.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot/commands/Bot/ping.js b/bot/commands/Bot/ping.js index 9bce46a..94b1446 100644 --- a/bot/commands/Bot/ping.js +++ b/bot/commands/Bot/ping.js @@ -1,4 +1,5 @@ const Command = require("../../base/Command.js"); +const replies = require('../../assets/replies.json'); module.exports = class Ping extends Command { constructor (name, category) { @@ -8,7 +9,8 @@ module.exports = class Ping extends Command { this.category = category } - run (client, interaction, data) { //eslint-disable-line no-unused-vars - return interaction.reply('Pong! Did I do this right?'); + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const msg = await interaction.reply({ content: replies.ping.random(), fetchReply: true }); + interaction.editReply(`${msg.content} Roundtrip: \`${msg.createdTimestamp - interaction.createdTimestamp}ms\` Heartbeat: \`${client.ws.ping}ms\``); } }; \ No newline at end of file From c3490af9d026cd47e2c465355f80cfbae3ce67f5 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 11 Dec 2022 17:23:21 +1100 Subject: [PATCH 28/65] avatar command --- bot/commands/Utility/avatar.js | 33 ++++++++++++++++++++ bot/commands/Utility/avatar.js.du | 52 ------------------------------- 2 files changed, 33 insertions(+), 52 deletions(-) create mode 100644 bot/commands/Utility/avatar.js delete mode 100644 bot/commands/Utility/avatar.js.du diff --git a/bot/commands/Utility/avatar.js b/bot/commands/Utility/avatar.js new file mode 100644 index 0000000..6bc5a35 --- /dev/null +++ b/bot/commands/Utility/avatar.js @@ -0,0 +1,33 @@ +const Command = require("../../base/Command.js"); + +module.exports = class Avatar extends Command { + constructor (name, category) { + super (name, category) + this.name = name, + this.description = 'View a full-sized version of someone\'s avatar.', + this.options = [ + { + type: 6, + name: "user", + description: "The user to get the avatar of." + }, + ], + this.usage = "/avatar [user]" + this.friendlyOptions = "`user` - The user to get the avatar of (optional)", + this.category = category + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const target = await interaction.options.getUser('user') ?? interaction.user; + const user = await client.users.fetch(target.id, {force: true}) + const member = await interaction.guild.members.fetch(target.id, {force: true}) + + const embed = new client.EmbedBuilder() + .setTitle(user.username + '#' + user.discriminator + "'s avatar") + .setColor(user.hexAccentColor ?? member.displayHexColor) + .setDescription(`[Global avatar](${user.avatarURL({extension: "png", "size": 4096})})`) + .setImage(member.displayAvatarURL({extension: "png", "size": 4096})); + + await interaction.reply({embeds: [embed]}); + } +}; \ No newline at end of file diff --git a/bot/commands/Utility/avatar.js.du b/bot/commands/Utility/avatar.js.du deleted file mode 100644 index 1190003..0000000 --- a/bot/commands/Utility/avatar.js.du +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = class { - constructor (name, category) { - this.name = name, - this.category = category, - this.enabled = true, - this.devOnly = false, - this.aliases = ['pfp'], - this.userPerms = [], - this.botPerms = [], - this.cooldown = 2000, - this.help = { - description: 'View a full-sized version of someone\'s avatar.', - arguments: '', - details: '', - examples: 'avatar\navatar @May\navatar emily' - }; - } - - async run (client, message, args, data) { //eslint-disable-line no-unused-vars - - let member = message.member; - - if (args[0]) { - if (message.mentions.length > 0) { - member = await message.guild.members.fetch(message.mentions[0].id) - } else { - member = await client.functions.validateUserID(message.guild, args[0]); - - if (!member) { - member = await message.guild.searchMembers(args.join(' '), 2); - - if (member.length === 0) return message.channel.send( - `${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.` - ); - - if (member.length > 1) return message.channel.send( - `${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` - ); - - member = member[0]; - } - } - } - - const embed = new client.MessageEmbed() - .setTitle(member.user.username + '#' + member.user.discriminator) - .setColor(client.functions.embedColor(message.guild, member)) - .setImage(member.user.avatarURL); - - message.channel.send({ embeds: [embed] }); - } -}; \ No newline at end of file From a51246ab16d03e33c23606ba0dd24fc9e2efbecf Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 10:22:04 +1100 Subject: [PATCH 29/65] only user is shown response for cmd not running --- .../interactionCreate/interactionHandler.js | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/bot/event_modules/interactionCreate/interactionHandler.js b/bot/event_modules/interactionCreate/interactionHandler.js index 4b3afe6..92c4be3 100644 --- a/bot/event_modules/interactionCreate/interactionHandler.js +++ b/bot/event_modules/interactionCreate/interactionHandler.js @@ -15,15 +15,17 @@ module.exports = class { const command = client.commands.get(interaction.commandName); // Return if the command is disabled globally - if (command.enabled === false) interaction.reply( - client.config.emojis.permError + ' This command has been disabled by my developers.' - ); + if (command.enabled === false) interaction.reply({ + content: client.config.emojis.permError + ' This command has been disabled by my developers.', + ephemeral: true + }); // Return if the command is restricted to developers (and the user is not a developer) if (command.devOnly === true && client.config.devIds.includes(interaction.user.id) !== true) { - return interaction.reply( - `${client.config.emojis.permError} ${interaction.user.username} is not in the sudoers file. This incident will be reported.` - ); + return interaction.reply({ + content: `${client.config.emojis.permError} ${interaction.user.username} is not in the sudoers file. This incident will be reported.`, + ephemeral: true + }); } // Cooldown @@ -32,9 +34,10 @@ module.exports = class { const currentTime = Date.now(); const cooldown = command.cooldown / 1000; const timePassed = Math.floor((currentTime - timestamp) / 1000); - return interaction.reply( - `${client.config.emojis.wait} <@${interaction.user.id}>, you need to wait ${cooldown - timePassed} seconds before using this command again.` - ); + return interaction.reply({ + content: `${client.config.emojis.wait} You need to wait ${cooldown - timePassed} seconds before using this command again.`, + ephemeral: true + }); } else { client.cooldowns.get(command.name).set(interaction.user.id, new Date()); setTimeout(() => { @@ -48,7 +51,10 @@ module.exports = class { client.logger.command(`Ran ${command.name}`); } catch (error) { client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`); - interaction.reply(`${client.config.emojis.botError} An error occurred when I was trying to run this command. I've sent through the details of the error to my developers.`); + interaction.reply({ + content: `${client.config.emojis.botError} An error occurred when I was trying to run this command. I've sent through the details of the error to my developers.`, + ephemeral: true + }); } } }; \ No newline at end of file From 3159c72439bb0cdabf4e14cdb50ec35b71daf6f4 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 10:22:28 +1100 Subject: [PATCH 30/65] hey woomy what is the weather in obama japan --- bot/commands/Utility/weather.js | 95 +++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 bot/commands/Utility/weather.js diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js new file mode 100644 index 0000000..ea2c5cf --- /dev/null +++ b/bot/commands/Utility/weather.js @@ -0,0 +1,95 @@ +const Command = require("../../base/Command.js"); +const fetch = require('node-fetch'); +const windrose = require('windrose'); +const ISO2 = require('../../assets/ISO2.json'); + + +module.exports = class Weather extends Command { + constructor (name, category) { + super (name, category) + this.name = name, + this.description = 'View the weather in a place ', + this.options = [ + { + type: 3, + name: "city", + description: "The city to check the weather at", + required: true + }, + { + type: 3, + name: "country", + description: "The country the city is in", + } + ], + this.category = category, + this.cooldown = 10000 + }; + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + + await interaction.deferReply(); + + const city = await interaction.options.get('city').value; + let country = await interaction.options.get('country'); + let countryCode = ""; + + if (country) { + country = country.value; + countryCode += "," + if (ISO2.country[country.toProperCase().trim()]) { + countryCode += ISO2.country[country.toProperCase().trim()]; + } else { + countryCode += country.trim(); + } + }; + + fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city + countryCode}&appid=${client.config.keys.weather}`, { headers: { 'User-Agent': client.config.userAgent }}) + .then(res => res.json()) + .then(json => { + if (json.cod >= 200 && json.cod <= 299) { + const tempCelsius = Math.round(json.main.temp - 273.15); + let embedColor; + if (tempCelsius < 0) { + embedColor = '#addeff'; + } else if (tempCelsius < 20) { + embedColor = '#4fb8ff'; + } else if (tempCelsius < 26) { + embedColor = '#ffea4f'; + } else if (tempCelsius < 31) { + embedColor = '#ffa14f'; + } else { + embedColor = '#ff614f'; + } + + const embed = new client.EmbedBuilder() + .setTitle('Current conditions in ' + city.toProperCase() + ', ' + ISO2.code[json.sys.country]) + .setThumbnail(`https://openweathermap.org/img/wn/${json.weather[0].icon}@4x.png`) + .setColor(embedColor) + .addFields([ + { name: 'Condition:', value: json.weather[0].main, inline: true }, + { name: 'Temperature:', value: `${tempCelsius}°C | ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, inline: true }, + { name: 'Min/Max:', value:` + ${Math.round(json.main.temp_min - 273.15)}°C - ${Math.round(json.main.temp_max - 273.15)}°C + ${Math.round(json.main.temp_min * 9/5 - 459.67)}°F - ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F + `, inline: true}, + { name: 'Humidity:', value: `${json.main.humidity}%`, inline: true }, + { name: 'Wind Speed:', value: `${Math.round(json.wind.speed * 10) / 10}km/h | ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, inline: true }, + { name: 'Wind Direction:', value: windrose.getPoint(json.wind.deg).name, inline: true} + ]) + .setFooter({ text: 'Powered by openweathermap.org'}); + + return interaction.editReply({embeds: [embed]}); + } else { + if (json.message && json.message === 'city not found') { + return interaction.editReply(`${client.config.emojis.userError} ${city.toProperCase()} is not listed in my sources.`); + } + return interaction.editReply(`${client.config.emojis.botError} API error occurred: \`code ${json.cod}: ${json.message}\``); + } + }) + .catch(err => { + return interaction.editReply(`${client.config.emojis.botError} An error has occurred: \`${err.stack}\``); + }); + + }; +}; \ No newline at end of file From 063fa844ab44274fe6937b15ee34cc409fba8a4e Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 11:18:31 +1100 Subject: [PATCH 31/65] nicer looking separators --- bot/commands/Utility/weather.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js index ea2c5cf..34603ab 100644 --- a/bot/commands/Utility/weather.js +++ b/bot/commands/Utility/weather.js @@ -68,13 +68,13 @@ module.exports = class Weather extends Command { .setColor(embedColor) .addFields([ { name: 'Condition:', value: json.weather[0].main, inline: true }, - { name: 'Temperature:', value: `${tempCelsius}°C | ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, inline: true }, + { name: 'Temperature:', value: `${tempCelsius}°C ・ ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, inline: true }, { name: 'Min/Max:', value:` - ${Math.round(json.main.temp_min - 273.15)}°C - ${Math.round(json.main.temp_max - 273.15)}°C - ${Math.round(json.main.temp_min * 9/5 - 459.67)}°F - ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F + ${Math.round(json.main.temp_min - 273.15)}°C ・ ${Math.round(json.main.temp_max - 273.15)}°C + ${Math.round(json.main.temp_min * 9/5 - 459.67)}°F ・ ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F `, inline: true}, { name: 'Humidity:', value: `${json.main.humidity}%`, inline: true }, - { name: 'Wind Speed:', value: `${Math.round(json.wind.speed * 10) / 10}km/h | ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, inline: true }, + { name: 'Wind Speed:', value: `${Math.round(json.wind.speed * 10) / 10}km/h ・ ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, inline: true }, { name: 'Wind Direction:', value: windrose.getPoint(json.wind.deg).name, inline: true} ]) .setFooter({ text: 'Powered by openweathermap.org'}); From 1036a253eb20655e10c69ac260c9004a25beb106 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 12:08:37 +1100 Subject: [PATCH 32/65] no longer defer + hide errors from public --- bot/commands/Utility/weather.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js index 34603ab..d40feab 100644 --- a/bot/commands/Utility/weather.js +++ b/bot/commands/Utility/weather.js @@ -28,8 +28,6 @@ module.exports = class Weather extends Command { async run (client, interaction, data) { //eslint-disable-line no-unused-vars - await interaction.deferReply(); - const city = await interaction.options.get('city').value; let country = await interaction.options.get('country'); let countryCode = ""; @@ -79,16 +77,20 @@ module.exports = class Weather extends Command { ]) .setFooter({ text: 'Powered by openweathermap.org'}); - return interaction.editReply({embeds: [embed]}); + return interaction.reply({embeds: [embed]}); } else { if (json.message && json.message === 'city not found') { - return interaction.editReply(`${client.config.emojis.userError} ${city.toProperCase()} is not listed in my sources.`); - } - return interaction.editReply(`${client.config.emojis.botError} API error occurred: \`code ${json.cod}: ${json.message}\``); - } - }) - .catch(err => { - return interaction.editReply(`${client.config.emojis.botError} An error has occurred: \`${err.stack}\``); + return interaction.reply({ + content: `${client.config.emojis.userError} ${city.toProperCase()} is not listed in my sources.`, + ephemeral: true + }); + }; + client.logger.error('WEATHER_COMMAND_ERROR', `API Error: ${json}`) + return interaction.reply({ + content: `${client.config.emojis.botError} API error occurred: \`code ${json.cod}\``, + ephemeral: true + }); + }; }); }; From 1a24f5b819a7a0b9a3418fc18d9494cdfd6d6ad3 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 12:09:44 +1100 Subject: [PATCH 33/65] not async by default --- bot/base/Event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/base/Event.js b/bot/base/Event.js index b725fed..3b7a9fd 100644 --- a/bot/base/Event.js +++ b/bot/base/Event.js @@ -3,7 +3,7 @@ module.exports = class { this.wsEvent = wsEvent; } - async run (client) { //eslint-disable-line no-unused-vars + run (client) { //eslint-disable-line no-unused-vars } }; \ No newline at end of file From d93d42a131221b8237186eff002b86eb936c8bb5 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 12:14:28 +1100 Subject: [PATCH 34/65] events now extend base Event class --- bot/base/Event.js | 2 +- bot/event_modules/interactionCreate/interactionHandler.js | 4 +++- bot/event_modules/ready/activity.js | 5 +++-- bot/event_modules/ready/logReady.js | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bot/base/Event.js b/bot/base/Event.js index 3b7a9fd..3dc70d9 100644 --- a/bot/base/Event.js +++ b/bot/base/Event.js @@ -1,4 +1,4 @@ -module.exports = class { +module.exports = class Event { constructor (wsEvent) { this.wsEvent = wsEvent; } diff --git a/bot/event_modules/interactionCreate/interactionHandler.js b/bot/event_modules/interactionCreate/interactionHandler.js index 92c4be3..246612c 100644 --- a/bot/event_modules/interactionCreate/interactionHandler.js +++ b/bot/event_modules/interactionCreate/interactionHandler.js @@ -1,5 +1,7 @@ -module.exports = class { +const Event = require("../../base/Event.js"); +module.exports = class InteractionHandler extends Event { constructor (wsEvent) { + super (wsEvent); this.wsEvent = wsEvent; } diff --git a/bot/event_modules/ready/activity.js b/bot/event_modules/ready/activity.js index ea72c7a..04083f0 100644 --- a/bot/event_modules/ready/activity.js +++ b/bot/event_modules/ready/activity.js @@ -1,7 +1,8 @@ +const Event = require("../../base/Event.js"); const activities = require('../../assets/activities.json'); - -module.exports = class { +module.exports = class Activity extends Event { constructor (wsEvent) { + super (wsEvent); this.wsEvent = wsEvent; } diff --git a/bot/event_modules/ready/logReady.js b/bot/event_modules/ready/logReady.js index 6395eab..fe70e7a 100644 --- a/bot/event_modules/ready/logReady.js +++ b/bot/event_modules/ready/logReady.js @@ -1,5 +1,7 @@ -module.exports = class { +const Event = require("../../base/Event.js"); +module.exports = class Ready extends Event { constructor (wsEvent) { + super (wsEvent); this.wsEvent = wsEvent; } From bd38870c44a62cf1a96646e02f2ecb57c7dc8381 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 12:25:34 +1100 Subject: [PATCH 35/65] oopsie forgot to turn on the linter --- bot/util/functions.js | 6 +----- bot/util/logger.js | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bot/util/functions.js b/bot/util/functions.js index e8d5656..866cce5 100644 --- a/bot/util/functions.js +++ b/bot/util/functions.js @@ -32,7 +32,7 @@ class Functions { return Math.round((Math.random() * (max - min) + min)); } - randomColour () { + randomColor () { const n = (Math.random() * 0xfffff * 1000000).toString(16); return '#' + n.slice(0, 6); } @@ -51,10 +51,6 @@ class Functions { return role; } - searchMembers (guild, input) { - - } - embedColor (guild, member) { if (!member) { return guild.members.cache.get(this.client.user.id).displayHexColor; diff --git a/bot/util/logger.js b/bot/util/logger.js index 6006c9d..51efdbe 100644 --- a/bot/util/logger.js +++ b/bot/util/logger.js @@ -34,7 +34,7 @@ class Logger { /** * Log something related to being successful - * @param {string} title The title of the log enty + * @param {string} title The title of the log entry * @param {string} body The body of the log entry * @returns {void} */ @@ -44,7 +44,7 @@ class Logger { /** * Log something related to a warning - * @param {string} title The title of the log enty + * @param {string} title The title of the log entry * @param {string} body The body of the log entry * @returns {void} */ @@ -54,7 +54,7 @@ class Logger { /** * Log something related to an error - * @param {string} title The title of the log enty + * @param {string} title The title of the log entry * @param {string} body The body of the log entry * @returns {void} */ @@ -64,7 +64,7 @@ class Logger { /** * Log something related to debugging - * @param {string} title The title of the log enty + * @param {string} title The title of the log entry * @param {string} body The body of the log entry * @returns {void} */ From 823c1d4de88068d46134668e545a00d82310afa4 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 12:25:48 +1100 Subject: [PATCH 36/65] oops forgot to turn on linter --- bot/base/Command.js | 12 +- bot/commands/Bot/ping.js | 6 +- bot/commands/Utility/avatar.js | 26 ++-- bot/commands/Utility/weather.js | 114 +++++++++--------- bot/deploy.js | 38 +++--- bot/event_modules/eventHandler.js | 2 +- .../interactionCreate/interactionHandler.js | 4 +- bot/event_modules/ready/activity.js | 2 +- bot/event_modules/ready/logReady.js | 2 +- 9 files changed, 103 insertions(+), 103 deletions(-) diff --git a/bot/base/Command.js b/bot/base/Command.js index f8573bc..0bf5ee9 100644 --- a/bot/base/Command.js +++ b/bot/base/Command.js @@ -2,19 +2,19 @@ module.exports = class Command { constructor (name, category) { // Gateway stuff this.name = name, - this.description = "No description provided.", + this.description = 'No description provided.', this.options = [], this.permissions = { - DEFAULT_MEMBER_PERMISSIONS: "SendMessages" - } + DEFAULT_MEMBER_PERMISSIONS: 'SendMessages' + }; this.dm_permission = false, // Extra stuff Woomy uses internally this.category = category, - this.usage = "No usage information provided.", - this.friendlyOptions = "No options provided." + this.usage = 'No usage information provided.', + this.friendlyOptions = 'No options provided.', this.enabled = true, this.devOnly = false, - this.cooldown = 2000 + this.cooldown = 2000; } run (client, interaction, data) { //eslint-disable-line no-unused-vars diff --git a/bot/commands/Bot/ping.js b/bot/commands/Bot/ping.js index 94b1446..1b2861f 100644 --- a/bot/commands/Bot/ping.js +++ b/bot/commands/Bot/ping.js @@ -1,12 +1,12 @@ -const Command = require("../../base/Command.js"); +const Command = require('../../base/Command.js'); const replies = require('../../assets/replies.json'); module.exports = class Ping extends Command { constructor (name, category) { - super (name, category) + super (name, category); this.name = name, this.description = 'Check response time between Woomy and Discord', - this.category = category + this.category = category; } async run (client, interaction, data) { //eslint-disable-line no-unused-vars diff --git a/bot/commands/Utility/avatar.js b/bot/commands/Utility/avatar.js index 6bc5a35..e189e3e 100644 --- a/bot/commands/Utility/avatar.js +++ b/bot/commands/Utility/avatar.js @@ -1,32 +1,32 @@ -const Command = require("../../base/Command.js"); +const Command = require('../../base/Command.js'); module.exports = class Avatar extends Command { constructor (name, category) { - super (name, category) + super (name, category); this.name = name, this.description = 'View a full-sized version of someone\'s avatar.', this.options = [ { type: 6, - name: "user", - description: "The user to get the avatar of." + name: 'user', + description: 'The user to get the avatar of.' }, ], - this.usage = "/avatar [user]" - this.friendlyOptions = "`user` - The user to get the avatar of (optional)", - this.category = category + this.usage = '/avatar [user]', + this.friendlyOptions = '`user` - The user to get the avatar of (optional)', + this.category = category; } async run (client, interaction, data) { //eslint-disable-line no-unused-vars const target = await interaction.options.getUser('user') ?? interaction.user; - const user = await client.users.fetch(target.id, {force: true}) - const member = await interaction.guild.members.fetch(target.id, {force: true}) + const user = await client.users.fetch(target.id, {force: true}); + const member = await interaction.guild.members.fetch(target.id, {force: true}); const embed = new client.EmbedBuilder() - .setTitle(user.username + '#' + user.discriminator + "'s avatar") - .setColor(user.hexAccentColor ?? member.displayHexColor) - .setDescription(`[Global avatar](${user.avatarURL({extension: "png", "size": 4096})})`) - .setImage(member.displayAvatarURL({extension: "png", "size": 4096})); + .setTitle(user.username + '#' + user.discriminator + '\'s avatar') + .setColor(user.hexAccentColor ?? member.displayHexColor) + .setDescription(`[Global avatar](${user.avatarURL({extension: 'png', 'size': 4096})})`) + .setImage(member.displayAvatarURL({extension: 'png', 'size': 4096})); await interaction.reply({embeds: [embed]}); } diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js index d40feab..0382f79 100644 --- a/bot/commands/Utility/weather.js +++ b/bot/commands/Utility/weather.js @@ -1,4 +1,4 @@ -const Command = require("../../base/Command.js"); +const Command = require('../../base/Command.js'); const fetch = require('node-fetch'); const windrose = require('windrose'); const ISO2 = require('../../assets/ISO2.json'); @@ -6,92 +6,92 @@ const ISO2 = require('../../assets/ISO2.json'); module.exports = class Weather extends Command { constructor (name, category) { - super (name, category) + super (name, category); this.name = name, this.description = 'View the weather in a place ', this.options = [ { type: 3, - name: "city", - description: "The city to check the weather at", + name: 'city', + description: 'The city to check the weather at', required: true }, { type: 3, - name: "country", - description: "The country the city is in", + name: 'country', + description: 'The country the city is in', } ], this.category = category, - this.cooldown = 10000 - }; + this.cooldown = 10000; + } async run (client, interaction, data) { //eslint-disable-line no-unused-vars const city = await interaction.options.get('city').value; let country = await interaction.options.get('country'); - let countryCode = ""; + let countryCode = ''; if (country) { country = country.value; - countryCode += "," + countryCode += ','; if (ISO2.country[country.toProperCase().trim()]) { countryCode += ISO2.country[country.toProperCase().trim()]; } else { countryCode += country.trim(); } - }; + } fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city + countryCode}&appid=${client.config.keys.weather}`, { headers: { 'User-Agent': client.config.userAgent }}) - .then(res => res.json()) - .then(json => { - if (json.cod >= 200 && json.cod <= 299) { - const tempCelsius = Math.round(json.main.temp - 273.15); - let embedColor; - if (tempCelsius < 0) { - embedColor = '#addeff'; - } else if (tempCelsius < 20) { - embedColor = '#4fb8ff'; - } else if (tempCelsius < 26) { - embedColor = '#ffea4f'; - } else if (tempCelsius < 31) { - embedColor = '#ffa14f'; + .then(res => res.json()) + .then(json => { + if (json.cod >= 200 && json.cod <= 299) { + const tempCelsius = Math.round(json.main.temp - 273.15); + let embedColor; + if (tempCelsius < 0) { + embedColor = '#addeff'; + } else if (tempCelsius < 20) { + embedColor = '#4fb8ff'; + } else if (tempCelsius < 26) { + embedColor = '#ffea4f'; + } else if (tempCelsius < 31) { + embedColor = '#ffa14f'; + } else { + embedColor = '#ff614f'; + } + + const embed = new client.EmbedBuilder() + .setTitle('Current conditions in ' + city.toProperCase() + ', ' + ISO2.code[json.sys.country]) + .setThumbnail(`https://openweathermap.org/img/wn/${json.weather[0].icon}@4x.png`) + .setColor(embedColor) + .addFields([ + { name: 'Condition:', value: json.weather[0].main, inline: true }, + { name: 'Temperature:', value: `${tempCelsius}°C ・ ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, inline: true }, + { name: 'Min/Max:', value:` + ${Math.round(json.main.temp_min - 273.15)}°C ・ ${Math.round(json.main.temp_max - 273.15)}°C + ${Math.round(json.main.temp_min * 9/5 - 459.67)}°F ・ ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F + `, inline: true}, + { name: 'Humidity:', value: `${json.main.humidity}%`, inline: true }, + { name: 'Wind Speed:', value: `${Math.round(json.wind.speed * 10) / 10}km/h ・ ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, inline: true }, + { name: 'Wind Direction:', value: windrose.getPoint(json.wind.deg).name, inline: true} + ]) + .setFooter({ text: 'Powered by openweathermap.org'}); + + return interaction.reply({embeds: [embed]}); } else { - embedColor = '#ff614f'; - } - - const embed = new client.EmbedBuilder() - .setTitle('Current conditions in ' + city.toProperCase() + ', ' + ISO2.code[json.sys.country]) - .setThumbnail(`https://openweathermap.org/img/wn/${json.weather[0].icon}@4x.png`) - .setColor(embedColor) - .addFields([ - { name: 'Condition:', value: json.weather[0].main, inline: true }, - { name: 'Temperature:', value: `${tempCelsius}°C ・ ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, inline: true }, - { name: 'Min/Max:', value:` - ${Math.round(json.main.temp_min - 273.15)}°C ・ ${Math.round(json.main.temp_max - 273.15)}°C - ${Math.round(json.main.temp_min * 9/5 - 459.67)}°F ・ ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F - `, inline: true}, - { name: 'Humidity:', value: `${json.main.humidity}%`, inline: true }, - { name: 'Wind Speed:', value: `${Math.round(json.wind.speed * 10) / 10}km/h ・ ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, inline: true }, - { name: 'Wind Direction:', value: windrose.getPoint(json.wind.deg).name, inline: true} - ]) - .setFooter({ text: 'Powered by openweathermap.org'}); - - return interaction.reply({embeds: [embed]}); - } else { - if (json.message && json.message === 'city not found') { + if (json.message && json.message === 'city not found') { + return interaction.reply({ + content: `${client.config.emojis.userError} ${city.toProperCase()} is not listed in my sources.`, + ephemeral: true + }); + } + client.logger.error('WEATHER_COMMAND_ERROR', `API Error: ${json}`); return interaction.reply({ - content: `${client.config.emojis.userError} ${city.toProperCase()} is not listed in my sources.`, + content: `${client.config.emojis.botError} API error occurred: \`code ${json.cod}\``, ephemeral: true }); - }; - client.logger.error('WEATHER_COMMAND_ERROR', `API Error: ${json}`) - return interaction.reply({ - content: `${client.config.emojis.botError} API error occurred: \`code ${json.cod}\``, - ephemeral: true - }); - }; - }); + } + }); - }; + } }; \ No newline at end of file diff --git a/bot/deploy.js b/bot/deploy.js index 6407f6b..920de24 100644 --- a/bot/deploy.js +++ b/bot/deploy.js @@ -2,35 +2,35 @@ const { REST, Routes } = require('discord.js'); const { clientId, token } = require('../botconfig.json'); -const guildId = "413591792185769984"; +const guildId = '413591792185769984'; const read = require('fs-readdir-recursive'); const commands = []; const commandFiles = read('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { - const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/'))); - commands.push({ - name: command.name, - description: command.description, - options: command.options, - permissions: command.permissions, - dm_permission: command.dm_permission - }); + const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/'))); + commands.push({ + name: command.name, + description: command.description, + options: command.options, + permissions: command.permissions, + dm_permission: command.dm_permission + }); } const rest = new REST({ version: '10' }).setToken(token); (async () => { - try { - console.log(`Started refreshing ${commands.length} application (/) commands.`); + try { + console.log(`Started refreshing ${commands.length} application (/) commands.`); - const data = await rest.put( - Routes.applicationGuildCommands(clientId, guildId), - { body: commands }, - ); + const data = await rest.put( + Routes.applicationGuildCommands(clientId, guildId), + { body: commands }, + ); - console.log(`Successfully reloaded ${data.length} application (/) commands.`); - } catch (error) { - console.error(error); - } + console.log(`Successfully reloaded ${data.length} application (/) commands.`); + } catch (error) { + console.error(error); + } })(); diff --git a/bot/event_modules/eventHandler.js b/bot/event_modules/eventHandler.js index a0faafe..60a69f6 100644 --- a/bot/event_modules/eventHandler.js +++ b/bot/event_modules/eventHandler.js @@ -1,6 +1,6 @@ /* eslint-disable indent */ - class EventHandler { + constructor (client) { this.client = client; } diff --git a/bot/event_modules/interactionCreate/interactionHandler.js b/bot/event_modules/interactionCreate/interactionHandler.js index 246612c..5c55b4d 100644 --- a/bot/event_modules/interactionCreate/interactionHandler.js +++ b/bot/event_modules/interactionCreate/interactionHandler.js @@ -1,4 +1,4 @@ -const Event = require("../../base/Event.js"); +const Event = require('../../base/Event.js'); module.exports = class InteractionHandler extends Event { constructor (wsEvent) { super (wsEvent); @@ -39,7 +39,7 @@ module.exports = class InteractionHandler extends Event { return interaction.reply({ content: `${client.config.emojis.wait} You need to wait ${cooldown - timePassed} seconds before using this command again.`, ephemeral: true - }); + }); } else { client.cooldowns.get(command.name).set(interaction.user.id, new Date()); setTimeout(() => { diff --git a/bot/event_modules/ready/activity.js b/bot/event_modules/ready/activity.js index 04083f0..2f6e151 100644 --- a/bot/event_modules/ready/activity.js +++ b/bot/event_modules/ready/activity.js @@ -1,4 +1,4 @@ -const Event = require("../../base/Event.js"); +const Event = require('../../base/Event.js'); const activities = require('../../assets/activities.json'); module.exports = class Activity extends Event { constructor (wsEvent) { diff --git a/bot/event_modules/ready/logReady.js b/bot/event_modules/ready/logReady.js index fe70e7a..6a798b0 100644 --- a/bot/event_modules/ready/logReady.js +++ b/bot/event_modules/ready/logReady.js @@ -1,4 +1,4 @@ -const Event = require("../../base/Event.js"); +const Event = require('../../base/Event.js'); module.exports = class Ready extends Event { constructor (wsEvent) { super (wsEvent); From 1001bc697b8ab879a9a3454b59accc2dc2506624 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 13:09:56 +1100 Subject: [PATCH 37/65] userinfo command --- bot/commands/Utility/userinfo.js | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 bot/commands/Utility/userinfo.js diff --git a/bot/commands/Utility/userinfo.js b/bot/commands/Utility/userinfo.js new file mode 100644 index 0000000..cccacf9 --- /dev/null +++ b/bot/commands/Utility/userinfo.js @@ -0,0 +1,71 @@ +const Command = require('../../base/Command.js'); +const dayjs = require('dayjs'); +dayjs.extend(require('dayjs/plugin/relativeTime')); + +module.exports = class Avatar extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'View someone\'s public account information', + this.options = [ + { + type: 6, + name: 'user', + description: 'The user who you want ' + }, + ], + this.usage = '/userinfo [user]', + this.friendlyOptions = '`user` - The user to get information on (optional)', + this.category = category; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const target = await interaction.options.getUser('user') ?? interaction.user; + const user = await client.users.fetch(target.id, {force: true}); + const member = await interaction.guild.members.fetch(target.id, {force: true}); + + const badges = []; + if (client.config.devIds.includes(user.id)) badges.push('<:Woomy_Developer:816822318289518622> '); + if (user.id === member.guild.ownerId) badges.push('<:owner:685703193694306331>'); + if (user.bot) badges.push('<:bot:686489601678114859>'); + + const roles = []; + for (const roleId of member._roles) { + if (roles.length === 45) { + roles.push(`and ${member.roles.length - 45} more`); + break; + } + + roles.push(`<@&${roleId}>`); + } + + const embed = new client.EmbedBuilder() + .setTitle(member.user.username + '#' + member.user.discriminator) + .setColor(user.hexAccentColor ?? member.displayHexColor) + .setThumbnail(member.displayAvatarURL({extension: 'png', 'size': 4096})) + .addFields([ + { + name: 'Display Name', value: member.nick || user.username, inline: true + }, + { + name: 'User ID', value: user.id, inline: true + }, + { + name: 'Highest Role', value: `<@&${member.roles.highest.id}>`, inline: true + }, + { + name: 'Roles:', value: roles.join(' ') + }, + { + name: 'Joined Server', value: `${dayjs(member.joinedAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.joinedAt)}*`, inline: true + }, + { + name: 'Joined Discord', value: `${dayjs(member.user.createdAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.user.createdAt)}*`, inline: true + } + ]); + if (badges.length > 0) { + embed.setDescription(badges.join(' ')); + } + return await interaction.reply({embeds: [embed]}); + } +}; \ No newline at end of file From 5c97a6dc6acad892fbca0a4dcdd9bb859852aa2a Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 12 Dec 2022 18:35:42 +1100 Subject: [PATCH 38/65] wip serverinfo --- bot/commands/Utility/serverinfo.js | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 bot/commands/Utility/serverinfo.js diff --git a/bot/commands/Utility/serverinfo.js b/bot/commands/Utility/serverinfo.js new file mode 100644 index 0000000..0336289 --- /dev/null +++ b/bot/commands/Utility/serverinfo.js @@ -0,0 +1,45 @@ +const Command = require('../../base/Command.js'); +const { time } = require('discord.js'); + +module.exports = class Avatar extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'View information on this server.', + this.usage = '/serverinfo', + this.category = category; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const guild = await client.guilds.fetch(interaction.guild.id, {force: true}); + const members = await guild.members.fetch(); + const embed = new client.EmbedBuilder() + .setColor(client.functions.embedColor(guild)) + .setTitle(guild.name) + .setThumbnail(guild.iconURL({extension: 'png', 'size': 4096})) + .addFields([ + { + name: 'ID', value: guild.id, inline: true + }, + { + name: 'Owner', value: `<@${guild.ownerId}>`, inline: true + }, + { + name: 'Created', value: time(guild.createdAt) + '\n' + time(guild.createdAt, 'R'), inline: true + }, + { + name: 'Boosts', value: `${guild.premiumSubscriptionCount} (Level ${guild.premiumTier})`, inline: true + + }, + { + name: 'Members', + value: `${members.size} Total\n${members.size - members.filter(member => member.user.bot).size} Humans\n${members.filter(member => member.user.bot).size} Bots`, + inline: true + }, + { + name: 'Channels', value: `${guild.channels.cache.size} ()` + } + ]); + interaction.reply({ embeds: [embed] }); + } +}; \ No newline at end of file From 4025bc2aa2816c417d4be7c817b95894d2fc01cd Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 13:42:43 +1100 Subject: [PATCH 39/65] +serverinfo command --- bot/commands/Utility/serverinfo.js | 56 +++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/bot/commands/Utility/serverinfo.js b/bot/commands/Utility/serverinfo.js index 0336289..6f86054 100644 --- a/bot/commands/Utility/serverinfo.js +++ b/bot/commands/Utility/serverinfo.js @@ -6,13 +6,44 @@ module.exports = class Avatar extends Command { super (name, category); this.name = name, this.description = 'View information on this server.', - this.usage = '/serverinfo', + this.usage = '/server', this.category = category; } async run (client, interaction, data) { //eslint-disable-line no-unused-vars const guild = await client.guilds.fetch(interaction.guild.id, {force: true}); const members = await guild.members.fetch(); + const roles = await interaction.guild.roles.cache; + const channels = await interaction.guild.channels.cache; + + let verificationLevel = 'None'; + + /* eslint-disable indent */ + switch (guild.verificationLevel) { + case 1: { + verificationLevel = 'Low'; + break; + } + case 2: { + verificationLevel = 'Medium'; + break; + } + case 3: { + verificationLevel = 'High'; + break; + } + case 4: { + verificationLevel = 'Very high'; + break; + } + } + /* eslint-disable indent */ + + let mfaLevel = 'None'; + if (guild.mfaLevel === 1) { + mfaLevel = '2FA required'; + } + const embed = new client.EmbedBuilder() .setColor(client.functions.embedColor(guild)) .setTitle(guild.name) @@ -25,19 +56,34 @@ module.exports = class Avatar extends Command { name: 'Owner', value: `<@${guild.ownerId}>`, inline: true }, { - name: 'Created', value: time(guild.createdAt) + '\n' + time(guild.createdAt, 'R'), inline: true + name: 'Locale', value: guild.preferredLocale, inline: true + }, + { + name: 'Verification level', value: verificationLevel, inline: true + }, + { + name: 'MFA level', value: mfaLevel, inline: true, }, { name: 'Boosts', value: `${guild.premiumSubscriptionCount} (Level ${guild.premiumTier})`, inline: true }, { - name: 'Members', - value: `${members.size} Total\n${members.size - members.filter(member => member.user.bot).size} Humans\n${members.filter(member => member.user.bot).size} Bots`, + name: `Members (${members.size})`, + value: `${members.size - members.filter(member => member.user.bot).size} Humans, ${members.filter(member => member.user.bot).size} Bots`, inline: true }, { - name: 'Channels', value: `${guild.channels.cache.size} ()` + name: 'Channels', value: `${channels.filter(channel => channel.type === 0 || channel.type === 5).size} Text, ${channels.filter(channel => channel.type === 2 || channel.type === 13).size} Voice`, inline: true + }, + { + name: 'Roles', value: roles.size.toString(), inline: true + }, + { + name: 'Created', value: time(guild.createdAt, 'D') + `, ${time(guild.createdAt, 'R')}`, inline: true + }, + { + name: 'Features', value: guild.features.join(', ') } ]); interaction.reply({ embeds: [embed] }); From e60b50630898b59b4a4a99e0b0abc4cf05faaf31 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 13:43:50 +1100 Subject: [PATCH 40/65] rename --- bot/commands/Utility/{userinfo.js => user.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bot/commands/Utility/{userinfo.js => user.js} (100%) diff --git a/bot/commands/Utility/userinfo.js b/bot/commands/Utility/user.js similarity index 100% rename from bot/commands/Utility/userinfo.js rename to bot/commands/Utility/user.js From 548ae6fab23d165c5c7f134cafd9ad2ec5812ae4 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 13:43:55 +1100 Subject: [PATCH 41/65] rename --- bot/commands/Utility/{serverinfo.js => server.js} | 0 bot/commands/Utility/user.js | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename bot/commands/Utility/{serverinfo.js => server.js} (100%) diff --git a/bot/commands/Utility/serverinfo.js b/bot/commands/Utility/server.js similarity index 100% rename from bot/commands/Utility/serverinfo.js rename to bot/commands/Utility/server.js diff --git a/bot/commands/Utility/user.js b/bot/commands/Utility/user.js index cccacf9..7b190c3 100644 --- a/bot/commands/Utility/user.js +++ b/bot/commands/Utility/user.js @@ -11,10 +11,10 @@ module.exports = class Avatar extends Command { { type: 6, name: 'user', - description: 'The user who you want ' + description: 'The user to get information on' }, ], - this.usage = '/userinfo [user]', + this.usage = '/user [user]', this.friendlyOptions = '`user` - The user to get information on (optional)', this.category = category; } From ac811afc44064d66e671155b1aeb7d09829ccf57 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 13:54:05 +1100 Subject: [PATCH 42/65] use native discord timestamps --- bot/commands/Utility/server.js | 2 +- bot/commands/Utility/user.js | 8 +++----- package-lock.json | 11 ----------- package.json | 1 - 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/bot/commands/Utility/server.js b/bot/commands/Utility/server.js index 6f86054..2aa807c 100644 --- a/bot/commands/Utility/server.js +++ b/bot/commands/Utility/server.js @@ -80,7 +80,7 @@ module.exports = class Avatar extends Command { name: 'Roles', value: roles.size.toString(), inline: true }, { - name: 'Created', value: time(guild.createdAt, 'D') + `, ${time(guild.createdAt, 'R')}`, inline: true + name: 'Created', value: time(guild.createdAt, 'D') + time(guild.createdAt, 'R'), inline: true }, { name: 'Features', value: guild.features.join(', ') diff --git a/bot/commands/Utility/user.js b/bot/commands/Utility/user.js index 7b190c3..c66dcb0 100644 --- a/bot/commands/Utility/user.js +++ b/bot/commands/Utility/user.js @@ -1,7 +1,5 @@ const Command = require('../../base/Command.js'); -const dayjs = require('dayjs'); -dayjs.extend(require('dayjs/plugin/relativeTime')); - +const { time } = require('discord.js'); module.exports = class Avatar extends Command { constructor (name, category) { super (name, category); @@ -57,10 +55,10 @@ module.exports = class Avatar extends Command { name: 'Roles:', value: roles.join(' ') }, { - name: 'Joined Server', value: `${dayjs(member.joinedAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.joinedAt)}*`, inline: true + name: 'Joined Server', value: time(member.joinedAt, 'D') + time(member.joinedAt, 'R'), inline: true }, { - name: 'Joined Discord', value: `${dayjs(member.user.createdAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.user.createdAt)}*`, inline: true + name: 'Joined Discord', value: time(user.createdAt, 'D') + time(user.createdAt, 'R'), inline: true } ]); if (badges.length > 0) { diff --git a/package-lock.json b/package-lock.json index 47fad63..f1847cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "@sentry/node": "^7.23.0", "bufferutil": "^4.0.3", "chalk": "^4.1.2", - "dayjs": "^1.10.6", "discord.js": "^14.7.1", "erlpack": "^0.1.3", "eslint": "^8.29.0", @@ -459,11 +458,6 @@ "node": ">= 8" } }, - "node_modules/dayjs": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz", - "integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==" - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2087,11 +2081,6 @@ "which": "^2.0.1" } }, - "dayjs": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz", - "integrity": "sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==" - }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", diff --git a/package.json b/package.json index 15c5220..bd8900c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "@sentry/node": "^7.23.0", "bufferutil": "^4.0.3", "chalk": "^4.1.2", - "dayjs": "^1.10.6", "discord.js": "^14.7.1", "erlpack": "^0.1.3", "eslint": "^8.29.0", From e40cf2b0a7813b0468fe0b71c50501c9f4b76309 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 19:02:24 +1100 Subject: [PATCH 43/65] uneeded deps --- package-lock.json | 14 ++++++++++++++ package.json | 1 + 2 files changed, 15 insertions(+) diff --git a/package-lock.json b/package-lock.json index f1847cc..2483dac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "erlpack": "^0.1.3", "eslint": "^8.29.0", "fs-readdir-recursive": "^1.1.0", + "moment": "^2.29.4", "node-fetch": "^2.6.7", "pg": "^8.5.1", "pg-format": "^1.0.4", @@ -1042,6 +1043,14 @@ "node": "*" } }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2514,6 +2523,11 @@ "brace-expansion": "^1.1.7" } }, + "moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index bd8900c..624eadb 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "erlpack": "^0.1.3", "eslint": "^8.29.0", "fs-readdir-recursive": "^1.1.0", + "moment": "^2.29.4", "node-fetch": "^2.6.7", "pg": "^8.5.1", "pg-format": "^1.0.4", From a477928374475a349f015f33c414eedff046b61b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 19:02:29 +1100 Subject: [PATCH 44/65] WIP about --- bot/commands/Bot/about.js | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 bot/commands/Bot/about.js diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js new file mode 100644 index 0000000..4da802b --- /dev/null +++ b/bot/commands/Bot/about.js @@ -0,0 +1,50 @@ +const Command = require('../../base/Command.js'); +const { version } = require('discord.js'); +const moment = require('moment'); +const { EmbedBuilder } = require('@discordjs/builders'); +require('moment-duration-format'); + + +module.exports = class About extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'Bot information and statistics', + this.category = category, + this.usage = '/about'; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const uptime = moment.duration(client.uptime).format(' D [days], H [hrs], m [mins], s [secs]'); + + let build = 'production'; + + if (client.config.developmentMode === true) { + build = 'development'; + } + + embed = new EmbedBuilder() + .setColor(client.functions.embedColor(interaction.guild) + .setThumbnail(client.user.vatarURL({format: "png"})) + .setTitle('About me!') + .addFields([ + { + name: 'General', + value: `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${uptime}\``, + inline: true + }, + { + name: 'Technical', + value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Host OS: \`${require("os").type}\`\n• bot version: \`${client.version.number} (${build})\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``, + inline: true + }, + { + name: 'Links', + value: '[Support](https://discord.gg/HCF8mdv) | [Git](https://gitdab.com/embee/woomy)' + } + ]) + interaction.reply({embeds: embed}) + + + } +}; \ No newline at end of file From b561580c683acbb58e56af4bd800a05865f6b9e9 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 19:08:24 +1100 Subject: [PATCH 45/65] +moment-duration-format --- package-lock.json | 11 +++++++++++ package.json | 1 + 2 files changed, 12 insertions(+) diff --git a/package-lock.json b/package-lock.json index 2483dac..97eff8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "eslint": "^8.29.0", "fs-readdir-recursive": "^1.1.0", "moment": "^2.29.4", + "moment-duration-format": "^2.3.2", "node-fetch": "^2.6.7", "pg": "^8.5.1", "pg-format": "^1.0.4", @@ -1051,6 +1052,11 @@ "node": "*" } }, + "node_modules/moment-duration-format": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/moment-duration-format/-/moment-duration-format-2.3.2.tgz", + "integrity": "sha512-cBMXjSW+fjOb4tyaVHuaVE/A5TqkukDWiOfxxAjY+PEqmmBQlLwn+8OzwPiG3brouXKY5Un4pBjAeB6UToXHaQ==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2528,6 +2534,11 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" }, + "moment-duration-format": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/moment-duration-format/-/moment-duration-format-2.3.2.tgz", + "integrity": "sha512-cBMXjSW+fjOb4tyaVHuaVE/A5TqkukDWiOfxxAjY+PEqmmBQlLwn+8OzwPiG3brouXKY5Un4pBjAeB6UToXHaQ==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index 624eadb..a183f1b 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "eslint": "^8.29.0", "fs-readdir-recursive": "^1.1.0", "moment": "^2.29.4", + "moment-duration-format": "^2.3.2", "node-fetch": "^2.6.7", "pg": "^8.5.1", "pg-format": "^1.0.4", From df8e98a7961803dc90414744a76c7b793bcb0013 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 13 Dec 2022 19:08:29 +1100 Subject: [PATCH 46/65] changes --- bot/commands/Bot/about.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js index 4da802b..7ee86c5 100644 --- a/bot/commands/Bot/about.js +++ b/bot/commands/Bot/about.js @@ -1,7 +1,6 @@ const Command = require('../../base/Command.js'); const { version } = require('discord.js'); const moment = require('moment'); -const { EmbedBuilder } = require('@discordjs/builders'); require('moment-duration-format'); @@ -23,9 +22,8 @@ module.exports = class About extends Command { build = 'development'; } - embed = new EmbedBuilder() - .setColor(client.functions.embedColor(interaction.guild) - .setThumbnail(client.user.vatarURL({format: "png"})) + const embed = new client.EmbedBuilder() + .setThumbnail(client.user.avatarURL({format: "png"})) .setTitle('About me!') .addFields([ { @@ -42,8 +40,8 @@ module.exports = class About extends Command { name: 'Links', value: '[Support](https://discord.gg/HCF8mdv) | [Git](https://gitdab.com/embee/woomy)' } - ]) - interaction.reply({embeds: embed}) + ]); + interaction.reply({embeds: embed}); } From 84036ecbb5f8fd9eb233620cb4a4116c02719c8b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 17 Dec 2022 20:58:25 +1100 Subject: [PATCH 47/65] about command done --- bot/commands/Bot/about.js | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js index 7ee86c5..ca44197 100644 --- a/bot/commands/Bot/about.js +++ b/bot/commands/Bot/about.js @@ -1,5 +1,5 @@ const Command = require('../../base/Command.js'); -const { version } = require('discord.js'); +const { version, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js'); const moment = require('moment'); require('moment-duration-format'); @@ -15,34 +15,42 @@ module.exports = class About extends Command { async run (client, interaction, data) { //eslint-disable-line no-unused-vars const uptime = moment.duration(client.uptime).format(' D [days], H [hrs], m [mins], s [secs]'); + const bot = await interaction.guild.members.fetch(client.user.id, {force: true}); + const userCount = await client.db.countUsers(); - let build = 'production'; - + let build = 'prod'; if (client.config.developmentMode === true) { - build = 'development'; + build = 'dev'; } + const links = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setURL('https://discord.gg/HCF8mdv') + .setLabel('Support') + .setStyle(ButtonStyle.Link), + new ButtonBuilder() + .setURL('https://gitdab.com/embee/woomy') + .setLabel('Source') + .setStyle(ButtonStyle.Link), + ); + const embed = new client.EmbedBuilder() - .setThumbnail(client.user.avatarURL({format: "png"})) + .setThumbnail(client.user.avatarURL({format: 'png'})) + .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) .setTitle('About me!') .addFields([ { name: 'General', - value: `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${uptime}\``, + value: `• Users (approx): \`${userCount.rows[0].count.toString()}\`\n• Channels: \`${client.channels.cache.size}\`\n• Servers: \`${client.guilds.cache.size}\`\n• Commands: \`${client.commands.size}\`\n• Uptime: \`${uptime}\``, inline: true }, { name: 'Technical', - value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Host OS: \`${require("os").type}\`\n• bot version: \`${client.version.number} (${build})\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``, + value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Host OS: \`${require('os').type}\`\n• Woomy version: \`v${client.version} ${build}\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``, inline: true - }, - { - name: 'Links', - value: '[Support](https://discord.gg/HCF8mdv) | [Git](https://gitdab.com/embee/woomy)' } ]); - interaction.reply({embeds: embed}); - - + return interaction.reply({ embeds: [embed], components: [links] }); } }; \ No newline at end of file From 7acf3301adffccbaa282cf1043f52d19fe90ad08 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 17 Dec 2022 21:03:36 +1100 Subject: [PATCH 48/65] new functions to get number of rows in db --- bot/util/database.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bot/util/database.js b/bot/util/database.js index eb4fd14..74c3d8d 100644 --- a/bot/util/database.js +++ b/bot/util/database.js @@ -161,6 +161,21 @@ class Database { const res = await this.pool.query('INSERT INTO users (user_id) VALUES ($1) RETURNING *;', [id]); return res.rows[0]; } + + async countGuilds () { + const res = await this.pool.query('SELECT COUNT(*) FROM guilds;'); + return res.rows[0].count; + } + + async countMembers () { + const res = await this.pool.query('SELECT COUNT(*) FROM members;'); + return res.rows[0].count; + } + + async countUsers () { + const res = await this.pool.query('SELECT COUNT(*) FROM users;'); + return res.rows[0].count; + } } module.exports = Database; \ No newline at end of file From 816e39df5cb9b252e3f144ad8b8681c29d2f04d3 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 17 Dec 2022 21:03:42 +1100 Subject: [PATCH 49/65] small changes --- bot/commands/Bot/about.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js index ca44197..9efa5ae 100644 --- a/bot/commands/Bot/about.js +++ b/bot/commands/Bot/about.js @@ -36,21 +36,23 @@ module.exports = class About extends Command { ); const embed = new client.EmbedBuilder() + .setTitle('About me') .setThumbnail(client.user.avatarURL({format: 'png'})) .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) - .setTitle('About me!') .addFields([ { name: 'General', - value: `• Users (approx): \`${userCount.rows[0].count.toString()}\`\n• Channels: \`${client.channels.cache.size}\`\n• Servers: \`${client.guilds.cache.size}\`\n• Commands: \`${client.commands.size}\`\n• Uptime: \`${uptime}\``, + value: `• Users: \`${userCount}\`\n• Servers: \`${client.guilds.cache.size}\`\n• Commands: \`${client.commands.size}\`\n• Uptime: \`${uptime}\``, inline: true }, { name: 'Technical', - value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Host OS: \`${require('os').type}\`\n• Woomy version: \`v${client.version} ${build}\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``, + value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Woomy version: \`v${client.version} ${build}\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``, inline: true } - ]); + ]) + .setFooter({ text: 'Made in Australia'}); + return interaction.reply({ embeds: [embed], components: [links] }); } }; \ No newline at end of file From 9a8c8892347c24e5c69faa92914ca73bf9aa192c Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 18 Dec 2022 14:45:25 +1100 Subject: [PATCH 50/65] user cmd now displays discord badges --- bot/commands/Utility/user.js | 5 ++++- botconfig.json.example | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bot/commands/Utility/user.js b/bot/commands/Utility/user.js index c66dcb0..e78c44e 100644 --- a/bot/commands/Utility/user.js +++ b/bot/commands/Utility/user.js @@ -25,7 +25,10 @@ module.exports = class Avatar extends Command { const badges = []; if (client.config.devIds.includes(user.id)) badges.push('<:Woomy_Developer:816822318289518622> '); if (user.id === member.guild.ownerId) badges.push('<:owner:685703193694306331>'); - if (user.bot) badges.push('<:bot:686489601678114859>'); + + user.flags?.toArray().forEach(flag => { + badges.push(`${client.config.emojis[flag] ?? flag}`); + }); const roles = []; for (const roleId of member._roles) { diff --git a/botconfig.json.example b/botconfig.json.example index 96a9682..c067788 100644 --- a/botconfig.json.example +++ b/botconfig.json.example @@ -27,6 +27,18 @@ "botError": "<:warning:701681841190600704>", "userError": "<:error:466995152976871434>", "permError": "<:denied:466995195150336020>", - "wait": "<:wait:467115775849922570>" + "wait": "<:wait:467115775849922570>", + "ActiveDeveloper": "<:ActiveDeveloper:1053643399477084261>", + "VerifiedDeveloper": "<:VerifiedDeveloper:1053643383631003709>", + "BugHunterLevel1": "<:BugHunterLevel1:1053643390853595186>", + "BugHunterLevel2": "<:BugHunterLevel2:1053643388836130826>", + "CertifiedModerator": "<:CertifiedModerator:1053643397103104070>", + "HypeSquadOnlineHouse1": "<:HypeSquadOnlineHouse1:1053643379948400730>", + "HypeSquadOnlineHouse2": "<:HypeSquadOnlineHouse2:1053643378253897758>", + "HypeSquadOnlineHouse3": "<:HypeSquadOnlineHouse3:1053643381823246388>", + "Hypesquad": "<:Hypesquad:1053643395215663144>", + "Partner": "<:Partner:1053643375921860618>", + "PremiumEarlySupporter": "<:PremiumEarlySupporter:1053643386550243338>", + "Staff": "<:Staff:1053643393248534652>" } } \ No newline at end of file From f2aadf49532a6d9f1327d8aebdebd380794164c7 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 18 Dec 2022 16:20:57 +1100 Subject: [PATCH 51/65] different symbol for about + remove useless usage --- bot/commands/Bot/about.js | 7 +++---- bot/commands/Utility/server.js | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js index 9efa5ae..2fe794e 100644 --- a/bot/commands/Bot/about.js +++ b/bot/commands/Bot/about.js @@ -9,8 +9,7 @@ module.exports = class About extends Command { super (name, category); this.name = name, this.description = 'Bot information and statistics', - this.category = category, - this.usage = '/about'; + this.category = category; } async run (client, interaction, data) { //eslint-disable-line no-unused-vars @@ -42,12 +41,12 @@ module.exports = class About extends Command { .addFields([ { name: 'General', - value: `• Users: \`${userCount}\`\n• Servers: \`${client.guilds.cache.size}\`\n• Commands: \`${client.commands.size}\`\n• Uptime: \`${uptime}\``, + value: `» Users: \`${userCount}\`\n» Servers: \`${client.guilds.cache.size}\`\n» Commands: \`${client.commands.size}\`\n» Uptime: \`${uptime}\``, inline: true }, { name: 'Technical', - value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Woomy version: \`v${client.version} ${build}\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``, + value: `» RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n» Woomy version: \`v${client.version} ${build}\`\n» discord.js version: \`v${version}\`\n» node.js version: \`${process.version}\``, inline: true } ]) diff --git a/bot/commands/Utility/server.js b/bot/commands/Utility/server.js index 2aa807c..01a395c 100644 --- a/bot/commands/Utility/server.js +++ b/bot/commands/Utility/server.js @@ -6,7 +6,6 @@ module.exports = class Avatar extends Command { super (name, category); this.name = name, this.description = 'View information on this server.', - this.usage = '/server', this.category = category; } From 83a9a1f65cca695448fd023303cdbf0af56f2de6 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 18 Dec 2022 16:21:07 +1100 Subject: [PATCH 52/65] WIP: help --- bot/commands/Bot/help.js | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 bot/commands/Bot/help.js diff --git a/bot/commands/Bot/help.js b/bot/commands/Bot/help.js new file mode 100644 index 0000000..2c79077 --- /dev/null +++ b/bot/commands/Bot/help.js @@ -0,0 +1,87 @@ +const Command = require('../../base/Command.js'); + +module.exports = class Help extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'Lists all the commands you can use', + this.options = [ + { + type: 3, + name: 'command', + description: 'The command to get information on' + }, + ], + this.usage = '/help [command]', + this.friendlyOptions = '`command` - The command to get information on', + this.category = category; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const input = await interaction.options.get('command'); + const bot = await interaction.guild.members.fetch(client.user.id, {force: true}); + const categories = []; + + client.commands.forEach(cmd => { + if (!categories.includes(cmd.category)) { + if (cmd.category === 'Developer' && !client.config.devIds.includes(interaction.user.id)) return; + categories.push(cmd.category); + } + }); + + + + if (!input) { + const fields = []; + const embed = new client.EmbedBuilder() + .setTitle('Command list') + .setColor(bot.displayHexColor) + .setDescription( + ` + » Use \`/help [command]\` to get full information on a specific command. + » [Click here](https://discord.gg/HCF8mdv) to join my support server if you need help! + » [Click here](https://discord.com/oauth2/authorize?client_id=${client.user.id}&permissions=2134240503&scope=bot) to invite me to your server! + ` + ) + .setFooter({text: 'Thank you for using Woomy! 🦑'}); + + categories.forEach(cat => { + let cmds = '`'; + const filteredCmds = client.commands.filter(cmd => cmd.category === cat); + filteredCmds.forEach(cmd => { + cmds += (cmd.name + '`, `'); + }); + + cmds = cmds.substr(0, cmds.length - 3); + + fields.push({name: cat.toProperCase() + ':', value: cmds}); + }); + + embed.addFields(fields); + + return interaction.reply({ embeds: [embed] }); + } else if (client.commands.has(input.value)) { + const command = await client.commands.get(input.value); + const embed = new client.EmbedBuilder() + .setTitle(`${command.category} -> ${command.name.toProperCase()}`) + .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) + .setDescription(command.description) + .setFooter({ text: '<> = required, / = either/or, [] = optional'}); + + const fields = []; + + if (command.usage !== 'No usage information provided.') { + fields.push({name: 'Usage:', value: command.usage}); + } + + if (command.friendlyOptions !== 'No options provided.') { + fields.push({name: 'Options', value: command.friendlyOptions}); + } + + if (fields.length > 0) embed.addFields(fields); + + return interaction.reply({ embeds: [embed] }); + } + return interaction.reply(`${client.config.emojis.userError} A command of that name could not be found.`); + } +}; \ No newline at end of file From be8c4f35d7ba803ae25429ad34c0813a1f27ff4a Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 18 Dec 2022 17:44:03 +1100 Subject: [PATCH 53/65] DONE: colour command --- bot/commands/Fun/colour.js | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 bot/commands/Fun/colour.js diff --git a/bot/commands/Fun/colour.js b/bot/commands/Fun/colour.js new file mode 100644 index 0000000..94d6d45 --- /dev/null +++ b/bot/commands/Fun/colour.js @@ -0,0 +1,47 @@ +const Command = require('../../base/Command.js'); + +module.exports = class Colour extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'Shows you a random colour or a colour generated from a hex code or text.', + this.category = category; + this.options = [ + { + type: 3, + name: 'input', + description: 'hex code/text', + } + ]; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const input = await interaction.options.get('input'); + let color = null; + + if (!input) { + color = client.functions.randomColor(); + } else if (input.value.match(/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)) { + color = input.value; + } else { + let hash = 0; + const string = input.value; + for (let i = 0; i < string.length; i++) { + hash = string.charCodeAt(i) + ((hash << 5) - hash); + } + color = '#'; + for (let i = 0; i < 3; i++) { + const value = (hash >> (i * 8)) & 0xFF; + color += ('00' + value.toString(16)).substr(-2); + } + } + + const embed = new client.EmbedBuilder() + .setTitle(color) + .setColor(color) + .setImage(`https://fakeimg.pl/256x256/${color.replace('#', '')}/?text=%20`) + .setFooter({ text: 'Wow, thats a pretty one!'}); + + interaction.reply({embeds: [embed]}); + } +}; \ No newline at end of file From 6f4545de4ce66c7585019b5c99d9b95fd514c8cb Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sun, 18 Dec 2022 17:45:22 +1100 Subject: [PATCH 54/65] grammar --- bot/commands/Fun/colour.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/commands/Fun/colour.js b/bot/commands/Fun/colour.js index 94d6d45..7198a3f 100644 --- a/bot/commands/Fun/colour.js +++ b/bot/commands/Fun/colour.js @@ -4,7 +4,7 @@ module.exports = class Colour extends Command { constructor (name, category) { super (name, category); this.name = name, - this.description = 'Shows you a random colour or a colour generated from a hex code or text.', + this.description = 'Shows you a random colour, or a colour generated from a hex code or text.', this.category = category; this.options = [ { From bec72ade6a0f74b907d38344c3d3e87ab99e0114 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 21 Dec 2022 15:53:08 +1100 Subject: [PATCH 55/65] DONE: garfield command --- bot/commands/Fun/garfield.js | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 bot/commands/Fun/garfield.js diff --git a/bot/commands/Fun/garfield.js b/bot/commands/Fun/garfield.js new file mode 100644 index 0000000..02ee8b6 --- /dev/null +++ b/bot/commands/Fun/garfield.js @@ -0,0 +1,80 @@ +const Command = require('../../base/Command.js'); +const fetch = require('node-fetch'); +const moment = require('moment'); + +module.exports = class Garfield extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'John I require lasagna', + this.category = category; + this.options = [ + { + type: 1, + name: 'daily', + description: 'Get the comic for the current day.' + }, + { + type: 1, + name: 'random', + description: 'Get a random comic.' + }, + { + type: 1, + name: 'from', + description: 'Get the comic for a specific date.', + options: [ + { + type: 3, + name: 'date', + description: 'The date the comic you wish to view was published, formatted like so: YYYY-MM-DD', + required: true + } + ] + } + ]; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + // set to get todays comic + let url = 'https://garfield-comics.glitch.me/~SRoMG/?date=' + new Date(); + const subCmd = interaction.options.getSubcommand(); + const bot = await interaction.guild.members.fetch(client.user.id, {force: true}); + + if (subCmd === 'from') { + let unverifiedDate = await interaction.options.get('date').value; + + unverifiedDate = unverifiedDate.replaceAll('.', '-'); + unverifiedDate = unverifiedDate.replaceAll('/', '-'); + + const verifiedDate = moment(unverifiedDate, 'YYYY-MM-DD', true); + + if (verifiedDate.isValid() === false) { + return interaction.reply({ + content: `${client.config.emojis.userError} The date you provided is not valid. Please format the date as follows: \`YYYY-MM-DD\``, + ephemeral: true + }); + } + url = 'https://garfield-comics.glitch.me/~SRoMG/?date=' + verifiedDate; + + } else if (subCmd === 'random') { + url = 'https://garfield-comics.glitch.me/~SRoMG/?date=xxxx'; + } + + await interaction.deferReply(); + + fetch(url, { headers: { 'User-Agent': client.config.userAgent }}) + .then(res => res.json()) + .then(json => { + const embed = new client.EmbedBuilder() + .setTitle(`#${json.data.number}: ${json.data.name}`) + .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) + .setImage(json.data.image.src); + interaction.editReply({ embeds: [embed] }); + }).catch(err => { + client.logger.error('GARFIELD_COMMAND_ERROR', `API err or err replying: ${err}`); + return interaction.editReply(`${client.config.emojis.botError} An API error occurred, sorry! I've reported this to my developers.`); + }); + + } +}; \ No newline at end of file From fd29ec513775f219da602e179185f2d7ffd313a2 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 21 Dec 2022 15:54:43 +1100 Subject: [PATCH 56/65] updated git repos --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a183f1b..d31c8da 100644 --- a/package.json +++ b/package.json @@ -26,12 +26,12 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/woomyware/v2.git" + "url": "git+https://gitdab.com/embee/woomy-v2.git" }, "author": "Emily J. (mudkipscience)", "license": "AGPL-3.0", "bugs": { - "url": "https://github.com/woomyware/v2/issues" + "url": "https://gitdab.com/embee/woomy-v2/issues" }, - "homepage": "https://github.com/woomyware/v2#readme" + "homepage": "https://gitdab.com/embee/woomy-v2" } From 2b8c67b16c6900809fee25043d9ceac97d6b3b64 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 21 Dec 2022 16:10:53 +1100 Subject: [PATCH 57/65] modified cooldowns and +inspire command --- bot/commands/Fun/garfield.js | 7 ++++--- bot/commands/Fun/inspire.js | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 bot/commands/Fun/inspire.js diff --git a/bot/commands/Fun/garfield.js b/bot/commands/Fun/garfield.js index 02ee8b6..e842921 100644 --- a/bot/commands/Fun/garfield.js +++ b/bot/commands/Fun/garfield.js @@ -7,7 +7,8 @@ module.exports = class Garfield extends Command { super (name, category); this.name = name, this.description = 'John I require lasagna', - this.category = category; + this.category = category, + this.cooldown = 20000, this.options = [ { type: 1, @@ -71,10 +72,10 @@ module.exports = class Garfield extends Command { .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) .setImage(json.data.image.src); interaction.editReply({ embeds: [embed] }); - }).catch(err => { + }) + .catch(err => { client.logger.error('GARFIELD_COMMAND_ERROR', `API err or err replying: ${err}`); return interaction.editReply(`${client.config.emojis.botError} An API error occurred, sorry! I've reported this to my developers.`); }); - } }; \ No newline at end of file diff --git a/bot/commands/Fun/inspire.js b/bot/commands/Fun/inspire.js new file mode 100644 index 0000000..1e37cf4 --- /dev/null +++ b/bot/commands/Fun/inspire.js @@ -0,0 +1,23 @@ +const Command = require('../../base/Command.js'); +const fetch = require('node-fetch'); + +module.exports = class Inspire extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'Generates a (likely terrible) inspirational quote.', + this.category = category, + this.cooldown = 10000; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + interaction.deferReply(); + fetch('http://inspirobot.me/api?generate=true', { headers: { 'User-Agent': client.config.userAgent }}) + .then(res => res.text()) + .then(body => interaction.editReply(body)) + .catch(err => { + client.logger.error('INSPIRE_COMMAND_ERROR', `API err or err replying: ${err}`); + return interaction.editReply(`${client.config.emojis.botError} An API error occurred, sorry! I've reported this to my developers.`); + }); + } +}; \ No newline at end of file From fa0be297bacd61d6f7a825d00f20b03441d67aae Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 24 Dec 2022 22:53:14 +1100 Subject: [PATCH 58/65] add cache mainly for API data --- bot/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/index.js b/bot/index.js index 80c1bbb..12acf67 100644 --- a/bot/index.js +++ b/bot/index.js @@ -33,6 +33,9 @@ class WoomyClient extends Discord.Client { this.aliases = new Discord.Collection(); this.eventModules = new Discord.Collection(); this.cooldowns = new Discord.Collection(); + + // Cache we can store stuff in + this.cache = new Discord.Collection(); } // Listen for Discord events and pass needed information to the event handler so we can respond to them. From 9e77c291cb974ab7e3a9ffa716a3e4a6d656ae14 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 24 Dec 2022 22:55:08 +1100 Subject: [PATCH 59/65] fix a bunch of stuff that is bad practice --- bot/commands/Bot/about.js | 6 +++--- bot/commands/Bot/help.js | 2 +- bot/commands/Fun/garfield.js | 2 +- bot/commands/Fun/inspire.js | 2 +- bot/commands/Utility/avatar.js | 2 +- bot/commands/Utility/server.js | 4 ++-- bot/commands/Utility/user.js | 6 +++--- bot/commands/Utility/weather.js | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bot/commands/Bot/about.js b/bot/commands/Bot/about.js index 2fe794e..a6e6915 100644 --- a/bot/commands/Bot/about.js +++ b/bot/commands/Bot/about.js @@ -37,8 +37,8 @@ module.exports = class About extends Command { const embed = new client.EmbedBuilder() .setTitle('About me') .setThumbnail(client.user.avatarURL({format: 'png'})) - .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) - .addFields([ + .setColor(bot.displayHexColor) + .addFields( { name: 'General', value: `» Users: \`${userCount}\`\n» Servers: \`${client.guilds.cache.size}\`\n» Commands: \`${client.commands.size}\`\n» Uptime: \`${uptime}\``, @@ -49,7 +49,7 @@ module.exports = class About extends Command { value: `» RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n» Woomy version: \`v${client.version} ${build}\`\n» discord.js version: \`v${version}\`\n» node.js version: \`${process.version}\``, inline: true } - ]) + ) .setFooter({ text: 'Made in Australia'}); return interaction.reply({ embeds: [embed], components: [links] }); diff --git a/bot/commands/Bot/help.js b/bot/commands/Bot/help.js index 2c79077..1c7c6a4 100644 --- a/bot/commands/Bot/help.js +++ b/bot/commands/Bot/help.js @@ -64,7 +64,7 @@ module.exports = class Help extends Command { const command = await client.commands.get(input.value); const embed = new client.EmbedBuilder() .setTitle(`${command.category} -> ${command.name.toProperCase()}`) - .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) + .setColor(bot.displayHexColor) .setDescription(command.description) .setFooter({ text: '<> = required, / = either/or, [] = optional'}); diff --git a/bot/commands/Fun/garfield.js b/bot/commands/Fun/garfield.js index e842921..e59ef87 100644 --- a/bot/commands/Fun/garfield.js +++ b/bot/commands/Fun/garfield.js @@ -69,7 +69,7 @@ module.exports = class Garfield extends Command { .then(json => { const embed = new client.EmbedBuilder() .setTitle(`#${json.data.number}: ${json.data.name}`) - .setColor(bot.user.hexAccentColor ?? bot.displayHexColor) + .setColor(bot.displayHexColor) .setImage(json.data.image.src); interaction.editReply({ embeds: [embed] }); }) diff --git a/bot/commands/Fun/inspire.js b/bot/commands/Fun/inspire.js index 1e37cf4..169b1f7 100644 --- a/bot/commands/Fun/inspire.js +++ b/bot/commands/Fun/inspire.js @@ -11,7 +11,7 @@ module.exports = class Inspire extends Command { } async run (client, interaction, data) { //eslint-disable-line no-unused-vars - interaction.deferReply(); + await interaction.deferReply(); fetch('http://inspirobot.me/api?generate=true', { headers: { 'User-Agent': client.config.userAgent }}) .then(res => res.text()) .then(body => interaction.editReply(body)) diff --git a/bot/commands/Utility/avatar.js b/bot/commands/Utility/avatar.js index e189e3e..65ef647 100644 --- a/bot/commands/Utility/avatar.js +++ b/bot/commands/Utility/avatar.js @@ -28,6 +28,6 @@ module.exports = class Avatar extends Command { .setDescription(`[Global avatar](${user.avatarURL({extension: 'png', 'size': 4096})})`) .setImage(member.displayAvatarURL({extension: 'png', 'size': 4096})); - await interaction.reply({embeds: [embed]}); + interaction.reply({embeds: [embed]}); } }; \ No newline at end of file diff --git a/bot/commands/Utility/server.js b/bot/commands/Utility/server.js index 01a395c..16f6974 100644 --- a/bot/commands/Utility/server.js +++ b/bot/commands/Utility/server.js @@ -47,7 +47,7 @@ module.exports = class Avatar extends Command { .setColor(client.functions.embedColor(guild)) .setTitle(guild.name) .setThumbnail(guild.iconURL({extension: 'png', 'size': 4096})) - .addFields([ + .addFields( { name: 'ID', value: guild.id, inline: true }, @@ -84,7 +84,7 @@ module.exports = class Avatar extends Command { { name: 'Features', value: guild.features.join(', ') } - ]); + ); interaction.reply({ embeds: [embed] }); } }; \ No newline at end of file diff --git a/bot/commands/Utility/user.js b/bot/commands/Utility/user.js index e78c44e..fd4eb05 100644 --- a/bot/commands/Utility/user.js +++ b/bot/commands/Utility/user.js @@ -44,7 +44,7 @@ module.exports = class Avatar extends Command { .setTitle(member.user.username + '#' + member.user.discriminator) .setColor(user.hexAccentColor ?? member.displayHexColor) .setThumbnail(member.displayAvatarURL({extension: 'png', 'size': 4096})) - .addFields([ + .addFields( { name: 'Display Name', value: member.nick || user.username, inline: true }, @@ -63,10 +63,10 @@ module.exports = class Avatar extends Command { { name: 'Joined Discord', value: time(user.createdAt, 'D') + time(user.createdAt, 'R'), inline: true } - ]); + ); if (badges.length > 0) { embed.setDescription(badges.join(' ')); } - return await interaction.reply({embeds: [embed]}); + return interaction.reply({embeds: [embed]}); } }; \ No newline at end of file diff --git a/bot/commands/Utility/weather.js b/bot/commands/Utility/weather.js index 0382f79..14f3334 100644 --- a/bot/commands/Utility/weather.js +++ b/bot/commands/Utility/weather.js @@ -64,7 +64,7 @@ module.exports = class Weather extends Command { .setTitle('Current conditions in ' + city.toProperCase() + ', ' + ISO2.code[json.sys.country]) .setThumbnail(`https://openweathermap.org/img/wn/${json.weather[0].icon}@4x.png`) .setColor(embedColor) - .addFields([ + .addFields( { name: 'Condition:', value: json.weather[0].main, inline: true }, { name: 'Temperature:', value: `${tempCelsius}°C ・ ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, inline: true }, { name: 'Min/Max:', value:` @@ -74,7 +74,7 @@ module.exports = class Weather extends Command { { name: 'Humidity:', value: `${json.main.humidity}%`, inline: true }, { name: 'Wind Speed:', value: `${Math.round(json.wind.speed * 10) / 10}km/h ・ ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, inline: true }, { name: 'Wind Direction:', value: windrose.getPoint(json.wind.deg).name, inline: true} - ]) + ) .setFooter({ text: 'Powered by openweathermap.org'}); return interaction.reply({embeds: [embed]}); From 0eb76aac2bac30f982ca0b696696ddde3119e44c Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 26 Dec 2022 16:31:54 +1100 Subject: [PATCH 60/65] 1/3 WIP splatnet --- bot/commands/Utility/splatnet.js | 182 +++++++++++++++++++++++++++++++ package-lock.json | 169 +++++++++++++++------------- package.json | 5 +- 3 files changed, 278 insertions(+), 78 deletions(-) create mode 100644 bot/commands/Utility/splatnet.js diff --git a/bot/commands/Utility/splatnet.js b/bot/commands/Utility/splatnet.js new file mode 100644 index 0000000..3aef77e --- /dev/null +++ b/bot/commands/Utility/splatnet.js @@ -0,0 +1,182 @@ +const Command = require('../../base/Command.js'); +const fetch = require('node-fetch'); +const { pagination } = require('@devraelfreeze/discordjs-pagination'); +const prettifyMiliseconds = require('pretty-ms'); + +module.exports = class Splatnet extends Command { + constructor (name, category) { + super (name, category); + this.name = name, + this.description = 'View the current map rotation, salmon run gear and SplatNet gear for Splatoon 3', + this.category = category, + this.options = [ + { + type: 1, + name: 'maps', + description: 'Get current and upcoming map rotations for turf war, anarchy and X-rank battles.' + }, + { + type: 1, + name: 'sr', + description: 'Get current and upcoming map rotations for salmon run, as well as the monthly gear reward.' + }, + { + type: 1, + name: 'gear', + description: 'View the gear currently available on the SplatNet mobile app.' + } + ]; + } + + async run (client, interaction, data) { //eslint-disable-line no-unused-vars + const subCmd = interaction.options.getSubcommand(); + const embeds = []; + + await interaction.deferReply(); + + if (subCmd === 'maps') { + if (client.cache.has('SPLATNET_MAPS') && Date.now() > client.cache.get('SPLATNET_MAPS').expiry) { + client.cache.delete('SPLATNET_MAPS'); + } + + if (!client.cache.has('SPLATNET_MAPS')) { + fetch('https://splatoon3.ink/data/schedules.json', { headers: { 'User-Agent': client.config.userAgent }}) + .then(res => res.json()) + .then(async json => { + // cache data so we dont spam API + client.cache.set('SPLATNET_MAPS', {data: json, expiry: new Date(json.data.xSchedules.nodes[0].endTime)}); + + embeds.push(new client.EmbedBuilder() + .setTitle('Current Splatoon 3 Maps') + .setColor(interaction.guild.members.me.displayHexColor) + .addFields( + { + name: '<:turf_war:814651383911153692> Turf War', + value: `${json.data.regularSchedules.nodes[0].regularMatchSetting.vsStages[0].name}\n${json.data.regularSchedules.nodes[0].regularMatchSetting.vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Series: ${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Open: ${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsStages[1].name}`, + inline: true + }, + { + name: `<:xRank:1056806341575970898> X rank: ${json.data.xSchedules.nodes[0].xMatchSetting.vsRule.name}`, + value: `${json.data.xSchedules.nodes[0].xMatchSetting.vsStages[0].name}\n${json.data.xSchedules.nodes[0].xMatchSetting.vsStages[1].name}`, + inline: true + } + ) + .setFooter({ text: `Maps changing in ${prettifyMiliseconds(new Date(json.data.xSchedules.nodes[0].endTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + for (let i = 1; i < json.data.regularSchedules.nodes.length; i++) { + embeds.push(new client.EmbedBuilder() + .setTitle('Upcoming Splatoon 3 Maps') + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: '<:turf_war:814651383911153692> Turf War', + value: `${json.data.regularSchedules.nodes[i].regularMatchSetting.vsStages[0].name}\n${json.data.regularSchedules.nodes[i].regularMatchSetting.vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Series: ${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[0].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[0].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[0].vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Open: ${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[1].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[1].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[1].vsStages[1].name}`, + inline: true + }, + { + name: `X rank: ${json.data.xSchedules.nodes[i].xMatchSetting.vsRule.name}`, + value: `${json.data.xSchedules.nodes[i].xMatchSetting.vsStages[0].name}\n${json.data.xSchedules.nodes[i].xMatchSetting.vsStages[1].name}`, + inline: true + } + ) + .setFooter({ text: `Starting in ${prettifyMiliseconds(new Date(json.data.xSchedules.nodes[i].startTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + } + await pagination({ + embeds: embeds, + author: interaction.member.user, + interaction: interaction, + time: 60000, + disableButtons: false, + }); + }) + .catch(err => { + client.logger.error('SPLATNET_COMMAND_ERROR', `API err or err replying: ${err.stack}`); + return interaction.editReply(`${client.config.emojis.botError} An error occurred, sorry! I've reported this to my developers.`); + }); + } else { + let json = client.cache.get('SPLATNET_MAPS'); + json = json.data; + embeds.push(new client.EmbedBuilder() + .setTitle('Current Splatoon 3 Maps') + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: '<:turf_war:814651383911153692> Turf War', + value: `${json.data.regularSchedules.nodes[0].regularMatchSetting.vsStages[0].name}\n${json.data.regularSchedules.nodes[0].regularMatchSetting.vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Series: ${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Open: ${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsStages[1].name}`, + inline: true + }, + { + name: `X rank: ${json.data.xSchedules.nodes[0].xMatchSetting.vsRule.name}`, + value: `${json.data.xSchedules.nodes[0].xMatchSetting.vsStages[0].name}\n${json.data.xSchedules.nodes[0].xMatchSetting.vsStages[1].name}`, + inline: true + } + ) + .setFooter({ text: `Maps changing in ${prettifyMiliseconds(new Date(json.data.xSchedules.nodes[0].endTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + + for (let i = 1; i < json.data.regularSchedules.nodes.length; i++) { + embeds.push(new client.EmbedBuilder() + .setTitle('Upcoming Splatoon 3 Maps') + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: '<:turf_war:814651383911153692> Turf War', + value: `${json.data.regularSchedules.nodes[i].regularMatchSetting.vsStages[0].name}\n${json.data.regularSchedules.nodes[i].regularMatchSetting.vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Series: ${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[0].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[0].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[0].vsStages[1].name}`, + inline: true + }, + { + name: `<:ranked:814651402479468544> Anarchy Open: ${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[1].vsRule.name}`, + value: `${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[1].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[i].bankaraMatchSettings[1].vsStages[1].name}`, + inline: true + }, + { + name: `X rank: ${json.data.xSchedules.nodes[i].xMatchSetting.vsRule.name}`, + value: `${json.data.xSchedules.nodes[i].xMatchSetting.vsStages[0].name}\n${json.data.xSchedules.nodes[i].xMatchSetting.vsStages[1].name}`, + inline: true + } + ) + .setFooter({ text: `Starting in ${prettifyMiliseconds(new Date(json.data.xSchedules.nodes[i].startTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + } + interaction.editReply({embeds: [embeds[0]]}); + } + + } + } +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 97eff8c..ce94af1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,13 @@ "version": "2.0.0", "license": "AGPL-3.0", "dependencies": { - "@sentry/node": "^7.23.0", + "@devraelfreeze/discordjs-pagination": "^2.6.8", + "@sentry/node": "^7.28.1", "bufferutil": "^4.0.3", "chalk": "^4.1.2", "discord.js": "^14.7.1", "erlpack": "^0.1.3", - "eslint": "^8.29.0", + "eslint": "^8.30.0", "fs-readdir-recursive": "^1.1.0", "moment": "^2.29.4", "moment-duration-format": "^2.3.2", @@ -27,6 +28,14 @@ "zlib-sync": "^0.1.7" } }, + "node_modules/@devraelfreeze/discordjs-pagination": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/@devraelfreeze/discordjs-pagination/-/discordjs-pagination-2.6.8.tgz", + "integrity": "sha512-qcVyCZ2svyqbFm4EPVeRk89TDcHHD6hLYbMv0gNob+OcM1Pjcr/GTVd2tyynoU3bZDNnhEfekIHVugORxKqFjg==", + "dependencies": { + "discord.js": "^14.2.0" + } + }, "node_modules/@discordjs/builders": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.4.0.tgz", @@ -88,14 +97,14 @@ } }, "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==", "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", @@ -110,9 +119,9 @@ } }, "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==", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -203,12 +212,12 @@ } }, "node_modules/@sentry/core": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.23.0.tgz", - "integrity": "sha512-oNLGsscSdMs1urCbpwe868NsoJWyeTOQXOm5w2e78yE7G6zm2Ra473NQio3lweaEvjQgSGpFyEfAn/3ubZbtPw==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.28.1.tgz", + "integrity": "sha512-7wvnuvn/mrAfcugWoCG/3pqDIrUgH5t+HisMJMGw0h9Tc33KqrmqMDCQVvjlrr2pWrw/vuUCFdm8CbUHJ832oQ==", "dependencies": { - "@sentry/types": "7.23.0", - "@sentry/utils": "7.23.0", + "@sentry/types": "7.28.1", + "@sentry/utils": "7.28.1", "tslib": "^1.9.3" }, "engines": { @@ -216,13 +225,13 @@ } }, "node_modules/@sentry/node": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.23.0.tgz", - "integrity": "sha512-w6J+5YRsQEn55508yQYT43ahMP5IHruxq8XnFqYMFZvRohVxrZ1qTz7AMoSgc8fDcHr+LKhs1PxJIqqNwkWrFA==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.28.1.tgz", + "integrity": "sha512-n7AbpJqZJjWPpKNGc55mP7AdQ+XSomS9MZJuZ+Xt2AU52aVwGPI4z9aHUJFSDGaMHHiu/toyPnoUES+XZf6/hw==", "dependencies": { - "@sentry/core": "7.23.0", - "@sentry/types": "7.23.0", - "@sentry/utils": "7.23.0", + "@sentry/core": "7.28.1", + "@sentry/types": "7.28.1", + "@sentry/utils": "7.28.1", "cookie": "^0.4.1", "https-proxy-agent": "^5.0.0", "lru_map": "^0.3.3", @@ -233,19 +242,19 @@ } }, "node_modules/@sentry/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.23.0.tgz", - "integrity": "sha512-fZ5XfVRswVZhKoCutQ27UpIHP16tvyc6ws+xq+njHv8Jg8gFBCoOxlJxuFhegD2xxylAn1aiSHNAErFWdajbpA==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.28.1.tgz", + "integrity": "sha512-DvSplMVrVEmOzR2M161V5+B8Up3vR71xMqJOpWTzE9TqtFJRGPtqT/5OBsNJJw1+/j2ssMcnKwbEo9Q2EGeS6g==", "engines": { "node": ">=8" } }, "node_modules/@sentry/utils": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.23.0.tgz", - "integrity": "sha512-ad/XXH03MfgDH/7N7FjKEOVaKrfQWdMaE0nCxZCr2RrvlitlmGQmPpms95epr1CpzSU3BDRImlILx6+TlrXOgg==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.28.1.tgz", + "integrity": "sha512-75/jzLUO9HH09iC9TslNimGbxOP3jgn89P+q7uR+rp2fJfRExHVeKJZQdK0Ij4/SmE7TJ3Uh2r154N0INZEx1g==", "dependencies": { - "@sentry/types": "7.23.0", + "@sentry/types": "7.28.1", "tslib": "^1.9.3" }, "engines": { @@ -546,12 +555,12 @@ } }, "node_modules/eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "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", @@ -570,7 +579,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", @@ -827,9 +836,9 @@ } }, "node_modules/globals": { - "version": "13.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", - "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dependencies": { "type-fest": "^0.20.2" }, @@ -885,9 +894,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==", "engines": { "node": ">= 4" } @@ -1772,6 +1781,14 @@ } }, "dependencies": { + "@devraelfreeze/discordjs-pagination": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/@devraelfreeze/discordjs-pagination/-/discordjs-pagination-2.6.8.tgz", + "integrity": "sha512-qcVyCZ2svyqbFm4EPVeRk89TDcHHD6hLYbMv0gNob+OcM1Pjcr/GTVd2tyynoU3bZDNnhEfekIHVugORxKqFjg==", + "requires": { + "discord.js": "^14.2.0" + } + }, "@discordjs/builders": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.4.0.tgz", @@ -1825,14 +1842,14 @@ "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==", "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", @@ -1841,9 +1858,9 @@ } }, "@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==", "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -1903,23 +1920,23 @@ "integrity": "sha512-Hec5N6zEkZuZFLybVKyLFLlcSgYmR6C1/+9NkIhxPwOf6tgX52ndJCSz8ADejmbrNE0VuNCNkpzhRZzenEC9vA==" }, "@sentry/core": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.23.0.tgz", - "integrity": "sha512-oNLGsscSdMs1urCbpwe868NsoJWyeTOQXOm5w2e78yE7G6zm2Ra473NQio3lweaEvjQgSGpFyEfAn/3ubZbtPw==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.28.1.tgz", + "integrity": "sha512-7wvnuvn/mrAfcugWoCG/3pqDIrUgH5t+HisMJMGw0h9Tc33KqrmqMDCQVvjlrr2pWrw/vuUCFdm8CbUHJ832oQ==", "requires": { - "@sentry/types": "7.23.0", - "@sentry/utils": "7.23.0", + "@sentry/types": "7.28.1", + "@sentry/utils": "7.28.1", "tslib": "^1.9.3" } }, "@sentry/node": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.23.0.tgz", - "integrity": "sha512-w6J+5YRsQEn55508yQYT43ahMP5IHruxq8XnFqYMFZvRohVxrZ1qTz7AMoSgc8fDcHr+LKhs1PxJIqqNwkWrFA==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.28.1.tgz", + "integrity": "sha512-n7AbpJqZJjWPpKNGc55mP7AdQ+XSomS9MZJuZ+Xt2AU52aVwGPI4z9aHUJFSDGaMHHiu/toyPnoUES+XZf6/hw==", "requires": { - "@sentry/core": "7.23.0", - "@sentry/types": "7.23.0", - "@sentry/utils": "7.23.0", + "@sentry/core": "7.28.1", + "@sentry/types": "7.28.1", + "@sentry/utils": "7.28.1", "cookie": "^0.4.1", "https-proxy-agent": "^5.0.0", "lru_map": "^0.3.3", @@ -1927,16 +1944,16 @@ } }, "@sentry/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.23.0.tgz", - "integrity": "sha512-fZ5XfVRswVZhKoCutQ27UpIHP16tvyc6ws+xq+njHv8Jg8gFBCoOxlJxuFhegD2xxylAn1aiSHNAErFWdajbpA==" + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.28.1.tgz", + "integrity": "sha512-DvSplMVrVEmOzR2M161V5+B8Up3vR71xMqJOpWTzE9TqtFJRGPtqT/5OBsNJJw1+/j2ssMcnKwbEo9Q2EGeS6g==" }, "@sentry/utils": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.23.0.tgz", - "integrity": "sha512-ad/XXH03MfgDH/7N7FjKEOVaKrfQWdMaE0nCxZCr2RrvlitlmGQmPpms95epr1CpzSU3BDRImlILx6+TlrXOgg==", + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.28.1.tgz", + "integrity": "sha512-75/jzLUO9HH09iC9TslNimGbxOP3jgn89P+q7uR+rp2fJfRExHVeKJZQdK0Ij4/SmE7TJ3Uh2r154N0INZEx1g==", "requires": { - "@sentry/types": "7.23.0", + "@sentry/types": "7.28.1", "tslib": "^1.9.3" } }, @@ -2163,12 +2180,12 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "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", @@ -2187,7 +2204,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", @@ -2374,9 +2391,9 @@ } }, "globals": { - "version": "13.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", - "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "requires": { "type-fest": "^0.20.2" } @@ -2406,9 +2423,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==" }, "import-fresh": { "version": "3.3.0", diff --git a/package.json b/package.json index d31c8da..03766f6 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,13 @@ "description": "Made with <3 by mudkipscience", "main": "index.js", "dependencies": { - "@sentry/node": "^7.23.0", + "@devraelfreeze/discordjs-pagination": "^2.6.8", + "@sentry/node": "^7.28.1", "bufferutil": "^4.0.3", "chalk": "^4.1.2", "discord.js": "^14.7.1", "erlpack": "^0.1.3", - "eslint": "^8.29.0", + "eslint": "^8.30.0", "fs-readdir-recursive": "^1.1.0", "moment": "^2.29.4", "moment-duration-format": "^2.3.2", From 3ca0b4cb5c378d3b651954dde5b0504b81b1bf62 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 26 Dec 2022 18:00:16 +1100 Subject: [PATCH 61/65] WIP splatnet --- bot/commands/Utility/splatnet.js | 81 ++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/bot/commands/Utility/splatnet.js b/bot/commands/Utility/splatnet.js index 3aef77e..233d9e4 100644 --- a/bot/commands/Utility/splatnet.js +++ b/bot/commands/Utility/splatnet.js @@ -2,6 +2,7 @@ const Command = require('../../base/Command.js'); const fetch = require('node-fetch'); const { pagination } = require('@devraelfreeze/discordjs-pagination'); const prettifyMiliseconds = require('pretty-ms'); +const brandAbilities = require('../../assets/s3BrandAbilities.json'); module.exports = class Splatnet extends Command { constructor (name, category) { @@ -17,7 +18,7 @@ module.exports = class Splatnet extends Command { }, { type: 1, - name: 'sr', + name: 'salmonrun', description: 'Get current and upcoming map rotations for salmon run, as well as the monthly gear reward.' }, { @@ -174,9 +175,83 @@ module.exports = class Splatnet extends Command { .setFooter({ text: `Starting in ${prettifyMiliseconds(new Date(json.data.xSchedules.nodes[i].startTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) ); } - interaction.editReply({embeds: [embeds[0]]}); + await pagination({ + embeds: embeds, + author: interaction.member.user, + interaction: interaction, + time: 60000, + disableButtons: false, + }); + } + } + + if (subCmd === 'gear') { + if (client.cache.has('SPLATNET_GEAR') && Date.now() > client.cache.get('SPLATNET_GEAR').expiry) { + client.cache.delete('SPLATNET_GEAR'); + } + + if (!client.cache.has('SPLATNET_GEAR')) { + fetch('https://splatoon3.ink/data/gear.json', { headers: { 'User-Agent': client.config.userAgent }}) + .then(res => res.json()) + .then(async json => { + client.cache.set('SPLATNET_GEAR', {data: json, expiry: new Date(json.data.gesotown.pickupBrand.brandGears[0].saleEndTime)}); + + for (let i = 0; i < json.data.gesotown.pickupBrand.brandGears.length; i++) { + embeds.push(new client.EmbedBuilder() + .setTitle(`${json.data.gesotown.pickupBrand.brandGears[i].gear.name} (${this.starPower(json.data.gesotown.pickupBrand.brandGears[i].gear.additionalGearPowers.length)})`) + .setDescription(`This piece of gear is apart of the ${json.data.gesotown.pickupBrand.brand.name} daily drop. The next drop will be for ${json.data.gesotown.pickupBrand.nextBrand.name}.`) + .setThumbnail(json.data.gesotown.pickupBrand.brandGears[i].gear.image.url) + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: 'Brand', + value: json.data.gesotown.pickupBrand.brandGears[i].gear.brand.name, + inline: true + }, + { + name: 'Price', + value: `${json.data.gesotown.pickupBrand.brandGears[i].price}`, + inline: true, + }, + { + name: 'Main Ability', + value: json.data.gesotown.pickupBrand.brandGears[i].gear.primaryGearPower.name, + inline: true + }, + { + name: 'Common Ability', + value: brandAbilities[json.data.gesotown.pickupBrand.brandGears[i].gear.brand.name.trim()].common, + inline: true + }, + { + name: 'Uncommon Ability', + value: brandAbilities[json.data.gesotown.pickupBrand.brandGears[i].gear.brand.name.trim()].uncommon, + inline: true + } + ) + .setFooter({ text: `Off sale in ${prettifyMiliseconds(new Date(json.data.gesotown.pickupBrand.brandGears[i].saleEndTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + } + await pagination({ + embeds: embeds, + author: interaction.member.user, + interaction: interaction, + time: 60000, + disableButtons: false, + }); + }) + .catch(err => { + client.logger.error('SPLATNET_COMMAND_ERROR', `API err or err replying: ${err.stack}`); + return interaction.editReply(`${client.config.emojis.botError} An error occurred, sorry! I've reported this to my developers.`); + }); } - } } + + starPower (slots) { + if (slots === 1) return '0*'; + if (slots === 2) return '1*'; + if (slots === 3) return '2*'; + return 'err'; + } }; \ No newline at end of file From d97c5fa569c0dc8125077f6ce06072a3c8b5f601 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 26 Dec 2022 18:00:25 +1100 Subject: [PATCH 62/65] added new brands --- ...atoon2brands.json => s3BrandAbilities.json} | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) rename bot/assets/{splatoon2brands.json => s3BrandAbilities.json} (82%) diff --git a/bot/assets/splatoon2brands.json b/bot/assets/s3BrandAbilities.json similarity index 82% rename from bot/assets/splatoon2brands.json rename to bot/assets/s3BrandAbilities.json index 7e958e9..0b9d2a7 100644 --- a/bot/assets/splatoon2brands.json +++ b/bot/assets/s3BrandAbilities.json @@ -5,15 +5,25 @@ }, "Annaki": { - "common": "Main Power Up", + "common": "Ink Saver (Sub)", "uncommon": "Special Saver" }, + "Barazushi": { + "common": "Intensify Action", + "uncommon": "Sub Power Up" + }, + "Cuttlegear": { "common": "N/A", "uncommon": "N/A" }, + "Emberz": { + "common": "Intensify Action", + "uncommon": "Special Charge Up" + }, + "Enperry": { "common": "Sub Power Up", "uncommon": "Ink Resistance Up" @@ -36,7 +46,7 @@ "Inkline": { "common": "Bomb Defence Up DX", - "uncommon": "Main Power Up" + "uncommon": "Intensify Action" }, "Krak-On": { @@ -54,7 +64,7 @@ "uncommon": "Special Saver" }, - "Splash Mob": { + "SplashMob": { "common": "Ink Saver (Main)", "uncommon": "Run Speed Up" }, @@ -75,7 +85,7 @@ }, "ToniKensa": { - "common": "Main Power Up", + "common": "Ink Saver (Main)", "uncommon": "Sub Power Up" }, From 75b9d712afb0c778a4872f6357a333bfd488dddb Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Mon, 26 Dec 2022 20:28:11 +1100 Subject: [PATCH 63/65] WIP need to do SR - splatnet --- bot/commands/Utility/splatnet.js | 125 ++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/bot/commands/Utility/splatnet.js b/bot/commands/Utility/splatnet.js index 233d9e4..d97fa9e 100644 --- a/bot/commands/Utility/splatnet.js +++ b/bot/commands/Utility/splatnet.js @@ -194,8 +194,9 @@ module.exports = class Splatnet extends Command { fetch('https://splatoon3.ink/data/gear.json', { headers: { 'User-Agent': client.config.userAgent }}) .then(res => res.json()) .then(async json => { - client.cache.set('SPLATNET_GEAR', {data: json, expiry: new Date(json.data.gesotown.pickupBrand.brandGears[0].saleEndTime)}); + client.cache.set('SPLATNET_GEAR', {data: json, expiry: new Date(json.data.gesotown.limitedGears[0].saleEndTime)}); + // splatnet daily drop for (let i = 0; i < json.data.gesotown.pickupBrand.brandGears.length; i++) { embeds.push(new client.EmbedBuilder() .setTitle(`${json.data.gesotown.pickupBrand.brandGears[i].gear.name} (${this.starPower(json.data.gesotown.pickupBrand.brandGears[i].gear.additionalGearPowers.length)})`) @@ -232,6 +233,43 @@ module.exports = class Splatnet extends Command { .setFooter({ text: `Off sale in ${prettifyMiliseconds(new Date(json.data.gesotown.pickupBrand.brandGears[i].saleEndTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) ); } + + // general splatnet items + for (let i = 0; i < json.data.gesotown.limitedGears.length; i++) { + embeds.push(new client.EmbedBuilder() + .setTitle(`${json.data.gesotown.limitedGears[i].gear.name} (${this.starPower(json.data.gesotown.limitedGears[i].gear.additionalGearPowers.length)})`) + .setThumbnail(json.data.gesotown.limitedGears[i].gear.image.url) + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: 'Brand', + value: json.data.gesotown.limitedGears[i].gear.brand.name, + inline: true + }, + { + name: 'Price', + value: `${json.data.gesotown.limitedGears[i].price}`, + inline: true, + }, + { + name: 'Main Ability', + value: json.data.gesotown.limitedGears[i].gear.primaryGearPower.name, + inline: true + }, + { + name: 'Common Ability', + value: brandAbilities[json.data.gesotown.limitedGears[i].gear.brand.name.trim()].common, + inline: true + }, + { + name: 'Uncommon Ability', + value: brandAbilities[json.data.gesotown.limitedGears[i].gear.brand.name.trim()].uncommon, + inline: true + } + ) + .setFooter({ text: `Off sale in ${prettifyMiliseconds(new Date(json.data.gesotown.limitedGears[i].saleEndTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + } await pagination({ embeds: embeds, author: interaction.member.user, @@ -244,6 +282,91 @@ module.exports = class Splatnet extends Command { client.logger.error('SPLATNET_COMMAND_ERROR', `API err or err replying: ${err.stack}`); return interaction.editReply(`${client.config.emojis.botError} An error occurred, sorry! I've reported this to my developers.`); }); + } else { + let json = client.cache.get('SPLATNET_GEAR'); + json = json.data; + + // splatnet daily drop + for (let i = 0; i < json.data.gesotown.pickupBrand.brandGears.length; i++) { + embeds.push(new client.EmbedBuilder() + .setTitle(`${json.data.gesotown.pickupBrand.brandGears[i].gear.name} (${this.starPower(json.data.gesotown.pickupBrand.brandGears[i].gear.additionalGearPowers.length)})`) + .setDescription(`This piece of gear is apart of the ${json.data.gesotown.pickupBrand.brand.name} daily drop. The next drop will be for ${json.data.gesotown.pickupBrand.nextBrand.name}.`) + .setThumbnail(json.data.gesotown.pickupBrand.brandGears[i].gear.image.url) + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: 'Brand', + value: json.data.gesotown.pickupBrand.brandGears[i].gear.brand.name, + inline: true + }, + { + name: 'Price', + value: `${json.data.gesotown.pickupBrand.brandGears[i].price}`, + inline: true, + }, + { + name: 'Main Ability', + value: json.data.gesotown.pickupBrand.brandGears[i].gear.primaryGearPower.name, + inline: true + }, + { + name: 'Common Ability', + value: brandAbilities[json.data.gesotown.pickupBrand.brandGears[i].gear.brand.name.trim()].common, + inline: true + }, + { + name: 'Uncommon Ability', + value: brandAbilities[json.data.gesotown.pickupBrand.brandGears[i].gear.brand.name.trim()].uncommon, + inline: true + } + ) + .setFooter({ text: `Off sale in ${prettifyMiliseconds(new Date(json.data.gesotown.pickupBrand.brandGears[i].saleEndTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + } + + // general splatnet items + for (let i = 0; i < json.data.gesotown.limitedGears.length; i++) { + embeds.push(new client.EmbedBuilder() + .setTitle(`${json.data.gesotown.limitedGears[i].gear.name} (${this.starPower(json.data.gesotown.limitedGears[i].gear.additionalGearPowers.length)})`) + .setThumbnail(json.data.gesotown.limitedGears[i].gear.image.url) + .setColor(interaction.guild.members.me.displayColor) + .addFields( + { + name: 'Brand', + value: json.data.gesotown.limitedGears[i].gear.brand.name, + inline: true + }, + { + name: 'Price', + value: `${json.data.gesotown.limitedGears[i].price}`, + inline: true, + }, + { + name: 'Main Ability', + value: json.data.gesotown.limitedGears[i].gear.primaryGearPower.name, + inline: true + }, + { + name: 'Common Ability', + value: brandAbilities[json.data.gesotown.limitedGears[i].gear.brand.name.trim()].common, + inline: true + }, + { + name: 'Uncommon Ability', + value: brandAbilities[json.data.gesotown.limitedGears[i].gear.brand.name.trim()].uncommon, + inline: true + } + ) + .setFooter({ text: `Off sale in ${prettifyMiliseconds(new Date(json.data.gesotown.limitedGears[i].saleEndTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`}) + ); + } + await pagination({ + embeds: embeds, + author: interaction.member.user, + interaction: interaction, + time: 60000, + disableButtons: false, + }); } } } From 2347762ecccb48a9fbd54a1c88b138d41ced3329 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Aug 2023 10:58:27 +1000 Subject: [PATCH 64/65] guild ID no longer hardcoded --- bot/deploy.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot/deploy.js b/bot/deploy.js index 920de24..027642a 100644 --- a/bot/deploy.js +++ b/bot/deploy.js @@ -2,11 +2,17 @@ const { REST, Routes } = require('discord.js'); const { clientId, token } = require('../botconfig.json'); -const guildId = '413591792185769984'; const read = require('fs-readdir-recursive'); const commands = []; const commandFiles = read('./commands').filter(file => file.endsWith('.js')); +if (process.argv.length === 2) { + console.log('No guild ID provided, deployment failed.'); + process.exit(1); +} + +const guildId = process.argv[2]; + for (const file of commandFiles) { const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/'))); commands.push({ From 0068cde2347f9887803c4787efdaf1e2cd10c2a0 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Aug 2023 10:58:42 +1000 Subject: [PATCH 65/65] salmonrun schedule support --- bot/commands/Utility/splatnet.js | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/bot/commands/Utility/splatnet.js b/bot/commands/Utility/splatnet.js index d97fa9e..ec818c0 100644 --- a/bot/commands/Utility/splatnet.js +++ b/bot/commands/Utility/splatnet.js @@ -185,6 +185,52 @@ module.exports = class Splatnet extends Command { } } + if (subCmd === 'salmonrun') { + if (client.cache.has('SPLATNET_SR') && Date.now() > client.cache.get('SPLATNET_SR').expiry) { + client.cache.delete('SPLATNET_SR'); + } + + if (!client.cache.has('SPLATNET_SR')) { + fetch('https://splatoon3.ink/data/schedules.json', { headers: { 'User-Agent': client.config.userAgent} }) + .then(res => res.json()) + .then(tlJson => { + fetch('https://splatoon3.ink/data/coop.json', { headers: { 'User-Agent': client.config.userAgent} }) + .then(rewardRes => rewardRes.json()) + .then(async rewardJson => { + const embeds = []; + const json = { + tl: tlJson.data.coopGroupingSchedule, + rw: rewardJson.data.coopResult.monthlyGear + }; + + embeds.push(new client.EmbedBuilder() + .setTitle('Current Salmon Run') + .setColor(interaction.guild.members.me.displayColor) + .setThumbnail(json.rw.image.url) + .setImage(json.tl.regularSchedules.nodes[0].setting.coopStage.image.url) + .addFields( + { + name: 'Stage', + value: json.tl.regularSchedules.nodes[0].setting.coopStage.name, + inline: true + }, + { + name: 'Monthly Gear', + value: json.rw.name, + inline: true + }, + { + name: 'Weapons', + value: json.tl.regularSchedules.nodes[0].setting.weapons[0] + } + + ) + ); + }); + }); + } + } + if (subCmd === 'gear') { if (client.cache.has('SPLATNET_GEAR') && Date.now() > client.cache.get('SPLATNET_GEAR').expiry) { client.cache.delete('SPLATNET_GEAR');