From 7e21eae72bf4cef7514c5bf293c91a543172a9f7 Mon Sep 17 00:00:00 2001 From: MastiderMast <65887954+MastiderMast@users.noreply.github.com> Date: Fri, 7 Apr 2023 02:59:09 +0200 Subject: [PATCH] Removed old message command handler --- README.md | 18 +- package-lock.json | 564 ++++++++---------------- package.json | 7 +- src/{slashCommands => commands}/eval.js | 0 src/commands/helloWorld.js | 15 +- src/{slashCommands => commands}/ping.js | 0 src/commands/reload.js | 18 +- src/commands/setprefix.js | 37 -- src/events/messageCreate.js | 43 +- src/handlers/commands.js | 37 -- src/handlers/slashCommands.js | 8 +- src/index.js | 30 -- src/slashCommands/reload.js | 16 - 13 files changed, 212 insertions(+), 581 deletions(-) rename src/{slashCommands => commands}/eval.js (100%) rename src/{slashCommands => commands}/ping.js (100%) delete mode 100644 src/commands/setprefix.js delete mode 100644 src/handlers/commands.js delete mode 100644 src/slashCommands/reload.js diff --git a/README.md b/README.md index b0ff53b..420a6ca 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,20 @@ # Discord.js-Advanced-Command-Handler -It is a simple event and command handler for Discord.js V14. - -[![Download](https://img.shields.io/badge/Download-blue?style=flat-square)](https://github.com/MastiderMast/Discord.js-Advanced-Command-Handler/releases) +Simple and easy to use Slash Command Handler for Discord.js v14. +If you want a old School Message Command Handler, check out [this older Release](https://github.com/MastiderMast/Discord.js-Advanced-Command-Handler/releases/tag/2.0.1) repository. ## Prerequisites -1. MySQL database is required! -2. Node.js v18.9.0 or newer is required. +- Node.js v19.8.1 or newer is required. ## Installation -1. Update your token and MySQL connection information in the config. +1. Fill out the `config.js.TEMPLATE` file with your bot's token and your userid. 2. Rename the `config.js.TEMPLATE` to `config.js` 3. Run the following command to install the package: `npm install` -4. Run the bot with the following command: `node .` +4. Run the bot with the following command: `npm start` or `node .` 5. Enjoy! ## Contributing -1. Fork it! -2. Create your feature branch: `git checkout -b my-new-feature` -3. Commit your changes: `git commit -am 'Add some feature'` -4. Push to the branch: `git push origin my-new-feature` -5. Submit a pull request +Just make a pull request and I will review it. ## License [MIT](https://choosealicense.com/licenses/mit/) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 96817b9..51addee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,68 +1,79 @@ { "name": "discord.js-advanced-command-handler", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "discord.js-advanced-command-handler", - "version": "2.0.0", - "license": "ISC", + "version": "2.0.1", + "license": "MIT", "dependencies": { "chalk": "^5.1.2", - "discord.js": "^14.6.0", - "mysql2": "^2.3.3" + "discord.js": "^14.9.0" }, "devDependencies": { "eslint": "^8.27.0" } }, "node_modules/@discordjs/builders": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.3.0.tgz", - "integrity": "sha512-Pvca6Nw8Hp+n3N+Wp17xjygXmMvggbh5ywUsOYE2Et4xkwwVRwgzxDJiMUuYapPtnYt4w/8aKlf5khc8ipLvhg==", - "dependencies": { - "@discordjs/util": "^0.1.0", - "@sapphire/shapeshift": "^3.7.0", - "discord-api-types": "^0.37.12", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.6.1.tgz", + "integrity": "sha512-CCcLwn/8ANhlAbhlE18fcaN0hfXTen53/JiwZs1t9oE/Cqa9maA8ZRarkCIsXF4J7J/MYnd0J6IsxeKsq+f6mw==", + "dependencies": { + "@discordjs/formatters": "^0.3.0", + "@discordjs/util": "^0.2.0", + "@sapphire/shapeshift": "^3.8.1", + "discord-api-types": "^0.37.37", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.3", + "tslib": "^2.5.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/collection": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.2.0.tgz", - "integrity": "sha512-VvrrtGb7vbfPHzbhGq9qZB5o8FOB+kfazrxdt0OtxzSkoBuw9dURMkCwWizZ00+rDpiK2HmLHBZX+y6JsG9khw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.0.tgz", + "integrity": "sha512-suyVndkEAAWrGxyw/CPGdtXoRRU6AUNkibtnbJevQzpelkJh3Q1gQqWDpqf5i39CnAn5+LrN0YS+cULeEjq2Yw==", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/formatters": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.0.tgz", + "integrity": "sha512-Fc4MomalbP8HMKEMor3qUiboAKDtR7PSBoPjwm7WYghVRwgJlj5WYvUsriLsxeKk8+Qq2oy+HJlGTUkGvX0YnA==", + "dependencies": { + "discord-api-types": "^0.37.37" + }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.3.0.tgz", - "integrity": "sha512-U6X5J+r/MxYpPTlHFuPxXEf92aKsBaD2teBC7sWkKILIr30O8c9+XshfL7KFBCavnAqS/qE+PF9fgRilO3N44g==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.7.0.tgz", + "integrity": "sha512-r2HzmznRIo8IDGYBWqQfkEaGN1LrFfWQd3dSyC4tOpMU8nuVvFUEw6V/lwnG44jyOq+vgyDny2fxeUDMt9I4aQ==", "dependencies": { - "@discordjs/collection": "^1.2.0", - "@discordjs/util": "^0.1.0", + "@discordjs/collection": "^1.5.0", + "@discordjs/util": "^0.2.0", "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.12", - "file-type": "^18.0.0", - "tslib": "^2.4.0", - "undici": "^5.11.0" + "@sapphire/snowflake": "^3.4.0", + "discord-api-types": "^0.37.37", + "file-type": "^18.2.1", + "tslib": "^2.5.0", + "undici": "^5.21.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/util": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.1.0.tgz", - "integrity": "sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz", + "integrity": "sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==", "engines": { "node": ">=16.9.0" } @@ -168,12 +179,12 @@ } }, "node_modules/@sapphire/shapeshift": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.0.tgz", - "integrity": "sha512-A6vI1zJoxhjWo4grsxpBRBgk96SqSdjLX5WlzKp9H+bJbkM07mvwcbtbVAmUZHbi/OG3HLfiZ1rlw4BhH6tsBQ==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.2.tgz", + "integrity": "sha512-NXpnJAsxN3/h9TqQPntOeVWZrpIuucqXI3IWF6tj2fWCoRLCuVK5wx7Dtg7pRrtkYfsMUbDqgKoX26vrC5iYfA==", "dependencies": { "fast-deep-equal": "^3.1.3", - "lodash.uniqwith": "^4.5.0" + "lodash": "^4.17.21" }, "engines": { "node": ">=v14.0.0", @@ -181,9 +192,9 @@ } }, "node_modules/@sapphire/snowflake": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", - "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", + "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -195,14 +206,14 @@ "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" }, "node_modules/@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "dependencies": { "@types/node": "*" } @@ -382,36 +393,29 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/discord-api-types": { - "version": "0.37.17", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.17.tgz", - "integrity": "sha512-5ZIw1VtkmToBy8ziketjHkZnW1FoLevyXdK/TslNFLozijug2RnB3MyBNtSGzML1c72koU3neeGkvFZ8OiU0tQ==" + "version": "0.37.37", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.37.tgz", + "integrity": "sha512-LDMBKzl/zbvHO/yCzno5hevuA6lFIXJwdKSJZQrB+1ToDpFfN9thK+xxgZNR4aVkI7GHRDja0p4Sl2oYVPnHYg==" }, "node_modules/discord.js": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.6.0.tgz", - "integrity": "sha512-On1K7xpJZRe0KsziIaDih2ksYPhgxym/ZqV45i1f3yig4vUotikqs7qp5oXiTzQ/UTiNRCixUWFTh7vA1YBCqw==", - "dependencies": { - "@discordjs/builders": "^1.3.0", - "@discordjs/collection": "^1.2.0", - "@discordjs/rest": "^1.3.0", - "@discordjs/util": "^0.1.0", - "@sapphire/snowflake": "^3.2.2", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.12", + "version": "14.9.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.9.0.tgz", + "integrity": "sha512-ygGms5xP4hG+QrrY9k7d/OYCzMltSMtdl/2Snzq/nLCiZo+Sna91Ulv9l0+B5Jd/Czcq37B7wJAnmja7GOa+bg==", + "dependencies": { + "@discordjs/builders": "^1.6.0", + "@discordjs/collection": "^1.5.0", + "@discordjs/formatters": "^0.3.0", + "@discordjs/rest": "^1.7.0", + "@discordjs/util": "^0.2.0", + "@sapphire/snowflake": "^3.4.0", + "@types/ws": "^8.5.4", + "discord-api-types": "^0.37.37", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", - "tslib": "^2.4.0", - "undici": "^5.11.0", - "ws": "^8.9.0" + "tslib": "^2.5.0", + "undici": "^5.21.0", + "ws": "^8.13.0" }, "engines": { "node": ">=16.9.0" @@ -660,9 +664,9 @@ } }, "node_modules/file-type": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.0.0.tgz", - "integrity": "sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.1.tgz", + "integrity": "sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==", "dependencies": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -716,14 +720,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dependencies": { - "is-property": "^1.0.2" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -786,17 +782,6 @@ "node": ">=8" } }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -895,11 +880,6 @@ "node": ">=8" } }, - "node_modules/is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -964,6 +944,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -975,27 +960,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/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1014,49 +978,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/mysql2": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", - "integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", - "dependencies": { - "denque": "^2.0.1", - "generate-function": "^2.3.1", - "iconv-lite": "^0.6.3", - "long": "^4.0.0", - "lru-cache": "^6.0.0", - "named-placeholders": "^1.1.2", - "seq-queue": "^0.0.5", - "sqlstring": "^2.3.2" - }, - "engines": { - "node": ">= 8.0" - } - }, - "node_modules/named-placeholders": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", - "integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", - "dependencies": { - "lru-cache": "^4.1.3" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/named-placeholders/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/named-placeholders/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -1179,11 +1100,6 @@ "node": ">= 0.8.0" } }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -1214,9 +1130,9 @@ ] }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -1329,16 +1245,6 @@ } ] }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/seq-queue": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1360,14 +1266,6 @@ "node": ">=8" } }, - "node_modules/sqlstring": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", - "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -1459,14 +1357,14 @@ } }, "node_modules/ts-mixer": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.2.tgz", - "integrity": "sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==" + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", + "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==" }, "node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/type-check": { "version": "0.4.0", @@ -1493,9 +1391,9 @@ } }, "node_modules/undici": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.12.0.tgz", - "integrity": "sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", + "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", "dependencies": { "busboy": "^1.6.0" }, @@ -1548,15 +1446,15 @@ "dev": true }, "node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -1567,11 +1465,6 @@ } } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -1587,42 +1480,51 @@ }, "dependencies": { "@discordjs/builders": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.3.0.tgz", - "integrity": "sha512-Pvca6Nw8Hp+n3N+Wp17xjygXmMvggbh5ywUsOYE2Et4xkwwVRwgzxDJiMUuYapPtnYt4w/8aKlf5khc8ipLvhg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.6.1.tgz", + "integrity": "sha512-CCcLwn/8ANhlAbhlE18fcaN0hfXTen53/JiwZs1t9oE/Cqa9maA8ZRarkCIsXF4J7J/MYnd0J6IsxeKsq+f6mw==", "requires": { - "@discordjs/util": "^0.1.0", - "@sapphire/shapeshift": "^3.7.0", - "discord-api-types": "^0.37.12", + "@discordjs/formatters": "^0.3.0", + "@discordjs/util": "^0.2.0", + "@sapphire/shapeshift": "^3.8.1", + "discord-api-types": "^0.37.37", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.3", + "tslib": "^2.5.0" } }, "@discordjs/collection": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.2.0.tgz", - "integrity": "sha512-VvrrtGb7vbfPHzbhGq9qZB5o8FOB+kfazrxdt0OtxzSkoBuw9dURMkCwWizZ00+rDpiK2HmLHBZX+y6JsG9khw==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.0.tgz", + "integrity": "sha512-suyVndkEAAWrGxyw/CPGdtXoRRU6AUNkibtnbJevQzpelkJh3Q1gQqWDpqf5i39CnAn5+LrN0YS+cULeEjq2Yw==" + }, + "@discordjs/formatters": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.0.tgz", + "integrity": "sha512-Fc4MomalbP8HMKEMor3qUiboAKDtR7PSBoPjwm7WYghVRwgJlj5WYvUsriLsxeKk8+Qq2oy+HJlGTUkGvX0YnA==", + "requires": { + "discord-api-types": "^0.37.37" + } }, "@discordjs/rest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.3.0.tgz", - "integrity": "sha512-U6X5J+r/MxYpPTlHFuPxXEf92aKsBaD2teBC7sWkKILIr30O8c9+XshfL7KFBCavnAqS/qE+PF9fgRilO3N44g==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.7.0.tgz", + "integrity": "sha512-r2HzmznRIo8IDGYBWqQfkEaGN1LrFfWQd3dSyC4tOpMU8nuVvFUEw6V/lwnG44jyOq+vgyDny2fxeUDMt9I4aQ==", "requires": { - "@discordjs/collection": "^1.2.0", - "@discordjs/util": "^0.1.0", + "@discordjs/collection": "^1.5.0", + "@discordjs/util": "^0.2.0", "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.37.12", - "file-type": "^18.0.0", - "tslib": "^2.4.0", - "undici": "^5.11.0" + "@sapphire/snowflake": "^3.4.0", + "discord-api-types": "^0.37.37", + "file-type": "^18.2.1", + "tslib": "^2.5.0", + "undici": "^5.21.0" } }, "@discordjs/util": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.1.0.tgz", - "integrity": "sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz", + "integrity": "sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==" }, "@eslint/eslintrc": { "version": "1.3.3", @@ -1696,18 +1598,18 @@ "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==" }, "@sapphire/shapeshift": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.7.0.tgz", - "integrity": "sha512-A6vI1zJoxhjWo4grsxpBRBgk96SqSdjLX5WlzKp9H+bJbkM07mvwcbtbVAmUZHbi/OG3HLfiZ1rlw4BhH6tsBQ==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.2.tgz", + "integrity": "sha512-NXpnJAsxN3/h9TqQPntOeVWZrpIuucqXI3IWF6tj2fWCoRLCuVK5wx7Dtg7pRrtkYfsMUbDqgKoX26vrC5iYfA==", "requires": { "fast-deep-equal": "^3.1.3", - "lodash.uniqwith": "^4.5.0" + "lodash": "^4.17.21" } }, "@sapphire/snowflake": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", - "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", + "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==" }, "@tokenizer/token": { "version": "0.3.0", @@ -1715,14 +1617,14 @@ "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" }, "@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "requires": { "@types/node": "*" } @@ -1855,33 +1757,29 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" - }, "discord-api-types": { - "version": "0.37.17", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.17.tgz", - "integrity": "sha512-5ZIw1VtkmToBy8ziketjHkZnW1FoLevyXdK/TslNFLozijug2RnB3MyBNtSGzML1c72koU3neeGkvFZ8OiU0tQ==" + "version": "0.37.37", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.37.tgz", + "integrity": "sha512-LDMBKzl/zbvHO/yCzno5hevuA6lFIXJwdKSJZQrB+1ToDpFfN9thK+xxgZNR4aVkI7GHRDja0p4Sl2oYVPnHYg==" }, "discord.js": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.6.0.tgz", - "integrity": "sha512-On1K7xpJZRe0KsziIaDih2ksYPhgxym/ZqV45i1f3yig4vUotikqs7qp5oXiTzQ/UTiNRCixUWFTh7vA1YBCqw==", + "version": "14.9.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.9.0.tgz", + "integrity": "sha512-ygGms5xP4hG+QrrY9k7d/OYCzMltSMtdl/2Snzq/nLCiZo+Sna91Ulv9l0+B5Jd/Czcq37B7wJAnmja7GOa+bg==", "requires": { - "@discordjs/builders": "^1.3.0", - "@discordjs/collection": "^1.2.0", - "@discordjs/rest": "^1.3.0", - "@discordjs/util": "^0.1.0", - "@sapphire/snowflake": "^3.2.2", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.37.12", + "@discordjs/builders": "^1.6.0", + "@discordjs/collection": "^1.5.0", + "@discordjs/formatters": "^0.3.0", + "@discordjs/rest": "^1.7.0", + "@discordjs/util": "^0.2.0", + "@sapphire/snowflake": "^3.4.0", + "@types/ws": "^8.5.4", + "discord-api-types": "^0.37.37", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", - "tslib": "^2.4.0", - "undici": "^5.11.0", - "ws": "^8.9.0" + "tslib": "^2.5.0", + "undici": "^5.21.0", + "ws": "^8.13.0" } }, "doctrine": { @@ -2068,9 +1966,9 @@ } }, "file-type": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.0.0.tgz", - "integrity": "sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.1.tgz", + "integrity": "sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==", "requires": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -2109,14 +2007,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "requires": { - "is-property": "^1.0.2" - } - }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2161,14 +2051,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -2232,11 +2114,6 @@ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2289,6 +2166,11 @@ "p-locate": "^5.0.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2300,24 +2182,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==" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2333,45 +2197,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "mysql2": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", - "integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", - "requires": { - "denque": "^2.0.1", - "generate-function": "^2.3.1", - "iconv-lite": "^0.6.3", - "long": "^4.0.0", - "lru-cache": "^6.0.0", - "named-placeholders": "^1.1.2", - "seq-queue": "^0.0.5", - "sqlstring": "^2.3.2" - } - }, - "named-placeholders": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", - "integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", - "requires": { - "lru-cache": "^4.1.3" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - } - } - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -2457,11 +2282,6 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -2475,9 +2295,9 @@ "dev": true }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -2533,16 +2353,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "seq-queue": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2558,11 +2368,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "sqlstring": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", - "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" - }, "streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -2625,14 +2430,14 @@ } }, "ts-mixer": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.2.tgz", - "integrity": "sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==" + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", + "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==" }, "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "type-check": { "version": "0.4.0", @@ -2650,9 +2455,9 @@ "dev": true }, "undici": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.12.0.tgz", - "integrity": "sha512-zMLamCG62PGjd9HHMpo05bSLvvwWOZgGeiWlN/vlqu3+lRo3elxktVGEyLMX+IO7c2eflLjcW74AlkhEZm15mg==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", + "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", "requires": { "busboy": "^1.6.0" } @@ -2693,16 +2498,11 @@ "dev": true }, "ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "requires": {} }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 4959a16..00f0d5a 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "discord.js-advanced-command-handler", - "version": "2.0.1", + "version": "2.1.0", "description": "🤖 Discord.js V14 Command and Event Handler", "main": "src/index.js", "type": "module", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node src/index.js" }, "repository": { "type": "git", @@ -22,7 +22,6 @@ }, "dependencies": { "chalk": "^5.1.2", - "discord.js": "^14.6.0", - "mysql2": "^2.3.3" + "discord.js": "^14.9.0" } } diff --git a/src/slashCommands/eval.js b/src/commands/eval.js similarity index 100% rename from src/slashCommands/eval.js rename to src/commands/eval.js diff --git a/src/commands/helloWorld.js b/src/commands/helloWorld.js index 4644cec..baaa9ab 100644 --- a/src/commands/helloWorld.js +++ b/src/commands/helloWorld.js @@ -1,9 +1,10 @@ -export default { - name: 'hello', - description: 'Hello world.', - aliases: ['hey', 'hi'], +import { SlashCommandBuilder } from '@discordjs/builders'; - async execute(message) { - message.reply('Hello World!'); +export default { + data: new SlashCommandBuilder() + .setName('hello') + .setDescription('Replies with Hello World!'), + async execute(client, interaction) { + interaction.reply('Hello World!'); } -}; +}; \ No newline at end of file diff --git a/src/slashCommands/ping.js b/src/commands/ping.js similarity index 100% rename from src/slashCommands/ping.js rename to src/commands/ping.js diff --git a/src/commands/reload.js b/src/commands/reload.js index 817c655..33ac6ec 100644 --- a/src/commands/reload.js +++ b/src/commands/reload.js @@ -1,16 +1,14 @@ -import commandHandler from '../handlers/commands.js'; +import { SlashCommandBuilder } from '@discordjs/builders'; import slashCommandHandler from '../handlers/slashCommands.js'; import config from '../data/config.js'; export default { - name: 'reload', - description: 'Reloads all commands', - aliases: ['rl'], - - async execute(message, args, client) { - if (!message.member.id == config.bot.owner) return message.reply('You do not have the permission to use this command!'); - let cmd = await commandHandler.reloadCommands(client); - let cmds = await slashCommandHandler.reloadSlashCommands(client); - message.reply(`Reloaded ${cmd} commands and ${cmds} slash commands!`); + data: new SlashCommandBuilder() + .setName('reload') + .setDescription('Reloads all commands'), + async execute(client, interaction) { + if (!interaction.member.id == config.bot.owner) return interaction.reply('You do not have the permission to use this command!'); + let cmd = await slashCommandHandler.reloadSlashCommands(client); + interaction.reply(`Reloaded ${cmd} slash commands!`); } }; diff --git a/src/commands/setprefix.js b/src/commands/setprefix.js deleted file mode 100644 index 89ed8fe..0000000 --- a/src/commands/setprefix.js +++ /dev/null @@ -1,37 +0,0 @@ -import Discord from 'discord.js'; -import util from 'util'; -import mysql from 'mysql2'; -import config from '../data/config.js'; - -var con = mysql.createPool({ - host: `${config.mysql.host}`, - port: `${config.mysql.port}`, - user: `${config.mysql.user}`, - password: `${config.mysql.password}`, - database: `${config.mysql.database}`, - multipleStatements: true -}); -const dbquery = util.promisify(con.query).bind(con); - -export default { - name: 'setprefix', - description: 'Reloads all commands', - aliases: [], - - async execute(message, args) { - if (!message.member.permissions.has('ADMINISTRATOR')) return message.reply('You do not have the permission to use this command!'); - - let rows = await dbquery(`SELECT * FROM guilds WHERE guildid = '${message.guild.id}'`); - - if (!args[1]) return message.reply(`Use ${rows[0].prefix}setprefix `); - - await dbquery(`UPDATE guilds SET prefix = '${args[1]}' WHERE guildid = '${message.guild.id}'`); - - const embed = new Discord.EmbedBuilder() - .setTitle('Prefix changed!') - .setDescription(`The prefix has been changed to ${args[1]}`) - .setColor('149C51'); - - message.reply({embeds: [embed]}); - } -}; diff --git a/src/events/messageCreate.js b/src/events/messageCreate.js index 05951e4..03db791 100644 --- a/src/events/messageCreate.js +++ b/src/events/messageCreate.js @@ -1,52 +1,11 @@ -import util from 'util'; -import mysql from 'mysql2'; -import config from '../data/config.js'; - -var con = mysql.createPool({ - host: `${config.mysql.host}`, - port: `${config.mysql.port}`, - user: `${config.mysql.user}`, - password: `${config.mysql.password}`, - database: `${config.mysql.database}`, - multipleStatements: true -}); -const dbquery = util.promisify(con.query).bind(con); - export default { event: 'messageCreate', async execute(client, message) { try { if (message.author.bot) return; - let prefix = await getPrefix(message.guild.id); - if (message.content.startsWith(prefix)) { - const args = message.content.substring(prefix.length).split(/ +/); - const command = client.commands.find(cmd => cmd.name == args[0] || cmd.aliases.includes(args[0])); - if (!command) return; - try { - command.execute(message, args, client); - } catch (error) { - message.reply('There was an error trying to execute that command!'); - console.log(error); - } - } else { - if (message.mentions.users.first() == client.user) message.channel.send('Hello!'); - } } catch (error) { console.log(error); } } -}; - -async function getPrefix(guildid) { - let rows = await dbquery(`SELECT prefix FROM guilds WHERE guildid = ${guildid}`); - if (rows.length < 1) { - await dbquery(`INSERT IGNORE INTO guilds (id, guildid) VALUES (NULL, '${guildid}')`); - return '!'; - } - if (rows[0].prefix == null) { - await dbquery(`UPDATE guilds SET prefix = '!' WHERE guildid = ${guildid}`); - return '!'; - } - return rows[0].prefix; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/handlers/commands.js b/src/handlers/commands.js deleted file mode 100644 index fc013e8..0000000 --- a/src/handlers/commands.js +++ /dev/null @@ -1,37 +0,0 @@ -import { readdirSync } from 'fs'; -import chalk from 'chalk'; - -async function loadCommands(client) { - const commandFiles = readdirSync('./src/commands').filter(file => file.endsWith('.js')); - for (let i = 0; i < commandFiles.length; i++) { - const cmd = await import(`../commands/${commandFiles[i]}`); - await client.commands.set(cmd.default.name, cmd.default); - console.log(chalk.greenBright(`[COMMAND] Loaded ${(chalk.yellow(commandFiles[i]))} with command ${(chalk.yellow(cmd.default.name))} ${(chalk.yellow(`[${cmd.default.aliases}]`))}`)); - - if (cmd.default.aliases) { - cmd.default.aliases.forEach(alias => { - client.aliases.set(alias, cmd.default); - }); - } - } -} - -async function reloadCommands(client) { - client.commands.clear(); - client.aliases.clear(); - const commandFiles = readdirSync('./src/commands').filter(file => file.endsWith('.js')); - for (let i = 0; i < commandFiles.length; i++) { - const cmd = await import(`../commands/${commandFiles[i]}?${Date.now()}`); - client.commands.set(cmd.default.name, cmd.default); - console.log(chalk.greenBright(`[COMMAND] Reloaded ${chalk.yellow(commandFiles[i])} with command ${chalk.yellow(cmd.default.name)} ${chalk.yellow(`[${cmd.default.aliases}]`)}`)); - - if (cmd.default.aliases) { - cmd.default.aliases.forEach(async (alias) => { - client.aliases.set(alias, cmd.default); - }); - } - } - return commandFiles.length; -} - -export default { loadCommands, reloadCommands }; \ No newline at end of file diff --git a/src/handlers/slashCommands.js b/src/handlers/slashCommands.js index aa0c094..189c338 100644 --- a/src/handlers/slashCommands.js +++ b/src/handlers/slashCommands.js @@ -6,9 +6,9 @@ import config from '../data/config.js'; const rest = new REST({ version: '10' }).setToken(config.bot.token); async function loadSlashCommands(client) { - const slashCommands = readdirSync('./src/slashCommands').filter(file => file.endsWith('.js')); + const slashCommands = readdirSync('./src/commands').filter(file => file.endsWith('.js')); for (let i = 0; i < slashCommands.length; i++) { - const command = await import(`../slashCommands/${slashCommands[i]}?${Date.now()}`); + const command = await import(`../commands/${slashCommands[i]}?${Date.now()}`); client.slashCommands.set(command.default.data.toJSON().name, command.default); console.log(chalk.greenBright(`[SLASHCOMMAND] Loaded ${chalk.yellow(slashCommands[i])} with command ${chalk.yellow(command.default.data.toJSON().name)}`)); } @@ -20,9 +20,9 @@ async function loadSlashCommands(client) { async function reloadSlashCommands(client) { client.slashCommands.clear(); - const slashCommands = readdirSync('./src/slashCommands').filter(file => file.endsWith('.js')); + const slashCommands = readdirSync('./src/commands').filter(file => file.endsWith('.js')); for (let i = 0; i < slashCommands.length; i++) { - const command = await import(`../slashCommands/${slashCommands[i]}`); + const command = await import(`../commands/${slashCommands[i]}`); client.slashCommands.set(command.default.data.toJSON().name, command.default); console.log(chalk.greenBright(`[SLASHCOMMAND] Reloaded ${chalk.yellow(slashCommands[i])} with command ${chalk.yellow(command.default.data.toJSON().name)}`)); } diff --git a/src/index.js b/src/index.js index 213362a..fd857a7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,37 +1,9 @@ import Discord from 'discord.js'; import config from './data/config.js'; -import chalk from 'chalk'; -import util from 'util'; -import mysql from 'mysql2'; -import commandHandler from './handlers/commands.js'; import eventHandler from './handlers/events.js'; import slashCommandHandler from './handlers/slashCommands.js'; -var con = mysql.createPool({ - host: `${config.mysql.host}`, - port: `${config.mysql.port}`, - user: `${config.mysql.user}`, - password: `${config.mysql.password}`, - database: `${config.mysql.database}`, - multipleStatements: true -}); -const dbquery = util.promisify(con.query).bind(con); - -// Check if Table Exists if not the bot will create it -dbquery('SHOW TABLES LIKE \'guilds\'').then(async (rows) => { - if (rows.length < 1) { - dbquery(`CREATE TABLE guilds ( - id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - guildid VARCHAR(50) NULL DEFAULT '0' COLLATE 'utf8mb4_0900_ai_ci', - prefix VARCHAR(50) NULL DEFAULT '!' COLLATE 'utf8mb4_0900_ai_ci', - PRIMARY KEY (id) USING BTREE, - UNIQUE INDEX guildid (guildid) USING BTREE - );`); - console.log(chalk.yellow('[MySQL] Created table guilds')); - } else console.log(chalk.green('[MySQL] Table guilds exists')); -}); - const client = new Discord.Client({ intents: [ Discord.GatewayIntentBits.MessageContent, @@ -50,11 +22,9 @@ const client = new Discord.Client({ await client.login(config.bot.token); -client.commands = new Discord.Collection(); client.aliases = new Discord.Collection(); client.slashCommands = new Discord.Collection(); -await commandHandler.loadCommands(client); await eventHandler.loadEvents(client); await slashCommandHandler.loadSlashCommands(client); diff --git a/src/slashCommands/reload.js b/src/slashCommands/reload.js deleted file mode 100644 index f675e26..0000000 --- a/src/slashCommands/reload.js +++ /dev/null @@ -1,16 +0,0 @@ -import { SlashCommandBuilder } from '@discordjs/builders'; -import commandHandler from '../handlers/commands.js'; -import slashCommandHandler from '../handlers/slashCommands.js'; -import config from '../data/config.js'; - -export default { - data: new SlashCommandBuilder() - .setName('reload') - .setDescription('Reloads all commands'), - async execute(client, interaction) { - if (!interaction.member.id == config.bot.owner) return interaction.reply('You do not have the permission to use this command!'); - let cmd = await commandHandler.reloadCommands(client); - let cmds = await slashCommandHandler.reloadSlashCommands(client); - interaction.reply(`Reloaded ${cmd} commands and ${cmds} slash commands!`); - } -};