From 7912b455e903d70a5d9aa16f6749c6eedc1c18a3 Mon Sep 17 00:00:00 2001 From: Dakedres Date: Tue, 18 Mar 2025 16:18:41 -0600 Subject: [PATCH] Minor refactor --- package-lock.json | 626 ++++++++++++++++++++++++++++++++++++++++++++++ src/constants.js | 15 +- src/index.js | 420 ++++++++++++++----------------- yarn.lock | 94 +++---- 4 files changed, 873 insertions(+), 282 deletions(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2c59428 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,626 @@ +{ + "name": "dicedicedice", + "version": "1.4.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dicedicedice", + "version": "1.4.0", + "license": "GPL-3.0", + "dependencies": { + "classic-level": "^1.3.0", + "discord.js": "^14.11.0", + "dotenv": "^16.0.3" + } + }, + "node_modules/@discordjs/builders": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.6.3.tgz", + "integrity": "sha512-CTCh8NqED3iecTNuiz49mwSsrc2iQb4d0MjMdmS/8pb69Y4IlzJ/DIy/p5GFlgOrFbNO2WzMHkWKQSiJ3VNXaw==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/formatters": "^0.3.1", + "@discordjs/util": "^0.3.1", + "@sapphire/shapeshift": "^3.8.2", + "discord-api-types": "^0.37.41", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/collection": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.1.tgz", + "integrity": "sha512-aWEc9DCf3TMDe9iaJoOnO2+JVAjeRNuRxPZQA6GVvBf+Z3gqUuWYBy2NWh4+5CLYq5uoc3MOvUQ5H5m8CJBqOA==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/formatters": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.1.tgz", + "integrity": "sha512-M7X4IGiSeh4znwcRGcs+49B5tBkNDn4k5bmhxJDAUhRxRHTiFAOTVUNQ6yAKySu5jZTnCbSvTYHW3w0rAzV1MA==", + "license": "Apache-2.0", + "dependencies": { + "discord-api-types": "^0.37.41" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/rest": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.7.1.tgz", + "integrity": "sha512-Ofa9UqT0U45G/eX86cURQnX7gzOJLG2oC28VhIk/G6IliYgQF7jFByBJEykPSHE4MxPhqCleYvmsrtfKh1nYmQ==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/collection": "^1.5.1", + "@discordjs/util": "^0.3.0", + "@sapphire/async-queue": "^1.5.0", + "@sapphire/snowflake": "^3.4.2", + "discord-api-types": "^0.37.41", + "file-type": "^18.3.0", + "tslib": "^2.5.0", + "undici": "^5.22.0" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/util": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.3.1.tgz", + "integrity": "sha512-HxXKYKg7vohx2/OupUN/4Sd02Ev3PBJ5q0gtjdcvXb0ErCva8jNHWfe/v5sU3UKjIB/uxOhc+TDOnhqffj9pRA==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/ws": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-0.8.3.tgz", + "integrity": "sha512-hcYtppanjHecbdNyCKQNH2I4RP9UrphDgmRgLYrATEQF1oo4sYSve7ZmGsBEXSzH72MO2tBPdWSThunbxUVk0g==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/collection": "^1.5.1", + "@discordjs/rest": "^1.7.1", + "@discordjs/util": "^0.3.1", + "@sapphire/async-queue": "^1.5.0", + "@types/ws": "^8.5.4", + "@vladfrangu/async_event_emitter": "^2.2.1", + "discord-api-types": "^0.37.41", + "tslib": "^2.5.0", + "ws": "^8.13.0" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@sapphire/async-queue": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", + "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/shapeshift": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.0.tgz", + "integrity": "sha512-iJpHmjAdwX9aSL6MvFpVyo+tkokDtInmSjoJHbz/k4VJfnim3DjvG0hgGEKWtWZgCu45RaLgcoNgR1fCPdIz3w==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/snowflake": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz", + "integrity": "sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "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==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz", + "integrity": "sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg==", + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vladfrangu/async_event_emitter": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz", + "integrity": "sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/abstract-level": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", + "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "catering": "^2.1.0", + "is-buffer": "^2.0.5", + "level-supports": "^4.0.0", + "level-transcoder": "^1.0.1", + "module-error": "^1.0.1", + "queue-microtask": "^1.2.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "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/catering": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", + "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/classic-level": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "abstract-level": "^1.0.2", + "catering": "^2.1.0", + "module-error": "^1.0.1", + "napi-macros": "^2.2.2", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/discord-api-types": { + "version": "0.37.42", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.42.tgz", + "integrity": "sha512-1Huaj9cQ1W7/uryS8MZs/tZemnoKB94thM1cE40lep3rpU3q7WHqkdjN/veX0prTkYlPhcyLd/DeF/pBO8X8oQ==", + "license": "MIT" + }, + "node_modules/discord.js": { + "version": "14.11.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.11.0.tgz", + "integrity": "sha512-CkueWYFQ28U38YPR8HgsBR/QT35oPpMbEsTNM30Fs8loBIhnA4s70AwQEoy6JvLcpWWJO7GY0y2BUzZmuBMepQ==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/builders": "^1.6.3", + "@discordjs/collection": "^1.5.1", + "@discordjs/formatters": "^0.3.1", + "@discordjs/rest": "^1.7.1", + "@discordjs/util": "^0.3.1", + "@discordjs/ws": "^0.8.3", + "@sapphire/snowflake": "^3.4.2", + "@types/ws": "^8.5.4", + "discord-api-types": "^0.37.41", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.5.0", + "undici": "^5.22.0", + "ws": "^8.13.0" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/file-type": { + "version": "18.4.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.4.0.tgz", + "integrity": "sha512-o6MQrZKTAK6WpvmQk3jqTVUmqxYBxW5bloUfrdH1ZnRFDvvAPNr+l+rgOxM3nkqWT+3khaj3FRMDydWe0xhu+w==", + "license": "MIT", + "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/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" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/level-supports": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", + "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/level-transcoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", + "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "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==", + "license": "MIT" + }, + "node_modules/module-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", + "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/napi-macros": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", + "license": "MIT" + }, + "node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "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" + } + ], + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "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==", + "license": "MIT", + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "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==", + "license": "MIT", + "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/token-types": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", + "license": "MIT", + "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/ts-mixer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", + "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==", + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz", + "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==", + "license": "0BSD" + }, + "node_modules/undici": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", + "license": "MIT", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/src/constants.js b/src/constants.js index abbd7a9..00e5338 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,4 +1,4 @@ -const constants = { +export default { rollRegex: /^(\d+)?([dhlfb])(\d+)(\s*([+\-*x\/])\s*(\d+))?/, optionRollRegex: /^(\d+)?(([dhlfb])(\d+))?(\s*([+\-*x\/])\s*(\d+))?/, descriptionRegex: /\s*((\d*-\d*)|(\d+))?([^;\n]+)/g, @@ -13,6 +13,7 @@ const constants = { macro: { name: 'macro', description: "Manage macros", + 'dm_permission': false, options: [ { name: 'add', @@ -42,7 +43,13 @@ const constants = { name: "name", description: "Name of the macro", type: 3, // String - required: true + required: true, + autocomplete: true, + getAutocomplete: interaction => { + let macros = globalThis.macroCache.get(interaction.guild.id) + + return macros ? Object.keys(macros) : [] + } } ] } @@ -65,6 +72,4 @@ A discord bot for metaphorically "rolling dice"/generating random values. Made f Present in ~${guildCount} guilds! ` -} - -export default constants \ No newline at end of file +} \ No newline at end of file diff --git a/src/index.js b/src/index.js index 7089b4a..1049843 100644 --- a/src/index.js +++ b/src/index.js @@ -5,15 +5,28 @@ import { ClassicLevel } from 'classic-level'; dotenv.config() -const replies = new Map() -const commands = new Map() +globalThis.commands = new Map() +globalThis.replies = new Map() +globalThis.macroCache = new Map() const db = new ClassicLevel('./db') -const macroCache = new Map() + +const client = new Client({ + intents: [ + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMessages, + GatewayIntentBits.MessageContent, + GatewayIntentBits.DirectMessages + ], + partials: [ + Partials.Channel + ] +}) +const rest = new REST().setToken(process.env.DISCORD_TOKEN) -const parseRollInt = (value, defaultValue) => +const ParseRollInt = (value, defaultValue) => value ? parseInt(value) : defaultValue -const parseOptionRoll = expression => { +const ParseOptionRoll = expression => { let match = constants.optionRollRegex.exec(expression.trim()) let [ @@ -28,16 +41,16 @@ const parseOptionRoll = expression => { .slice(1) return { - count: parseRollInt(count), + count: ParseRollInt(count), mode, - size: parseRollInt(size), + size: ParseRollInt(size), operation, - modifier: parseRollInt(modifier), - descriptionConditions: pullDescription(expression, match) + modifier: ParseRollInt(modifier), + descriptionConditions: PullDescription(expression, match) } } -const parseRoll = expression => { +const ParseRoll = expression => { let match = constants.rollRegex.exec(expression.trim()) if(match == null) @@ -53,23 +66,23 @@ const parseRoll = expression => { ] = match.slice(1) return { - count: parseRollInt(count, 1), + count: ParseRollInt(count, 1), mode, - size: parseRollInt(size), + size: ParseRollInt(size), operation, - modifier: parseRollInt(modifier), - descriptionConditions: pullDescription(expression, match) + modifier: ParseRollInt(modifier), + descriptionConditions: PullDescription(expression, match) } } -const pullDescription = (expression, match) => { +const PullDescription = (expression, match) => { if(match[0].length == expression.length) return - return parseDescription(expression.slice(match[0].length)) + return ParseDescription(expression.slice(match[0].length)) } -const parseDescription = description => { +const ParseDescription = description => { let conditions = [] let match @@ -85,8 +98,8 @@ const parseDescription = description => { let split = rangeExp.split('-') range = { - lower: parseRollInt(split[0], -Infinity), - upper: parseRollInt(split[1], Infinity) + lower: ParseRollInt(split[0], -Infinity), + upper: ParseRollInt(split[1], Infinity) } } else if(valueExp) { range = { @@ -104,16 +117,16 @@ const parseDescription = description => { return conditions } -const handleMessage = (message, respond) => { - let dice = parseRoll(message.content) +const OnMessage = (message, respond) => { + let dice = ParseRoll(message.content) if(dice == undefined) return // No dice - rollDice(dice, respond) + RollDice(dice, respond) } -const rollDice = (dice, respond) => { +const RollDice = (dice, respond) => { if(dice.size > 255) { respond('That die is way too big... .-.') return @@ -197,36 +210,36 @@ const rollDice = (dice, respond) => { respond(response) } -const saveReply = (message, reply) => { - replies.set(message.id, { +const SaveReply = (message, reply) => { + globalThis.replies.set(message.id, { id: reply.id, timestamp: Date.now() }) } -const messageCycle = async message => { - handleMessage(message, async content => { - saveReply(message, await message.reply(content) ) +const MessageCycle = async message => { + OnMessage(message, async content => { + SaveReply(message, await message.reply(content) ) }) } -const rehandleMessage = async (message, reply) => { - handleMessage(message, async content => { - saveReply(message, await reply.edit(content) ) +const RehandleMessage = async (message, reply) => { + OnMessage(message, async content => { + SaveReply(message, await reply.edit(content) ) }) } -const pruneReplies = () => { - for(let [ id, entry ] of replies.entries()) { +const PruneReplies = () => { + for(let [ id, entry ] of globalThis.replies.entries()) { let age = Date.now() - entry.timestamp if(age > 1000 * 60 * 3) { - replies.delete(id) + globalThis.replies.delete(id) } } } -const interactionRespond = (interaction, content) => { +const InteractionRespond = (interaction, content) => { let reply = { content, ephemeral: true } if(interaction.replied || interaction.deferred) { @@ -236,29 +249,28 @@ const interactionRespond = (interaction, content) => { } } -const handleError = (interaction) => (error) => - interactionRespond(interaction, constants.errorMessage(error) ) +const ErrorHandler = (interaction) => (error) => + InteractionRespond(interaction, constants.errorMessage(error) ) .catch(reportingError => console.error('Could not display error message:\n ', reportingError) ) - -const addCommand = (data, callback) => { - commands.set(data.name, { +const Command = (data, callback) => { + globalThis.commands.set(data.name, { data, execute: callback }) } -const addSubcommands = (data, subcommandCallbacks) => - addCommand(data, interaction => { +const Subcommands = (data, subcommandCallbacks) => + Command(data, interaction => { return subcommandCallbacks[interaction.options.getSubcommand()](interaction) }) -const openMacros = guildId => +const OpenMacros = guildId => db.sublevel(guildId).sublevel('macros') -const reloadMacros = async guildId => { +const ReloadMacros = async guildId => { let commands = [] - let macros = openMacros(guildId) + let macros = OpenMacros(guildId) let cacheEntry = {} for await (let [ name, dice ] of macros.iterator() ) { @@ -266,7 +278,7 @@ const reloadMacros = async guildId => { commands.push({ name, - description: elipsify("Roll " + dice.replaceAll('\n', ';'), 100), + description: Elipsify("Roll " + dice.replaceAll('\n', ';'), 100), options: [ { name: "options", @@ -277,19 +289,19 @@ const reloadMacros = async guildId => { }) } - macroCache.set(guildId, cacheEntry) + globalThis.macroCache.set(guildId, cacheEntry) await rest.put( Routes.applicationGuildCommands(process.env.DISCORD_ID, guildId), - { body: commands } + { body: globalThis.commands } ) .catch(err => console.error('Failed to reload macros:', err) ) } -const elipsify = (string, maxLength) => +const Elipsify = (string, maxLength) => string.length > maxLength ? string.slice(0, maxLength - 3) + '...' : string -const pruneDB = async () => { +const PruneDB = async () => { let validIds = [] for await(let key of db.keys()) { @@ -308,188 +320,32 @@ const pruneDB = async () => { return validIds } - -addCommand( - constants.commands.about, - async interaction => { - let embed = { - title: 'dicedicedice', - thumbnail: { - url: constants.iconUrl - }, - description: constants.aboutMessage(client.guilds.cache.size) - } - - await interaction.reply({ - embeds: [ embed ], - ephemeral: true - }) - } -) - -const openResponses = (interaction, ephemeral) => async content => +const Responses = (interaction, ephemeral) => async content => interaction.reply({ content, ephemeral }) -addSubcommands({ - name: 'macro', - description: "Manage macros", - 'dm_permission': false, - options: [ - { - name: 'add', - description: "Define a dice macro", - type: 1, // Sub command - options: [ - { - name: "name", - description: "Name of the macro", - type: 3, // String - required: true - }, - { - name: "dice", - description: "The dice expression to save as a macro", - type: 3, // String - required: true - } - ] - }, - { - name: 'remove', - description: "Remove a macro", - type: 1, // Sub command - options: [ - { - name: "name", - description: "Name of the macro", - type: 3, // String - required: true, - autocomplete: true, - getAutocomplete: interaction => { - let macros = macroCache.get(interaction.guild.id) - - return macros ? Object.keys(macros) : [] - } - } - ] - } - ] -}, { - add: async interaction => { - let respond = openResponses(interaction, true) - let name = interaction.options.get('name').value.toLowerCase() - - if(!constants.macroNameRegex.test(name)) - return respond("Please provide a macro name that consists of only alphanumeric characters.") - - if(commands.has(name)) - return respond("Uhh,, I think that macro name is already taken by my own commands, sorry.") - - let macros = macroCache.get(interaction.guild.id) - - if(macros && !macros[name] && Object.keys(macros).length >= 100) - return respond("I can't keep track of that many macros,, ;-;") - - let dice = interaction.options.get('dice').value - - if(!constants.rollRegex.test(dice) ) - return respond("Please provide a valid roll expression.") - - await interaction.deferReply({ ephemeral: true }) - - await Promise.all([ - openMacros(interaction.guild.id).put(name, dice), - reloadMacros(interaction.guild.id) - ]) - interaction.followUp(`Macro added! Try \`/${name}\`! You might need to switch to a different server and back or reopen Discord in order for it to recognize the new command.`) - }, - remove: async interaction => { - let name = interaction.options.get('name').value.toLowerCase() - let macros = macroCache.get(interaction.guild.id) - let respond = openResponses(interaction, true) - - if(!macros) - return respond('There aren\'t even any macros in this guild!') - - let dice = macros && macroCache.get(interaction.guild.id)[name] - - if(!dice) - return respond("There isn't a macro with that name .-.") - - await interaction.deferReply({ ephemeral: true }) - await Promise.all([ - openMacros(interaction.guild.id).del(name), - reloadMacros(interaction.guild.id) - ]) - - await interaction.followUp(`Removed \`${name}\`, its dice expression was: \`\`\`${dice}\`\`\``) - } -}) - - - -const client = new Client({ - intents: [ - GatewayIntentBits.Guilds, - GatewayIntentBits.GuildMessages, - GatewayIntentBits.MessageContent, - GatewayIntentBits.DirectMessages - ], - partials: [ - Partials.Channel - ] -}) - -const safeSubscribe = (event, callback) => { +const Subscribe = (event, callback) => { client.on(event, (...args) => { return callback(...args) .catch(err => console.error(err)) }) } -const rest = new REST().setToken(process.env.DISCORD_TOKEN) - -safeSubscribe('ready', async () => { - console.log("Logged in!") - - let guildIds = await pruneDB() - - for(let guildId of guildIds) - await reloadMacros(guildId) - - console.log("Ready") -}) - -safeSubscribe('messageCreate', messageCycle) - -safeSubscribe('messageUpdate', async (oldMessage, newMessage) => { - if(replies.has(newMessage.id) ) { - let { id } = replies.get(newMessage.id) - - newMessage.channel.messages.fetch(id) - .then(reply => rehandleMessage(newMessage, reply) ) - .catch(err => messageCycle(newMessage) ) - } else { - messageCycle(newMessage) - } -}) - -const handleCommand = async interaction => { - if(commands.has(interaction.commandName) ) { - commands.get(interaction.commandName).execute(interaction) - .catch(handleError(interaction)) +const HandleCommand = async interaction => { + if(globalThis.commands.has(interaction.commandName) ) { + globalThis.commands.get(interaction.commandName).execute(interaction) + .catch(ErrorHandler(interaction)) return } await interaction.deferReply() - let roll = macroCache.get(interaction.guild.id)[interaction.commandName] + let roll = globalThis.macroCache.get(interaction.guild.id)[interaction.commandName] if(roll) { - let dice = parseRoll(roll) + let dice = ParseRoll(roll) let options = interaction.options.get('options') if(options) { - let optionDice = parseOptionRoll(options.value) + let optionDice = ParseOptionRoll(options.value) for(let [ key, value ] of Object.entries(optionDice)) { if(value) @@ -497,24 +353,24 @@ const handleCommand = async interaction => { } } - rollDice(dice, content => interaction.followUp(content) ) + RollDice(dice, content => interaction.followUp(content) ) } } -const findOption = (options, name) => +const FindOption = (options, name) => options.find(option => option.name == name) -const handleAutocomplete = async interaction => { - if(commands.has(interaction.commandName) ) { - let { data } = commands.get(interaction.commandName) +const HandleAutocomplete = async interaction => { + if(globalThis.commands.has(interaction.commandName) ) { + let { data } = globalThis.commands.get(interaction.commandName) let subcommand = interaction.options.getSubcommand() let focusedOption = interaction.options.getFocused(true) if(subcommand !== undefined) { - data = findOption(data.options, subcommand) + data = FindOption(data.options, subcommand) } - let option = findOption(data.options, focusedOption.name) + let option = FindOption(data.options, focusedOption.name) if(!option) { console.error('Could not find option: ' + focusedOption) @@ -530,29 +386,133 @@ const handleAutocomplete = async interaction => { } } -safeSubscribe('interactionCreate', interaction => { +const Interaction = interaction => { if(interaction.isChatInputCommand()) { - return handleCommand(interaction) + return HandleCommand(interaction) } else if(interaction.isAutocomplete()) { - return handleAutocomplete(interaction) + return HandleAutocomplete(interaction) .catch(console.error) } -}) +} +const MessageUpdate = async (oldMessage, newMessage) => { + if(globalThis.replies.has(newMessage.id) ) { + let { id } = globalThis.replies.get(newMessage.id) + newMessage.channel.messages.fetch(id) + .then(reply => RehandleMessage(newMessage, reply) ) + .catch(err => MessageCycle(newMessage) ) + } else { + MessageCycle(newMessage) + } +} -;(async () => { +const About = async (interaction) => { + let embed = { + title: 'dicedicedice', + thumbnail: { + url: constants.iconUrl + }, + description: constants.aboutMessage(client.guilds.cache.size) + } + + await interaction.reply({ + embeds: [ embed ], + ephemeral: true + }) +} + +const AddMacro = async (interaction) => { + let respond = Responses(interaction, true) + let name = interaction.options.get('name').value.toLowerCase() + + if(!constants.macroNameRegex.test(name)) + return respond("Please provide a macro name that consists of only alphanumeric characters.") + + if(commands.has(name)) + return respond("Uhh,, I think that macro name is already taken by my own commands, sorry.") + + let macros = globalThis.macroCache.get(interaction.guild.id) + + if(macros && !macros[name] && Object.keys(macros).length >= 100) + return respond("I can't keep track of that many macros,, ;-;") + + let dice = interaction.options.get('dice').value + + if(!constants.rollRegex.test(dice) ) + return respond("Please provide a valid roll expression.") + + await interaction.deferReply({ ephemeral: true }) + + await Promise.all([ + OpenMacros(interaction.guild.id).put(name, dice), + ReloadMacros(interaction.guild.id) + ]) + interaction.followUp(`Macro added! Try \`/${name}\`! You might need to switch to a different server and back or reopen Discord in order for it to recognize the new command.`) +} + +const RemoveMacro = async (interaction) => { + let name = interaction.options.get('name').value.toLowerCase() + let macros = macroCache.get(interaction.guild.id) + let respond = openResponses(interaction, true) + + if(!macros) + return respond('There aren\'t even any macros in this guild!') + + let dice = macros && macroCache.get(interaction.guild.id)[name] + + if(!dice) + return respond("There isn't a macro with that name .-.") + + await interaction.deferReply({ ephemeral: true }) + await Promise.all([ + openMacros(interaction.guild.id).del(name), + reloadMacros(interaction.guild.id) + ]) + + await interaction.followUp(`Removed \`${name}\`, its dice expression was: \`\`\`${dice}\`\`\``) +} + +const Start = async () => { + Command( + constants.commands.about, + About + ) + + Subcommands(constants.commands.macro, { + add: AddMacro, + remove: RemoveMacro + }) + + Subscribe('interactionCreate', Interaction) + Subscribe('messageCreate', MessageCycle) + Subscribe('messageUpdate', MessageUpdate) + Subscribe('ready', async () => { + console.log("Logged in!") + + let guildIds = await PruneDB() + + for(let guildId of guildIds) + await ReloadMacros(guildId) + + console.log("Ready") + }) + await rest.put( Routes.applicationCommands(process.env.DISCORD_ID), { - body: [ ...commands.values() ] + body: [ ...globalThis.commands.values() ] .map(command => command.data ) } ) .catch(err => console.error('Command registration failed: ', err) ) + console.log(process.env) + await client.login(process.env.DISCORD_TOKEN) .catch(err => console.error('Login failed: ', err) ) - setInterval(pruneReplies, 1000 * 60) -})() + setInterval(PruneReplies, 1000 * 60) +} + +Start() diff --git a/yarn.lock b/yarn.lock index 9654b39..11a2ebb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,7 +4,7 @@ "@discordjs/builders@^1.6.3": version "1.6.3" - resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.6.3.tgz#994b4fe57e77b47096f74bb5a1f664870a930a43" + resolved "https://registry.npmjs.org/@discordjs/builders/-/builders-1.6.3.tgz" integrity sha512-CTCh8NqED3iecTNuiz49mwSsrc2iQb4d0MjMdmS/8pb69Y4IlzJ/DIy/p5GFlgOrFbNO2WzMHkWKQSiJ3VNXaw== dependencies: "@discordjs/formatters" "^0.3.1" @@ -17,19 +17,19 @@ "@discordjs/collection@^1.5.1": version "1.5.1" - resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.5.1.tgz#bc7ca557838dc29247bf19860426637f103bc383" + resolved "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.1.tgz" integrity sha512-aWEc9DCf3TMDe9iaJoOnO2+JVAjeRNuRxPZQA6GVvBf+Z3gqUuWYBy2NWh4+5CLYq5uoc3MOvUQ5H5m8CJBqOA== "@discordjs/formatters@^0.3.1": version "0.3.1" - resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.3.1.tgz#81393cf25e6e3223361061629752ea727475e842" + resolved "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.1.tgz" integrity sha512-M7X4IGiSeh4znwcRGcs+49B5tBkNDn4k5bmhxJDAUhRxRHTiFAOTVUNQ6yAKySu5jZTnCbSvTYHW3w0rAzV1MA== dependencies: discord-api-types "^0.37.41" "@discordjs/rest@^1.7.1": version "1.7.1" - resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.7.1.tgz#eeef0e71a37c95fa27962129729b2aa9de8e3752" + resolved "https://registry.npmjs.org/@discordjs/rest/-/rest-1.7.1.tgz" integrity sha512-Ofa9UqT0U45G/eX86cURQnX7gzOJLG2oC28VhIk/G6IliYgQF7jFByBJEykPSHE4MxPhqCleYvmsrtfKh1nYmQ== dependencies: "@discordjs/collection" "^1.5.1" @@ -43,12 +43,12 @@ "@discordjs/util@^0.3.0", "@discordjs/util@^0.3.1": version "0.3.1" - resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-0.3.1.tgz#4e8737e1dcff7e9f5eccc3116fb44755b65b1e97" + resolved "https://registry.npmjs.org/@discordjs/util/-/util-0.3.1.tgz" integrity sha512-HxXKYKg7vohx2/OupUN/4Sd02Ev3PBJ5q0gtjdcvXb0ErCva8jNHWfe/v5sU3UKjIB/uxOhc+TDOnhqffj9pRA== "@discordjs/ws@^0.8.3": version "0.8.3" - resolved "https://registry.yarnpkg.com/@discordjs/ws/-/ws-0.8.3.tgz#77db8d563b731a2198c1b40f63b1ef8d230504f7" + resolved "https://registry.npmjs.org/@discordjs/ws/-/ws-0.8.3.tgz" integrity sha512-hcYtppanjHecbdNyCKQNH2I4RP9UrphDgmRgLYrATEQF1oo4sYSve7ZmGsBEXSzH72MO2tBPdWSThunbxUVk0g== dependencies: "@discordjs/collection" "^1.5.1" @@ -63,12 +63,12 @@ "@sapphire/async-queue@^1.5.0": version "1.5.0" - resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.0.tgz#2f255a3f186635c4fb5a2381e375d3dfbc5312d8" + resolved "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz" integrity sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA== "@sapphire/shapeshift@^3.8.2": version "3.9.0" - resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.0.tgz#5425d90b5f394b44b13928006f6b78c5294c0ce9" + resolved "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.0.tgz" integrity sha512-iJpHmjAdwX9aSL6MvFpVyo+tkokDtInmSjoJHbz/k4VJfnim3DjvG0hgGEKWtWZgCu45RaLgcoNgR1fCPdIz3w== dependencies: fast-deep-equal "^3.1.3" @@ -76,34 +76,34 @@ "@sapphire/snowflake@^3.4.2": version "3.5.1" - resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.1.tgz#254521c188b49e8b2d4cc048b475fb2b38737fec" + resolved "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz" integrity sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA== "@tokenizer/token@^0.3.0": version "0.3.0" - resolved "https://registry.yarnpkg.com/@tokenizer/token/-/token-0.3.0.tgz#fe98a93fe789247e998c75e74e9c7c63217aa276" + resolved "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz" integrity sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A== "@types/node@*": version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.1.tgz#de559d4b33be9a808fd43372ccee822c70f39704" + resolved "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz" integrity sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg== "@types/ws@^8.5.4": version "8.5.4" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5" + resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz" integrity sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg== dependencies: "@types/node" "*" "@vladfrangu/async_event_emitter@^2.2.1": version "2.2.2" - resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz#84c5a3f8d648842cec5cc649b88df599af32ed88" + resolved "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz" integrity sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ== abstract-level@^1.0.2: version "1.0.3" - resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" + resolved "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz" integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== dependencies: buffer "^6.0.3" @@ -116,12 +116,12 @@ abstract-level@^1.0.2: base64-js@^1.3.1: version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== buffer@^6.0.3: version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== dependencies: base64-js "^1.3.1" @@ -129,19 +129,19 @@ buffer@^6.0.3: busboy@^1.6.0: version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + resolved "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz" integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== dependencies: streamsearch "^1.1.0" catering@^2.1.0: version "2.1.1" - resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" + resolved "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz" integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== classic-level@^1.3.0: version "1.3.0" - resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.3.0.tgz#5e36680e01dc6b271775c093f2150844c5edd5c8" + resolved "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz" integrity sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg== dependencies: abstract-level "^1.0.2" @@ -152,12 +152,12 @@ classic-level@^1.3.0: discord-api-types@^0.37.41: version "0.37.42" - resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.42.tgz#3c196267ed31e9ea249e6880c15e2af1c6428629" + resolved "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.42.tgz" integrity sha512-1Huaj9cQ1W7/uryS8MZs/tZemnoKB94thM1cE40lep3rpU3q7WHqkdjN/veX0prTkYlPhcyLd/DeF/pBO8X8oQ== discord.js@^14.11.0: version "14.11.0" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.11.0.tgz#6529d49f30d10fc5a9ff8e6796661aa998769afe" + resolved "https://registry.npmjs.org/discord.js/-/discord.js-14.11.0.tgz" integrity sha512-CkueWYFQ28U38YPR8HgsBR/QT35oPpMbEsTNM30Fs8loBIhnA4s70AwQEoy6JvLcpWWJO7GY0y2BUzZmuBMepQ== dependencies: "@discordjs/builders" "^1.6.3" @@ -177,17 +177,17 @@ discord.js@^14.11.0: dotenv@^16.0.3: version "16.0.3" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz" integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== fast-deep-equal@^3.1.3: version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== file-type@^18.3.0: version "18.4.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-18.4.0.tgz#1d6c2c9351ad0dfe1f03165e04d60797b159578f" + resolved "https://registry.npmjs.org/file-type/-/file-type-18.4.0.tgz" integrity sha512-o6MQrZKTAK6WpvmQk3jqTVUmqxYBxW5bloUfrdH1ZnRFDvvAPNr+l+rgOxM3nkqWT+3khaj3FRMDydWe0xhu+w== dependencies: readable-web-to-node-stream "^3.0.2" @@ -201,22 +201,22 @@ ieee754@^1.2.1: inherits@^2.0.3: version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-buffer@^2.0.5: version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== level-supports@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" + resolved "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz" integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== level-transcoder@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" + resolved "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz" integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== dependencies: buffer "^6.0.3" @@ -224,42 +224,42 @@ level-transcoder@^1.0.1: lodash.snakecase@^4.1.1: version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz" integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== lodash@^4.17.21: version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== module-error@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" + resolved "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz" integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== napi-macros@^2.2.2: version "2.2.2" - resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" + resolved "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz" integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== node-gyp-build@^4.3.0: version "4.6.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" + resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz" integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== peek-readable@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/peek-readable/-/peek-readable-5.0.0.tgz#7ead2aff25dc40458c60347ea76cfdfd63efdfec" + resolved "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz" integrity sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A== queue-microtask@^1.2.3: version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== readable-stream@^3.6.0: version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" @@ -268,31 +268,31 @@ readable-stream@^3.6.0: readable-web-to-node-stream@^3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz#5d52bb5df7b54861fd48d015e93a2cb87b3ee0bb" + 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" safe-buffer@~5.2.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== streamsearch@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== string_decoder@^1.1.1: version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" strtok3@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/strtok3/-/strtok3-7.0.0.tgz#868c428b4ade64a8fd8fee7364256001c1a4cbe5" + resolved "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz" integrity sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ== dependencies: "@tokenizer/token" "^0.3.0" @@ -300,7 +300,7 @@ strtok3@^7.0.0: token-types@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/token-types/-/token-types-5.0.1.tgz#aa9d9e6b23c420a675e55413b180635b86a093b4" + resolved "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz" integrity sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg== dependencies: "@tokenizer/token" "^0.3.0" @@ -308,27 +308,27 @@ token-types@^5.0.1: ts-mixer@^6.0.3: version "6.0.3" - resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.3.tgz#69bd50f406ff39daa369885b16c77a6194c7cae6" + resolved "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz" integrity sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ== tslib@^2.5.0: version "2.5.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.2.tgz#1b6f07185c881557b0ffa84b111a0106989e8338" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz" integrity sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA== undici@^5.22.0: version "5.22.1" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" + resolved "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz" integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw== dependencies: busboy "^1.6.0" util-deprecate@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== ws@^8.13.0: version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + resolved "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==