diff --git a/Dockerfile b/Dockerfile index 4c5e3a0..3abaa6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ##### Build Image ##### -FROM node:18 as builder +FROM node:20 as builder # Move to working directory /build WORKDIR /build @@ -20,7 +20,7 @@ RUN npm run-script build ##### Deployment Image ##### -FROM node:18-alpine +FROM node:20-alpine # Move to /bin directory as the place for resulting binary folder WORKDIR /bin diff --git a/package-lock.json b/package-lock.json index 85cd4e9..73efa30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,16 +11,16 @@ "dependencies": { "base64-js": "^1.5.1", "deflate-js": "^0.2.3", - "discord.js": "^14.3.0", + "discord.js": "^14.16.2", "dotenv": "^16.0.3", "fs": "^0.0.1-security", - "fuse.js": "^6.6.2", + "fuse.js": "^7.0.0", "https": "^1.0.0", "interval-promise": "^1.4.0", "jsdom": "^20.0.0", "node-fetch": "^3.2.6", "sanitize-filename": "^1.6.3", - "slash-create": "^5.8.0", + "slash-create": "^6.2.1", "sqlite3": "^5.0.8", "topgg-autoposter": "^2.0.1", "ydke": "^1.1.0" @@ -29,47 +29,140 @@ "@types/deflate-js": "^0.2.0", "@types/jsdom": "^16.2.14", "@types/sqlite3": "^3.1.8", - "typescript": "^4.8.0-dev.20220627" + "typescript": "^5.6.2" } }, "node_modules/@discordjs/builders": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", - "integrity": "sha512-ARy4BUTMU+S0ZI6605NDqfWO+qZqV2d/xfY32z3hVSsd9IaAKJBZ1ILTZLy87oIjW8+gUpQmk9Kt0ZP9bmmd8Q==", - "dependencies": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.37.3", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.9.0.tgz", + "integrity": "sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==", + "dependencies": { + "@discordjs/formatters": "^0.5.0", + "@discordjs/util": "^1.1.1", + "@sapphire/shapeshift": "^4.0.0", + "discord-api-types": "0.37.97", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.4", + "tslib": "^2.6.3" }, "engines": { - "node": ">=16.9.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" } }, "node_modules/@discordjs/collection": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.1.0.tgz", - "integrity": "sha512-PQ2Bv6pnT7aGPCKWbvvNRww5tYCGpggIQVgpuF9TdDPeR6n6vQYxezXiLVOS9z2B62Dp4c+qepQ15SgJbLYtCQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz", + "integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==", "engines": { - "node": ">=16.9.0" + "node": ">=16.11.0" + } + }, + "node_modules/@discordjs/formatters": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.5.0.tgz", + "integrity": "sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g==", + "dependencies": { + "discord-api-types": "0.37.97" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" } }, "node_modules/@discordjs/rest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.1.0.tgz", - "integrity": "sha512-yCrthRTQeUyNThQEpCk7bvQJlwQmz6kU0tf3dcWBv2WX3Bncl41x7Wc+v5b5OsIxfNYq38PvVtWircu9jtYZug==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.4.0.tgz", + "integrity": "sha512-Xb2irDqNcq+O8F0/k/NaDp7+t091p+acb51iA4bCKfIn+WFWd6HrNvcsSbMMxIR9NjcMZS6NReTKygqiQN+ntw==", "dependencies": { - "@discordjs/collection": "^1.0.1", - "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.3", - "file-type": "^17.1.6", - "tslib": "^2.4.0", - "undici": "^5.9.1" + "@discordjs/collection": "^2.1.1", + "@discordjs/util": "^1.1.1", + "@sapphire/async-queue": "^1.5.3", + "@sapphire/snowflake": "^3.5.3", + "@vladfrangu/async_event_emitter": "^2.4.6", + "discord-api-types": "0.37.97", + "magic-bytes.js": "^1.10.0", + "tslib": "^2.6.3", + "undici": "6.19.8" + }, + "engines": { + "node": ">=18" }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", "engines": { - "node": ">=16.9.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/util": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.1.1.tgz", + "integrity": "sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.1.1.tgz", + "integrity": "sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==", + "dependencies": { + "@discordjs/collection": "^2.1.0", + "@discordjs/rest": "^2.3.0", + "@discordjs/util": "^1.1.0", + "@sapphire/async-queue": "^1.5.2", + "@types/ws": "^8.5.10", + "@vladfrangu/async_event_emitter": "^2.2.4", + "discord-api-types": "0.37.83", + "tslib": "^2.6.2", + "ws": "^8.16.0" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws/node_modules/@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws/node_modules/discord-api-types": { + "version": "0.37.83", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.83.tgz", + "integrity": "sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==" + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "license": "MIT", + "engines": { + "node": ">=14" } }, "node_modules/@gar/promisify": { @@ -164,41 +257,35 @@ } }, "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==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.3.tgz", + "integrity": "sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" } }, "node_modules/@sapphire/shapeshift": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz", - "integrity": "sha512-7JFsW5IglyOIUQI1eE0g6h06D/Far6HqpcowRScgCiLSqTf3hhkPWCWotVTtVycnDCMYIwPeaw6IEPBomKC8pA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-4.0.0.tgz", + "integrity": "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==", "dependencies": { "fast-deep-equal": "^3.1.3", - "lodash.uniqwith": "^4.5.0" + "lodash": "^4.17.21" }, "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" + "node": ">=v16" } }, "node_modules/@sapphire/snowflake": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", - "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.3.tgz", + "integrity": "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==", "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==" - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -298,13 +385,22 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", "dependencies": { "@types/node": "*" } }, + "node_modules/@vladfrangu/async_event_emitter": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.6.tgz", + "integrity": "sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -654,29 +750,34 @@ } }, "node_modules/discord-api-types": { - "version": "0.37.5", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.5.tgz", - "integrity": "sha512-RhzoX02jw2M+n/AU5K74KTM4J8Sn3ZImUJvoA4lh+SDcrqi1ddSjrafciF4bECj4rPc2vHwoyyTNgbUwE8vbpA==" + "version": "0.37.97", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz", + "integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==" }, "node_modules/discord.js": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.3.0.tgz", - "integrity": "sha512-CpIwoAAuELiHSgVKRMzsCADS6ZlJwAZ9RlvcJYdEgS00aW36dSvXyBgE+S3pigkc7G+jU6BEalMUWIJFveqrBQ==", - "dependencies": { - "@discordjs/builders": "^1.2.0", - "@discordjs/collection": "^1.1.0", - "@discordjs/rest": "^1.1.0", - "@sapphire/snowflake": "^3.2.2", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.3", - "fast-deep-equal": "^3.1.3", - "lodash.snakecase": "^4.1.1", - "tslib": "^2.4.0", - "undici": "^5.9.1", - "ws": "^8.8.1" + "version": "14.16.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.16.2.tgz", + "integrity": "sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/builders": "^1.9.0", + "@discordjs/collection": "1.5.3", + "@discordjs/formatters": "^0.5.0", + "@discordjs/rest": "^2.4.0", + "@discordjs/util": "^1.1.1", + "@discordjs/ws": "1.1.1", + "@sapphire/snowflake": "3.5.3", + "discord-api-types": "0.37.97", + "fast-deep-equal": "3.1.3", + "lodash.snakecase": "4.1.1", + "tslib": "^2.6.3", + "undici": "6.19.8" + }, + "engines": { + "node": ">=18" }, - "engines": { - "node": ">=16.9.0" + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" } }, "node_modules/domexception": { @@ -788,9 +889,10 @@ } }, "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -824,22 +926,6 @@ "node": "^12.20 || >= 14.13" } }, - "node_modules/file-type": { - "version": "17.1.6", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", - "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", - "dependencies": { - "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0-alpha.9", - "token-types": "^5.0.0-alpha.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/file-type?sponsor=1" - } - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -886,9 +972,10 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fuse.js": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz", - "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz", + "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==", + "license": "Apache-2.0", "engines": { "node": ">=10" } @@ -1032,25 +1119,6 @@ "node": ">=0.10.0" } }, - "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/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1182,6 +1250,11 @@ "node": ">= 0.8.0" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -1192,11 +1265,6 @@ "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "node_modules/lodash.uniqwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", - "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==" - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1208,6 +1276,11 @@ "node": ">=10" } }, + "node_modules/magic-bytes.js": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz", + "integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==" + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -1630,18 +1703,6 @@ "node": ">=0.10.0" } }, - "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/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -1720,21 +1781,6 @@ "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/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -1831,23 +1877,25 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/slash-create": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/slash-create/-/slash-create-5.8.0.tgz", - "integrity": "sha512-VTnGMO+w/c/HBBn2V6wdBO3SFTC5svlWwfwz+kxDCezfmNZL06kGwPGKzCk+lkBobUK4c+yL12zfopKDCibmnQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/slash-create/-/slash-create-6.2.1.tgz", + "integrity": "sha512-ootudSRNVVeOdTgD4WLWwLOhw31Tfgi3243du3UiqDpGcAUJQNJ4dSBRcf44pmlmT7T/8YppHU1bS847S1iYbg==", + "license": "MIT", "dependencies": { - "eventemitter3": "^4.0.7", + "eventemitter3": "^5.0.1", "lodash.isequal": "^4.5.0", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.3", + "undici": "^5.28.4" }, "engines": { - "node": ">=14" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/Snazzah" }, "peerDependencies": { - "express": "^4.17.1", - "fastify": "^3.9.1" + "express": "^4", + "fastify": "^3 || ^4" }, "peerDependenciesMeta": { "express": { @@ -1858,6 +1906,18 @@ } } }, + "node_modules/slash-create/node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -1979,22 +2039,6 @@ "node": ">=8" } }, - "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/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -2024,22 +2068,6 @@ "node": ">=0.6" } }, - "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/topgg-autoposter": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/topgg-autoposter/-/topgg-autoposter-2.0.1.tgz", @@ -2051,9 +2079,10 @@ } }, "node_modules/topgg-autoposter/node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2095,14 +2124,14 @@ } }, "node_modules/ts-mixer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", - "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz", + "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==" }, "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" }, "node_modules/tweetnacl": { "version": "1.0.3", @@ -2121,24 +2150,25 @@ } }, "node_modules/typescript": { - "version": "4.8.0-dev.20220627", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.0-dev.20220627.tgz", - "integrity": "sha512-AotGcCE4LR1khwUAONhErpEdikkPmmkibtbhakf8A6mfzTe7VxsUF8CVLbE4ZJlGkafl0TsWFi7mxvrv47Dq2w==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/undici": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", - "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", "engines": { - "node": ">=12.18" + "node": ">=18.17" } }, "node_modules/unique-filename": { @@ -2288,15 +2318,15 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -2333,36 +2363,93 @@ }, "dependencies": { "@discordjs/builders": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", - "integrity": "sha512-ARy4BUTMU+S0ZI6605NDqfWO+qZqV2d/xfY32z3hVSsd9IaAKJBZ1ILTZLy87oIjW8+gUpQmk9Kt0ZP9bmmd8Q==", - "requires": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.37.3", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.9.0.tgz", + "integrity": "sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg==", + "requires": { + "@discordjs/formatters": "^0.5.0", + "@discordjs/util": "^1.1.1", + "@sapphire/shapeshift": "^4.0.0", + "discord-api-types": "0.37.97", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.4", + "tslib": "^2.6.3" } }, "@discordjs/collection": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.1.0.tgz", - "integrity": "sha512-PQ2Bv6pnT7aGPCKWbvvNRww5tYCGpggIQVgpuF9TdDPeR6n6vQYxezXiLVOS9z2B62Dp4c+qepQ15SgJbLYtCQ==" + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz", + "integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==" }, - "@discordjs/rest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.1.0.tgz", - "integrity": "sha512-yCrthRTQeUyNThQEpCk7bvQJlwQmz6kU0tf3dcWBv2WX3Bncl41x7Wc+v5b5OsIxfNYq38PvVtWircu9jtYZug==", + "@discordjs/formatters": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.5.0.tgz", + "integrity": "sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g==", "requires": { - "@discordjs/collection": "^1.0.1", - "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.3", - "file-type": "^17.1.6", - "tslib": "^2.4.0", - "undici": "^5.9.1" + "discord-api-types": "0.37.97" + } + }, + "@discordjs/rest": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.4.0.tgz", + "integrity": "sha512-Xb2irDqNcq+O8F0/k/NaDp7+t091p+acb51iA4bCKfIn+WFWd6HrNvcsSbMMxIR9NjcMZS6NReTKygqiQN+ntw==", + "requires": { + "@discordjs/collection": "^2.1.1", + "@discordjs/util": "^1.1.1", + "@sapphire/async-queue": "^1.5.3", + "@sapphire/snowflake": "^3.5.3", + "@vladfrangu/async_event_emitter": "^2.4.6", + "discord-api-types": "0.37.97", + "magic-bytes.js": "^1.10.0", + "tslib": "^2.6.3", + "undici": "6.19.8" + }, + "dependencies": { + "@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==" + } } }, + "@discordjs/util": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.1.1.tgz", + "integrity": "sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g==" + }, + "@discordjs/ws": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.1.1.tgz", + "integrity": "sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==", + "requires": { + "@discordjs/collection": "^2.1.0", + "@discordjs/rest": "^2.3.0", + "@discordjs/util": "^1.1.0", + "@sapphire/async-queue": "^1.5.2", + "@types/ws": "^8.5.10", + "@vladfrangu/async_event_emitter": "^2.2.4", + "discord-api-types": "0.37.83", + "tslib": "^2.6.2", + "ws": "^8.16.0" + }, + "dependencies": { + "@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==" + }, + "discord-api-types": { + "version": "0.37.83", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.83.tgz", + "integrity": "sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==" + } + } + }, + "@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==" + }, "@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -2440,28 +2527,23 @@ } }, "@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==" + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.3.tgz", + "integrity": "sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w==" }, "@sapphire/shapeshift": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz", - "integrity": "sha512-7JFsW5IglyOIUQI1eE0g6h06D/Far6HqpcowRScgCiLSqTf3hhkPWCWotVTtVycnDCMYIwPeaw6IEPBomKC8pA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-4.0.0.tgz", + "integrity": "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==", "requires": { "fast-deep-equal": "^3.1.3", - "lodash.uniqwith": "^4.5.0" + "lodash": "^4.17.21" } }, "@sapphire/snowflake": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", - "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" - }, - "@tokenizer/token": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.3.tgz", + "integrity": "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==" }, "@tootallnate/once": { "version": "2.0.0", @@ -2550,13 +2632,18 @@ "dev": true }, "@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", "requires": { "@types/node": "*" } }, + "@vladfrangu/async_event_emitter": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.6.tgz", + "integrity": "sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==" + }, "abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -2815,26 +2902,27 @@ "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" }, "discord-api-types": { - "version": "0.37.5", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.5.tgz", - "integrity": "sha512-RhzoX02jw2M+n/AU5K74KTM4J8Sn3ZImUJvoA4lh+SDcrqi1ddSjrafciF4bECj4rPc2vHwoyyTNgbUwE8vbpA==" + "version": "0.37.97", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz", + "integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==" }, "discord.js": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.3.0.tgz", - "integrity": "sha512-CpIwoAAuELiHSgVKRMzsCADS6ZlJwAZ9RlvcJYdEgS00aW36dSvXyBgE+S3pigkc7G+jU6BEalMUWIJFveqrBQ==", - "requires": { - "@discordjs/builders": "^1.2.0", - "@discordjs/collection": "^1.1.0", - "@discordjs/rest": "^1.1.0", - "@sapphire/snowflake": "^3.2.2", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.3", - "fast-deep-equal": "^3.1.3", - "lodash.snakecase": "^4.1.1", - "tslib": "^2.4.0", - "undici": "^5.9.1", - "ws": "^8.8.1" + "version": "14.16.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.16.2.tgz", + "integrity": "sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw==", + "requires": { + "@discordjs/builders": "^1.9.0", + "@discordjs/collection": "1.5.3", + "@discordjs/formatters": "^0.5.0", + "@discordjs/rest": "^2.4.0", + "@discordjs/util": "^1.1.1", + "@discordjs/ws": "1.1.1", + "@sapphire/snowflake": "3.5.3", + "discord-api-types": "0.37.97", + "fast-deep-equal": "3.1.3", + "lodash.snakecase": "4.1.1", + "tslib": "^2.6.3", + "undici": "6.19.8" } }, "domexception": { @@ -2909,9 +2997,9 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "fast-deep-equal": { "version": "3.1.3", @@ -2932,16 +3020,6 @@ "web-streams-polyfill": "^3.0.3" } }, - "file-type": { - "version": "17.1.6", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", - "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", - "requires": { - "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0-alpha.9", - "token-types": "^5.0.0-alpha.2" - } - }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -2979,9 +3057,9 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fuse.js": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz", - "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz", + "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==" }, "gauge": { "version": "3.0.2", @@ -3097,11 +3175,6 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -3210,6 +3283,11 @@ "type-check": "~0.3.2" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -3220,11 +3298,6 @@ "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "lodash.uniqwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", - "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==" - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -3233,6 +3306,11 @@ "yallist": "^4.0.0" } }, + "magic-bytes.js": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz", + "integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==" + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -3543,11 +3621,6 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, - "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==" - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -3610,14 +3683,6 @@ "util-deprecate": "^1.0.1" } }, - "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" - } - }, "retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -3682,13 +3747,24 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "slash-create": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/slash-create/-/slash-create-5.8.0.tgz", - "integrity": "sha512-VTnGMO+w/c/HBBn2V6wdBO3SFTC5svlWwfwz+kxDCezfmNZL06kGwPGKzCk+lkBobUK4c+yL12zfopKDCibmnQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/slash-create/-/slash-create-6.2.1.tgz", + "integrity": "sha512-ootudSRNVVeOdTgD4WLWwLOhw31Tfgi3243du3UiqDpGcAUJQNJ4dSBRcf44pmlmT7T/8YppHU1bS847S1iYbg==", "requires": { - "eventemitter3": "^4.0.7", + "eventemitter3": "^5.0.1", "lodash.isequal": "^4.5.0", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.3", + "undici": "^5.28.4" + }, + "dependencies": { + "undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + } } }, "smart-buffer": { @@ -3775,15 +3851,6 @@ "ansi-regex": "^5.0.1" } }, - "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" - } - }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -3807,15 +3874,6 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, - "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" - } - }, "topgg-autoposter": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/topgg-autoposter/-/topgg-autoposter-2.0.1.tgz", @@ -3827,9 +3885,9 @@ }, "dependencies": { "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==" } } }, @@ -3860,14 +3918,14 @@ } }, "ts-mixer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", - "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz", + "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==" }, "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" }, "tweetnacl": { "version": "1.0.3", @@ -3883,15 +3941,15 @@ } }, "typescript": { - "version": "4.8.0-dev.20220627", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.0-dev.20220627.tgz", - "integrity": "sha512-AotGcCE4LR1khwUAONhErpEdikkPmmkibtbhakf8A6mfzTe7VxsUF8CVLbE4ZJlGkafl0TsWFi7mxvrv47Dq2w==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true }, "undici": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", - "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==" + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==" }, "unique-filename": { "version": "1.1.1", @@ -4007,9 +4065,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "requires": {} }, "xml-name-validator": { diff --git a/package.json b/package.json index 59eee72..f0a2f1a 100644 --- a/package.json +++ b/package.json @@ -13,16 +13,16 @@ "dependencies": { "base64-js": "^1.5.1", "deflate-js": "^0.2.3", - "discord.js": "^14.3.0", + "discord.js": "^14.16.2", "dotenv": "^16.0.3", "fs": "^0.0.1-security", - "fuse.js": "^6.6.2", + "fuse.js": "^7.0.0", "https": "^1.0.0", "interval-promise": "^1.4.0", "jsdom": "^20.0.0", "node-fetch": "^3.2.6", "sanitize-filename": "^1.6.3", - "slash-create": "^5.8.0", + "slash-create": "^6.2.1", "sqlite3": "^5.0.8", "topgg-autoposter": "^2.0.1", "ydke": "^1.1.0" @@ -31,6 +31,6 @@ "@types/deflate-js": "^0.2.0", "@types/jsdom": "^16.2.14", "@types/sqlite3": "^3.1.8", - "typescript": "^4.8.0-dev.20220627" + "typescript": "^5.6.2" } } diff --git a/src/commands/convert.ts b/src/commands/convert.ts index 06d8dd3..ed6cc59 100644 --- a/src/commands/convert.ts +++ b/src/commands/convert.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandOptionType, ComponentType, TextInputStyle, CommandContext, ModalSendableContext, ModalOptions, MessageFile, ModalInteractionContext } from 'slash-create'; +import { SlashCommand, CommandOptionType, ComponentType, TextInputStyle, CommandContext, ModalSendableContext, ModalOptions, MessageFile, ModalInteractionContext, InteractionContextType, ApplicationIntegrationType } from 'slash-create'; import { Deck, Encoder, YDKEncoder, YDKeEncoder, OmegaEncoder, NamelistEncoder, KonamiEncoder, JSONEncoder } from '../utilities/encoders.js' import url from 'url'; import fetch from 'node-fetch'; @@ -75,7 +75,9 @@ export class ConvertCommand extends SlashCommand { type: CommandOptionType.STRING, name: 'name', description: 'The name you want the deck to output with. Only relevant when converting to YDK or JSON.' - }] + }], + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }); this.filePath = __filename; }; @@ -89,10 +91,10 @@ export class ConvertCommand extends SlashCommand { case 'Convert from a .YDK file.': var deckurl = ctx.attachments.first()?.url if (!deckurl) { - return ctx.send('You need to attach the YDK file you want to convert with the "file" option. Please try again.', { ephemeral: true }) + return ctx.send({content: 'You need to attach the YDK file you want to convert with the "file" option. Please try again.', ephemeral: true }) } if (!deckurl.endsWith('.ydk')) { - return ctx.send('The file you submitted was not a YDK file. Please try again.', { ephemeral: true }) + return ctx.send({content: 'The file you submitted was not a YDK file. Please try again.', ephemeral: true }) } var ydkfile = await fetch(deckurl).then(e => e.text()); const ydkdecoder = new YDKEncoder(); @@ -114,7 +116,7 @@ export class ConvertCommand extends SlashCommand { }); modal = mctx; if (!mctx.values.ydkein.startsWith('ydke://')) { - return mctx.send('The URI you entered was not for a YDKe. Please try again.', { ephemeral: true }) + return mctx.send({content: 'The URI you entered was not for a YDKe. Please try again.', ephemeral: true }) } var ydkedecoder = new YDKeEncoder(); deck = await ydkedecoder.decode(mctx.values.ydkein); @@ -161,7 +163,7 @@ export class ConvertCommand extends SlashCommand { return ctx.send('You need to attach the JSON file you want to convert with the "file" option.') } if (!deckurl.endsWith('.json')) { - return ctx.send('The file you submitted was not a JSON file. Please try again.', { ephemeral: true }) + return ctx.send({content: 'The file you submitted was not a JSON file. Please try again.', ephemeral: true }) } var jsonfile = await fetch(deckurl).then(e => e.text()); const jsondecoder = new JSONEncoder(); @@ -183,8 +185,9 @@ export class ConvertCommand extends SlashCommand { }); modal = mctx; - if (!mctx.values.konamiin.startsWith('https://www.db.yugioh-card.com/yugiohdb/member_deck.action?cgid=')) { - return mctx.send('The URL you entered either isn\'t from Konami\'s database, or was entered incorrectly.\nPlease try again.', { ephemeral: true }) + if (!mctx.values.konamiin.startsWith('https://www.db.yugioh-card.com/yugiohdb/member_deck.action?cgid=') || !mctx.values.konamiin.startsWith('http://www.db.yugioh-card.com/yugiohdb/member_deck.action?cgid=')) { + return mctx.send({content: 'Normally, you would see this error message when you put in a link to Konami\'s database incorrectly.\nHowever, our ability to convert from Konami\'s database is currently broken.\nWe deeply apologise for the inconvenience, and strive to have it operational again soon.', ephemeral: true }) + // 'The URL you entered either isn\'t from Konami\'s database, or was entered incorrectly.\nPlease try again.' } var konamidecoder = new KonamiEncoder(); @@ -207,7 +210,7 @@ export class ConvertCommand extends SlashCommand { modal = mctx; if (!mctx.values.ypdin.startsWith('https://ygoprodeck.com/deck/')) { - return mctx.send('The URL you entered either isn\'t from YGOPRODeck, or was input incorrectly.\nPlease try again.', { ephemeral: true }) + return mctx.send({content: 'The URL you entered either isn\'t from YGOPRODeck, or was input incorrectly.\nPlease try again.', ephemeral: true }) } var page = await fetch(mctx.values.ypdin).then(e => e.text()); @@ -263,9 +266,9 @@ export class ConvertCommand extends SlashCommand { var attachment = { file: buffer, name: (ctx.options.name ?? deck.deckName ?? 'result') + '.ydk' }; if (modal) { - modal.send('Here\'s your converted YDK file:', { file: attachment }) + modal.send({content: 'Here\'s your converted YDK file:', files: [attachment] }) } else { - ctx.send('Here\'s your converted YDK file:', { file: attachment }) + ctx.send({content: 'Here\'s your converted YDK file:', files: [attachment] }) } break; case 'Convert to a YDKE string.': @@ -305,9 +308,9 @@ export class ConvertCommand extends SlashCommand { var attachment = { file: buffer, name: (ctx.options.name ?? deck.deckName ?? 'result') + '.json' }; if (modal) { - modal.send('Here\'s your converted JSON file:', { file: attachment }) + modal.send({content: 'Here\'s your converted JSON file:', files: [attachment] }) } else { - ctx.send('Here\'s your converted JSON file:', { file: attachment }) + ctx.send({content: 'Here\'s your converted JSON file:', files: [attachment] }) } break; } diff --git a/src/commands/duellinksset.ts b/src/commands/duellinksset.ts index 6acb107..f8697e8 100644 --- a/src/commands/duellinksset.ts +++ b/src/commands/duellinksset.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext } from 'slash-create'; +import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext, InteractionContextType, ApplicationIntegrationType } from 'slash-create'; import { getFuzzySetSearch } from '../utilities/duellinksmeta.js'; import { searchSet } from '../utilities/searchutil.js'; @@ -13,7 +13,9 @@ export class DuelLinksSetCommand extends SlashCommand { description: 'The set name you want to search for.', required: true, autocomplete: true - }] + }], + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }) } diff --git a/src/commands/invite.ts b/src/commands/invite.ts index 7e060b7..8d25708 100644 --- a/src/commands/invite.ts +++ b/src/commands/invite.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandContext } from 'slash-create'; +import { SlashCommand, CommandContext, InteractionContextType, ApplicationIntegrationType } from 'slash-create'; import url from 'url'; const __filename = url.fileURLToPath(import.meta.url); @@ -7,13 +7,15 @@ export class InviteCommand extends SlashCommand { super(creator, { name: 'i', description: 'Gives information about Junk Converter, as well as an invite link.', - deferEphemeral: true + deferEphemeral: true, + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }); this.filePath = __filename; } async run(ctx: CommandContext) { - return ctx.send('Junk Converter is a Discord bot coded in a mix of discord.js and slash-create for the purposes of converting Yu-Gi-Oh! decks between various digital deck formats. It also has the ability to search for cards, from both the OCG/TCG and Rush Duel.\nMade with :drop_of_blood:, :sweat_drops:, :droplet:, and :heart: by 8 and uwx.\n\nTo invite Junk Converter to your server, you can either click/tap on its user profile and select "Add to Server," or you can click the link below.\nhttps://discord.com/api/oauth2/authorize?client_id=990092946848223322&permissions=262144&scope=bot%20applications.commands\nIf you\'re having problems with Junk Converter, you can either let me know by joining my Discord server, or DMing me on Twitter @track8regret.\nhttps://discord.gg/2vMBrWf5uc\n\n\nYou can also contribute directly to Junk Converter by sending a pull request to our GitHub page.\nhttps://github.com/track8regret/Junk-Converter', {'ephemeral': true}) + return ctx.send({content: 'Junk Converter is a Discord bot coded in a mix of discord.js and slash-create for the purposes of converting Yu-Gi-Oh! decks between various digital deck formats. It also has the ability to search for cards, from both the OCG/TCG and Rush Duel.\nMade with :drop_of_blood:, :sweat_drops:, :droplet:, and :heart: by 8 and uwx.\n\nTo invite Junk Converter to your server, you can either click/tap on its user profile and select "Add to Server," or you can click the link below.\nhttps://discord.com/api/oauth2/authorize?client_id=990092946848223322&permissions=262144&scope=bot%20applications.commands\nIf you\'re having problems with Junk Converter, you can either let me know by joining my Discord server, or DMing me on Twitter @track8regret.\nhttps://discord.gg/2vMBrWf5uc\n\n\nYou can also contribute directly to Junk Converter by sending a pull request to our GitHub page.\nhttps://github.com/track8regret/Junk-Converter', 'ephemeral': true}) } } \ No newline at end of file diff --git a/src/commands/masterduelset.ts b/src/commands/masterduelset.ts index 8b7945f..6e4919f 100644 --- a/src/commands/masterduelset.ts +++ b/src/commands/masterduelset.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext } from 'slash-create'; +import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext, InteractionContextType, ApplicationIntegrationType } from 'slash-create'; import { getFuzzySetSearch } from '../utilities/duellinksmeta.js'; import { searchSet } from '../utilities/searchutil.js'; @@ -13,7 +13,9 @@ export class MasterDuelSetCommand extends SlashCommand { description: 'The set name you want to search for.', required: true, autocomplete: true - }] + }], + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }) } diff --git a/src/commands/search.ts b/src/commands/search.ts index 3c7a241..3ce3e9a 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext } from 'slash-create'; +import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext, ApplicationIntegrationType, InteractionContextType } from 'slash-create'; import { getFuzzyCardSearch } from '../utilities/database-cache.js'; import { searchCard } from '../utilities/searchutil.js'; @@ -12,8 +12,10 @@ export class SearchCommand extends SlashCommand { name: 'query', description: 'The card name or ID you want to search for.', required: true, - autocomplete: true - }] + autocomplete: true, + }], + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }) } diff --git a/src/commands/searchrush.ts b/src/commands/searchrush.ts index a7a0232..aadbe19 100644 --- a/src/commands/searchrush.ts +++ b/src/commands/searchrush.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext } from 'slash-create'; +import { SlashCommand, CommandOptionType, CommandContext, AutocompleteContext, InteractionContextType, ApplicationIntegrationType } from 'slash-create'; import { getFuzzyCardSearch } from '../utilities/database-cache.js'; import { searchCard } from '../utilities/searchutil.js'; @@ -13,7 +13,9 @@ export class SearchRushCommand extends SlashCommand { description: 'The card name or ID you want to search for.', required: true, autocomplete: true - }] + }], + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }) } diff --git a/src/commands/vote.ts b/src/commands/vote.ts index 4b25fd6..8035b7f 100644 --- a/src/commands/vote.ts +++ b/src/commands/vote.ts @@ -1,4 +1,4 @@ -import { SlashCommand, CommandContext } from 'slash-create'; +import { SlashCommand, CommandContext, InteractionContextType, ApplicationIntegrationType } from 'slash-create'; import url from 'url'; const __filename = url.fileURLToPath(import.meta.url); @@ -7,13 +7,15 @@ export class VoteCommand extends SlashCommand { super(creator, { name: 'v', description: 'Provides a link to vote for Junk Converter on Top.gg.', - deferEphemeral: true + deferEphemeral: true, + contexts: [InteractionContextType.PRIVATE_CHANNEL, InteractionContextType.BOT_DM, InteractionContextType.GUILD], + integrationTypes: [ApplicationIntegrationType.GUILD_INSTALL, ApplicationIntegrationType.USER_INSTALL] }); this.filePath = __filename; } async run(ctx: CommandContext) { - return ctx.send('While it serves to gain you no reward in comparison to other bots, voting for Junk Converter on Top.gg will greatly help with promoting the bot and making sure that other individuals are able to find it when searching for a tool like this.\nYour vote would be greatly appreciated.\n\nhttps://top.gg/bot/990092946848223322/vote', {'ephemeral': true}) + return ctx.send({content: 'While it serves to gain you no reward in comparison to other bots, voting for Junk Converter on Top.gg will greatly help with promoting the bot and making sure that other individuals are able to find it when searching for a tool like this.\nYour vote would be greatly appreciated.\n\nhttps://top.gg/bot/990092946848223322/vote', 'ephemeral': true}) } } \ No newline at end of file diff --git a/src/junk.ts b/src/junk.ts index e2c0dc1..24ed682 100644 --- a/src/junk.ts +++ b/src/junk.ts @@ -33,16 +33,16 @@ if (JANK === "false") { }) } -await creator - .withServer( +await creator.withServer( new GatewayServer( (handler) => client.ws.on(GatewayDispatchEvents.InteractionCreate, handler) - ) - ) - .registerCommands([ConvertCommand, InviteCommand, VoteCommand, SearchCommand, SearchRushCommand, DuelLinksSetCommand, MasterDuelSetCommand]) // register commands - .on('commandError', (command, error) => console.error(`Command ${command.commandName}:`, error)) - .syncCommands() - .syncCommandsIn(TEST_SERVER!) + )) +await creator.registerCommands([ConvertCommand, InviteCommand, VoteCommand, SearchCommand, SearchRushCommand, DuelLinksSetCommand, MasterDuelSetCommand]) // register commands +await creator.syncCommands() +await creator.syncCommandsIn(TEST_SERVER!) + +await creator.on('commandError', (command, error) => console.error(`Command ${command.commandName}:`, error)) + client.login(TOKEN); client.on('ready', () => { diff --git a/src/utilities/database-cache.ts b/src/utilities/database-cache.ts index a92d3c2..73adf58 100644 --- a/src/utilities/database-cache.ts +++ b/src/utilities/database-cache.ts @@ -4,6 +4,7 @@ import interval from 'interval-promise'; import fs from 'fs'; import path from 'path'; import url from 'url'; +// import { default as Fuse } from 'fuse.js' import { default as Fuse } from 'fuse.js' import { pipeline } from 'stream/promises'; @@ -314,7 +315,7 @@ const fuserush = new Fuse([...new Set([ }); export function getFuzzyCardSearch(input: string | number, format: 'ocgtcg' | 'rush'): string[] { - let results: Fuse.FuseResult[]; + let results; if (format === 'ocgtcg') { results = fuse.search(String(input), {limit: 100}); } else { diff --git a/src/utilities/duellinksmeta.ts b/src/utilities/duellinksmeta.ts index b3eaf38..281c290 100644 --- a/src/utilities/duellinksmeta.ts +++ b/src/utilities/duellinksmeta.ts @@ -1,6 +1,6 @@ import fetch from 'node-fetch'; import interval from 'interval-promise'; -import { default as Fuse } from 'fuse.js'; +import Fuse from 'fuse.js'; export interface Card { _id: string, @@ -141,7 +141,7 @@ const fusemd = new Fuse(mdmsets, { }); export function getFuzzySetSearch (input: string, game: 'dl' | 'md'): string[] { - let results: Fuse.FuseResult[]; + let results; if (game === 'dl') { results = fusedl.search(String(input), {limit: 100}); } else { diff --git a/src/utilities/encoders.ts b/src/utilities/encoders.ts index 1a01208..3d2c22d 100644 --- a/src/utilities/encoders.ts +++ b/src/utilities/encoders.ts @@ -192,7 +192,7 @@ class NamelistEncoder extends Encoder { if (entry.trim() === '') continue; var prep = entry.split(/(?<=^\S+)\s/) - var amount = ~~prep[0] + var amount: number = ~~prep[0] var cardname = prep[1].trim(); mdar.push([Number(amount), String(cardname)]) } @@ -202,7 +202,7 @@ class NamelistEncoder extends Encoder { if (entry.trim() === '') continue; var prep = entry.split(/(?<=^\S+)\s/) - var amount = ~~prep[0] + var amount: number = ~~prep[0] var cardname = prep[1].trim(); exar.push([Number(amount), String(cardname)]) } @@ -213,7 +213,7 @@ class NamelistEncoder extends Encoder { if (entry.trim() === '') continue; var prep = entry.split(/(?<=^\S+)\s/) - var amount = ~~prep[0] + var amount: number = ~~prep[0] var cardname = prep[1].trim(); sdar.push([Number(amount), String(cardname)]) } @@ -221,19 +221,19 @@ class NamelistEncoder extends Encoder { var mdai = []; for (const [amount, name] of mdar) { - for (var i = 0; i < amount; i++) { + for (var i = 0; i < +amount; i++) { mdai.push(getIdForCardName(name as string)) } } var exai = []; for (const [amount, name] of exar) { - for (var i = 0; i < amount; i++) { + for (var i = 0; i < +amount; i++) { exai.push(getIdForCardName(name as string)) } } var sdai = []; for (const [amount, name] of sdar) { - for (var i = 0; i < amount; i++) { + for (var i = 0; i < +amount; i++) { sdai.push(getIdForCardName(name as string)) } } @@ -312,19 +312,19 @@ class KonamiEncoder extends Encoder { var mdai = []; for (const [amount, name] of mdar) { - for (var i = 0; i < amount; i++) { + for (var i = 0; i < +amount; i++) { mdai.push(getIdForCardName(name as string)) } } var exai = []; for (const [amount, name] of exar) { - for (var i = 0; i < amount; i++) { + for (var i = 0; i < +amount; i++) { exai.push(getIdForCardName(name as string)) } } var sdai = []; for (const [amount, name] of sdar) { - for (var i = 0; i < amount; i++) { + for (var i = 0; i < +amount; i++) { sdai.push(getIdForCardName(name as string)) } } diff --git a/src/utilities/searchutil.ts b/src/utilities/searchutil.ts index 2b0b6ed..333e440 100644 --- a/src/utilities/searchutil.ts +++ b/src/utilities/searchutil.ts @@ -3,7 +3,7 @@ import fetch from 'node-fetch'; import { YGOPRODeck, LinkMarker, Card as YPDCard } from '../utilities/ygoprodeck.js' import { DuelLinksMeta, MasterDuelMeta, Card as DLMCard, Set as DLMSet } from '../utilities/duellinksmeta.js'; import { getIdForCardName, getTypeForId } from '../utilities/database-cache.js' -import allemoji from '../utilities/emojis.json' +import allemoji from '../utilities/emojis.json' with { type: "json" } const { JANK } = process.env var emojis = allemoji.junk @@ -43,7 +43,7 @@ export async function searchCard (query: string, ctx: CommandContext, format?: ' if (cardinfo === undefined) { // do something, exit - return ctx.send('The card you searched for turned up as undefined in our search.\nUsually, this happens when YGOPRODeck doesn\'t have information on a card we list.\nIf you suspect it\'s something else, please try again.', {ephemeral: true}) + return ctx.send({content: 'The card you searched for turned up as undefined in our search.\nUsually, this happens when YGOPRODeck doesn\'t have information on a card we list.\nIf you suspect it\'s something else, please try again.', ephemeral: true}) } let embedfields: Array = []; @@ -268,7 +268,7 @@ export async function searchSet (query: string, ctx: CommandContext, game: 'dl' if (setresult === undefined) { // do something, exit - return ctx.send('The set you searched for turned up as undefined in our search.\nEither you misspelled your input, or DLM Corp. doesn\'t currently have information on this set.\nIf you suspect it\'s something else, please try again.', {ephemeral: true}) + return ctx.send({content: 'The set you searched for turned up as undefined in our search.\nEither you misspelled your input, or DLM Corp. doesn\'t currently have information on this set.\nIf you suspect it\'s something else, please try again.', ephemeral: true}) } let embedfields: Array = []; diff --git a/tsconfig.json b/tsconfig.json index 6669b37..c9930b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,9 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "lib": ["es2021", "DOM.Iterable"], - "module": "es2022", + "module": "NodeNext", "target": "es2022", - "moduleResolution": "node16", + "moduleResolution": "NodeNext", "strict": true, "esModuleInterop": true,