diff --git a/example_bot/HOW TO RUN b/example_bot/HOW TO RUN
new file mode 100755
index 0000000..027aa16
--- /dev/null
+++ b/example_bot/HOW TO RUN
@@ -0,0 +1,5 @@
+How to run your new amazing discord bot.
+
+First make sure you have node.js installed on your system, you can check with "node --version".
+
+After that run the install.bat file. it will install the required packages, it wont take very long. When thats done, you can run the run.bat file, it should make your discord bot come online! If it does not, please check your token and your bot id in the config.json file
\ No newline at end of file
diff --git a/example_bot/commands/utility/temp-file b/example_bot/commands/utility/temp-file
new file mode 100755
index 0000000..e69de29
diff --git a/example_bot/install.bat b/example_bot/install.bat
new file mode 100755
index 0000000..0beeff2
--- /dev/null
+++ b/example_bot/install.bat
@@ -0,0 +1,2 @@
+@echo off
+npm i discord.js
\ No newline at end of file
diff --git a/example_bot/node_modules/.package-lock.json b/example_bot/node_modules/.package-lock.json
deleted file mode 100644
index a3229ee..0000000
--- a/example_bot/node_modules/.package-lock.json
+++ /dev/null
@@ -1,264 +0,0 @@
-{
- "name": "example_bot",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "node_modules/@discordjs/builders": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.7.0.tgz",
- "integrity": "sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==",
- "dependencies": {
- "@discordjs/formatters": "^0.3.3",
- "@discordjs/util": "^1.0.2",
- "@sapphire/shapeshift": "^3.9.3",
- "discord-api-types": "0.37.61",
- "fast-deep-equal": "^3.1.3",
- "ts-mixer": "^6.0.3",
- "tslib": "^2.6.2"
- },
- "engines": {
- "node": ">=16.11.0"
- }
- },
- "node_modules/@discordjs/collection": {
- "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.11.0"
- }
- },
- "node_modules/@discordjs/formatters": {
- "version": "0.3.3",
- "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.3.tgz",
- "integrity": "sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==",
- "dependencies": {
- "discord-api-types": "0.37.61"
- },
- "engines": {
- "node": ">=16.11.0"
- }
- },
- "node_modules/@discordjs/rest": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.2.0.tgz",
- "integrity": "sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==",
- "dependencies": {
- "@discordjs/collection": "^2.0.0",
- "@discordjs/util": "^1.0.2",
- "@sapphire/async-queue": "^1.5.0",
- "@sapphire/snowflake": "^3.5.1",
- "@vladfrangu/async_event_emitter": "^2.2.2",
- "discord-api-types": "0.37.61",
- "magic-bytes.js": "^1.5.0",
- "tslib": "^2.6.2",
- "undici": "5.27.2"
- },
- "engines": {
- "node": ">=16.11.0"
- }
- },
- "node_modules/@discordjs/rest/node_modules/@discordjs/collection": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz",
- "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==",
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@discordjs/util": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.0.2.tgz",
- "integrity": "sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==",
- "engines": {
- "node": ">=16.11.0"
- }
- },
- "node_modules/@discordjs/ws": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.2.tgz",
- "integrity": "sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==",
- "dependencies": {
- "@discordjs/collection": "^2.0.0",
- "@discordjs/rest": "^2.1.0",
- "@discordjs/util": "^1.0.2",
- "@sapphire/async-queue": "^1.5.0",
- "@types/ws": "^8.5.9",
- "@vladfrangu/async_event_emitter": "^2.2.2",
- "discord-api-types": "0.37.61",
- "tslib": "^2.6.2",
- "ws": "^8.14.2"
- },
- "engines": {
- "node": ">=16.11.0"
- }
- },
- "node_modules/@discordjs/ws/node_modules/@discordjs/collection": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz",
- "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==",
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@fastify/busboy": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz",
- "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==",
- "engines": {
- "node": ">=14"
- }
- },
- "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==",
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/@sapphire/shapeshift": {
- "version": "3.9.3",
- "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.3.tgz",
- "integrity": "sha512-WzKJSwDYloSkHoBbE8rkRW8UNKJiSRJ/P8NqJ5iVq7U2Yr/kriIBx2hW+wj2Z5e5EnXL1hgYomgaFsdK6b+zqQ==",
- "dependencies": {
- "fast-deep-equal": "^3.1.3",
- "lodash": "^4.17.21"
- },
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/@sapphire/snowflake": {
- "version": "3.5.1",
- "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz",
- "integrity": "sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==",
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/@types/node": {
- "version": "20.10.1",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.1.tgz",
- "integrity": "sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==",
- "dependencies": {
- "undici-types": "~5.26.4"
- }
- },
- "node_modules/@types/ws": {
- "version": "8.5.9",
- "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.9.tgz",
- "integrity": "sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==",
- "dependencies": {
- "@types/node": "*"
- }
- },
- "node_modules/@vladfrangu/async_event_emitter": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz",
- "integrity": "sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==",
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/discord-api-types": {
- "version": "0.37.61",
- "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.61.tgz",
- "integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw=="
- },
- "node_modules/discord.js": {
- "version": "14.14.1",
- "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.1.tgz",
- "integrity": "sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==",
- "dependencies": {
- "@discordjs/builders": "^1.7.0",
- "@discordjs/collection": "1.5.3",
- "@discordjs/formatters": "^0.3.3",
- "@discordjs/rest": "^2.1.0",
- "@discordjs/util": "^1.0.2",
- "@discordjs/ws": "^1.0.2",
- "@sapphire/snowflake": "3.5.1",
- "@types/ws": "8.5.9",
- "discord-api-types": "0.37.61",
- "fast-deep-equal": "3.1.3",
- "lodash.snakecase": "4.1.1",
- "tslib": "2.6.2",
- "undici": "5.27.2",
- "ws": "8.14.2"
- },
- "engines": {
- "node": ">=16.11.0"
- }
- },
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "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.snakecase": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
- "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="
- },
- "node_modules/magic-bytes.js": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.5.0.tgz",
- "integrity": "sha512-wJkXvutRbNWcc37tt5j1HyOK1nosspdh3dj6LUYYAvF6JYNqs53IfRvK9oEpcwiDA1NdoIi64yAMfdivPeVAyw=="
- },
- "node_modules/ts-mixer": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz",
- "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ=="
- },
- "node_modules/tslib": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
- "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
- },
- "node_modules/undici": {
- "version": "5.27.2",
- "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz",
- "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==",
- "dependencies": {
- "@fastify/busboy": "^2.0.0"
- },
- "engines": {
- "node": ">=14.0"
- }
- },
- "node_modules/undici-types": {
- "version": "5.26.5",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
- "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
- },
- "node_modules/ws": {
- "version": "8.14.2",
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
- "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
- "engines": {
- "node": ">=10.0.0"
- },
- "peerDependencies": {
- "bufferutil": "^4.0.1",
- "utf-8-validate": ">=5.0.2"
- },
- "peerDependenciesMeta": {
- "bufferutil": {
- "optional": true
- },
- "utf-8-validate": {
- "optional": true
- }
- }
- }
- }
-}
diff --git a/example_bot/node_modules/@discordjs/builders/LICENSE b/example_bot/node_modules/@discordjs/builders/LICENSE
deleted file mode 100644
index cbe9c65..0000000
--- a/example_bot/node_modules/@discordjs/builders/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2021 Noel Buechler
- Copyright 2021 Vlad Frangu
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/builders/README.md b/example_bot/node_modules/@discordjs/builders/README.md
deleted file mode 100644
index dc88b7f..0000000
--- a/example_bot/node_modules/@discordjs/builders/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/builders` is a utility package for easily building Discord API payloads.
-
-## Installation
-
-**Node.js 16.11.0 or newer is required.**
-
-```sh
-npm install @discordjs/builders
-yarn add @discordjs/builders
-pnpm add @discordjs/builders
-```
-
-## Examples
-
-You can find examples of how to use the builders in the [Slash Command Builders][example] examples.
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[example]: https://github.com/discordjs/discord.js/blob/main/packages/builders/docs/examples/Slash%20Command%20Builders.md
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/builders/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/builders
-[npm]: https://www.npmjs.com/package/@discordjs/builders
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/builders/package.json b/example_bot/node_modules/@discordjs/builders/package.json
deleted file mode 100644
index 5084770..0000000
--- a/example_bot/node_modules/@discordjs/builders/package.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/builders",
- "version": "1.7.0",
- "description": "A set of builders that you can use when creating your bot",
- "exports": {
- ".": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- }
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Vlad Frangu ",
- "Crawl ",
- "Amish Shah ",
- "SpaceEEC ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "discord",
- "api",
- "bot",
- "client",
- "node",
- "discordapp",
- "discordjs"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/builders"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "dependencies": {
- "@sapphire/shapeshift": "^3.9.3",
- "discord-api-types": "0.37.61",
- "fast-deep-equal": "^3.1.3",
- "ts-mixer": "^6.0.3",
- "tslib": "^2.6.2",
- "@discordjs/formatters": "^0.3.3",
- "@discordjs/util": "^1.0.2"
- },
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "16.18.60",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "downlevel-dts": "^0.11.0",
- "esbuild-plugin-version-injector": "^1.2.1",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^3.0.3",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "vitest": "^0.34.6",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=16.11.0"
- },
- "publishConfig": {
- "access": "public"
- },
- "scripts": {
- "test": "vitest run",
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json && downlevel-dts ./dist-docs ./dist-docs",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
- "fmt": "pnpm run format",
- "docs": "pnpm run build:docs && api-extractor run --local",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/collection/CHANGELOG.md b/example_bot/node_modules/@discordjs/collection/CHANGELOG.md
deleted file mode 100644
index 2c43057..0000000
--- a/example_bot/node_modules/@discordjs/collection/CHANGELOG.md
+++ /dev/null
@@ -1,190 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-# [@discordjs/collection@1.5.3](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.5.2...@discordjs/collection@1.5.3) - (2023-08-17)
-
-## Documentation
-
-- Update Node.js requirement to 16.11.0 (#9764) ([188877c](https://github.com/discordjs/discord.js/commit/188877c50af70f0d5cffb246620fa277435c6ce6))
-
-# [@discordjs/collection@1.5.2](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.5.1...@discordjs/collection@1.5.2) - (2023-07-31)
-
-## Refactor
-
-- **collection:** Reduce `reduce`'s code (#9581) ([b85a3f2](https://github.com/discordjs/discord.js/commit/b85a3f2ddee8fc5974749b95fc07389a03093df2))
-
-# [@discordjs/collection@1.5.1](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.5.0...@discordjs/collection@1.5.1) - (2023-05-01)
-
-## Bug Fixes
-
-- Fix external links (#9313) ([a7425c2](https://github.com/discordjs/discord.js/commit/a7425c29c4f23f1b31f4c6a463107ca9eb7fd7e2))
-
-## Documentation
-
-- Generate static imports for types with api-extractor ([98a76db](https://github.com/discordjs/discord.js/commit/98a76db482879f79d6bb2fb2e5fc65ac2c34e2d9))
-
-# [@discordjs/collection@1.5.2](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.5.1...@discordjs/collection@1.5.2) - (2023-07-31)
-
-## Refactor
-
-- **collection:** Reduce `reduce`'s code (#9581) ([b85a3f2](https://github.com/discordjs/discord.js/commit/b85a3f2ddee8fc5974749b95fc07389a03093df2))
-
-# [@discordjs/collection@1.5.1](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.5.0...@discordjs/collection@1.5.1) - (2023-05-01)
-
-## Bug Fixes
-
-- Fix external links (#9313) ([a7425c2](https://github.com/discordjs/discord.js/commit/a7425c29c4f23f1b31f4c6a463107ca9eb7fd7e2))
-
-## Documentation
-
-- Generate static imports for types with api-extractor ([98a76db](https://github.com/discordjs/discord.js/commit/98a76db482879f79d6bb2fb2e5fc65ac2c34e2d9))
-
-# [@discordjs/collection@1.5.1](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.5.0...@discordjs/collection@1.5.1) - (2023-05-01)
-
-## Bug Fixes
-
-- Fix external links (#9313) ([a7425c2](https://github.com/discordjs/discord.js/commit/a7425c29c4f23f1b31f4c6a463107ca9eb7fd7e2))
-
-## Documentation
-
-- Generate static imports for types with api-extractor ([98a76db](https://github.com/discordjs/discord.js/commit/98a76db482879f79d6bb2fb2e5fc65ac2c34e2d9))
-
-# [@discordjs/collection@1.5.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.4.0...@discordjs/collection@1.5.0) - (2023-04-01)
-
-## Bug Fixes
-
-- **scripts:** Accessing tsComment ([d8d5f31](https://github.com/discordjs/discord.js/commit/d8d5f31d3927fd1de62f1fa3a1a6e454243ad87b))
-
-## Features
-
-- **website:** Render syntax and mdx on the server (#9086) ([ee5169e](https://github.com/discordjs/discord.js/commit/ee5169e0aadd7bbfcd752aae614ec0f69602b68b))
-
-## Refactor
-
-- **collection:** Fix/silence linter warnings (#9266) ([d6f4e60](https://github.com/discordjs/discord.js/commit/d6f4e60efd1a1796fc84dbbfbac4f9790e480a1c))
-
-# [@discordjs/collection@1.4.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.3.0...@discordjs/collection@1.4.0) - (2023-03-12)
-
-## Documentation
-
-- Fix version export (#9049) ([8b70f49](https://github.com/discordjs/discord.js/commit/8b70f497a1207e30edebdecd12b926c981c13d28))
-
-## Features
-
-- **website:** Add support for source file links (#9048) ([f6506e9](https://github.com/discordjs/discord.js/commit/f6506e99c496683ee0ab67db0726b105b929af38))
-
-## Refactor
-
-- Compare with `undefined` directly (#9191) ([869153c](https://github.com/discordjs/discord.js/commit/869153c3fdf155783e7c0ecebd3627b087c3a026))
-
-# [@discordjs/collection@1.3.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.2.0...@discordjs/collection@1.3.0) - (2022-11-28)
-
-## Bug Fixes
-
-- Pin @types/node version ([9d8179c](https://github.com/discordjs/discord.js/commit/9d8179c6a78e1c7f9976f852804055964d5385d4))
-
-## Features
-
-- Add `Collection#subtract()` (#8393) ([291f36c](https://github.com/discordjs/discord.js/commit/291f36cd736b5dea058145a1335bf7c78ec1d81d))
-
-# [@discordjs/collection@1.2.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.1.0...@discordjs/collection@1.2.0) - (2022-10-08)
-
-## Bug Fixes
-
-- Footer / sidebar / deprecation alert ([ba3e0ed](https://github.com/discordjs/discord.js/commit/ba3e0ed348258fe8e51eefb4aa7379a1230616a9))
-
-## Documentation
-
-- Change name (#8604) ([dd5a089](https://github.com/discordjs/discord.js/commit/dd5a08944c258a847fc4377f1d5e953264ab47d0))
-- Remove xml tag from collection#find (#8550) ([4032457](https://github.com/discordjs/discord.js/commit/40324574ebea9894cadcc967e0db0e4e21d62768))
-
-## Features
-
-- Web-components (#8715) ([0ac3e76](https://github.com/discordjs/discord.js/commit/0ac3e766bd9dbdeb106483fa4bb085d74de346a2))
-
-## Refactor
-
-- Website components (#8600) ([c334157](https://github.com/discordjs/discord.js/commit/c3341570d983aea9ecc419979d5a01de658c9d67))
-- Use `eslint-config-neon` for packages. (#8579) ([edadb9f](https://github.com/discordjs/discord.js/commit/edadb9fe5dfd9ff51a3cfc9b25cb242d3f9f5241))
-
-## Typings
-
-- **Collection:** Make fn return type unknown (#8676) ([822b7f2](https://github.com/discordjs/discord.js/commit/822b7f234af053c8f917b0a998b82abfccd33801))
-
-# [@discordjs/collection@1.1.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@1.0.1...@discordjs/collection@1.1.0) - (2022-08-22)
-
-## Bug Fixes
-
-- Use proper format for `@link` text (#8384) ([2655639](https://github.com/discordjs/discord.js/commit/26556390a3800e954974a00c1328ff47d3e67e9a))
-
-## Documentation
-
-- Fence examples in codeblocks ([193b252](https://github.com/discordjs/discord.js/commit/193b252672440a860318d3c2968aedd9cb88e0ce))
-- Use link tags (#8382) ([5494791](https://github.com/discordjs/discord.js/commit/549479131318c659f86f0eb18578d597e22522d3))
-
-## Features
-
-- **website:** Show `constructor` information (#8540) ([e42fd16](https://github.com/discordjs/discord.js/commit/e42fd1636973b10dd7ed6fb4280ee1a4a8f82007))
-- **website:** Show descriptions for `@typeParam` blocks (#8523) ([e475b63](https://github.com/discordjs/discord.js/commit/e475b63f257f6261d73cb89fee9ecbcdd84e2a6b))
-
-## Refactor
-
-- **website:** Adjust typography (#8503) ([0f83402](https://github.com/discordjs/discord.js/commit/0f834029850d2448981596cf082ff59917018d66))
-- Docs design (#8487) ([4ab1d09](https://github.com/discordjs/discord.js/commit/4ab1d09997a18879a9eb9bda39df6f15aa22557e))
-
-# [@discordjs/collection@0.8.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.7.0...@discordjs/collection@0.8.0) - (2022-07-17)
-
-## Bug Fixes
-
-- **Collection:** Make error messages consistent (#8224) ([5bd6b28](https://github.com/discordjs/discord.js/commit/5bd6b28b3ebfced1cb9d23e83bd7c0def7a12404))
-- Check for function type (#8064) ([3bb9c0e](https://github.com/discordjs/discord.js/commit/3bb9c0e5c37311044ff41761b572ac4f91cda57c))
-
-## Documentation
-
-- Add codecov coverage badge to readmes (#8226) ([f6db285](https://github.com/discordjs/discord.js/commit/f6db285c073898a749fe4591cbd4463d1896daf5))
-
-## Features
-
-- Codecov (#8219) ([f10f4cd](https://github.com/discordjs/discord.js/commit/f10f4cdcd88ca6be7ec735ed3a415ba13da83db0))
-- **docgen:** Update typedoc ([b3346f4](https://github.com/discordjs/discord.js/commit/b3346f4b9b3d4f96443506643d4631dc1c6d7b21))
-- Website (#8043) ([127931d](https://github.com/discordjs/discord.js/commit/127931d1df7a2a5c27923c2f2151dbf3824e50cc))
-- **docgen:** Typescript support ([3279b40](https://github.com/discordjs/discord.js/commit/3279b40912e6aa61507bedb7db15a2b8668de44b))
-- Docgen package (#8029) ([8b979c0](https://github.com/discordjs/discord.js/commit/8b979c0245c42fd824d8e98745ee869f5360fc86))
-- Use vitest instead of jest for more speed ([8d8e6c0](https://github.com/discordjs/discord.js/commit/8d8e6c03decd7352a2aa180f6e5bc1a13602539b))
-- Add scripts package for locally used scripts ([f2ae1f9](https://github.com/discordjs/discord.js/commit/f2ae1f9348bfd893332a9060f71a8a5f272a1b8b))
-
-## Refactor
-
-- **collection:** Remove `default` property (#8055) ([c8f1690](https://github.com/discordjs/discord.js/commit/c8f1690896f55f06e05a83704262783cfc2bb91d))
-- **collection:** Remove default export (#8053) ([16810f3](https://github.com/discordjs/discord.js/commit/16810f3e410bf35ed7e6e7412d517ea74c792c5d))
-- Move all the config files to root (#8033) ([769ea0b](https://github.com/discordjs/discord.js/commit/769ea0bfe78c4f1d413c6b397c604ffe91e39c6a))
-
-## Testing
-
-- **collection:** Improve coverage (#8222) ([a51f721](https://github.com/discordjs/discord.js/commit/a51f7215eca67a0f46fba8b2d706f7ec6f6dc228))
-
-# [@discordjs/collection@0.7.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.6.0...@discordjs/collection@0.7.0) - (2022-06-04)
-
-## Styling
-
-- Cleanup tests and tsup configs ([6b8ef20](https://github.com/discordjs/discord.js/commit/6b8ef20cb3af5b5cfd176dd0aa0a1a1e98551629))
-
-# [@discordjs/collection@0.6.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.5.0...@discordjs/collection@0.6.0) - (2022-04-17)
-
-## Features
-
-- Add support for module: NodeNext in TS and ESM (#7598) ([8f1986a](https://github.com/discordjs/discord.js/commit/8f1986a6aa98365e09b00e84ad5f9f354ab61f3d))
-- **builders:** Add attachment command option type (#7203) ([ae0f35f](https://github.com/discordjs/discord.js/commit/ae0f35f51d68dfa5a7dc43d161ef9365171debdb))
-- **Collection:** Add merging functions (#7299) ([e4bd07b](https://github.com/discordjs/discord.js/commit/e4bd07b2394f227ea06b72eb6999de9ab3127b25))
-
-# [@discordjs/collection@0.5.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.4.0...@discordjs/collection@0.5.0) - (2022-01-24)
-
-## Refactor
-
-- Make `intersect` perform a true intersection (#7211) ([d8efba2](https://github.com/discordjs/discord.js/commit/d8efba24e09aa2a8dbf028fc57a561a56e7833fd))
-
-## Typings
-
-- Add `ReadonlyCollection` (#7245) ([db25f52](https://github.com/discordjs/discord.js/commit/db25f529b26d7c819c1c42ad3e26c2263ea2da0e))
-- **Collection:** Union types on `intersect` and `difference` (#7196) ([1f9b922](https://github.com/discordjs/discord.js/commit/1f9b9225f2066e9cc66c3355417139fd25cc403c))
diff --git a/example_bot/node_modules/@discordjs/collection/LICENSE b/example_bot/node_modules/@discordjs/collection/LICENSE
deleted file mode 100644
index d21f37a..0000000
--- a/example_bot/node_modules/@discordjs/collection/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2021 Noel Buechler
- Copyright 2015 Amish Shah
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/collection/README.md b/example_bot/node_modules/@discordjs/collection/README.md
deleted file mode 100644
index 4ddde14..0000000
--- a/example_bot/node_modules/@discordjs/collection/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/collection` is a powerful utility data structure used in discord.js.
-
-## Installation
-
-**Node.js 16.11.0 or newer is required.**
-
-```sh
-npm install @discordjs/collection
-yarn add @discordjs/collection
-pnpm add @discordjs/collection
-```
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/collection/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/collection
-[npm]: https://www.npmjs.com/package/@discordjs/collection
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/collection/package.json b/example_bot/node_modules/@discordjs/collection/package.json
deleted file mode 100644
index 81e2418..0000000
--- a/example_bot/node_modules/@discordjs/collection/package.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "name": "@discordjs/collection",
- "version": "1.5.3",
- "description": "Utility data structure used in discord.js",
- "scripts": {
- "test": "vitest run",
- "build": "tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
- "format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
- "fmt": "yarn format",
- "docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
- "prepack": "yarn lint && yarn test && yarn build",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
- "release": "cliff-jumper"
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "exports": {
- "types": "./dist/index.d.ts",
- "import": "./dist/index.mjs",
- "require": "./dist/index.js"
- },
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "Amish Shah ",
- "SpaceEEC ",
- "Vlad Frangu ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "map",
- "collection",
- "utility"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/collection"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "devDependencies": {
- "@favware/cliff-jumper": "^2.1.1",
- "@microsoft/api-extractor": "^7.36.4",
- "@types/node": "16.18.40",
- "@vitest/coverage-v8": "^0.34.2",
- "cross-env": "^7.0.3",
- "esbuild-plugin-version-injector": "^1.2.0",
- "eslint": "^8.47.0",
- "eslint-config-neon": "^0.1.47",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^2.8.8",
- "tsup": "^7.2.0",
- "turbo": "^1.10.12",
- "typescript": "^5.1.6",
- "vitest": "^0.34.2"
- },
- "engines": {
- "node": ">=16.11.0"
- },
- "publishConfig": {
- "access": "public"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/formatters/LICENSE b/example_bot/node_modules/@discordjs/formatters/LICENSE
deleted file mode 100644
index e2baac1..0000000
--- a/example_bot/node_modules/@discordjs/formatters/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2021 Noel Buechler
- Copyright 2021 Vlad Frangu
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/formatters/README.md b/example_bot/node_modules/@discordjs/formatters/README.md
deleted file mode 100644
index 65ad4b0..0000000
--- a/example_bot/node_modules/@discordjs/formatters/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/formatters` is a collection of functions for formatting strings to be used on Discord.
-
-## Installation
-
-**Node.js 16.11.0 or newer is required.**
-
-```sh
-npm install @discordjs/formatters
-yarn add @discordjs/formatters
-pnpm add @discordjs/formatters
-bun add @discordjs/formatters
-```
-
-## Example usage
-
-````ts
-import { codeBlock } from '@discordjs/formatters';
-
-const formattedCode = codeBlock('hello world!');
-console.log(formattedCode);
-
-// Prints:
-// ```
-// hello world!
-// ```
-````
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/formatters/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/formatters
-[npm]: https://www.npmjs.com/package/@discordjs/formatters
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/formatters/package.json b/example_bot/node_modules/@discordjs/formatters/package.json
deleted file mode 100644
index 71fcedb..0000000
--- a/example_bot/node_modules/@discordjs/formatters/package.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/formatters",
- "version": "0.3.3",
- "description": "A set of functions to format strings for Discord.",
- "exports": {
- ".": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- }
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "SpaceEEC ",
- "Vlad Frangu ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/formatters"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "dependencies": {
- "discord-api-types": "0.37.61"
- },
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "16.18.60",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^3.0.3",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "vitest": "^0.34.6",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=16.11.0"
- },
- "publishConfig": {
- "access": "public"
- },
- "scripts": {
- "test": "vitest run",
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
- "docs": "pnpm run build:docs && api-extractor run --local",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/formatters/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/rest/LICENSE b/example_bot/node_modules/@discordjs/rest/LICENSE
deleted file mode 100644
index f9d970e..0000000
--- a/example_bot/node_modules/@discordjs/rest/LICENSE
+++ /dev/null
@@ -1,192 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-Copyright 2021 Noel Buechler
-Copyright 2021 Vlad Frangu
-Copyright 2021 Aura Román
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/rest/README.md b/example_bot/node_modules/@discordjs/rest/README.md
deleted file mode 100644
index 6cc1e75..0000000
--- a/example_bot/node_modules/@discordjs/rest/README.md
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/rest` is a module that allows you to easily make REST requests to the Discord API.
-
-## Installation
-
-**Node.js 16.11.0 or newer is required.**
-
-Note: native fetch (not recommended) is unavailable in this node version, either use a newer node version or use the more performant `undiciRequest` strategy (default)
-
-```sh
-npm install @discordjs/rest
-yarn add @discordjs/rest
-pnpm add @discordjs/rest
-bun add @discordjs/rest
-```
-
-## Examples
-
-Install all required dependencies:
-
-```sh
-npm install @discordjs/rest discord-api-types
-yarn add @discordjs/rest discord-api-types
-pnpm add @discordjs/rest discord-api-types
-bun add @discordjs/rest discord-api-types
-```
-
-Send a basic message:
-
-```js
-import { REST } from '@discordjs/rest';
-import { Routes } from 'discord-api-types/v10';
-
-const rest = new REST({ version: '10' }).setToken(TOKEN);
-
-try {
- await rest.post(Routes.channelMessages(CHANNEL_ID), {
- body: {
- content: 'A message via REST!',
- },
- });
-} catch (error) {
- console.error(error);
-}
-```
-
-Create a thread from an existing message to be archived after 60 minutes of inactivity:
-
-```js
-import { REST } from '@discordjs/rest';
-import { Routes } from 'discord-api-types/v10';
-
-const rest = new REST({ version: '10' }).setToken(TOKEN);
-
-try {
- await rest.post(Routes.threads(CHANNEL_ID, MESSAGE_ID), {
- body: {
- name: 'Thread',
- auto_archive_duration: 60,
- },
- });
-} catch (error) {
- console.error(error);
-}
-```
-
-Send a basic message in an edge environment:
-
-```js
-import { REST } from '@discordjs/rest';
-import { Routes } from 'discord-api-types/v10';
-
-const rest = new REST({ version: '10', makeRequest: fetch }).setToken(TOKEN);
-
-try {
- await rest.post(Routes.channelMessages(CHANNEL_ID), {
- body: {
- content: 'A message via REST from the edge!',
- },
- });
-} catch (error) {
- console.error(error);
-}
-```
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/rest/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/rest
-[npm]: https://www.npmjs.com/package/@discordjs/rest
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/LICENSE b/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/LICENSE
deleted file mode 100644
index d21f37a..0000000
--- a/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2021 Noel Buechler
- Copyright 2015 Amish Shah
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/README.md b/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/README.md
deleted file mode 100644
index 21d1dcc..0000000
--- a/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/collection` is a powerful utility data structure used in discord.js.
-
-## Installation
-
-**Node.js 18 or newer is required.**
-
-```sh
-npm install @discordjs/collection
-yarn add @discordjs/collection
-pnpm add @discordjs/collection
-```
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/collection/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/collection
-[npm]: https://www.npmjs.com/package/@discordjs/collection
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/package.json b/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/package.json
deleted file mode 100644
index b36bb31..0000000
--- a/example_bot/node_modules/@discordjs/rest/node_modules/@discordjs/collection/package.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/collection",
- "version": "2.0.0",
- "description": "Utility data structure used in discord.js",
- "exports": {
- ".": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- }
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "Amish Shah ",
- "SpaceEEC ",
- "Vlad Frangu ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "map",
- "collection",
- "utility"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/collection"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "18.18.8",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "esbuild-plugin-version-injector": "^1.2.1",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^3.0.3",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "vitest": "^0.34.6",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=18"
- },
- "publishConfig": {
- "access": "public"
- },
- "scripts": {
- "test": "vitest run",
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
- "fmt": "pnpm run format",
- "docs": "pnpm run build:docs && api-extractor run --local",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/rest/package.json b/example_bot/node_modules/@discordjs/rest/package.json
deleted file mode 100644
index 2e68796..0000000
--- a/example_bot/node_modules/@discordjs/rest/package.json
+++ /dev/null
@@ -1,116 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/rest",
- "version": "2.2.0",
- "description": "The REST API for discord.js",
- "exports": {
- ".": {
- "node": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- },
- "default": {
- "require": {
- "types": "./dist/web.d.ts",
- "default": "./dist/web.js"
- },
- "import": {
- "types": "./dist/web.d.mts",
- "default": "./dist/web.mjs"
- }
- }
- },
- "./*": {
- "require": {
- "types": "./dist/strategies/*.d.ts",
- "default": "./dist/strategies/*.js"
- },
- "import": {
- "types": "./dist/strategies/*.d.mts",
- "default": "./dist/strategies/*.mjs"
- }
- }
- },
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "Amish Shah ",
- "SpaceEEC ",
- "Vlad Frangu ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "discord",
- "api",
- "rest",
- "discordapp",
- "discordjs"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/rest"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "dependencies": {
- "@sapphire/async-queue": "^1.5.0",
- "@sapphire/snowflake": "^3.5.1",
- "@vladfrangu/async_event_emitter": "^2.2.2",
- "discord-api-types": "0.37.61",
- "magic-bytes.js": "^1.5.0",
- "tslib": "^2.6.2",
- "undici": "5.27.2",
- "@discordjs/util": "^1.0.2",
- "@discordjs/collection": "^2.0.0"
- },
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "18.17.9",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "esbuild-plugin-version-injector": "^1.2.1",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^3.1.0",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "vitest": "^0.34.6",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=16.11.0"
- },
- "publishConfig": {
- "access": "public"
- },
- "scripts": {
- "test": "vitest run",
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
- "fmt": "pnpm run format",
- "docs": "pnpm run build:docs && api-extractor run --local --minify",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/util/LICENSE b/example_bot/node_modules/@discordjs/util/LICENSE
deleted file mode 100644
index e2822e9..0000000
--- a/example_bot/node_modules/@discordjs/util/LICENSE
+++ /dev/null
@@ -1,190 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2022 Noel Buechler
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/util/README.md b/example_bot/node_modules/@discordjs/util/README.md
deleted file mode 100644
index bcdbc4c..0000000
--- a/example_bot/node_modules/@discordjs/util/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/util` is a collection of utility functions for use with discord.js.
-
-## Installation
-
-**Node.js 16.11.0 or newer is required.**
-
-```sh
-npm install @discordjs/util
-yarn add @discordjs/util
-pnpm add @discordjs/util
-bun add @discordjs/util
-```
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/util/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/util
-[npm]: https://www.npmjs.com/package/@discordjs/util
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/util/package.json b/example_bot/node_modules/@discordjs/util/package.json
deleted file mode 100644
index b15d4fe..0000000
--- a/example_bot/node_modules/@discordjs/util/package.json
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/util",
- "version": "1.0.2",
- "description": "Utilities shared across Discord.js packages",
- "exports": {
- ".": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- }
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "Amish Shah ",
- "Vlad Frangu ",
- "SpaceEEC ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "api",
- "bot",
- "client",
- "node",
- "discordjs"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/util"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "16.18.60",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^3.0.3",
- "tsd": "^0.29.0",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "vitest": "^0.34.6",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=16.11.0"
- },
- "publishConfig": {
- "access": "public"
- },
- "tsd": {
- "directory": "__tests__/types"
- },
- "scripts": {
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "test": "vitest run && tsd",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
- "fmt": "pnpm run format",
- "docs": "pnpm run build:docs && api-extractor run --local",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/util/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/ws/LICENSE b/example_bot/node_modules/@discordjs/ws/LICENSE
deleted file mode 100644
index 39794ad..0000000
--- a/example_bot/node_modules/@discordjs/ws/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2022 Noel Buechler
- Copyright 2022 Denis Cristea
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/ws/README.md b/example_bot/node_modules/@discordjs/ws/README.md
deleted file mode 100644
index 5db86a0..0000000
--- a/example_bot/node_modules/@discordjs/ws/README.md
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/ws` is a powerful wrapper around Discord's gateway.
-
-## Installation
-
-**Node.js 16.11.0 or newer is required.**
-
-```sh
-npm install @discordjs/ws
-yarn add @discordjs/ws
-pnpm add @discordjs/ws
-bun add @discordjs/ws
-```
-
-### Optional packages
-
-- [zlib-sync](https://www.npmjs.com/package/zlib-sync) for WebSocket data compression and inflation (`npm install zlib-sync`)
-- [bufferutil](https://www.npmjs.com/package/bufferutil) for a much faster WebSocket connection (`npm install bufferutil`)
-- [utf-8-validate](https://www.npmjs.com/package/utf-8-validate) in combination with `bufferutil` for much faster WebSocket processing (`npm install utf-8-validate`)
-
-## Example usage
-
-```ts
-import { WebSocketManager, WebSocketShardEvents, CompressionMethod } from '@discordjs/ws';
-import { REST } from '@discordjs/rest';
-
-const rest = new REST().setToken(process.env.DISCORD_TOKEN);
-// This example will spawn Discord's recommended shard count, all under the current process.
-const manager = new WebSocketManager({
- token: process.env.DISCORD_TOKEN,
- intents: 0, // for no intents
- rest,
- // uncomment if you have zlib-sync installed and want to use compression
- // compression: CompressionMethod.ZlibStream,
-});
-
-manager.on(WebSocketShardEvents.Dispatch, (event) => {
- // Process gateway events here.
-});
-
-await manager.connect();
-```
-
-### Specify shards
-
-```ts
-// Spawn 4 shards
-const manager = new WebSocketManager({
- token: process.env.DISCORD_TOKEN,
- intents: 0,
- rest,
- shardCount: 4,
-});
-
-// The manager also supports being responsible for only a subset of your shards:
-
-// Your bot will run 8 shards overall
-// This manager will only take care of 0, 2, 4, and 6
-const manager = new WebSocketManager({
- token: process.env.DISCORD_TOKEN,
- intents: 0,
- rest,
- shardCount: 8,
- shardIds: [0, 2, 4, 6],
-});
-
-// Alternatively, if your shards are consecutive, you can pass in a range
-const manager = new WebSocketManager({
- token: process.env.DISCORD_TOKEN,
- intents: 0,
- rest,
- shardCount: 8,
- shardIds: {
- start: 0,
- end: 4,
- },
-});
-```
-
-### Specify `worker_threads`
-
-You can also have the shards spawn in worker threads:
-
-```ts
-import { WebSocketManager, WorkerShardingStrategy } from '@discordjs/ws';
-import { REST } from '@discordjs/rest';
-
-const rest = new REST().setToken(process.env.DISCORD_TOKEN);
-const manager = new WebSocketManager({
- token: process.env.DISCORD_TOKEN,
- intents: 0,
- rest,
- shardCount: 6,
- // This will cause 3 workers to spawn, 2 shards per each
- buildStrategy: (manager) => new WorkerShardingStrategy(manager, { shardsPerWorker: 2 }),
- // Or maybe you want all your shards under a single worker
- buildStrategy: (manager) => new WorkerShardingStrategy(manager, { shardsPerWorker: 'all' }),
-});
-```
-
-**Note**: By default, this will cause the workers to effectively only be responsible for the WebSocket connection, they simply pass up all the events back to the main process for the manager to emit. If you want to have the workers handle events as well, you can pass in a `workerPath` option to the `WorkerShardingStrategy` constructor:
-
-```ts
-import { WebSocketManager, WorkerShardingStrategy } from '@discordjs/ws';
-import { REST } from '@discordjs/rest';
-
-const rest = new REST().setToken(process.env.DISCORD_TOKEN);
-const manager = new WebSocketManager({
- token: process.env.DISCORD_TOKEN,
- intents: 0,
- rest,
- buildStrategy: (manager) =>
- new WorkerShardingStrategy(manager, {
- shardsPerWorker: 2,
- workerPath: './worker.js',
- }),
-});
-```
-
-And your `worker.ts` file:
-
-```ts
-import { WorkerBootstrapper, WebSocketShardEvents } from '@discordjs/ws';
-
-const bootstrapper = new WorkerBootstrapper();
-void bootstrapper.bootstrap({
- // Those will be sent to the main thread for the manager to emit
- forwardEvents: [
- WebSocketShardEvents.Closed,
- WebSocketShardEvents.Debug,
- WebSocketShardEvents.Hello,
- WebSocketShardEvents.Ready,
- WebSocketShardEvents.Resumed,
- ],
- shardCallback: (shard) => {
- shard.on(WebSocketShardEvents.Dispatch, (event) => {
- // Process gateway events here however you want (e.g. send them through a message broker)
- // You also have access to shard.id if you need it
- });
- },
-});
-```
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/ws/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/ws
-[npm]: https://www.npmjs.com/package/@discordjs/ws
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/LICENSE b/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/LICENSE
deleted file mode 100644
index d21f37a..0000000
--- a/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- Copyright 2021 Noel Buechler
- Copyright 2015 Amish Shah
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/README.md b/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/README.md
deleted file mode 100644
index 21d1dcc..0000000
--- a/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## About
-
-`@discordjs/collection` is a powerful utility data structure used in discord.js.
-
-## Installation
-
-**Node.js 18 or newer is required.**
-
-```sh
-npm install @discordjs/collection
-yarn add @discordjs/collection
-pnpm add @discordjs/collection
-```
-
-## Links
-
-- [Website][website] ([source][website-source])
-- [Documentation][documentation]
-- [Guide][guide] ([source][guide-source])
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
-- [discord.js Discord server][discord]
-- [Discord API Discord server][discord-api]
-- [GitHub][source]
-- [npm][npm]
-- [Related libraries][related-libs]
-
-## Contributing
-
-Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
-[documentation][documentation].
-See [the contribution guide][contributing] if you'd like to submit a PR.
-
-## Help
-
-If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
-
-[website]: https://discord.js.org
-[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
-[documentation]: https://discord.js.org/docs/packages/collection/stable
-[guide]: https://discordjs.guide/
-[guide-source]: https://github.com/discordjs/guide
-[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
-[discord]: https://discord.gg/djs
-[discord-api]: https://discord.gg/discord-api
-[source]: https://github.com/discordjs/discord.js/tree/main/packages/collection
-[npm]: https://www.npmjs.com/package/@discordjs/collection
-[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
-[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/package.json b/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/package.json
deleted file mode 100644
index b36bb31..0000000
--- a/example_bot/node_modules/@discordjs/ws/node_modules/@discordjs/collection/package.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/collection",
- "version": "2.0.0",
- "description": "Utility data structure used in discord.js",
- "exports": {
- ".": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- }
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "Amish Shah ",
- "SpaceEEC ",
- "Vlad Frangu ",
- "Aura Román "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "map",
- "collection",
- "utility"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/collection"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "18.18.8",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "esbuild-plugin-version-injector": "^1.2.1",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "prettier": "^3.0.3",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "vitest": "^0.34.6",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=18"
- },
- "publishConfig": {
- "access": "public"
- },
- "scripts": {
- "test": "vitest run",
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
- "fmt": "pnpm run format",
- "docs": "pnpm run build:docs && api-extractor run --local",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@discordjs/ws/package.json b/example_bot/node_modules/@discordjs/ws/package.json
deleted file mode 100644
index e9a260a..0000000
--- a/example_bot/node_modules/@discordjs/ws/package.json
+++ /dev/null
@@ -1,109 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/package.json",
- "name": "@discordjs/ws",
- "version": "1.0.2",
- "description": "Wrapper around Discord's gateway",
- "exports": {
- ".": {
- "require": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
- },
- "import": {
- "types": "./dist/index.d.mts",
- "default": "./dist/index.mjs"
- }
- },
- "./defaultWorker": {
- "require": {
- "types": null,
- "default": "./dist/defaultWorker.js"
- },
- "import": {
- "types": null,
- "default": "./dist/defaultWorker.mjs"
- }
- }
- },
- "main": "./dist/index.js",
- "module": "./dist/index.mjs",
- "types": "./dist/index.d.ts",
- "directories": {
- "lib": "src",
- "test": "__tests__"
- },
- "files": [
- "dist"
- ],
- "contributors": [
- "Crawl ",
- "Amish Shah ",
- "SpaceEEC ",
- "Vlad Frangu ",
- "Aura Román ",
- "DD "
- ],
- "license": "Apache-2.0",
- "keywords": [
- "discord",
- "api",
- "gateway",
- "discordapp",
- "discordjs"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/discordjs/discord.js.git",
- "directory": "packages/ws"
- },
- "bugs": {
- "url": "https://github.com/discordjs/discord.js/issues"
- },
- "homepage": "https://discord.js.org",
- "dependencies": {
- "@sapphire/async-queue": "^1.5.0",
- "@types/ws": "^8.5.9",
- "@vladfrangu/async_event_emitter": "^2.2.2",
- "discord-api-types": "0.37.61",
- "tslib": "^2.6.2",
- "ws": "^8.14.2",
- "@discordjs/collection": "^2.0.0",
- "@discordjs/rest": "^2.1.0",
- "@discordjs/util": "^1.0.2"
- },
- "devDependencies": {
- "@favware/cliff-jumper": "^2.2.1",
- "@types/node": "18.17.9",
- "@vitest/coverage-v8": "^0.34.6",
- "cross-env": "^7.0.3",
- "esbuild-plugin-version-injector": "^1.2.1",
- "eslint": "^8.53.0",
- "eslint-config-neon": "^0.1.57",
- "eslint-formatter-pretty": "^5.0.0",
- "mock-socket": "^9.3.1",
- "prettier": "^3.0.3",
- "tsup": "^7.2.0",
- "turbo": "^1.10.17-canary.0",
- "typescript": "^5.2.2",
- "undici": "5.27.2",
- "vitest": "^0.34.6",
- "zlib-sync": "^0.1.9",
- "@discordjs/api-extractor": "^7.38.1"
- },
- "engines": {
- "node": ">=16.11.0"
- },
- "publishConfig": {
- "access": "public"
- },
- "scripts": {
- "test": "vitest run",
- "build": "tsc --noEmit && tsup",
- "build:docs": "tsc -p tsconfig.docs.json",
- "lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
- "format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
- "docs": "pnpm run build:docs && api-extractor run --local",
- "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/ws/*'",
- "release": "cliff-jumper"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@fastify/busboy/LICENSE b/example_bot/node_modules/@fastify/busboy/LICENSE
deleted file mode 100644
index 290762e..0000000
--- a/example_bot/node_modules/@fastify/busboy/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright Brian White. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
\ No newline at end of file
diff --git a/example_bot/node_modules/@fastify/busboy/README.md b/example_bot/node_modules/@fastify/busboy/README.md
deleted file mode 100644
index c74e618..0000000
--- a/example_bot/node_modules/@fastify/busboy/README.md
+++ /dev/null
@@ -1,271 +0,0 @@
-# busboy
-
-
-
-[](https://github.com/fastify/busboy/actions)
-[](https://coveralls.io/r/fastify/busboy?branch=master)
-[](https://standardjs.com/)
-[](https://github.com/nodejs/security-wg/blob/HEAD/processes/responsible_disclosure_template.md)
-
-
-
-
-
-[](https://www.npmjs.com/package/@fastify/busboy)
-[](https://www.npmjs.com/package/@fastify/busboy)
-
-
-
-Description
-===========
-
-A Node.js module for parsing incoming HTML form data.
-
-This is an officially supported fork by [fastify](https://github.com/fastify/) organization of the amazing library [originally created](https://github.com/mscdex/busboy) by Brian White,
-aimed at addressing long-standing issues with it.
-
-Benchmark (Mean time for 500 Kb payload, 2000 cycles, 1000 cycle warmup):
-
-| Library | Version | Mean time in nanoseconds (less is better) |
-|-----------------------|---------|-------------------------------------------|
-| busboy | 0.3.1 | `340114` |
-| @fastify/busboy | 1.0.0 | `270984` |
-
-[Changelog](https://github.com/fastify/busboy/blob/master/CHANGELOG.md) since busboy 0.31.
-
-Requirements
-============
-
-* [Node.js](http://nodejs.org/) 10+
-
-
-Install
-=======
-
- npm i @fastify/busboy
-
-
-Examples
-========
-
-* Parsing (multipart) with default options:
-
-```javascript
-const http = require('node:http');
-const { inspect } = require('node:util');
-const Busboy = require('busboy');
-
-http.createServer((req, res) => {
- if (req.method === 'POST') {
- const busboy = new Busboy({ headers: req.headers });
- busboy.on('file', (fieldname, file, filename, encoding, mimetype) => {
- console.log(`File [${fieldname}]: filename: ${filename}, encoding: ${encoding}, mimetype: ${mimetype}`);
- file.on('data', data => {
- console.log(`File [${fieldname}] got ${data.length} bytes`);
- });
- file.on('end', () => {
- console.log(`File [${fieldname}] Finished`);
- });
- });
- busboy.on('field', (fieldname, val, fieldnameTruncated, valTruncated, encoding, mimetype) => {
- console.log(`Field [${fieldname}]: value: ${inspect(val)}`);
- });
- busboy.on('finish', () => {
- console.log('Done parsing form!');
- res.writeHead(303, { Connection: 'close', Location: '/' });
- res.end();
- });
- req.pipe(busboy);
- } else if (req.method === 'GET') {
- res.writeHead(200, { Connection: 'close' });
- res.end(`
-
- `);
- }
-}).listen(8000, () => {
- console.log('Listening for requests');
-});
-
-// Example output, using http://nodejs.org/images/ryan-speaker.jpg as the file:
-//
-// Listening for requests
-// File [filefield]: filename: ryan-speaker.jpg, encoding: binary
-// File [filefield] got 11971 bytes
-// Field [textfield]: value: 'testing! :-)'
-// File [filefield] Finished
-// Done parsing form!
-```
-
-* Save all incoming files to disk:
-
-```javascript
-const http = require('node:http');
-const path = require('node:path');
-const os = require('node:os');
-const fs = require('node:fs');
-
-const Busboy = require('busboy');
-
-http.createServer(function(req, res) {
- if (req.method === 'POST') {
- const busboy = new Busboy({ headers: req.headers });
- busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
- var saveTo = path.join(os.tmpdir(), path.basename(fieldname));
- file.pipe(fs.createWriteStream(saveTo));
- });
- busboy.on('finish', function() {
- res.writeHead(200, { 'Connection': 'close' });
- res.end("That's all folks!");
- });
- return req.pipe(busboy);
- }
- res.writeHead(404);
- res.end();
-}).listen(8000, function() {
- console.log('Listening for requests');
-});
-```
-
-* Parsing (urlencoded) with default options:
-
-```javascript
-const http = require('node:http');
-const { inspect } = require('node:util');
-
-const Busboy = require('busboy');
-
-http.createServer(function(req, res) {
- if (req.method === 'POST') {
- const busboy = new Busboy({ headers: req.headers });
- busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
- console.log('File [' + fieldname + ']: filename: ' + filename);
- file.on('data', function(data) {
- console.log('File [' + fieldname + '] got ' + data.length + ' bytes');
- });
- file.on('end', function() {
- console.log('File [' + fieldname + '] Finished');
- });
- });
- busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) {
- console.log('Field [' + fieldname + ']: value: ' + inspect(val));
- });
- busboy.on('finish', function() {
- console.log('Done parsing form!');
- res.writeHead(303, { Connection: 'close', Location: '/' });
- res.end();
- });
- req.pipe(busboy);
- } else if (req.method === 'GET') {
- res.writeHead(200, { Connection: 'close' });
- res.end('\
- \
- ');
- }
-}).listen(8000, function() {
- console.log('Listening for requests');
-});
-
-// Example output:
-//
-// Listening for requests
-// Field [textfield]: value: 'testing! :-)'
-// Field [selectfield]: value: '9001'
-// Field [checkfield]: value: 'on'
-// Done parsing form!
-```
-
-
-API
-===
-
-_Busboy_ is a _Writable_ stream
-
-Busboy (special) events
------------------------
-
-* **file**(< _string_ >fieldname, < _ReadableStream_ >stream, < _string_ >filename, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new file form field found. `transferEncoding` contains the 'Content-Transfer-Encoding' value for the file stream. `mimeType` contains the 'Content-Type' value for the file stream.
- * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents), otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any** incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically and safely discarded (these discarded files do still count towards `files` and `parts` limits).
- * If a configured file size limit was reached, `stream` will both have a boolean property `truncated` (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens.
- * The property `bytesRead` informs about the number of bytes that have been read so far.
-
-* **field**(< _string_ >fieldname, < _string_ >value, < _boolean_ >fieldnameTruncated, < _boolean_ >valueTruncated, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new non-file field found.
-
-* **partsLimit**() - Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted.
-
-* **filesLimit**() - Emitted when specified `files` limit has been reached. No more 'file' events will be emitted.
-
-* **fieldsLimit**() - Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted.
-
-
-Busboy methods
---------------
-
-* **(constructor)**(< _object_ >config) - Creates and returns a new Busboy instance.
-
- * The constructor takes the following valid `config` settings:
-
- * **headers** - _object_ - These are the HTTP headers of the incoming request, which are used by individual parsers.
-
- * **autoDestroy** - _boolean_ - Whether this stream should automatically call .destroy() on itself after ending. (Default: false).
-
- * **highWaterMark** - _integer_ - highWaterMark to use for this Busboy instance (Default: WritableStream default).
-
- * **fileHwm** - _integer_ - highWaterMark to use for file streams (Default: ReadableStream default).
-
- * **defCharset** - _string_ - Default character set to use when one isn't defined (Default: 'utf8').
-
- * **preservePath** - _boolean_ - If paths in the multipart 'filename' field shall be preserved. (Default: false).
-
- * **isPartAFile** - __function__ - Use this function to override the default file detection functionality. It has following parameters:
-
- * fieldName - __string__ The name of the field.
-
- * contentType - __string__ The content-type of the part, e.g. `text/plain`, `image/jpeg`, `application/octet-stream`
-
- * fileName - __string__ The name of a file supplied by the part.
-
- (Default: `(fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)`)
-
- * **limits** - _object_ - Various limits on incoming data. Valid properties are:
-
- * **fieldNameSize** - _integer_ - Max field name size (in bytes) (Default: 100 bytes).
-
- * **fieldSize** - _integer_ - Max field value size (in bytes) (Default: 1 MiB, which is 1024 x 1024 bytes).
-
- * **fields** - _integer_ - Max number of non-file fields (Default: Infinity).
-
- * **fileSize** - _integer_ - For multipart forms, the max file size (in bytes) (Default: Infinity).
-
- * **files** - _integer_ - For multipart forms, the max number of file fields (Default: Infinity).
-
- * **parts** - _integer_ - For multipart forms, the max number of parts (fields + files) (Default: Infinity).
-
- * **headerPairs** - _integer_ - For multipart forms, the max number of header key=>value pairs to parse **Default:** 2000
-
- * **headerSize** - _integer_ - For multipart forms, the max size of a multipart header **Default:** 81920.
-
- * The constructor can throw errors:
-
- * **Busboy expected an options-Object.** - Busboy expected an Object as first parameters.
-
- * **Busboy expected an options-Object with headers-attribute.** - The first parameter is lacking of a headers-attribute.
-
- * **Limit $limit is not a valid number** - Busboy expected the desired limit to be of type number. Busboy throws this Error to prevent a potential security issue by falling silently back to the Busboy-defaults. Potential source for this Error can be the direct use of environment variables without transforming them to the type number.
-
- * **Unsupported Content-Type.** - The `Content-Type` isn't one Busboy can parse.
-
- * **Missing Content-Type-header.** - The provided headers don't include `Content-Type` at all.
diff --git a/example_bot/node_modules/@fastify/busboy/deps/dicer/LICENSE b/example_bot/node_modules/@fastify/busboy/deps/dicer/LICENSE
deleted file mode 100644
index 290762e..0000000
--- a/example_bot/node_modules/@fastify/busboy/deps/dicer/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright Brian White. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
\ No newline at end of file
diff --git a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js b/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js
deleted file mode 100644
index 79da160..0000000
--- a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js
+++ /dev/null
@@ -1,207 +0,0 @@
-'use strict'
-
-const WritableStream = require('node:stream').Writable
-const inherits = require('node:util').inherits
-
-const StreamSearch = require('../../streamsearch/sbmh')
-
-const PartStream = require('./PartStream')
-const HeaderParser = require('./HeaderParser')
-
-const DASH = 45
-const B_ONEDASH = Buffer.from('-')
-const B_CRLF = Buffer.from('\r\n')
-const EMPTY_FN = function () {}
-
-function Dicer (cfg) {
- if (!(this instanceof Dicer)) { return new Dicer(cfg) }
- WritableStream.call(this, cfg)
-
- if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
-
- if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
-
- this._headerFirst = cfg.headerFirst
-
- this._dashes = 0
- this._parts = 0
- this._finished = false
- this._realFinish = false
- this._isPreamble = true
- this._justMatched = false
- this._firstWrite = true
- this._inHeader = true
- this._part = undefined
- this._cb = undefined
- this._ignoreData = false
- this._partOpts = { highWaterMark: cfg.partHwm }
- this._pause = false
-
- const self = this
- this._hparser = new HeaderParser(cfg)
- this._hparser.on('header', function (header) {
- self._inHeader = false
- self._part.emit('header', header)
- })
-}
-inherits(Dicer, WritableStream)
-
-Dicer.prototype.emit = function (ev) {
- if (ev === 'finish' && !this._realFinish) {
- if (!this._finished) {
- const self = this
- process.nextTick(function () {
- self.emit('error', new Error('Unexpected end of multipart data'))
- if (self._part && !self._ignoreData) {
- const type = (self._isPreamble ? 'Preamble' : 'Part')
- self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
- self._part.push(null)
- process.nextTick(function () {
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- })
- return
- }
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- })
- }
- } else { WritableStream.prototype.emit.apply(this, arguments) }
-}
-
-Dicer.prototype._write = function (data, encoding, cb) {
- // ignore unexpected data (e.g. extra trailer data after finished)
- if (!this._hparser && !this._bparser) { return cb() }
-
- if (this._headerFirst && this._isPreamble) {
- if (!this._part) {
- this._part = new PartStream(this._partOpts)
- if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() }
- }
- const r = this._hparser.push(data)
- if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
- }
-
- // allows for "easier" testing
- if (this._firstWrite) {
- this._bparser.push(B_CRLF)
- this._firstWrite = false
- }
-
- this._bparser.push(data)
-
- if (this._pause) { this._cb = cb } else { cb() }
-}
-
-Dicer.prototype.reset = function () {
- this._part = undefined
- this._bparser = undefined
- this._hparser = undefined
-}
-
-Dicer.prototype.setBoundary = function (boundary) {
- const self = this
- this._bparser = new StreamSearch('\r\n--' + boundary)
- this._bparser.on('info', function (isMatch, data, start, end) {
- self._oninfo(isMatch, data, start, end)
- })
-}
-
-Dicer.prototype._ignore = function () {
- if (this._part && !this._ignoreData) {
- this._ignoreData = true
- this._part.on('error', EMPTY_FN)
- // we must perform some kind of read on the stream even though we are
- // ignoring the data, otherwise node's Readable stream will not emit 'end'
- // after pushing null to the stream
- this._part.resume()
- }
-}
-
-Dicer.prototype._oninfo = function (isMatch, data, start, end) {
- let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
-
- if (!this._part && this._justMatched && data) {
- while (this._dashes < 2 && (start + i) < end) {
- if (data[start + i] === DASH) {
- ++i
- ++this._dashes
- } else {
- if (this._dashes) { buf = B_ONEDASH }
- this._dashes = 0
- break
- }
- }
- if (this._dashes === 2) {
- if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) }
- this.reset()
- this._finished = true
- // no more parts will be added
- if (self._parts === 0) {
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- }
- }
- if (this._dashes) { return }
- }
- if (this._justMatched) { this._justMatched = false }
- if (!this._part) {
- this._part = new PartStream(this._partOpts)
- this._part._read = function (n) {
- self._unpause()
- }
- if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() }
- if (!this._isPreamble) { this._inHeader = true }
- }
- if (data && start < end && !this._ignoreData) {
- if (this._isPreamble || !this._inHeader) {
- if (buf) { shouldWriteMore = this._part.push(buf) }
- shouldWriteMore = this._part.push(data.slice(start, end))
- if (!shouldWriteMore) { this._pause = true }
- } else if (!this._isPreamble && this._inHeader) {
- if (buf) { this._hparser.push(buf) }
- r = this._hparser.push(data.slice(start, end))
- if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
- }
- }
- if (isMatch) {
- this._hparser.reset()
- if (this._isPreamble) { this._isPreamble = false } else {
- if (start !== end) {
- ++this._parts
- this._part.on('end', function () {
- if (--self._parts === 0) {
- if (self._finished) {
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- } else {
- self._unpause()
- }
- }
- })
- }
- }
- this._part.push(null)
- this._part = undefined
- this._ignoreData = false
- this._justMatched = true
- this._dashes = 0
- }
-}
-
-Dicer.prototype._unpause = function () {
- if (!this._pause) { return }
-
- this._pause = false
- if (this._cb) {
- const cb = this._cb
- this._cb = undefined
- cb()
- }
-}
-
-module.exports = Dicer
diff --git a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js b/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js
deleted file mode 100644
index 65f667b..0000000
--- a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js
+++ /dev/null
@@ -1,100 +0,0 @@
-'use strict'
-
-const EventEmitter = require('node:events').EventEmitter
-const inherits = require('node:util').inherits
-const getLimit = require('../../../lib/utils/getLimit')
-
-const StreamSearch = require('../../streamsearch/sbmh')
-
-const B_DCRLF = Buffer.from('\r\n\r\n')
-const RE_CRLF = /\r\n/g
-const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
-
-function HeaderParser (cfg) {
- EventEmitter.call(this)
-
- cfg = cfg || {}
- const self = this
- this.nread = 0
- this.maxed = false
- this.npairs = 0
- this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
- this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
- this.buffer = ''
- this.header = {}
- this.finished = false
- this.ss = new StreamSearch(B_DCRLF)
- this.ss.on('info', function (isMatch, data, start, end) {
- if (data && !self.maxed) {
- if (self.nread + end - start >= self.maxHeaderSize) {
- end = self.maxHeaderSize - self.nread + start
- self.nread = self.maxHeaderSize
- self.maxed = true
- } else { self.nread += (end - start) }
-
- self.buffer += data.toString('binary', start, end)
- }
- if (isMatch) { self._finish() }
- })
-}
-inherits(HeaderParser, EventEmitter)
-
-HeaderParser.prototype.push = function (data) {
- const r = this.ss.push(data)
- if (this.finished) { return r }
-}
-
-HeaderParser.prototype.reset = function () {
- this.finished = false
- this.buffer = ''
- this.header = {}
- this.ss.reset()
-}
-
-HeaderParser.prototype._finish = function () {
- if (this.buffer) { this._parseHeader() }
- this.ss.matches = this.ss.maxMatches
- const header = this.header
- this.header = {}
- this.buffer = ''
- this.finished = true
- this.nread = this.npairs = 0
- this.maxed = false
- this.emit('header', header)
-}
-
-HeaderParser.prototype._parseHeader = function () {
- if (this.npairs === this.maxHeaderPairs) { return }
-
- const lines = this.buffer.split(RE_CRLF)
- const len = lines.length
- let m, h
-
- for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
- if (lines[i].length === 0) { continue }
- if (lines[i][0] === '\t' || lines[i][0] === ' ') {
- // folded header content
- // RFC2822 says to just remove the CRLF and not the whitespace following
- // it, so we follow the RFC and include the leading whitespace ...
- if (h) {
- this.header[h][this.header[h].length - 1] += lines[i]
- continue
- }
- }
-
- const posColon = lines[i].indexOf(':')
- if (
- posColon === -1 ||
- posColon === 0
- ) {
- return
- }
- m = RE_HDR.exec(lines[i])
- h = m[1].toLowerCase()
- this.header[h] = this.header[h] || []
- this.header[h].push((m[2] || ''))
- if (++this.npairs === this.maxHeaderPairs) { break }
- }
-}
-
-module.exports = HeaderParser
diff --git a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js b/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js
deleted file mode 100644
index c91da1c..0000000
--- a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict'
-
-const inherits = require('node:util').inherits
-const ReadableStream = require('node:stream').Readable
-
-function PartStream (opts) {
- ReadableStream.call(this, opts)
-}
-inherits(PartStream, ReadableStream)
-
-PartStream.prototype._read = function (n) {}
-
-module.exports = PartStream
diff --git a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts b/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts
deleted file mode 100644
index 3c5b896..0000000
--- a/example_bot/node_modules/@fastify/busboy/deps/dicer/lib/dicer.d.ts
+++ /dev/null
@@ -1,164 +0,0 @@
-// Type definitions for dicer 0.2
-// Project: https://github.com/mscdex/dicer
-// Definitions by: BendingBender
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.2
-///
-
-import stream = require("stream");
-
-// tslint:disable:unified-signatures
-
-/**
- * A very fast streaming multipart parser for node.js.
- * Dicer is a WritableStream
- *
- * Dicer (special) events:
- * - on('finish', ()) - Emitted when all parts have been parsed and the Dicer instance has been ended.
- * - on('part', (stream: PartStream)) - Emitted when a new part has been found.
- * - on('preamble', (stream: PartStream)) - Emitted for preamble if you should happen to need it (can usually be ignored).
- * - on('trailer', (data: Buffer)) - Emitted when trailing data was found after the terminating boundary (as with the preamble, this can usually be ignored too).
- */
-export class Dicer extends stream.Writable {
- /**
- * Creates and returns a new Dicer instance with the following valid config settings:
- *
- * @param config The configuration to use
- */
- constructor(config: Dicer.Config);
- /**
- * Sets the boundary to use for parsing and performs some initialization needed for parsing.
- * You should only need to use this if you set headerFirst to true in the constructor and are parsing the boundary from the preamble header.
- *
- * @param boundary The boundary to use
- */
- setBoundary(boundary: string): void;
- addListener(event: "finish", listener: () => void): this;
- addListener(event: "part", listener: (stream: Dicer.PartStream) => void): this;
- addListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this;
- addListener(event: "trailer", listener: (data: Buffer) => void): this;
- addListener(event: "close", listener: () => void): this;
- addListener(event: "drain", listener: () => void): this;
- addListener(event: "error", listener: (err: Error) => void): this;
- addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
- addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
- addListener(event: string, listener: (...args: any[]) => void): this;
- on(event: "finish", listener: () => void): this;
- on(event: "part", listener: (stream: Dicer.PartStream) => void): this;
- on(event: "preamble", listener: (stream: Dicer.PartStream) => void): this;
- on(event: "trailer", listener: (data: Buffer) => void): this;
- on(event: "close", listener: () => void): this;
- on(event: "drain", listener: () => void): this;
- on(event: "error", listener: (err: Error) => void): this;
- on(event: "pipe", listener: (src: stream.Readable) => void): this;
- on(event: "unpipe", listener: (src: stream.Readable) => void): this;
- on(event: string, listener: (...args: any[]) => void): this;
- once(event: "finish", listener: () => void): this;
- once(event: "part", listener: (stream: Dicer.PartStream) => void): this;
- once(event: "preamble", listener: (stream: Dicer.PartStream) => void): this;
- once(event: "trailer", listener: (data: Buffer) => void): this;
- once(event: "close", listener: () => void): this;
- once(event: "drain", listener: () => void): this;
- once(event: "error", listener: (err: Error) => void): this;
- once(event: "pipe", listener: (src: stream.Readable) => void): this;
- once(event: "unpipe", listener: (src: stream.Readable) => void): this;
- once(event: string, listener: (...args: any[]) => void): this;
- prependListener(event: "finish", listener: () => void): this;
- prependListener(event: "part", listener: (stream: Dicer.PartStream) => void): this;
- prependListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this;
- prependListener(event: "trailer", listener: (data: Buffer) => void): this;
- prependListener(event: "close", listener: () => void): this;
- prependListener(event: "drain", listener: () => void): this;
- prependListener(event: "error", listener: (err: Error) => void): this;
- prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
- prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
- prependListener(event: string, listener: (...args: any[]) => void): this;
- prependOnceListener(event: "finish", listener: () => void): this;
- prependOnceListener(event: "part", listener: (stream: Dicer.PartStream) => void): this;
- prependOnceListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this;
- prependOnceListener(event: "trailer", listener: (data: Buffer) => void): this;
- prependOnceListener(event: "close", listener: () => void): this;
- prependOnceListener(event: "drain", listener: () => void): this;
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
- prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
- prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
- removeListener(event: "finish", listener: () => void): this;
- removeListener(event: "part", listener: (stream: Dicer.PartStream) => void): this;
- removeListener(event: "preamble", listener: (stream: Dicer.PartStream) => void): this;
- removeListener(event: "trailer", listener: (data: Buffer) => void): this;
- removeListener(event: "close", listener: () => void): this;
- removeListener(event: "drain", listener: () => void): this;
- removeListener(event: "error", listener: (err: Error) => void): this;
- removeListener(event: "pipe", listener: (src: stream.Readable) => void): this;
- removeListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
- removeListener(event: string, listener: (...args: any[]) => void): this;
-}
-
-declare namespace Dicer {
- interface Config {
- /**
- * This is the boundary used to detect the beginning of a new part.
- */
- boundary?: string | undefined;
- /**
- * If true, preamble header parsing will be performed first.
- */
- headerFirst?: boolean | undefined;
- /**
- * The maximum number of header key=>value pairs to parse Default: 2000 (same as node's http).
- */
- maxHeaderPairs?: number | undefined;
- }
-
- /**
- * PartStream is a _ReadableStream_
- *
- * PartStream (special) events:
- * - on('header', (header: object)) - An object containing the header for this particular part. Each property value is an array of one or more string values.
- */
- interface PartStream extends stream.Readable {
- addListener(event: "header", listener: (header: object) => void): this;
- addListener(event: "close", listener: () => void): this;
- addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
- addListener(event: "end", listener: () => void): this;
- addListener(event: "readable", listener: () => void): this;
- addListener(event: "error", listener: (err: Error) => void): this;
- addListener(event: string, listener: (...args: any[]) => void): this;
- on(event: "header", listener: (header: object) => void): this;
- on(event: "close", listener: () => void): this;
- on(event: "data", listener: (chunk: Buffer | string) => void): this;
- on(event: "end", listener: () => void): this;
- on(event: "readable", listener: () => void): this;
- on(event: "error", listener: (err: Error) => void): this;
- on(event: string, listener: (...args: any[]) => void): this;
- once(event: "header", listener: (header: object) => void): this;
- once(event: "close", listener: () => void): this;
- once(event: "data", listener: (chunk: Buffer | string) => void): this;
- once(event: "end", listener: () => void): this;
- once(event: "readable", listener: () => void): this;
- once(event: "error", listener: (err: Error) => void): this;
- once(event: string, listener: (...args: any[]) => void): this;
- prependListener(event: "header", listener: (header: object) => void): this;
- prependListener(event: "close", listener: () => void): this;
- prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
- prependListener(event: "end", listener: () => void): this;
- prependListener(event: "readable", listener: () => void): this;
- prependListener(event: "error", listener: (err: Error) => void): this;
- prependListener(event: string, listener: (...args: any[]) => void): this;
- prependOnceListener(event: "header", listener: (header: object) => void): this;
- prependOnceListener(event: "close", listener: () => void): this;
- prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
- prependOnceListener(event: "end", listener: () => void): this;
- prependOnceListener(event: "readable", listener: () => void): this;
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
- removeListener(event: "header", listener: (header: object) => void): this;
- removeListener(event: "close", listener: () => void): this;
- removeListener(event: "data", listener: (chunk: Buffer | string) => void): this;
- removeListener(event: "end", listener: () => void): this;
- removeListener(event: "readable", listener: () => void): this;
- removeListener(event: "error", listener: (err: Error) => void): this;
- removeListener(event: string, listener: (...args: any[]) => void): this;
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js b/example_bot/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js
deleted file mode 100644
index b90c0e8..0000000
--- a/example_bot/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js
+++ /dev/null
@@ -1,228 +0,0 @@
-'use strict'
-
-/**
- * Copyright Brian White. All rights reserved.
- *
- * @see https://github.com/mscdex/streamsearch
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
- * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
- */
-const EventEmitter = require('node:events').EventEmitter
-const inherits = require('node:util').inherits
-
-function SBMH (needle) {
- if (typeof needle === 'string') {
- needle = Buffer.from(needle)
- }
-
- if (!Buffer.isBuffer(needle)) {
- throw new TypeError('The needle has to be a String or a Buffer.')
- }
-
- const needleLength = needle.length
-
- if (needleLength === 0) {
- throw new Error('The needle cannot be an empty String/Buffer.')
- }
-
- if (needleLength > 256) {
- throw new Error('The needle cannot have a length bigger than 256.')
- }
-
- this.maxMatches = Infinity
- this.matches = 0
-
- this._occ = new Array(256)
- .fill(needleLength) // Initialize occurrence table.
- this._lookbehind_size = 0
- this._needle = needle
- this._bufpos = 0
-
- this._lookbehind = Buffer.alloc(needleLength)
-
- // Populate occurrence table with analysis of the needle,
- // ignoring last letter.
- for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
- this._occ[needle[i]] = needleLength - 1 - i
- }
-}
-inherits(SBMH, EventEmitter)
-
-SBMH.prototype.reset = function () {
- this._lookbehind_size = 0
- this.matches = 0
- this._bufpos = 0
-}
-
-SBMH.prototype.push = function (chunk, pos) {
- if (!Buffer.isBuffer(chunk)) {
- chunk = Buffer.from(chunk, 'binary')
- }
- const chlen = chunk.length
- this._bufpos = pos || 0
- let r
- while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
- return r
-}
-
-SBMH.prototype._sbmh_feed = function (data) {
- const len = data.length
- const needle = this._needle
- const needleLength = needle.length
- const lastNeedleChar = needle[needleLength - 1]
-
- // Positive: points to a position in `data`
- // pos == 3 points to data[3]
- // Negative: points to a position in the lookbehind buffer
- // pos == -2 points to lookbehind[lookbehind_size - 2]
- let pos = -this._lookbehind_size
- let ch
-
- if (pos < 0) {
- // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
- // search with character lookup code that considers both the
- // lookbehind buffer and the current round's haystack data.
- //
- // Loop until
- // there is a match.
- // or until
- // we've moved past the position that requires the
- // lookbehind buffer. In this case we switch to the
- // optimized loop.
- // or until
- // the character to look at lies outside the haystack.
- while (pos < 0 && pos <= len - needleLength) {
- ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
-
- if (
- ch === lastNeedleChar &&
- this._sbmh_memcmp(data, pos, needleLength - 1)
- ) {
- this._lookbehind_size = 0
- ++this.matches
- this.emit('info', true)
-
- return (this._bufpos = pos + needleLength)
- }
- pos += this._occ[ch]
- }
-
- // No match.
-
- if (pos < 0) {
- // There's too few data for Boyer-Moore-Horspool to run,
- // so let's use a different algorithm to skip as much as
- // we can.
- // Forward pos until
- // the trailing part of lookbehind + data
- // looks like the beginning of the needle
- // or until
- // pos == 0
- while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
- }
-
- if (pos >= 0) {
- // Discard lookbehind buffer.
- this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
- this._lookbehind_size = 0
- } else {
- // Cut off part of the lookbehind buffer that has
- // been processed and append the entire haystack
- // into it.
- const bytesToCutOff = this._lookbehind_size + pos
- if (bytesToCutOff > 0) {
- // The cut off data is guaranteed not to contain the needle.
- this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
- }
-
- this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
- this._lookbehind_size - bytesToCutOff)
- this._lookbehind_size -= bytesToCutOff
-
- data.copy(this._lookbehind, this._lookbehind_size)
- this._lookbehind_size += len
-
- this._bufpos = len
- return len
- }
- }
-
- pos += (pos >= 0) * this._bufpos
-
- // Lookbehind buffer is now empty. We only need to check if the
- // needle is in the haystack.
- if (data.indexOf(needle, pos) !== -1) {
- pos = data.indexOf(needle, pos)
- ++this.matches
- if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
-
- return (this._bufpos = pos + needleLength)
- } else {
- pos = len - needleLength
- }
-
- // There was no match. If there's trailing haystack data that we cannot
- // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
- // data is less than the needle size) then match using a modified
- // algorithm that starts matching from the beginning instead of the end.
- // Whatever trailing data is left after running this algorithm is added to
- // the lookbehind buffer.
- while (
- pos < len &&
- (
- data[pos] !== needle[0] ||
- (
- (Buffer.compare(
- data.subarray(pos, pos + len - pos),
- needle.subarray(0, len - pos)
- ) !== 0)
- )
- )
- ) {
- ++pos
- }
- if (pos < len) {
- data.copy(this._lookbehind, 0, pos, pos + (len - pos))
- this._lookbehind_size = len - pos
- }
-
- // Everything until pos is guaranteed not to contain needle data.
- if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
-
- this._bufpos = len
- return len
-}
-
-SBMH.prototype._sbmh_lookup_char = function (data, pos) {
- return (pos < 0)
- ? this._lookbehind[this._lookbehind_size + pos]
- : data[pos]
-}
-
-SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
- for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
- if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
- }
- return true
-}
-
-module.exports = SBMH
diff --git a/example_bot/node_modules/@fastify/busboy/lib/main.d.ts b/example_bot/node_modules/@fastify/busboy/lib/main.d.ts
deleted file mode 100644
index 91b6448..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/main.d.ts
+++ /dev/null
@@ -1,196 +0,0 @@
-// Definitions by: Jacob Baskin
-// BendingBender
-// Igor Savin
-
-///
-
-import * as http from 'http';
-import { Readable, Writable } from 'stream';
-export { Dicer } from "../deps/dicer/lib/dicer";
-
-export const Busboy: BusboyConstructor;
-export default Busboy;
-
-export interface BusboyConfig {
- /**
- * These are the HTTP headers of the incoming request, which are used by individual parsers.
- */
- headers: BusboyHeaders;
- /**
- * `highWaterMark` to use for this Busboy instance.
- * @default WritableStream default.
- */
- highWaterMark?: number | undefined;
- /**
- * highWaterMark to use for file streams.
- * @default ReadableStream default.
- */
- fileHwm?: number | undefined;
- /**
- * Default character set to use when one isn't defined.
- * @default 'utf8'
- */
- defCharset?: string | undefined;
- /**
- * Detect if a Part is a file.
- *
- * By default a file is detected if contentType
- * is application/octet-stream or fileName is not
- * undefined.
- *
- * Modify this to handle e.g. Blobs.
- */
- isPartAFile?: (fieldName: string | undefined, contentType: string | undefined, fileName: string | undefined) => boolean;
- /**
- * If paths in the multipart 'filename' field shall be preserved.
- * @default false
- */
- preservePath?: boolean | undefined;
- /**
- * Various limits on incoming data.
- */
- limits?:
- | {
- /**
- * Max field name size (in bytes)
- * @default 100 bytes
- */
- fieldNameSize?: number | undefined;
- /**
- * Max field value size (in bytes)
- * @default 1MB
- */
- fieldSize?: number | undefined;
- /**
- * Max number of non-file fields
- * @default Infinity
- */
- fields?: number | undefined;
- /**
- * For multipart forms, the max file size (in bytes)
- * @default Infinity
- */
- fileSize?: number | undefined;
- /**
- * For multipart forms, the max number of file fields
- * @default Infinity
- */
- files?: number | undefined;
- /**
- * For multipart forms, the max number of parts (fields + files)
- * @default Infinity
- */
- parts?: number | undefined;
- /**
- * For multipart forms, the max number of header key=>value pairs to parse
- * @default 2000
- */
- headerPairs?: number | undefined;
-
- /**
- * For multipart forms, the max size of a header part
- * @default 81920
- */
- headerSize?: number | undefined;
- }
- | undefined;
-}
-
-export type BusboyHeaders = { 'content-type': string } & http.IncomingHttpHeaders;
-
-export interface BusboyFileStream extends
- Readable {
-
- truncated: boolean;
-
- /**
- * The number of bytes that have been read so far.
- */
- bytesRead: number;
-}
-
-export interface Busboy extends Writable {
- addListener(event: Event, listener: BusboyEvents[Event]): this;
-
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
-
- on(event: Event, listener: BusboyEvents[Event]): this;
-
- on(event: string | symbol, listener: (...args: any[]) => void): this;
-
- once(event: Event, listener: BusboyEvents[Event]): this;
-
- once(event: string | symbol, listener: (...args: any[]) => void): this;
-
- removeListener(event: Event, listener: BusboyEvents[Event]): this;
-
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
-
- off(event: Event, listener: BusboyEvents[Event]): this;
-
- off(event: string | symbol, listener: (...args: any[]) => void): this;
-
- prependListener(event: Event, listener: BusboyEvents[Event]): this;
-
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
-
- prependOnceListener(event: Event, listener: BusboyEvents[Event]): this;
-
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
-}
-
-export interface BusboyEvents {
- /**
- * Emitted for each new file form field found.
- *
- * * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the
- * file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents),
- * otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any**
- * incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically
- * and safely discarded (these discarded files do still count towards `files` and `parts` limits).
- * * If a configured file size limit was reached, `stream` will both have a boolean property `truncated`
- * (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens.
- *
- * @param listener.transferEncoding Contains the 'Content-Transfer-Encoding' value for the file stream.
- * @param listener.mimeType Contains the 'Content-Type' value for the file stream.
- */
- file: (
- fieldname: string,
- stream: BusboyFileStream,
- filename: string,
- transferEncoding: string,
- mimeType: string,
- ) => void;
- /**
- * Emitted for each new non-file field found.
- */
- field: (
- fieldname: string,
- value: string,
- fieldnameTruncated: boolean,
- valueTruncated: boolean,
- transferEncoding: string,
- mimeType: string,
- ) => void;
- finish: () => void;
- /**
- * Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted.
- */
- partsLimit: () => void;
- /**
- * Emitted when specified `files` limit has been reached. No more 'file' events will be emitted.
- */
- filesLimit: () => void;
- /**
- * Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted.
- */
- fieldsLimit: () => void;
- error: (error: unknown) => void;
-}
-
-export interface BusboyConstructor {
- (options: BusboyConfig): Busboy;
-
- new(options: BusboyConfig): Busboy;
-}
-
diff --git a/example_bot/node_modules/@fastify/busboy/lib/main.js b/example_bot/node_modules/@fastify/busboy/lib/main.js
deleted file mode 100644
index 8794beb..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/main.js
+++ /dev/null
@@ -1,85 +0,0 @@
-'use strict'
-
-const WritableStream = require('node:stream').Writable
-const { inherits } = require('node:util')
-const Dicer = require('../deps/dicer/lib/Dicer')
-
-const MultipartParser = require('./types/multipart')
-const UrlencodedParser = require('./types/urlencoded')
-const parseParams = require('./utils/parseParams')
-
-function Busboy (opts) {
- if (!(this instanceof Busboy)) { return new Busboy(opts) }
-
- if (typeof opts !== 'object') {
- throw new TypeError('Busboy expected an options-Object.')
- }
- if (typeof opts.headers !== 'object') {
- throw new TypeError('Busboy expected an options-Object with headers-attribute.')
- }
- if (typeof opts.headers['content-type'] !== 'string') {
- throw new TypeError('Missing Content-Type-header.')
- }
-
- const {
- headers,
- ...streamOptions
- } = opts
-
- this.opts = {
- autoDestroy: false,
- ...streamOptions
- }
- WritableStream.call(this, this.opts)
-
- this._done = false
- this._parser = this.getParserByHeaders(headers)
- this._finished = false
-}
-inherits(Busboy, WritableStream)
-
-Busboy.prototype.emit = function (ev) {
- if (ev === 'finish') {
- if (!this._done) {
- this._parser?.end()
- return
- } else if (this._finished) {
- return
- }
- this._finished = true
- }
- WritableStream.prototype.emit.apply(this, arguments)
-}
-
-Busboy.prototype.getParserByHeaders = function (headers) {
- const parsed = parseParams(headers['content-type'])
-
- const cfg = {
- defCharset: this.opts.defCharset,
- fileHwm: this.opts.fileHwm,
- headers,
- highWaterMark: this.opts.highWaterMark,
- isPartAFile: this.opts.isPartAFile,
- limits: this.opts.limits,
- parsedConType: parsed,
- preservePath: this.opts.preservePath
- }
-
- if (MultipartParser.detect.test(parsed[0])) {
- return new MultipartParser(this, cfg)
- }
- if (UrlencodedParser.detect.test(parsed[0])) {
- return new UrlencodedParser(this, cfg)
- }
- throw new Error('Unsupported Content-Type.')
-}
-
-Busboy.prototype._write = function (chunk, encoding, cb) {
- this._parser.write(chunk, cb)
-}
-
-module.exports = Busboy
-module.exports.default = Busboy
-module.exports.Busboy = Busboy
-
-module.exports.Dicer = Dicer
diff --git a/example_bot/node_modules/@fastify/busboy/lib/types/multipart.js b/example_bot/node_modules/@fastify/busboy/lib/types/multipart.js
deleted file mode 100644
index ad242db..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/types/multipart.js
+++ /dev/null
@@ -1,306 +0,0 @@
-'use strict'
-
-// TODO:
-// * support 1 nested multipart level
-// (see second multipart example here:
-// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
-// * support limits.fieldNameSize
-// -- this will require modifications to utils.parseParams
-
-const { Readable } = require('node:stream')
-const { inherits } = require('node:util')
-
-const Dicer = require('../../deps/dicer/lib/Dicer')
-
-const parseParams = require('../utils/parseParams')
-const decodeText = require('../utils/decodeText')
-const basename = require('../utils/basename')
-const getLimit = require('../utils/getLimit')
-
-const RE_BOUNDARY = /^boundary$/i
-const RE_FIELD = /^form-data$/i
-const RE_CHARSET = /^charset$/i
-const RE_FILENAME = /^filename$/i
-const RE_NAME = /^name$/i
-
-Multipart.detect = /^multipart\/form-data/i
-function Multipart (boy, cfg) {
- let i
- let len
- const self = this
- let boundary
- const limits = cfg.limits
- const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
- const parsedConType = cfg.parsedConType || []
- const defCharset = cfg.defCharset || 'utf8'
- const preservePath = cfg.preservePath
- const fileOpts = { highWaterMark: cfg.fileHwm }
-
- for (i = 0, len = parsedConType.length; i < len; ++i) {
- if (Array.isArray(parsedConType[i]) &&
- RE_BOUNDARY.test(parsedConType[i][0])) {
- boundary = parsedConType[i][1]
- break
- }
- }
-
- function checkFinished () {
- if (nends === 0 && finished && !boy._done) {
- finished = false
- self.end()
- }
- }
-
- if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
-
- const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
- const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
- const filesLimit = getLimit(limits, 'files', Infinity)
- const fieldsLimit = getLimit(limits, 'fields', Infinity)
- const partsLimit = getLimit(limits, 'parts', Infinity)
- const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
- const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
-
- let nfiles = 0
- let nfields = 0
- let nends = 0
- let curFile
- let curField
- let finished = false
-
- this._needDrain = false
- this._pause = false
- this._cb = undefined
- this._nparts = 0
- this._boy = boy
-
- const parserCfg = {
- boundary,
- maxHeaderPairs: headerPairsLimit,
- maxHeaderSize: headerSizeLimit,
- partHwm: fileOpts.highWaterMark,
- highWaterMark: cfg.highWaterMark
- }
-
- this.parser = new Dicer(parserCfg)
- this.parser.on('drain', function () {
- self._needDrain = false
- if (self._cb && !self._pause) {
- const cb = self._cb
- self._cb = undefined
- cb()
- }
- }).on('part', function onPart (part) {
- if (++self._nparts > partsLimit) {
- self.parser.removeListener('part', onPart)
- self.parser.on('part', skipPart)
- boy.hitPartsLimit = true
- boy.emit('partsLimit')
- return skipPart(part)
- }
-
- // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
- // us emit 'end' early since we know the part has ended if we are already
- // seeing the next part
- if (curField) {
- const field = curField
- field.emit('end')
- field.removeAllListeners('end')
- }
-
- part.on('header', function (header) {
- let contype
- let fieldname
- let parsed
- let charset
- let encoding
- let filename
- let nsize = 0
-
- if (header['content-type']) {
- parsed = parseParams(header['content-type'][0])
- if (parsed[0]) {
- contype = parsed[0].toLowerCase()
- for (i = 0, len = parsed.length; i < len; ++i) {
- if (RE_CHARSET.test(parsed[i][0])) {
- charset = parsed[i][1].toLowerCase()
- break
- }
- }
- }
- }
-
- if (contype === undefined) { contype = 'text/plain' }
- if (charset === undefined) { charset = defCharset }
-
- if (header['content-disposition']) {
- parsed = parseParams(header['content-disposition'][0])
- if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
- for (i = 0, len = parsed.length; i < len; ++i) {
- if (RE_NAME.test(parsed[i][0])) {
- fieldname = parsed[i][1]
- } else if (RE_FILENAME.test(parsed[i][0])) {
- filename = parsed[i][1]
- if (!preservePath) { filename = basename(filename) }
- }
- }
- } else { return skipPart(part) }
-
- if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
-
- let onData,
- onEnd
-
- if (isPartAFile(fieldname, contype, filename)) {
- // file/binary field
- if (nfiles === filesLimit) {
- if (!boy.hitFilesLimit) {
- boy.hitFilesLimit = true
- boy.emit('filesLimit')
- }
- return skipPart(part)
- }
-
- ++nfiles
-
- if (!boy._events.file) {
- self.parser._ignore()
- return
- }
-
- ++nends
- const file = new FileStream(fileOpts)
- curFile = file
- file.on('end', function () {
- --nends
- self._pause = false
- checkFinished()
- if (self._cb && !self._needDrain) {
- const cb = self._cb
- self._cb = undefined
- cb()
- }
- })
- file._read = function (n) {
- if (!self._pause) { return }
- self._pause = false
- if (self._cb && !self._needDrain) {
- const cb = self._cb
- self._cb = undefined
- cb()
- }
- }
- boy.emit('file', fieldname, file, filename, encoding, contype)
-
- onData = function (data) {
- if ((nsize += data.length) > fileSizeLimit) {
- const extralen = fileSizeLimit - nsize + data.length
- if (extralen > 0) { file.push(data.slice(0, extralen)) }
- file.truncated = true
- file.bytesRead = fileSizeLimit
- part.removeAllListeners('data')
- file.emit('limit')
- return
- } else if (!file.push(data)) { self._pause = true }
-
- file.bytesRead = nsize
- }
-
- onEnd = function () {
- curFile = undefined
- file.push(null)
- }
- } else {
- // non-file field
- if (nfields === fieldsLimit) {
- if (!boy.hitFieldsLimit) {
- boy.hitFieldsLimit = true
- boy.emit('fieldsLimit')
- }
- return skipPart(part)
- }
-
- ++nfields
- ++nends
- let buffer = ''
- let truncated = false
- curField = part
-
- onData = function (data) {
- if ((nsize += data.length) > fieldSizeLimit) {
- const extralen = (fieldSizeLimit - (nsize - data.length))
- buffer += data.toString('binary', 0, extralen)
- truncated = true
- part.removeAllListeners('data')
- } else { buffer += data.toString('binary') }
- }
-
- onEnd = function () {
- curField = undefined
- if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
- boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
- --nends
- checkFinished()
- }
- }
-
- /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
- broken. Streams2/streams3 is a huge black box of confusion, but
- somehow overriding the sync state seems to fix things again (and still
- seems to work for previous node versions).
- */
- part._readableState.sync = false
-
- part.on('data', onData)
- part.on('end', onEnd)
- }).on('error', function (err) {
- if (curFile) { curFile.emit('error', err) }
- })
- }).on('error', function (err) {
- boy.emit('error', err)
- }).on('finish', function () {
- finished = true
- checkFinished()
- })
-}
-
-Multipart.prototype.write = function (chunk, cb) {
- const r = this.parser.write(chunk)
- if (r && !this._pause) {
- cb()
- } else {
- this._needDrain = !r
- this._cb = cb
- }
-}
-
-Multipart.prototype.end = function () {
- const self = this
-
- if (self.parser.writable) {
- self.parser.end()
- } else if (!self._boy._done) {
- process.nextTick(function () {
- self._boy._done = true
- self._boy.emit('finish')
- })
- }
-}
-
-function skipPart (part) {
- part.resume()
-}
-
-function FileStream (opts) {
- Readable.call(this, opts)
-
- this.bytesRead = 0
-
- this.truncated = false
-}
-
-inherits(FileStream, Readable)
-
-FileStream.prototype._read = function (n) {}
-
-module.exports = Multipart
diff --git a/example_bot/node_modules/@fastify/busboy/lib/types/urlencoded.js b/example_bot/node_modules/@fastify/busboy/lib/types/urlencoded.js
deleted file mode 100644
index 6f5f784..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/types/urlencoded.js
+++ /dev/null
@@ -1,190 +0,0 @@
-'use strict'
-
-const Decoder = require('../utils/Decoder')
-const decodeText = require('../utils/decodeText')
-const getLimit = require('../utils/getLimit')
-
-const RE_CHARSET = /^charset$/i
-
-UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
-function UrlEncoded (boy, cfg) {
- const limits = cfg.limits
- const parsedConType = cfg.parsedConType
- this.boy = boy
-
- this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
- this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
- this.fieldsLimit = getLimit(limits, 'fields', Infinity)
-
- let charset
- for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
- if (Array.isArray(parsedConType[i]) &&
- RE_CHARSET.test(parsedConType[i][0])) {
- charset = parsedConType[i][1].toLowerCase()
- break
- }
- }
-
- if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
-
- this.decoder = new Decoder()
- this.charset = charset
- this._fields = 0
- this._state = 'key'
- this._checkingBytes = true
- this._bytesKey = 0
- this._bytesVal = 0
- this._key = ''
- this._val = ''
- this._keyTrunc = false
- this._valTrunc = false
- this._hitLimit = false
-}
-
-UrlEncoded.prototype.write = function (data, cb) {
- if (this._fields === this.fieldsLimit) {
- if (!this.boy.hitFieldsLimit) {
- this.boy.hitFieldsLimit = true
- this.boy.emit('fieldsLimit')
- }
- return cb()
- }
-
- let idxeq; let idxamp; let i; let p = 0; const len = data.length
-
- while (p < len) {
- if (this._state === 'key') {
- idxeq = idxamp = undefined
- for (i = p; i < len; ++i) {
- if (!this._checkingBytes) { ++p }
- if (data[i] === 0x3D/* = */) {
- idxeq = i
- break
- } else if (data[i] === 0x26/* & */) {
- idxamp = i
- break
- }
- if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
- this._hitLimit = true
- break
- } else if (this._checkingBytes) { ++this._bytesKey }
- }
-
- if (idxeq !== undefined) {
- // key with assignment
- if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
- this._state = 'val'
-
- this._hitLimit = false
- this._checkingBytes = true
- this._val = ''
- this._bytesVal = 0
- this._valTrunc = false
- this.decoder.reset()
-
- p = idxeq + 1
- } else if (idxamp !== undefined) {
- // key with no assignment
- ++this._fields
- let key; const keyTrunc = this._keyTrunc
- if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
-
- this._hitLimit = false
- this._checkingBytes = true
- this._key = ''
- this._bytesKey = 0
- this._keyTrunc = false
- this.decoder.reset()
-
- if (key.length) {
- this.boy.emit('field', decodeText(key, 'binary', this.charset),
- '',
- keyTrunc,
- false)
- }
-
- p = idxamp + 1
- if (this._fields === this.fieldsLimit) { return cb() }
- } else if (this._hitLimit) {
- // we may not have hit the actual limit if there are encoded bytes...
- if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
- p = i
- if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
- // yep, we actually did hit the limit
- this._checkingBytes = false
- this._keyTrunc = true
- }
- } else {
- if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
- p = len
- }
- } else {
- idxamp = undefined
- for (i = p; i < len; ++i) {
- if (!this._checkingBytes) { ++p }
- if (data[i] === 0x26/* & */) {
- idxamp = i
- break
- }
- if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
- this._hitLimit = true
- break
- } else if (this._checkingBytes) { ++this._bytesVal }
- }
-
- if (idxamp !== undefined) {
- ++this._fields
- if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
- this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
- decodeText(this._val, 'binary', this.charset),
- this._keyTrunc,
- this._valTrunc)
- this._state = 'key'
-
- this._hitLimit = false
- this._checkingBytes = true
- this._key = ''
- this._bytesKey = 0
- this._keyTrunc = false
- this.decoder.reset()
-
- p = idxamp + 1
- if (this._fields === this.fieldsLimit) { return cb() }
- } else if (this._hitLimit) {
- // we may not have hit the actual limit if there are encoded bytes...
- if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
- p = i
- if ((this._val === '' && this.fieldSizeLimit === 0) ||
- (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
- // yep, we actually did hit the limit
- this._checkingBytes = false
- this._valTrunc = true
- }
- } else {
- if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
- p = len
- }
- }
- }
- cb()
-}
-
-UrlEncoded.prototype.end = function () {
- if (this.boy._done) { return }
-
- if (this._state === 'key' && this._key.length > 0) {
- this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
- '',
- this._keyTrunc,
- false)
- } else if (this._state === 'val') {
- this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
- decodeText(this._val, 'binary', this.charset),
- this._keyTrunc,
- this._valTrunc)
- }
- this.boy._done = true
- this.boy.emit('finish')
-}
-
-module.exports = UrlEncoded
diff --git a/example_bot/node_modules/@fastify/busboy/lib/utils/Decoder.js b/example_bot/node_modules/@fastify/busboy/lib/utils/Decoder.js
deleted file mode 100644
index 7917678..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/utils/Decoder.js
+++ /dev/null
@@ -1,54 +0,0 @@
-'use strict'
-
-const RE_PLUS = /\+/g
-
-const HEX = [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-]
-
-function Decoder () {
- this.buffer = undefined
-}
-Decoder.prototype.write = function (str) {
- // Replace '+' with ' ' before decoding
- str = str.replace(RE_PLUS, ' ')
- let res = ''
- let i = 0; let p = 0; const len = str.length
- for (; i < len; ++i) {
- if (this.buffer !== undefined) {
- if (!HEX[str.charCodeAt(i)]) {
- res += '%' + this.buffer
- this.buffer = undefined
- --i // retry character
- } else {
- this.buffer += str[i]
- ++p
- if (this.buffer.length === 2) {
- res += String.fromCharCode(parseInt(this.buffer, 16))
- this.buffer = undefined
- }
- }
- } else if (str[i] === '%') {
- if (i > p) {
- res += str.substring(p, i)
- p = i
- }
- this.buffer = ''
- ++p
- }
- }
- if (p < len && this.buffer === undefined) { res += str.substring(p) }
- return res
-}
-Decoder.prototype.reset = function () {
- this.buffer = undefined
-}
-
-module.exports = Decoder
diff --git a/example_bot/node_modules/@fastify/busboy/lib/utils/basename.js b/example_bot/node_modules/@fastify/busboy/lib/utils/basename.js
deleted file mode 100644
index db58819..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/utils/basename.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'
-
-module.exports = function basename (path) {
- if (typeof path !== 'string') { return '' }
- for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
- switch (path.charCodeAt(i)) {
- case 0x2F: // '/'
- case 0x5C: // '\'
- path = path.slice(i + 1)
- return (path === '..' || path === '.' ? '' : path)
- }
- }
- return (path === '..' || path === '.' ? '' : path)
-}
diff --git a/example_bot/node_modules/@fastify/busboy/lib/utils/decodeText.js b/example_bot/node_modules/@fastify/busboy/lib/utils/decodeText.js
deleted file mode 100644
index be35d6b..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/utils/decodeText.js
+++ /dev/null
@@ -1,114 +0,0 @@
-'use strict'
-
-// Node has always utf-8
-const utf8Decoder = new TextDecoder('utf-8')
-const textDecoders = new Map([
- ['utf-8', utf8Decoder],
- ['utf8', utf8Decoder]
-])
-
-function getDecoder (charset) {
- let lc
- while (true) {
- switch (charset) {
- case 'utf-8':
- case 'utf8':
- return decoders.utf8
- case 'latin1':
- case 'ascii': // TODO: Make these a separate, strict decoder?
- case 'us-ascii':
- case 'iso-8859-1':
- case 'iso8859-1':
- case 'iso88591':
- case 'iso_8859-1':
- case 'windows-1252':
- case 'iso_8859-1:1987':
- case 'cp1252':
- case 'x-cp1252':
- return decoders.latin1
- case 'utf16le':
- case 'utf-16le':
- case 'ucs2':
- case 'ucs-2':
- return decoders.utf16le
- case 'base64':
- return decoders.base64
- default:
- if (lc === undefined) {
- lc = true
- charset = charset.toLowerCase()
- continue
- }
- return decoders.other.bind(charset)
- }
- }
-}
-
-const decoders = {
- utf8: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
- }
- return data.utf8Slice(0, data.length)
- },
-
- latin1: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- return data
- }
- return data.latin1Slice(0, data.length)
- },
-
- utf16le: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
- }
- return data.ucs2Slice(0, data.length)
- },
-
- base64: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
- }
- return data.base64Slice(0, data.length)
- },
-
- other: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
- }
-
- if (textDecoders.has(this.toString())) {
- try {
- return textDecoders.get(this).decode(data)
- } catch (e) { }
- }
- return typeof data === 'string'
- ? data
- : data.toString()
- }
-}
-
-function decodeText (text, sourceEncoding, destEncoding) {
- if (text) {
- return getDecoder(destEncoding)(text, sourceEncoding)
- }
- return text
-}
-
-module.exports = decodeText
diff --git a/example_bot/node_modules/@fastify/busboy/lib/utils/getLimit.js b/example_bot/node_modules/@fastify/busboy/lib/utils/getLimit.js
deleted file mode 100644
index cb64fd6..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/utils/getLimit.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict'
-
-module.exports = function getLimit (limits, name, defaultLimit) {
- if (
- !limits ||
- limits[name] === undefined ||
- limits[name] === null
- ) { return defaultLimit }
-
- if (
- typeof limits[name] !== 'number' ||
- isNaN(limits[name])
- ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
-
- return limits[name]
-}
diff --git a/example_bot/node_modules/@fastify/busboy/lib/utils/parseParams.js b/example_bot/node_modules/@fastify/busboy/lib/utils/parseParams.js
deleted file mode 100644
index 1698e62..0000000
--- a/example_bot/node_modules/@fastify/busboy/lib/utils/parseParams.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/* eslint-disable object-property-newline */
-'use strict'
-
-const decodeText = require('./decodeText')
-
-const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
-
-const EncodedLookup = {
- '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
- '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
- '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
- '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
- '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
- '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
- '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
- '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
- '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
- '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
- '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
- '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
- '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
- '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
- '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
- '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
- '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
- '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
- '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
- '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
- '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
- '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
- '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
- '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
- '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
- '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
- '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
- '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
- '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
- '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
- '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
- '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
- '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
- '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
- '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
- '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
- '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
- '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
- '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
- '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
- '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
- '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
- '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
- '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
- '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
- '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
- '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
- '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
- '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
- '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
- '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
- '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
- '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
- '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
- '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
- '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
- '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
- '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
- '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
- '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
- '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
- '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
- '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
- '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
- '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
- '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
- '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
- '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
- '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
- '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
- '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
- '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
- '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
- '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
- '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
- '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
- '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
- '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
- '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
- '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
- '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
- '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
- '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
- '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
- '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
- '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
- '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
- '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
- '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
- '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
- '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
- '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
- '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
- '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
- '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
- '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
- '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
-}
-
-function encodedReplacer (match) {
- return EncodedLookup[match]
-}
-
-const STATE_KEY = 0
-const STATE_VALUE = 1
-const STATE_CHARSET = 2
-const STATE_LANG = 3
-
-function parseParams (str) {
- const res = []
- let state = STATE_KEY
- let charset = ''
- let inquote = false
- let escaping = false
- let p = 0
- let tmp = ''
- const len = str.length
-
- for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
- const char = str[i]
- if (char === '\\' && inquote) {
- if (escaping) { escaping = false } else {
- escaping = true
- continue
- }
- } else if (char === '"') {
- if (!escaping) {
- if (inquote) {
- inquote = false
- state = STATE_KEY
- } else { inquote = true }
- continue
- } else { escaping = false }
- } else {
- if (escaping && inquote) { tmp += '\\' }
- escaping = false
- if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
- if (state === STATE_CHARSET) {
- state = STATE_LANG
- charset = tmp.substring(1)
- } else { state = STATE_VALUE }
- tmp = ''
- continue
- } else if (state === STATE_KEY &&
- (char === '*' || char === '=') &&
- res.length) {
- state = char === '*'
- ? STATE_CHARSET
- : STATE_VALUE
- res[p] = [tmp, undefined]
- tmp = ''
- continue
- } else if (!inquote && char === ';') {
- state = STATE_KEY
- if (charset) {
- if (tmp.length) {
- tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
- 'binary',
- charset)
- }
- charset = ''
- } else if (tmp.length) {
- tmp = decodeText(tmp, 'binary', 'utf8')
- }
- if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
- tmp = ''
- ++p
- continue
- } else if (!inquote && (char === ' ' || char === '\t')) { continue }
- }
- tmp += char
- }
- if (charset && tmp.length) {
- tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
- 'binary',
- charset)
- } else if (tmp) {
- tmp = decodeText(tmp, 'binary', 'utf8')
- }
-
- if (res[p] === undefined) {
- if (tmp) { res[p] = tmp }
- } else { res[p][1] = tmp }
-
- return res
-}
-
-module.exports = parseParams
diff --git a/example_bot/node_modules/@fastify/busboy/package.json b/example_bot/node_modules/@fastify/busboy/package.json
deleted file mode 100644
index 4be895c..0000000
--- a/example_bot/node_modules/@fastify/busboy/package.json
+++ /dev/null
@@ -1,86 +0,0 @@
-{
- "name": "@fastify/busboy",
- "version": "2.1.0",
- "private": false,
- "author": "Brian White ",
- "contributors": [
- {
- "name": "Igor Savin",
- "email": "kibertoad@gmail.com",
- "url": "https://github.com/kibertoad"
- },
- {
- "name": "Aras Abbasi",
- "email": "aras.abbasi@gmail.com",
- "url": "https://github.com/uzlopak"
- }
- ],
- "description": "A streaming parser for HTML form data for node.js",
- "main": "lib/main",
- "type": "commonjs",
- "types": "lib/main.d.ts",
- "scripts": {
- "bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify",
- "bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js",
- "coveralls": "nyc report --reporter=lcov",
- "lint": "npm run lint:standard",
- "lint:everything": "npm run lint && npm run test:types",
- "lint:fix": "standard --fix",
- "lint:standard": "standard --verbose | snazzy",
- "test:mocha": "tap",
- "test:types": "tsd",
- "test:coverage": "nyc npm run test",
- "test": "npm run test:mocha"
- },
- "engines": {
- "node": ">=14"
- },
- "devDependencies": {
- "@types/node": "^20.1.0",
- "busboy": "^1.0.0",
- "photofinish": "^1.8.0",
- "snazzy": "^9.0.0",
- "standard": "^17.0.0",
- "tap": "^16.3.8",
- "tinybench": "^2.5.1",
- "tsd": "^0.29.0",
- "typescript": "^5.0.2"
- },
- "keywords": [
- "uploads",
- "forms",
- "multipart",
- "form-data"
- ],
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/fastify/busboy.git"
- },
- "tsd": {
- "directory": "test/types",
- "compilerOptions": {
- "esModuleInterop": false,
- "module": "commonjs",
- "target": "ES2017"
- }
- },
- "standard": {
- "globals": [
- "describe",
- "it"
- ],
- "ignore": [
- "bench"
- ]
- },
- "files": [
- "README.md",
- "LICENSE",
- "lib/*",
- "deps/encoding/*",
- "deps/dicer/lib",
- "deps/streamsearch/",
- "deps/dicer/LICENSE"
- ]
-}
diff --git a/example_bot/node_modules/@sapphire/async-queue/CHANGELOG.md b/example_bot/node_modules/@sapphire/async-queue/CHANGELOG.md
deleted file mode 100644
index f2d02e0..0000000
--- a/example_bot/node_modules/@sapphire/async-queue/CHANGELOG.md
+++ /dev/null
@@ -1,148 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-# [@sapphire/async-queue@1.5.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.4.0...@sapphire/async-queue@1.5.0) - (2022-08-16)
-
-## 🐛 Bug Fixes
-
-- **deps:** Update all non-major dependencies ([2308bd7](https://github.com/sapphiredev/utilities/commit/2308bd74356b6b2e0c12995b25f4d8ade4803fe9))
-
-## 🚀 Features
-
-- Add `AsyncQueue#abortAll` (#429) ([b351e70](https://github.com/sapphiredev/utilities/commit/b351e70ebef329009daaebba89729ee84bb5704c))
-
-# [@sapphire/async-queue@1.4.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.3.1...@sapphire/async-queue@1.4.0) - (2022-08-07)
-
-## 🐛 Bug Fixes
-
-- **deps:** Update all non-major dependencies ([84af0db](https://github.com/sapphiredev/utilities/commit/84af0db2db749223b036aa99fe19a2e9af5681c6))
-- **deps:** Update all non-major dependencies ([50cd8de](https://github.com/sapphiredev/utilities/commit/50cd8dea593b6f5ae75571209456b3421e2ca59a))
-
-## 📝 Documentation
-
-- Add @muchnameless as a contributor ([a1221fe](https://github.com/sapphiredev/utilities/commit/a1221fea68506e99591d5d00ec552a07c26833f9))
-- Add @enxg as a contributor ([d2382f0](https://github.com/sapphiredev/utilities/commit/d2382f04e3909cb4ad11798a0a10e683f6cf5383))
-- Add @EvolutionX-10 as a contributor ([efc3a32](https://github.com/sapphiredev/utilities/commit/efc3a320a72ae258996dd62866d206c33f8d4961))
-- Add @MajesticString as a contributor ([295b3e9](https://github.com/sapphiredev/utilities/commit/295b3e9849a4b0fe64074bae02f6426378a303c3))
-- Add @Mzato0001 as a contributor ([c790ef2](https://github.com/sapphiredev/utilities/commit/c790ef25df2d7e22888fa9f8169167aa555e9e19))
-- Add @NotKaskus as a contributor ([00da8f1](https://github.com/sapphiredev/utilities/commit/00da8f199137b9277119823f322d1f2d168d928a))
-- Add @imranbarbhuiya as a contributor ([fb674c2](https://github.com/sapphiredev/utilities/commit/fb674c2c5594d41e71662263553dcb4bac9e37f4))
-- Add @axisiscool as a contributor ([ce1aa31](https://github.com/sapphiredev/utilities/commit/ce1aa316871a88d3663efbdf2a42d3d8dfe6a27f))
-- Add @dhruv-kaushikk as a contributor ([ebbf43f](https://github.com/sapphiredev/utilities/commit/ebbf43f63617daba96e72c50a234bf8b64f6ddc4))
-- Add @Commandtechno as a contributor ([f1d69fa](https://github.com/sapphiredev/utilities/commit/f1d69fabe1ee0abe4be08b19e63dbec03102f7ce))
-- Fix typedoc causing OOM crashes ([63ba41c](https://github.com/sapphiredev/utilities/commit/63ba41c4b6678554b1c7043a22d3296db4f59360))
-
-## 🚀 Features
-
-- **AsyncQueue:** Add AbortSignal support (#417) ([c0629e7](https://github.com/sapphiredev/utilities/commit/c0629e781ebc3f48e496a0851191b32e91f62fe9))
-
-## 🧪 Testing
-
-- Migrate to vitest (#380) ([075ec73](https://github.com/sapphiredev/utilities/commit/075ec73c7a8e3374fad3ada612d37eb4ac36ec8d))
-
-## [1.3.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.3.0...@sapphire/async-queue@1.3.1) (2022-04-01)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-# [1.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.2.0...@sapphire/async-queue@1.3.0) (2022-03-06)
-
-### Features
-
-- allow module: NodeNext ([#306](https://github.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://github.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6))
-- **ts-config:** add multi-config structure ([#281](https://github.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://github.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37))
-
-# [1.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.9...@sapphire/async-queue@1.2.0) (2022-01-28)
-
-### Features
-
-- change build system to tsup ([#270](https://github.com/sapphiredev/utilities/issues/270)) ([365a53a](https://github.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8))
-
-## [1.1.9](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.8...@sapphire/async-queue@1.1.9) (2021-11-06)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.1.8](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.7...@sapphire/async-queue@1.1.8) (2021-10-26)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.1.7](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.6...@sapphire/async-queue@1.1.7) (2021-10-17)
-
-### Bug Fixes
-
-- allow more node & npm versions in engines field ([5977d2a](https://github.com/sapphiredev/utilities/commit/5977d2a30a4b2cfdf84aff3f33af03ffde1bbec5))
-
-## [1.1.6](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.5...@sapphire/async-queue@1.1.6) (2021-10-11)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.1.5](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.4...@sapphire/async-queue@1.1.5) (2021-10-04)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.1.4](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.3...@sapphire/async-queue@1.1.4) (2021-06-27)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.1.3](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.2...@sapphire/async-queue@1.1.3) (2021-06-06)
-
-### Bug Fixes
-
-- remove peer deps, update dev deps, update READMEs ([#124](https://github.com/sapphiredev/utilities/issues/124)) ([67256ed](https://github.com/sapphiredev/utilities/commit/67256ed43b915b02a8b5c68230ba82d6210c5032))
-
-## [1.1.2](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.1...@sapphire/async-queue@1.1.2) (2021-05-20)
-
-### Bug Fixes
-
-- **async-queue:** mark package as side effect free ([1c4b901](https://github.com/sapphiredev/utilities/commit/1c4b901cda3d14bd085c35cc74e160f844567ba7))
-
-## [1.1.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.0...@sapphire/async-queue@1.1.1) (2021-05-02)
-
-### Bug Fixes
-
-- drop the `www.` from the SapphireJS URL ([494d89f](https://github.com/sapphiredev/utilities/commit/494d89ffa04f78c195b93d7905b3232884f7d7e2))
-- update all the SapphireJS URLs from `.com` to `.dev` ([f59b46d](https://github.com/sapphiredev/utilities/commit/f59b46d1a0ebd39cad17b17d71cd3b9da808d5fd))
-
-# [1.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.7...@sapphire/async-queue@1.1.0) (2021-04-21)
-
-### Features
-
-- add @sapphire/embed-jsx ([#100](https://github.com/sapphiredev/utilities/issues/100)) ([7277a23](https://github.com/sapphiredev/utilities/commit/7277a236015236ed8e81b7882875410facc4ce17))
-
-## [1.0.7](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.6...@sapphire/async-queue@1.0.7) (2021-04-19)
-
-### Bug Fixes
-
-- change all Sapphire URLs from "project"->"community" & use our domain where applicable 👨🌾🚜 ([#102](https://github.com/sapphiredev/utilities/issues/102)) ([835b408](https://github.com/sapphiredev/utilities/commit/835b408e8e57130c3787aca2e32613346ff23e4d))
-
-## [1.0.6](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.5...@sapphire/async-queue@1.0.6) (2021-04-03)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.0.5](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.4...@sapphire/async-queue@1.0.5) (2021-03-16)
-
-### Bug Fixes
-
-- remove terser from all packages ([#79](https://github.com/sapphiredev/utilities/issues/79)) ([1cfe4e7](https://github.com/sapphiredev/utilities/commit/1cfe4e7c804e62c142495686d2b83b81d0026c02))
-
-## [1.0.4](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.3...@sapphire/async-queue@1.0.4) (2021-02-16)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.0.3](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.2...@sapphire/async-queue@1.0.3) (2021-02-13)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.0.2](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.1...@sapphire/async-queue@1.0.2) (2021-01-25)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-## [1.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.0...@sapphire/async-queue@1.0.1) (2021-01-16)
-
-**Note:** Version bump only for package @sapphire/async-queue
-
-# 1.0.0 (2021-01-13)
-
-### Features
-
-- **async-queue:** add async-queue package ([#56](https://github.com/sapphiredev/utilities/issues/56)) ([ba81832](https://github.com/sapphiredev/utilities/commit/ba8183287dbbc3f3d7d79af6d5a2d3dd8d62f63e))
diff --git a/example_bot/node_modules/@sapphire/async-queue/README.md b/example_bot/node_modules/@sapphire/async-queue/README.md
deleted file mode 100644
index 40d1358..0000000
--- a/example_bot/node_modules/@sapphire/async-queue/README.md
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
-# @sapphire/async-queue
-
-**Sequential asynchronous lock-based queue for promises.**
-
-[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
-[](https://codecov.io/gh/sapphiredev/utilities)
-[](https://bundlephobia.com/result?p=@sapphire/async-queue)
-[](https://www.npmjs.com/package/@sapphire/async-queue)
-
-
-
-## Description
-
-Ever needed a queue for a set of promises? This is the package for you.
-
-## Features
-
-- Written in TypeScript
-- Bundled with esbuild so it can be used in NodeJS and browsers
-- Offers CommonJS, ESM and UMD bundles
-- Fully tested
-
-## Installation
-
-You can use the following command to install this package, or replace `npm install` with your package manager of choice.
-
-```sh
-npm install @sapphire/async-queue
-```
-
----
-
-## Buy us some doughnuts
-
-Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
-
-We accept donations through Open Collective, Ko-fi, PayPal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.
-
-| Donate With | Address |
-| :-------------: | :-------------------------------------------------: |
-| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
-| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
-| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
-| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
-
-## Contributors ✨
-
-Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
-
-
-
-
-
-
-
-
-
-
-
-This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
diff --git a/example_bot/node_modules/@sapphire/async-queue/package.json b/example_bot/node_modules/@sapphire/async-queue/package.json
deleted file mode 100644
index b1917fd..0000000
--- a/example_bot/node_modules/@sapphire/async-queue/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "name": "@sapphire/async-queue",
- "version": "1.5.0",
- "description": "Sequential asynchronous lock-based queue for promises",
- "author": "@sapphire",
- "license": "MIT",
- "main": "dist/index.js",
- "module": "dist/index.mjs",
- "browser": "dist/index.global.js",
- "unpkg": "dist/index.global.js",
- "types": "dist/index.d.ts",
- "exports": {
- "import": "./dist/index.mjs",
- "require": "./dist/index.js",
- "types": "./dist/index.d.ts"
- },
- "sideEffects": false,
- "homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/async-queue",
- "scripts": {
- "test": "vitest run",
- "lint": "eslint src tests --ext ts --fix -c ../../.eslintrc",
- "build": "tsup",
- "prepack": "yarn build",
- "bump": "cliff-jumper",
- "check-update": "cliff-jumper --dry-run"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sapphiredev/utilities.git",
- "directory": "packages/async-queue"
- },
- "files": [
- "dist/**/*.js*",
- "dist/**/*.mjs*",
- "dist/**/*.d*"
- ],
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- },
- "keywords": [
- "@sapphire/async-queue",
- "bot",
- "typescript",
- "ts",
- "yarn",
- "discord",
- "sapphire",
- "standalone"
- ],
- "bugs": {
- "url": "https://github.com/sapphiredev/utilities/issues"
- },
- "publishConfig": {
- "access": "public"
- },
- "devDependencies": {
- "@favware/cliff-jumper": "^1.8.6",
- "@vitest/coverage-c8": "^0.22.0",
- "c8": "^7.12.0",
- "tsup": "^6.2.2",
- "typescript": "^4.7.4",
- "vitest": "^0.22.0"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@sapphire/shapeshift/CHANGELOG.md b/example_bot/node_modules/@sapphire/shapeshift/CHANGELOG.md
deleted file mode 100644
index 7dbda72..0000000
--- a/example_bot/node_modules/@sapphire/shapeshift/CHANGELOG.md
+++ /dev/null
@@ -1,298 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-# [3.9.3](https://github.com/sapphiredev/shapeshift/compare/v3.9.3...v3.9.3) - (2023-10-13)
-
-## 🏠 Refactor
-
-- Change email regex (#306) ([c5d49cf](https://github.com/sapphiredev/shapeshift/commit/c5d49cf32931aff24ab74ba87ee8d6d35f7231af))
-
-# [3.9.2](https://github.com/sapphiredev/shapeshift/compare/v3.9.1...v3.9.2) - (2023-06-04)
-
-## 🐛 Bug Fixes
-
-- **arrayvalidator:** Fixed runaway type instantiation with TypeScript >=5.1 (#275) ([f59d901](https://github.com/sapphiredev/shapeshift/commit/f59d90112181e6625230c28e6a4f0f065ced6344))
-
-# [3.9.1](https://github.com/sapphiredev/shapeshift/compare/v3.9.0...v3.9.1) - (2023-06-02)
-
-## 🐛 Bug Fixes
-
-- **types:** Move the `types` condition to the front (#273) ([5a3e202](https://github.com/sapphiredev/shapeshift/commit/5a3e202e9ceafb3d330a568e93c060dd5aac1dde))
-
-# [3.9.0](https://github.com/sapphiredev/shapeshift/compare/v3.8.2...v3.9.0) - (2023-05-09)
-
-## 🐛 Bug Fixes
-
-- Resolve minor grammar mistake (#260) ([62df609](https://github.com/sapphiredev/shapeshift/commit/62df6094845ffa118aa93ea3c5f47f81f1c5d99f))
-
-## 🚀 Features
-
-- Add BaseValidator.describe (#267) ([d9e1a2d](https://github.com/sapphiredev/shapeshift/commit/d9e1a2d2f3c5e6378f0025becf8497138ee6d97c))
-
-# [3.8.2](https://github.com/sapphiredev/shapeshift/compare/v3.8.1...v3.8.2) - (2023-04-02)
-
-## 🐛 Bug Fixes
-
-- ***:** TypeScript 5.x compatibility (#253) ([eba2a88](https://github.com/sapphiredev/shapeshift/commit/eba2a88b91fb6631f431313753299ec7a70cf6ce))
-- Remove `node:` prefix (#249) ([af766b5](https://github.com/sapphiredev/shapeshift/commit/af766b504c1013f3cd24f7bf803ac9ff7442a8d7))
-
-# [3.8.1](https://github.com/sapphiredev/shapeshift/compare/v3.8.0...v3.8.1) - (2022-12-15)
-
-## 🐛 Bug Fixes
-
-- Fixed lodash esm import (#230) ([63def7b](https://github.com/sapphiredev/shapeshift/commit/63def7bcec6319b3792093945ba7ba9f871ced6f))
-
-# [3.8.0](https://github.com/sapphiredev/shapeshift/compare/v3.7.1...v3.8.0) - (2022-12-11)
-
-## 🏠 Refactor
-
-- Remove `NonNullObject` (#227) ([04d3934](https://github.com/sapphiredev/shapeshift/commit/04d39343f55a4e1571f54870a84d8b95447bd682))
-
-## 🚀 Features
-
-- Add `when` constraint (#223) ([8eade90](https://github.com/sapphiredev/shapeshift/commit/8eade90cd4c02b80746ecdcdc612829d7f765178))
-
-# [3.7.1](https://github.com/sapphiredev/shapeshift/compare/v3.7.0...v3.7.1) - (2022-11-27)
-
-## 🐛 Bug Fixes
-
-- Fixed "jump to definition" for `undefinedToOptional` going to wrong symbol (#226) ([6aab6d0](https://github.com/sapphiredev/shapeshift/commit/6aab6d01450fd7abbeaa95e91fb58568240e02ff))
-
-## 📝 Documentation
-
-- Add @legendhimslef as a contributor ([499522a](https://github.com/sapphiredev/shapeshift/commit/499522a782c3ecd4df80978d0811df1a75d08212))
-
-# [3.7.0](https://github.com/sapphiredev/shapeshift/compare/v3.6.0...v3.7.0) - (2022-10-02)
-
-## 📝 Documentation
-
-- Add phone in readme (#203) ([4ec9b7a](https://github.com/sapphiredev/shapeshift/commit/4ec9b7ab85124d84b3404cb548b17b9221a716c5))
-- Add RealShadowNova as a contributor for tool (#185) ([6dfc442](https://github.com/sapphiredev/shapeshift/commit/6dfc442af6ef26d6bbca39078eca5727257b6dab))
-
-## 🚀 Features
-
-- Add `s.string.phone` (#202) ([7d122d5](https://github.com/sapphiredev/shapeshift/commit/7d122d5dc0eaa63c639b9cde1514e63566a681bd))
-
-# [3.6.0](https://github.com/sapphiredev/shapeshift/compare/v3.5.1...v3.6.0) - (2022-08-29)
-
-## 🐛 Bug Fixes
-
-- Typescript 4.8 compatibility (#179) ([2281535](https://github.com/sapphiredev/shapeshift/commit/2281535f7589a987510828e46bf66accc8393c34))
-
-## 🚀 Features
-
-- Add `Validator#is` (#183) ([5114f95](https://github.com/sapphiredev/shapeshift/commit/5114f9516e5406cd1ca4a7ceb5ea5761158af1c6))
-
-# [3.5.1](https://github.com/sapphiredev/shapeshift/compare/v3.5.0...v3.5.1) - (2022-07-17)
-
-## 🐛 Bug Fixes
-
-- Fast deep equal import (#155) ([5ce8ff6](https://github.com/sapphiredev/shapeshift/commit/5ce8ff6803b70624af07c3e406bc1cdc9e3cdafe))
-
-# [3.5.0](https://github.com/sapphiredev/shapeshift/compare/v3.4.1...v3.5.0) - (2022-07-10)
-
-## 🏠 Refactor
-
-- Port net module (#149) ([5f26e32](https://github.com/sapphiredev/shapeshift/commit/5f26e32b0f87d2b100ca13471d5835c0067ddee8))
-
-## 🐛 Bug Fixes
-
-- Ensure browser compatibility (#150) ([92d05d8](https://github.com/sapphiredev/shapeshift/commit/92d05d83c1fbab53f98f61219fb01d49fc031bae))
-- Fixed `s.array` type inference (#153) ([a5948dc](https://github.com/sapphiredev/shapeshift/commit/a5948dc67ce6a0ea73986d32084898a4ce0b9c3a))
-- Fixed `shape#array` types (#146) ([43016a0](https://github.com/sapphiredev/shapeshift/commit/43016a025b04a676d906758ed065d26a17231888))
-
-## 🚀 Features
-
-- Lazy validator (#147) ([807666e](https://github.com/sapphiredev/shapeshift/commit/807666ef537c84d2e0f8bd9f4ce1a8060bfb3fb5))
-- Reshape finally (#148) ([d3751f6](https://github.com/sapphiredev/shapeshift/commit/d3751f6d3d99f415d797369f98158f932371e02c))
-- **arrays:** Add unique (#141) ([ad7af34](https://github.com/sapphiredev/shapeshift/commit/ad7af34eb811541253150b7ff0b58a6bd7200796))
-
-# [3.4.1](https://github.com/sapphiredev/shapeshift/compare/v3.4.0...v3.4.1) - (2022-07-03)
-
-## 🏠 Refactor
-
-- Move all type utilities to one file (#139) ([61cab3d](https://github.com/sapphiredev/shapeshift/commit/61cab3d0e486d9dc74c8f6160ff8c75c91b595b2))
-
-## 🐛 Bug Fixes
-
-- Return array-validator from length* methods (#140) ([75b1f9a](https://github.com/sapphiredev/shapeshift/commit/75b1f9a6efffb6c27dcfd48eb4ec6269a3614633))
-
-## 🧪 Testing
-
-- Typechecking for tests (#145) ([273cdc8](https://github.com/sapphiredev/shapeshift/commit/273cdc82c1cf65ba4111ca6e70b050e02cbdf485))
-
-# [3.4.0](https://github.com/sapphiredev/shapeshift/compare/v3.3.2...v3.4.0) - (2022-06-29)
-
-## 🚀 Features
-
-- Add `required` in object validation (#137) ([928f7be](https://github.com/sapphiredev/shapeshift/commit/928f7beb5e727b47868e9e46f2191f2def228080))
-
-# [3.3.2](https://github.com/sapphiredev/shapeshift/compare/v3.3.1...v3.3.2) - (2022-06-26)
-
-## 🐛 Bug Fixes
-
-- Make keys optional in object parsing (#134) ([57a3719](https://github.com/sapphiredev/shapeshift/commit/57a37193d64399aae1431b041012d582e8defecf))
-
-# [3.3.1](https://github.com/sapphiredev/shapeshift/compare/v3.3.0...v3.3.1) - (2022-06-22)
-
-## 🐛 Bug Fixes
-
-- Add generic type to parse (#133) ([90c91aa](https://github.com/sapphiredev/shapeshift/commit/90c91aad572d51a2bfbd1ed32a51e1d4201c5d4a))
-
-# [3.3.0](https://github.com/sapphiredev/shapeshift/compare/v3.2.0...v3.3.0) - (2022-06-19)
-
-## 🐛 Bug Fixes
-
-- Compile for es2020 instead of es2021 (#128) ([051344d](https://github.com/sapphiredev/shapeshift/commit/051344debe1cf423713d7fc64b8908353348f301))
-
-## 🚀 Features
-
-- Allow passing functions in `setValidationEnabled` (#131) ([e1991cf](https://github.com/sapphiredev/shapeshift/commit/e1991cfef1ffe92f9167d11d7f2ded65379df8d2))
-
-## 🧪 Testing
-
-- Migrate to vitest (#126) ([4d80969](https://github.com/sapphiredev/shapeshift/commit/4d80969b714c39768499569456405a73c1444da8))
-
-# [3.2.0](https://github.com/sapphiredev/shapeshift/compare/v3.1.0...v3.2.0) - (2022-06-11)
-
-## 🚀 Features
-
-- Add disabling of validators (#125) ([e17af95](https://github.com/sapphiredev/shapeshift/commit/e17af95d697be62796c57d03385b0c74b9d2d580))
-
-# [3.1.0](https://github.com/sapphiredev/shapeshift/compare/v3.0.0...v3.1.0) - (2022-06-04)
-
-## 🐛 Bug Fixes
-
-- **ObjectValidator:** Fix #121 (#122) ([ecfad7e](https://github.com/sapphiredev/shapeshift/commit/ecfad7ec2cdd9e0cee0b3e227e55a91b28c29c30))
-
-## 📝 Documentation
-
-- **readme:** Clarify the difference between validations and schemas and add table of contents (#108) ([dc492a3](https://github.com/sapphiredev/shapeshift/commit/dc492a395349cc5bc680f313146127ea510b4ada))
-
-## 🚀 Features
-
-- **StringValidator:** Add date string checks (#106) ([1b72907](https://github.com/sapphiredev/shapeshift/commit/1b729078be32a88aeddf574c9cff3098990d4f94))
-
-# [3.0.0](https://github.com/sapphiredev/shapeshift/compare/v2.2.0...v3.0.0) - (2022-05-06)
-
-## 🏃 Performance
-
-- Speed up object validation a LOT (#101) ([817278e](https://github.com/sapphiredev/shapeshift/commit/817278e6a3ac128ca342e5ae1737f40b98788c37))
-
-## 🐛 Bug Fixes
-
-- Expand method names (#100) ([741490f](https://github.com/sapphiredev/shapeshift/commit/741490fb6907f618fa25fe53808f7dcb5a59a96c))}
-
- ### 💥 Breaking Changes:
- - `date.eq` has been renamed to `date.equal`
- - `string.lengthLt` has been renamed to `string.lengthLessThan`
- - `string.lengthLe` has been renamed to `string.lengthLessThanOrEqual`
- - `string.lengthGt` has been renamed to `string.lengthGreaterThan`
- - `string.lengthGe` has been renamed to `string.lengthGreaterThanOrEqual`
- - `string.lengthEq` has been renamed to `string.lengthEqual`
- - `string.lengthNe` has been renamed to `string.lengthNotEqual`
- - `number.gt` has been renamed to `number.greaterThan`
- - `number.ge` has been renamed to `number.greaterThanOrEqual`
- - `number.lt` has been renamed to `number.lessThan`
- - `number.le` has been renamed to `number.lessThanOrEqual`
- - `number.eq` has been renamed to `number.equal`
- - `number.ne` has been renamed to `number.notEqual`
- - `bigint.gt` has been renamed to `bigint.greaterThan`
- - `bigint.ge` has been renamed to `bigint.greaterThanOrEqual`
- - `bigint.lt` has been renamed to `bigint.lessThan`
- - `bigint.le` has been renamed to `bigint.lessThanOrEqual`
- - `bigint.eq` has been renamed to `bigint.equal`
- - `bigint.ne` has been renamed to `bigint.notEqual`
- - `boolean.eq` has been renamed to `boolean.equal`
- - `boolean.ne` has been renamed to `boolean.notEqual`
- - `array.lengthLt` has been renamed to `array.lengthLessThan`
- - `array.lengthLe` has been renamed to `array.lengthLessThanOrEqual`
- - `array.lengthGt` has been renamed to `array.lengthGreaterThan`
- - `array.lengthGe` has been renamed to `array.lengthGreaterThanOrEqual`
- - `array.lengthEq` has been renamed to `array.lengthEqual`
- - `array.lengthNe` has been renamed to `array.lengthNotEqual`
- - `typedArray.lengthLt` has been renamed to `typedArray.lengthLessThan`
- - `typedArray.lengthLe` has been renamed to `typedArray.lengthLessThanOrEqual`
- - `typedArray.lengthGt` has been renamed to `typedArray.lengthGreaterThan`
- - `typedArray.lengthGe` has been renamed to `typedArray.lengthGreaterThanOrEqual`
- - `typedArray.lengthEq` has been renamed to `typedArray.lengthEqual`
- - `typedArray.lengthNe` has been renamed to `typedArray.lengthNotEqual`
- - `typedArray.byteLengthLt` has been renamed to `typedArray.byteLengthLessThan`
- - `typedArray.byteLengthLe` has been renamed to `typedArray.byteLengthLessThanOrEqual`
- - `typedArray.byteLengthGt` has been renamed to `typedArray.byteLengthGreaterThan`
- - `typedArray.byteLengthGe` has been renamed to `typedArray.byteLengthGreaterThanOrEqual`
- - `typedArray.byteLengthEq` has been renamed to `typedArray.byteLengthEqual`
- - `typedArray.byteLengthNe` has been renamed to `typedArray.byteLengthNotEqual`
-
-- **ObjectValidator:** Don't run validation on arrays (#99) ([c83b3d0](https://github.com/sapphiredev/shapeshift/commit/c83b3d03a201d38cc230d9c831ca1d9b66ca533b))
-
-## 🚀 Features
-
-- Add 2 utility types inspired by yup and co (#102) ([2fef902](https://github.com/sapphiredev/shapeshift/commit/2fef9026c30f2f1825aa55511d0ab088a3dd13ab))
-
-# [2.2.0](https://github.com/sapphiredev/shapeshift/compare/v2.0.0...v2.2.0) - (2022-04-29)
-
-## Bug Fixes
-
-- Ensure `BaseError` is exported as value (#95) ([335d799](https://github.com/sapphiredev/shapeshift/commit/335d799ef7a8c1a19a12e3eeec07e6d210db113d))
-
-## Documentation
-
-- **readme:** Add todo notice for `reshape` and `function` validations (#75) ([d5f16f6](https://github.com/sapphiredev/shapeshift/commit/d5f16f615de83503187dc834c6245fafbf138f5e))
-
-## Features
-
-- Add Typed Array (#78) ([ca5ea5f](https://github.com/sapphiredev/shapeshift/commit/ca5ea5f568084bd5d3aa004911d4ea64329e1a89))
-
-## Performance
-
-- Optimize `NativeEnum` (#79) ([e9ae280](https://github.com/sapphiredev/shapeshift/commit/e9ae280f73e9ea08239bd8bd22165fe0b2178f82))
-
-# [@sapphire/shapeshift@2.1.0](https://github.com/sapphiredev/shapeshift/compare/v2.0.0...@sapphire/shapeshift@2.1.0) - (2022-04-24)
-
-## Documentation
-
-- **readme:** Add todo notice for `reshape` and `function` validations (#75) ([d5f16f6](https://github.com/sapphiredev/shapeshift/commit/d5f16f615de83503187dc834c6245fafbf138f5e))
-
-## Performance
-
-- Optimize `NativeEnum` (#79) ([e9ae280](https://github.com/sapphiredev/shapeshift/commit/e9ae280f73e9ea08239bd8bd22165fe0b2178f82))
-
-## [2.0.0](https://github.com/sapphiredev/shapeshift/compare/v1.0.0...v2.0.0) (2022-03-13)
-
-### Features
-
-- add `default` ([#25](https://github.com/sapphiredev/shapeshift/issues/25)) ([378c51f](https://github.com/sapphiredev/shapeshift/commit/378c51fb4ba2c501fd782387169db888d6bfe662))
-- add bigint methods ([#32](https://github.com/sapphiredev/shapeshift/issues/32)) ([4c444c1](https://github.com/sapphiredev/shapeshift/commit/4c444c15657c4610b99481b6dec9812bd136d72b))
-- add MapValidator ([#21](https://github.com/sapphiredev/shapeshift/issues/21)) ([c4d1258](https://github.com/sapphiredev/shapeshift/commit/c4d12586762d446b858454077b66635d9d11e2d6))
-- add NativeEnum validator ([#54](https://github.com/sapphiredev/shapeshift/issues/54)) ([7359042](https://github.com/sapphiredev/shapeshift/commit/7359042843d1119f396ac2c038aaff89dbd90c8e))
-- add RecordValidator ([#20](https://github.com/sapphiredev/shapeshift/issues/20)) ([8727427](https://github.com/sapphiredev/shapeshift/commit/8727427be4656792eebcdc5bddf6bcd61bc7e846))
-- add remaining string validations ([#38](https://github.com/sapphiredev/shapeshift/issues/38)) ([1c2fd7b](https://github.com/sapphiredev/shapeshift/commit/1c2fd7bbb20463f09ac461b697c312bec6ae9195))
-- add tuple ([#39](https://github.com/sapphiredev/shapeshift/issues/39)) ([b7704bf](https://github.com/sapphiredev/shapeshift/commit/b7704bf87cf5225021408cf4a6b9ceff8cba25b3))
-- added number transformers ([#17](https://github.com/sapphiredev/shapeshift/issues/17)) ([89a8ddd](https://github.com/sapphiredev/shapeshift/commit/89a8ddd8583774e68c43260c28ee1589ef44516c))
-- allow the use of module: NodeNext ([#55](https://github.com/sapphiredev/shapeshift/issues/55)) ([e6827c5](https://github.com/sapphiredev/shapeshift/commit/e6827c5a12b6a2803a137b71fe4c21bd1c35034b))
-- **array:** add array length Comparators ([#40](https://github.com/sapphiredev/shapeshift/issues/40)) ([1e564c2](https://github.com/sapphiredev/shapeshift/commit/1e564c204b6c9b0a798b3121d31dd4cc99165f60))
-- **Array:** generate tuple types with given length ([#52](https://github.com/sapphiredev/shapeshift/issues/52)) ([793648b](https://github.com/sapphiredev/shapeshift/commit/793648b4cde1f72c5b735ceebb0c48272179be06))
-- **ArrayValidator:** add length ranges ([#53](https://github.com/sapphiredev/shapeshift/issues/53)) ([e431d62](https://github.com/sapphiredev/shapeshift/commit/e431d6218b86fc1480fce14c4466cb36567cad2f))
-- display the property that errored ([#35](https://github.com/sapphiredev/shapeshift/issues/35)) ([fe188b0](https://github.com/sapphiredev/shapeshift/commit/fe188b0d17eeaa5f73b08085562903e23e91717c))
-- improve how errors are returned ([#29](https://github.com/sapphiredev/shapeshift/issues/29)) ([8bc7669](https://github.com/sapphiredev/shapeshift/commit/8bc7669a1a66a10449b321cc4447e411383977d9))
-- **s.object:** add passthrough ([#66](https://github.com/sapphiredev/shapeshift/issues/66)) ([ee9f6f3](https://github.com/sapphiredev/shapeshift/commit/ee9f6f367e513c0120a04cfafe05057c7907c327))
-
-### Bug Fixes
-
-- copy/paste error and `ge` ([#22](https://github.com/sapphiredev/shapeshift/issues/22)) ([fe6505f](https://github.com/sapphiredev/shapeshift/commit/fe6505f8e698bcaf9f8024b2d8f012559827cbb0))
-- fix union type and add test ([#41](https://github.com/sapphiredev/shapeshift/issues/41)) ([fbcf8a9](https://github.com/sapphiredev/shapeshift/commit/fbcf8a9c617c16b33fdddb0a44aa0fe506164fd3))
-- **s.union:** fix union overrides ([#62](https://github.com/sapphiredev/shapeshift/issues/62)) ([56e9b19](https://github.com/sapphiredev/shapeshift/commit/56e9b1947d9b2b129dbed374671114b2242e6d35))
-
-## 1.0.0 (2022-01-16)
-
-### Features
-
-- added more primitives ([#2](https://github.com/sapphiredev/shapeshift/issues/2)) ([16af17b](https://github.com/sapphiredev/shapeshift/commit/16af17b5d9ee40dce284ee120e0b099f7b2cc0b8))
-- added more things ([7c73d82](https://github.com/sapphiredev/shapeshift/commit/7c73d82cf3740d5b2d4eebcac7767da9d3562437))
-- added ObjectValidator ([#3](https://github.com/sapphiredev/shapeshift/issues/3)) ([abe7ead](https://github.com/sapphiredev/shapeshift/commit/abe7eaddee981ef485713ff5e7b7f32ff97c645b))
-
-### Bug Fixes
-
-- resolved install error ([a5abe13](https://github.com/sapphiredev/shapeshift/commit/a5abe1362bb6d9ce6d6471bffa47fe8983b0d1a4))
diff --git a/example_bot/node_modules/@sapphire/shapeshift/LICENSE.md b/example_bot/node_modules/@sapphire/shapeshift/LICENSE.md
deleted file mode 100644
index 95a4396..0000000
--- a/example_bot/node_modules/@sapphire/shapeshift/LICENSE.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# The MIT License (MIT)
-
-Copyright © `2021` `The Sapphire Community and its contributors`
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the “Software”), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/example_bot/node_modules/@sapphire/shapeshift/README.md b/example_bot/node_modules/@sapphire/shapeshift/README.md
deleted file mode 100644
index c9f113f..0000000
--- a/example_bot/node_modules/@sapphire/shapeshift/README.md
+++ /dev/null
@@ -1,934 +0,0 @@
-
-
-
-
-# @sapphire/shapeshift
-
-**Shapeshift**
-
-Blazing fast input validation and transformation ⚡
-
-[](https://github.com/sapphiredev/shapeshift/blob/main/LICENSE.md)
-[](https://codecov.io/gh/sapphiredev/shapeshift)
-[](https://www.npmjs.com/package/@sapphire/shapeshift)
-
-
-
-## Table of Contents
-
-- [@sapphire/shapeshift](#sapphireshapeshift)
- - [Table of Contents](#table-of-contents)
- - [Description](#description)
- - [Features](#features)
- - [Usage](#usage)
- - [Basic usage](#basic-usage)
- - [Defining validations](#defining-validations)
- - [Primitives](#primitives)
- - [Literals](#literals)
- - [Strings](#strings)
- - [Numbers](#numbers)
- - [BigInts](#bigints)
- - [Booleans](#booleans)
- - [Arrays](#arrays)
- - [Tuples](#tuples)
- - [Unions](#unions)
- - [Enums](#enums)
- - [Maps](#maps)
- - [Sets](#sets)
- - [Instances](#instances)
- - [Records](#records)
- - [Functions // TODO](#functions--todo)
- - [TypedArray](#typedarray)
- - [Defining schemas (objects)](#defining-schemas-objects)
- - [Utility types for TypeScript](#utility-types-for-typescript)
- - [Extracting an interface from a schema](#extracting-an-interface-from-a-schema)
- - [Defining the structure of a schema through an interface](#defining-the-structure-of-a-schema-through-an-interface)
- - [`.extend`:](#extend)
- - [`.pick` / `.omit`:](#pick--omit)
- - [`.partial`](#partial)
- - [`.required`](#required)
- - [Handling unrecognized keys](#handling-unrecognized-keys)
- - [`.strict`](#strict)
- - [`.ignore`](#ignore)
- - [`.passthrough`](#passthrough)
- - [BaseValidator: methods and properties](#basevalidator-methods-and-properties)
- - [`.run`](#rundata-unknown-resultt-error-given-a-validation-you-can-call-this-method-to-check-whether-or-not-the)
- - [`.parse`](#parsedata-unknown-t-given-a-validations-you-can-call-this-method-to-check-whether-or-not-the-input-is-valid)
- - [`.transform`](#transformrvalue-t--r-nopvalidatorr-adds-a-constraint-that-modifies-the-input)
- - [`.reshape`](#reshapervalue-t--resultr-error--iconstraint-nopvalidatorr-adds-a-constraint-able-to-both-validate)
- - [`.default`](#defaultvalue-t----t-transform-undefined-into-the-given-value-or-the-callbacks-returned-value)
- - [`.optional`](#optional-a-convenience-method-that-returns-a-union-of-the-type-with-sundefined)
- - [`.nullable`](#nullable-a-convenience-method-that-returns-a-union-of-the-type-with-snullable)
- - [`.nullish`](#nullish-a-convenience-method-that-returns-a-union-of-the-type-with-snullish)
- - [`.array`](#array-a-convenience-method-that-returns-an-arrayvalidator-with-the-type)
- - [`.or`](#or-a-convenience-method-that-returns-an-unionvalidator-with-the-type-this-method-is-also-overridden-in)
- - [`.when`](#when-adjust-the-schema-based-on-a-sibling-or-sinbling-children-fields)
- - [Available options for providing `is`](#available-options-for-providing-is)
- - [Resolving of the `key` (first) parameter](#resolving-of-the-key-first-parameter)
- - [Examples](#examples)
- - [Enabling and disabling validation](#enabling-and-disabling-validation)
- - [Buy us some doughnuts](#buy-us-some-doughnuts)
- - [Contributors](#contributors)
-
-## Description
-
-[Back to top][toc]
-
-A very fast and lightweight input validation and transformation library for JavaScript.
-
-> **Note**: Shapeshift requires Node.js v14.0.0 or higher to work.
-
-## Features
-
-[Back to top][toc]
-
-- TypeScript friendly
-- Offers CJS, ESM and UMD builds
-- API similar to [`zod`]
-- Faster than ⚡
-
-## Usage
-
-[Back to top][toc]
-
-**_For complete usages, please dive into our [documentation]_**
-
-### Basic usage
-
-[Back to top][toc]
-
-Creating a simple string validation
-
-```typescript
-import { s } from '@sapphire/shapeshift';
-
-const myStringValidation = s.string;
-
-// Parse
-myStringValidation.parse('sapphire'); // => returns 'sapphire'
-myStringValidation.parse(12); // throws ValidationError
-```
-
-Creating an object schema
-
-```typescript
-import { s } from '@sapphire/shapeshift';
-
-const user = s.object({
- username: s.string
-});
-
-user.parse({ username: 'Sapphire' });
-```
-
-### Defining validations
-
-[Back to top][toc]
-
-#### Primitives
-
-[Back to top][toc]
-
-```typescript
-import { s } from '@sapphire/shapeshift';
-
-// Primitives
-s.string;
-s.number;
-s.bigint;
-s.boolean;
-s.date;
-
-// Empty Types
-s.undefined;
-s.null;
-s.nullish; // Accepts undefined | null
-
-// Catch-all Types
-s.any;
-s.unknown;
-
-// Never Type
-s.never;
-```
-
-#### Literals
-
-[Back to top][toc]
-
-```typescript
-s.literal('sapphire');
-s.literal(12);
-s.literal(420n);
-s.literal(true);
-s.literal(new Date(1639278160000)); // s.date.equal(1639278160000);
-```
-
-#### Strings
-
-[Back to top][toc]
-
-Shapeshift includes a handful of string-specific validations:
-
-```typescript
-s.string.lengthLessThan(5);
-s.string.lengthLessThanOrEqual(5);
-s.string.lengthGreaterThan(5);
-s.string.lengthGreaterThanOrEqual(5);
-s.string.lengthEqual(5);
-s.string.lengthNotEqual(5);
-s.string.email;
-s.string.url();
-s.string.uuid();
-s.string.regex(regex);
-s.string.ip();
-s.string.ipv4;
-s.string.ipv6;
-s.string.phone();
-```
-
-#### Numbers
-
-[Back to top][toc]
-
-Shapeshift includes a handful of number-specific validations:
-
-```typescript
-s.number.greaterThan(5); // > 5
-s.number.greaterThanOrEqual(5); // >= 5
-s.number.lessThan(5); // < 5
-s.number.lessThanOrEqual(5); // <= 5
-s.number.equal(5); // === 5
-s.number.notEqual(5); // !== 5
-
-s.number.equal(NaN); // special case: Number.isNaN
-s.number.notEqual(NaN); // special case: !Number.isNaN
-
-s.number.int; // value must be an integer
-s.number.safeInt; // value must be a safe integer
-s.number.finite; // value must be finite
-
-s.number.positive; // .greaterThanOrEqual(0)
-s.number.negative; // .lessThan(0)
-
-s.number.divisibleBy(5); // Divisible by 5
-```
-
-And transformations:
-
-```typescript
-s.number.abs; // Transforms the number to an absolute number
-s.number.sign; // Gets the number's sign
-
-s.number.trunc; // Transforms the number to the result of `Math.trunc`
-s.number.floor; // Transforms the number to the result of `Math.floor`
-s.number.fround; // Transforms the number to the result of `Math.fround`
-s.number.round; // Transforms the number to the result of `Math.round`
-s.number.ceil; // Transforms the number to the result of `Math.ceil`
-```
-
-#### BigInts
-
-[Back to top][toc]
-
-Shapeshift includes a handful of number-specific validations:
-
-```typescript
-s.bigint.greaterThan(5n); // > 5n
-s.bigint.greaterThanOrEqual(5n); // >= 5n
-s.bigint.lessThan(5n); // < 5n
-s.bigint.lessThanOrEqual(5n); // <= 5n
-s.bigint.equal(5n); // === 5n
-s.bigint.notEqual(5n); // !== 5n
-
-s.bigint.positive; // .greaterThanOrEqual(0n)
-s.bigint.negative; // .lessThan(0n)
-
-s.bigint.divisibleBy(5n); // Divisible by 5n
-```
-
-And transformations:
-
-```typescript
-s.bigint.abs; // Transforms the bigint to an absolute bigint
-
-s.bigint.intN(5); // Clamps to a bigint to a signed bigint with 5 digits, see BigInt.asIntN
-s.bigint.uintN(5); // Clamps to a bigint to an unsigned bigint with 5 digits, see BigInt.asUintN
-```
-
-#### Booleans
-
-[Back to top][toc]
-
-Shapeshift includes a few boolean-specific validations:
-
-```typescript
-s.boolean.true; // value must be true
-s.boolean.false; // value must be false
-
-s.boolean.equal(true); // s.boolean.true
-s.boolean.equal(false); // s.boolean.false
-
-s.boolean.notEqual(true); // s.boolean.false
-s.boolean.notEqual(false); // s.boolean.true
-```
-
-#### Arrays
-
-[Back to top][toc]
-
-```typescript
-const stringArray = s.array(s.string);
-const stringArray = s.string.array;
-```
-
-Shapeshift includes a handful of array-specific validations:
-
-```typescript
-s.string.array.lengthLessThan(5); // Must have less than 5 elements
-s.string.array.lengthLessThanOrEqual(5); // Must have 5 or less elements
-s.string.array.lengthGreaterThan(5); // Must have more than 5 elements
-s.string.array.lengthGreaterThanOrEqual(5); // Must have 5 or more elements
-s.string.array.lengthEqual(5); // Must have exactly 5 elements
-s.string.array.lengthNotEqual(5); // Must not have exactly 5 elements
-s.string.array.lengthRange(0, 4); // Must have at least 0 elements and less than 4 elements (in math, that is [0, 4))
-s.string.array.lengthRangeInclusive(0, 4); // Must have at least 0 elements and at most 4 elements (in math, that is [0, 4])
-s.string.array.lengthRangeExclusive(0, 4); // Must have more than 0 element and less than 4 elements (in math, that is (0, 4))
-s.string.array.unique; // All elements must be unique. Deep equality is used to check for uniqueness.
-```
-
-> **Note**: All `.length` methods define tuple types with the given amount of elements. For example,
-> `s.string.array.lengthGreaterThanOrEqual(2)`'s inferred type is `[string, string, ...string[]]`
-
-#### Tuples
-
-[Back to top][toc]
-
-Unlike arrays, tuples have a fixed number of elements and each element can have a different type:
-
-```typescript
-const dish = s.tuple([
- s.string, // Dish's name
- s.number.int, // Table's number
- s.date // Date the dish was ready for delivery
-]);
-
-dish.parse(['Iberian ham', 10, new Date()]);
-```
-
-#### Unions
-
-[Back to top][toc]
-
-Shapeshift includes a built-in method for composing OR types:
-
-```typescript
-const stringOrNumber = s.union(s.string, s.number);
-
-stringOrNumber.parse('Sapphire'); // => 'Sapphire'
-stringOrNumber.parse(42); // => 42
-stringOrNumber.parse({}); // => throws CombinedError
-```
-
-#### Enums
-
-[Back to top][toc]
-
-Enums are a convenience method that aliases `s.union(s.literal(a), s.literal(b), ...)`:
-
-```typescript
-s.enum('Red', 'Green', 'Blue');
-// s.union(s.literal('Red'), s.literal('Green'), s.literal('Blue'));
-```
-
-#### Maps
-
-[Back to top][toc]
-
-```typescript
-const map = s.map(s.string, s.number);
-// Map
-```
-
-#### Sets
-
-[Back to top][toc]
-
-```typescript
-const set = s.set(s.number);
-// Set
-```
-
-#### Instances
-
-[Back to top][toc]
-
-You can use `s.instance(Class)` to check that the input is an instance of a class. This is useful to validate inputs
-against classes:
-
-```typescript
-class User {
- public constructor(public name: string) {}
-}
-
-const userInstanceValidation = s.instance(User);
-userInstanceValidation.parse(new User('Sapphire')); // => User { name: 'Sapphire' }
-userInstanceValidation.parse('oops'); // => throws ValidatorError
-```
-
-#### Records
-
-[Back to top][toc]
-
-Record validations are similar to objects, but validate `Record` types. Keep in mind this does not check for
-the keys, and cannot support validation for specific ones:
-
-```typescript
-const tags = s.record(s.string);
-
-tags.parse({ foo: 'bar', hello: 'world' }); // => { foo: 'bar', hello: 'world' }
-tags.parse({ foo: 42 }); // => throws CombinedError
-tags.parse('Hello'); // => throws ValidateError
-```
-
----
-
-_**Function validation is not yet implemented and will be made available starting v2.1.0**_
-
-#### Functions // TODO
-
-[Back to top][toc]
-
-You can define function validations. This checks for whether or not an input is a function:
-
-```typescript
-s.function; // () => unknown
-```
-
-You can define arguments by passing an array as the first argument, as well as the return type as the second:
-
-```typescript
-s.function([s.string]); // (arg0: string) => unknown
-s.function([s.string, s.number], s.string); // (arg0: string, arg1: number) => string
-```
-
-> **Note**: Shapeshift will transform the given function into one with validation on arguments and output. You can
-> access the `.raw` property of the function to get the unchecked function.
-
----
-
-#### TypedArray
-
-[Back to top][toc]
-
-```ts
-const typedArray = s.typedArray();
-const int16Array = s.int16Array;
-const uint16Array = s.uint16Array;
-const uint8ClampedArray = s.uint8ClampedArray;
-const int16Array = s.int16Array;
-const uint16Array = s.uint16Array;
-const int32Array = s.int32Array;
-const uint32Array = s.uint32Array;
-const float32Array = s.float32Array;
-const float64Array = s.float64Array;
-const bigInt64Array = s.bigInt64Array;
-const bigUint64Array = s.bigUint64Array;
-```
-
-Shapeshift includes a handful of validations specific to typed arrays.
-
-```typescript
-s.typedArray().lengthLessThan(5); // Length must be less than 5
-s.typedArray().lengthLessThanOrEqual(5); // Length must be 5 or less
-s.typedArray().lengthGreaterThan(5); // Length must be more than 5
-s.typedArray().lengthGreaterThanOrEqual(5); // Length must be 5 or more
-s.typedArray().lengthEqual(5); // Length must be exactly 5
-s.typedArray().lengthNotEqual(5); // Length must not be 5
-s.typedArray().lengthRange(0, 4); // Length L must satisfy 0 <= L < 4
-s.typedArray().lengthRangeInclusive(0, 4); // Length L must satisfy 0 <= L <= 4
-s.typedArray().lengthRangeExclusive(0, 4); // Length L must satisfy 0 < L < 4
-```
-
-Note that all of these methods have analogous methods for working with the typed array's byte length,
-`s.typedArray().byteLengthX()` - for instance, `s.typedArray().byteLengthLessThan(5)` is the same as
-`s.typedArray().lengthLessThan(5)` but for the array's byte length.
-
----
-
-### Defining schemas (objects)
-
-[Back to top][toc]
-
-```typescript
-// Properties are required by default:
-const animal = s.object({
- name: s.string,
- age: s.number
-});
-```
-
-#### Utility types for TypeScript
-
-[Back to top][toc]
-
-For object validation Shapeshift exports 2 utility types that can be used to extract interfaces from schemas and define
-the structure of a schema as an interface beforehand respectively.
-
-##### Extracting an interface from a schema
-
-[Back to top][toc]
-
-You can use the `InferType` type to extract the interface from a schema, for example:
-
-```typescript
-import { InferType, s } from '@sapphire/shapeshift';
-
-const schema = s.object({
- foo: s.string,
- bar: s.number,
- baz: s.boolean,
- qux: s.bigint,
- quux: s.date
-});
-
-type Inferredtype = InferType;
-
-// Expected type:
-type Inferredtype = {
- foo: string;
- bar: number;
- baz: boolean;
- qux: bigint;
- quux: Date;
-};
-```
-
-##### Defining the structure of a schema through an interface
-
-[Back to top][toc]
-
-You can use the `SchemaOf` type to define the structure of a schema before defining the actual schema, for example:
-
-```typescript
-import { s, SchemaOf } from '@sapphire/shapeshift';
-
-interface IIngredient {
- ingredientId: string | undefined;
- name: string | undefined;
-}
-
-interface IInstruction {
- instructionId: string | undefined;
- message: string | undefined;
-}
-
-interface IRecipe {
- recipeId: string | undefined;
- title: string;
- description: string;
- instructions: IInstruction[];
- ingredients: IIngredient[];
-}
-
-type InstructionSchemaType = SchemaOf;
-// Expected Type: ObjectValidator
-
-type IngredientSchemaType = SchemaOf;
-// Expected Type: ObjectValidator
-
-type RecipeSchemaType = SchemaOf;
-// Expected Type: ObjectValidator
-
-const instructionSchema: InstructionSchemaType = s.object({
- instructionId: s.string.optional,
- message: s.string
-});
-
-const ingredientSchema: IngredientSchemaType = s.object({
- ingredientId: s.string.optional,
- name: s.string
-});
-
-const recipeSchema: RecipeSchemaType = s.object({
- recipeId: s.string.optional,
- title: s.string,
- description: s.string,
- instructions: s.array(instructionSchema),
- ingredients: s.array(ingredientSchema)
-});
-```
-
-#### `.extend`:
-
-[Back to top][toc]
-
-You can add additional fields using either an object or an ObjectValidator, in this case, you will get a new object
-validator with the merged properties:
-
-```typescript
-const animal = s.object({
- name: s.string.optional,
- age: s.number
-});
-
-const pet = animal.extend({
- owner: s.string.nullish
-});
-
-const pet = animal.extend(
- s.object({
- owner: s.string.nullish
- })
-);
-```
-
-> If both schemas share keys, an error will be thrown. Please use `.omit` on the first object if you desire this
-> behaviour.
-
-#### `.pick` / `.omit`:
-
-[Back to top][toc]
-
-Inspired by TypeScript's built-in `Pick` and `Omit` utility types, all object schemas have the aforementioned methods
-that return a modifier version:
-
-```typescript
-const pkg = s.object({
- name: s.string,
- description: s.string,
- dependencies: s.string.array
-});
-
-const justTheName = pkg.pick(['name']);
-// s.object({ name: s.string });
-
-const noDependencies = pkg.omit(['dependencies']);
-// s.object({ name: s.string, description: s.string });
-```
-
-#### `.partial`
-
-[Back to top][toc]
-
-Inspired by TypeScript's built-in `Partial` utility type, all object schemas have the aforementioned method that makes
-all properties optional:
-
-```typescript
-const user = s.object({
- username: s.string,
- password: s.string
-}).partial;
-```
-
-Which is the same as doing:
-
-```typescript
-const user = s.object({
- username: s.string.optional,
- password: s.string.optional
-});
-```
-
----
-
-#### `.required`
-
-[Back to top][toc]
-
-Inspired by TypeScript's built-in `Required` utility type, all object schemas have the aforementioned method that makes
-all properties required:
-
-```typescript
-const user = s.object({
- username: s.string.optional,
- password: s.string.optional
-}).required;
-```
-
-Which is the same as doing:
-
-```typescript
-const user = s.object({
- username: s.string,
- password: s.string
-});
-```
-
----
-
-### Handling unrecognized keys
-
-[Back to top][toc]
-
-By default, Shapeshift will not include keys that are not defined by the schema during parsing:
-
-```typescript
-const person = s.object({
- framework: s.string
-});
-
-person.parse({
- framework: 'Sapphire',
- awesome: true
-});
-// => { name: 'Sapphire' }
-```
-
-#### `.strict`
-
-[Back to top][toc]
-
-You can disallow unknown keys with `.strict`. If the input includes any unknown keys, an error will be thrown.
-
-```typescript
-const person = s.object({
- framework: s.string
-}).strict;
-
-person.parse({
- framework: 'Sapphire',
- awesome: true
-});
-// => throws ValidationError
-```
-
-#### `.ignore`
-
-[Back to top][toc]
-
-You can use the `.ignore` getter to reset an object schema to the default behaviour (ignoring unrecognized keys).
-
-#### `.passthrough`
-
-[Back to top][toc]
-
-You can use the `.passthrough` getter to make the validator add the unrecognized properties the shape does not have,
-from the input.
-
----
-
-### BaseValidator: methods and properties
-
-[Back to top][toc]
-
-All validations in Shapeshift contain certain methods.
-
-- #### `.run(data: unknown): Result`: given a validation, you can call this method to check whether or not the
-
- input is valid. If it is, a `Result` with `success: true` and a deep-cloned value will be returned with the given
- constraints and transformations. Otherwise, a `Result` with `success: false` and an error is returned.
-
-- #### `.parse(data: unknown): T`: given a validations, you can call this method to check whether or not the input is valid.
-
- If it is, a deep-cloned value will be returned with the given constraints and transformations. Otherwise, an error is
- thrown.
-
-- #### `.transform((value: T) => R): NopValidator`: adds a constraint that modifies the input:
-
-```typescript
-import { s } from '@sapphire/shapeshift';
-
-const getLength = s.string.transform((value) => value.length);
-getLength.parse('Hello There'); // => 11
-```
-
-> :warning: `.transform`'s functions **must not throw**. If a validation error is desired to be thrown, `.reshape`
-> instead.
-
-- #### `.reshape((value: T) => Result | IConstraint): NopValidator`: adds a constraint able to both validate
- and modify the input:
-
-```typescript
-import { s, Result } from '@sapphire/shapeshift';
-
-const getLength = s.string.reshape((value) => Result.ok(value.length));
-getLength.parse('Hello There'); // => 11
-```
-
-> :warning: `.reshape`'s functions **must not throw**. If a validation error is desired to be thrown, use
-> `Result.err(error)` instead.
-
-- #### `.default(value: T | (() => T))`: transform `undefined` into the given value or the callback's returned value:
-
-```typescript
-const name = s.string.default('Sapphire');
-name.parse('Hello'); // => 'Hello'
-name.parse(undefined); // => 'Sapphire'
-```
-
-```typescript
-const number = s.number.default(Math.random);
-number.parse(12); // => 12
-number.parse(undefined); // => 0.989911985608602
-number.parse(undefined); // => 0.3224350185068794
-```
-
-> :warning: The default values are not validated.
-
-- #### `.optional`: a convenience method that returns a union of the type with `s.undefined`.
-
-```typescript
-s.string.optional; // s.union(s.string, s.undefined)
-```
-
-- #### `.nullable`: a convenience method that returns a union of the type with `s.nullable`.
-
-```typescript
-s.string.nullable; // s.union(s.string, s.nullable)
-```
-
-- #### `.nullish`: a convenience method that returns a union of the type with `s.nullish`.
-
-```typescript
-s.string.nullish; // s.union(s.string, s.nullish)
-```
-
-- #### `.array`: a convenience method that returns an ArrayValidator with the type.
-
-```typescript
-s.string.array; // s.array(s.string)
-```
-
-- #### `.or`: a convenience method that returns an UnionValidator with the type. This method is also overridden in
- UnionValidator to just append one more entry.
-
-```typescript
-s.string.or(s.number);
-// => s.union(s.string, s.number)
-
-s.object({ name: s.string }).or(s.string, s.number);
-// => s.union(s.object({ name: s.string }), s.string, s.number)
-```
-
-- #### `.when`: Adjust the schema based on a sibling or sinbling children fields.
-
-For using when you provide an object literal where the key `is` is undefined, a value, or a matcher function; `then`
-provides the schema when `is` resolves truthy, and `otherwise` provides the schema when `is` resolves falsey.
-
-##### Available options for providing `is`
-
-When `is` is not provided (`=== undefined`) it is strictly resolved as `Boolean(value)` wherein `value` is the current
-value of the referenced sibling. Note that if multiple siblings are referenced then all the values of the array need to
-resolve truthy for the `is` to resolve truthy.
-
-When `is` is a primitive literal it is strictly compared (`===`) to the current value.
-
-If you want to use a different form of equality you can provide a function like: `is: (value) => value === true`.
-
-##### Resolving of the `key` (first) parameter
-
-For resolving the `key` parameter to its respective value we use [lodash/get](https://lodash.com/docs#get). This means
-that every way that Lodash supports resolving a key to its respective value is also supported by Shapeshift. This
-includes:
-
-- Simply providing a string or number like `'name'` or `1`.
-- Providing a string or number with a dot notation like `'name.first'` (representative of a nested object structure of
- `{ 'name': { 'first': 'Sapphire' } }` => resolves to `Sapphire`).
-- Providing a string or number with a bracket notation like `'name[0]'` (representative of an array structure of
- `{ 'name': ['Sapphire', 'Framework'] }` => resolves to `Sapphire`).
-- Providing a string or number with a dot and bracket notation like `'name[1].first'` (representative of a nested object
- structure of `{ 'name': [{ 'first': 'Sapphire' }, { 'first': 'Framework' }] }` => resolves to `Framework`).
-
-##### Examples
-
-Let's start with a basic example:
-
-```typescript
-const whenPredicate = s.object({
- booleanLike: s.boolean,
- numberLike: s.number.when('booleanLike', {
- then: (schema) => schema.greaterThanOrEqual(5),
- otherwise: (schema) => schema.lessThanOrEqual(5)
- })
-});
-
-whenPredicate.parse({ booleanLike: true, numberLike: 6 });
-// => { booleanLike: true, numberLike: 6 }
-
-whenPredicate.parse({ booleanLike: true, numberLike: 4 });
-// => ExpectedConstraintError('s.number.greaterThanOrEqual', 'Invalid number value', 4, 'expected >= 5')
-
-whenPredicate.parse({ booleanLike: false, numberLike: 4 });
-// => { booleanLike: false, numberLike: 4 }
-```
-
-The provided key can also be an array of sibling children:
-
-```typescript
-const whenPredicate = s.object({
- booleanLike: s.boolean,
- stringLike: s.string,
- numberLike: s.number.when(['booleanLike', 'stringLike'], {
- is: ([booleanLikeValue, stringLikeValue]) => booleanLikeValue === true && stringLikeValue === 'foobar',
- then: (schema) => schema.greaterThanOrEqual(5),
- otherwise: (schema) => schema.lessThanOrEqual(5)
- })
-});
-
-whenPredicate.parse({ booleanLike: true, stringLike: 'foobar', numberLike: 6 });
-// => { booleanLike: true, numberLike: 6 }
-
-whenPredicate.parse({ booleanLike: true, stringLike: 'barfoo', numberLike: 4 });
-// => ExpectedConstraintError('s.number.greaterThanOrEqual', 'Invalid number value', 4, 'expected >= 5')
-
-whenPredicate.parse({ booleanLike: false, stringLike: 'foobar' numberLike: 4 });
-// => ExpectedConstraintError('s.number.greaterThanOrEqual', 'Invalid number value', 4, 'expected >= 5')
-```
-
-### Enabling and disabling validation
-
-[Back to top][toc]
-
-At times, you might want to have a consistent code base with validation, but would like to keep validation to the strict
-necessities instead of the in-depth constraints available in shapeshift. By calling `setGlobalValidationEnabled` you can
-disable validation at a global level, and by calling `setValidationEnabled` you can disable validation on a
-per-validator level.
-
-> When setting the validation enabled status per-validator, you can also set it to `null` to use the global setting.
-
-```typescript
-import { setGlobalValidationEnabled } from '@sapphire/shapeshift';
-
-setGlobalValidationEnabled(false);
-```
-
-```typescript
-import { s } from '@sapphire/shapeshift';
-
-const predicate = s.string.lengthGreaterThan(5).setValidationEnabled(false);
-```
-
-## Buy us some doughnuts
-
-[Back to top][toc]
-
-Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are
-amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
-
-We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons
-below to donate through your method of choice.
-
-| Donate With | Address |
-| :-------------: | :-------------------------------------------------: |
-| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
-| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
-| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
-| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
-
-## Contributors
-
-[Back to top][toc]
-
-Please make sure to read the [Contributing Guide][contributing] before making a pull request.
-
-Thank you to all the people who already contributed to Sapphire!
-
-
-
-
-
-[contributing]: https://github.com/sapphiredev/.github/blob/main/.github/CONTRIBUTING.md
-[`zod`]: https://github.com/colinhacks/zod
-[documentation]: https://www.sapphirejs.dev/docs/Documentation/api-shapeshift/
-[toc]: #table-of-contents
diff --git a/example_bot/node_modules/@sapphire/shapeshift/package.json b/example_bot/node_modules/@sapphire/shapeshift/package.json
deleted file mode 100644
index 7105a09..0000000
--- a/example_bot/node_modules/@sapphire/shapeshift/package.json
+++ /dev/null
@@ -1,125 +0,0 @@
-{
- "name": "@sapphire/shapeshift",
- "version": "3.9.3",
- "description": "Blazing fast input validation and transformation ⚡",
- "author": "@sapphire",
- "license": "MIT",
- "main": "dist/index.js",
- "module": "dist/index.mjs",
- "browser": "dist/index.global.js",
- "unpkg": "dist/index.global.js",
- "types": "dist/index.d.ts",
- "exports": {
- "types": "./dist/index.d.ts",
- "import": "./dist/index.mjs",
- "require": "./dist/index.js"
- },
- "sideEffects": false,
- "homepage": "https://www.sapphirejs.dev",
- "scripts": {
- "lint": "eslint src tests --ext ts --fix",
- "format": "prettier --write \"{src,tests}/**/*.ts\"",
- "docs": "typedoc-json-parser",
- "test": "vitest run",
- "build": "tsup",
- "clean": "node scripts/clean.mjs",
- "typecheck": "tsc -p tsconfig.eslint.json",
- "bump": "cliff-jumper",
- "check-update": "cliff-jumper --dry-run",
- "_postinstall": "husky install .github/husky",
- "prepack": "yarn build && pinst --disable",
- "postpack": "pinst --enable"
- },
- "dependencies": {
- "fast-deep-equal": "^3.1.3",
- "lodash": "^4.17.21"
- },
- "devDependencies": {
- "@commitlint/cli": "^17.7.2",
- "@commitlint/config-conventional": "^17.7.0",
- "@favware/cliff-jumper": "^2.2.0",
- "@favware/npm-deprecate": "^1.0.7",
- "@sapphire/eslint-config": "^5.0.2",
- "@sapphire/prettier-config": "^2.0.0",
- "@sapphire/ts-config": "^5.0.0",
- "@types/jsdom": "^21.1.3",
- "@types/lodash": "^4.14.199",
- "@types/node": "^20.8.5",
- "@typescript-eslint/eslint-plugin": "^6.7.5",
- "@typescript-eslint/parser": "^6.7.5",
- "@vitest/coverage-v8": "^0.34.6",
- "cz-conventional-changelog": "^3.3.0",
- "esbuild-plugins-node-modules-polyfill": "^1.6.1",
- "eslint": "^8.51.0",
- "eslint-config-prettier": "^9.0.0",
- "eslint-plugin-prettier": "^5.0.1",
- "husky": "^8.0.3",
- "jsdom": "^22.1.0",
- "lint-staged": "^14.0.1",
- "pinst": "^3.0.0",
- "prettier": "^3.0.3",
- "ts-node": "^10.9.1",
- "tsup": "^7.2.0",
- "typedoc": "^0.25.2",
- "typedoc-json-parser": "^9.0.1",
- "typescript": "^5.2.2",
- "vite": "^4.4.11",
- "vitest": "^0.34.6"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sapphiredev/shapeshift.git"
- },
- "files": [
- "dist/**/*.js*",
- "dist/**/*.mjs*",
- "dist/**/*.d*"
- ],
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- },
- "keywords": [
- "@sapphire/shapeshift",
- "shapeshift",
- "bot",
- "typescript",
- "ts",
- "yarn",
- "sapphire",
- "schema",
- "validation",
- "type-checking",
- "checking",
- "input-validation",
- "runtime-validation",
- "ow",
- "type-validation",
- "zod"
- ],
- "bugs": {
- "url": "https://github.com/sapphiredev/shapeshift/issues"
- },
- "commitlint": {
- "extends": [
- "@commitlint/config-conventional"
- ]
- },
- "lint-staged": {
- "*": "prettier --ignore-unknown --write",
- "*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
- },
- "config": {
- "commitizen": {
- "path": "./node_modules/cz-conventional-changelog"
- }
- },
- "publishConfig": {
- "access": "public"
- },
- "resolutions": {
- "ansi-regex": "^5.0.1",
- "minimist": "^1.2.8"
- },
- "packageManager": "yarn@3.6.4"
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@sapphire/snowflake/CHANGELOG.md b/example_bot/node_modules/@sapphire/snowflake/CHANGELOG.md
deleted file mode 100644
index 511b056..0000000
--- a/example_bot/node_modules/@sapphire/snowflake/CHANGELOG.md
+++ /dev/null
@@ -1,294 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-# [@sapphire/snowflake@3.5.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.5.0...@sapphire/snowflake@3.5.1) - (2023-05-12)
-
-## 🏠 Refactor
-
-- **snowflake:** Handle out-of-bounds `increment` correctly (#596) ([b5276d7](https://github.com/sapphiredev/utilities/commit/b5276d7372c33356975a302bafb5ae8aba604431))
-
-# [@sapphire/snowflake@3.5.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.4.3...@sapphire/snowflake@3.5.0) - (2023-05-10)
-
-## 🚀 Features
-
-- **snowflake:** Expose `processId` and `workerId` (#595) ([b873c1c](https://github.com/sapphiredev/utilities/commit/b873c1cc3b30cb54d710a49f7618e125ac1132ad))
-
-# [@sapphire/snowflake@3.4.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.4.1...@sapphire/snowflake@3.4.2) - (2023-04-12)
-
-## 🏠 Refactor
-
-- **Snowflake:** Simplify `compare` logic (#578) ([886254e](https://github.com/sapphiredev/utilities/commit/886254eea2f0cc5e8f63d015acffaf0e61489357))
-
-# [@sapphire/snowflake@3.4.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.4.0...@sapphire/snowflake@3.4.1) - (2023-04-10)
-
-## 🐛 Bug Fixes
-
-- **snowflake:** Ensure strings are never compared with bigints ([22199a5](https://github.com/sapphiredev/utilities/commit/22199a5aa0c6150f46e01bfbe328deecb9f818ba))
-- **deps:** Update all non-major dependencies (#577) ([291dd67](https://github.com/sapphiredev/utilities/commit/291dd6783e57d8f075ce566218ba076ef6c4bbbd))
-- **deps:** Update all non-major dependencies (#545) ([40ca040](https://github.com/sapphiredev/utilities/commit/40ca040a21d8a0949682051a3a974538183a400e))
-- **deps:** Update all non-major dependencies (#544) ([cc78f17](https://github.com/sapphiredev/utilities/commit/cc78f17390c7f3db08af92bf46a5a70a9c11dd5f))
-
-## 🧪 Testing
-
-- Cleanup tests ([aec1bb2](https://github.com/sapphiredev/utilities/commit/aec1bb290d0f3c00a1ae4f4c86302ebbb161d348))
-
-# [@sapphire/snowflake@3.4.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.3.0...@sapphire/snowflake@3.4.0) - (2022-12-27)
-
-## 🐛 Bug Fixes
-
-- **deps:** Update all non-major dependencies (#532) ([8033d1f](https://github.com/sapphiredev/utilities/commit/8033d1ff7a5a1974134c61f424f171cccb2915e1))
-
-## 📝 Documentation
-
-- Add @06000208 as a contributor ([fa3349e](https://github.com/sapphiredev/utilities/commit/fa3349e55ce4ad008785211dec7bf8e2b5d933df))
-
-## 🚀 Features
-
-- **snowflake:** Added `Snowflake.compare` (#531) ([6accd6d](https://github.com/sapphiredev/utilities/commit/6accd6d15eab12e312034f8ef43cff032835c972))
-
-# [@sapphire/snowflake@3.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.2.2...@sapphire/snowflake@3.3.0) - (2022-12-03)
-
-## 🏠 Refactor
-
-- Split `@sapphire/time-utilities` into 4 sub-packages (#462) ([574299a](https://github.com/sapphiredev/utilities/commit/574299a99e658f6500a2a7efa587a0919b2d1313))
-
-## 🐛 Bug Fixes
-
-- **snowflake:** TwitterSnowflake using incorrect epoch (#522) ([4ad4117](https://github.com/sapphiredev/utilities/commit/4ad41170488161b2998bd72da5a8b7fea10539a0))
-- **deps:** Update all non-major dependencies (#514) ([21b07d5](https://github.com/sapphiredev/utilities/commit/21b07d5db529a0d982647a60de98e46f36f1ac93))
-- **deps:** Update all non-major dependencies (#505) ([6178296](https://github.com/sapphiredev/utilities/commit/617829649e1e4deeee02b14533b5377cd5bc1fb3))
-- **deps:** Update all non-major dependencies (#466) ([dc08606](https://github.com/sapphiredev/utilities/commit/dc08606a97154e47c65536123ac5f8b1262f7bd2))
-- **deps:** Update all non-major dependencies ([e20f299](https://github.com/sapphiredev/utilities/commit/e20f29906e83cee000aaba9c6827e3bec5173d28))
-- **deps:** Update all non-major dependencies ([2308bd7](https://github.com/sapphiredev/utilities/commit/2308bd74356b6b2e0c12995b25f4d8ade4803fe9))
-- **deps:** Update all non-major dependencies ([84af0db](https://github.com/sapphiredev/utilities/commit/84af0db2db749223b036aa99fe19a2e9af5681c6))
-- **deps:** Update all non-major dependencies ([50cd8de](https://github.com/sapphiredev/utilities/commit/50cd8dea593b6f5ae75571209456b3421e2ca59a))
-
-## 📝 Documentation
-
-- Add @didinele as a contributor ([42ef7b6](https://github.com/sapphiredev/utilities/commit/42ef7b656c48fd0e720119db1d622c8bba2791e9))
-- Add @goestav as a contributor ([0e56a92](https://github.com/sapphiredev/utilities/commit/0e56a92a4e2d0942bfa207f81a8cb03b32312034))
-- Add @CitTheDev as a contributor ([34169ea](https://github.com/sapphiredev/utilities/commit/34169eae1dc0476ccf5a6c4f36e28602a204829e))
-- Add @legendhimslef as a contributor ([059b6f1](https://github.com/sapphiredev/utilities/commit/059b6f1ab5362d46d58624d06c1aa39192b0716f))
-- Add @r-priyam as a contributor ([fb278ba](https://github.com/sapphiredev/utilities/commit/fb278bacf627ec6fc88752eafeb12df5f3177a2c))
-- Change name of @kyranet (#451) ([df4fdef](https://github.com/sapphiredev/utilities/commit/df4fdefce18659975a4ebc224723638507d02d35))
-- Update @RealShadowNova as a contributor ([a869ba0](https://github.com/sapphiredev/utilities/commit/a869ba0abfad041610b9115187d426aebe671af6))
-- Add @muchnameless as a contributor ([a1221fe](https://github.com/sapphiredev/utilities/commit/a1221fea68506e99591d5d00ec552a07c26833f9))
-- Add @enxg as a contributor ([d2382f0](https://github.com/sapphiredev/utilities/commit/d2382f04e3909cb4ad11798a0a10e683f6cf5383))
-- Add @EvolutionX-10 as a contributor ([efc3a32](https://github.com/sapphiredev/utilities/commit/efc3a320a72ae258996dd62866d206c33f8d4961))
-- Add @MajesticString as a contributor ([295b3e9](https://github.com/sapphiredev/utilities/commit/295b3e9849a4b0fe64074bae02f6426378a303c3))
-- Add @Mzato0001 as a contributor ([c790ef2](https://github.com/sapphiredev/utilities/commit/c790ef25df2d7e22888fa9f8169167aa555e9e19))
-
-## 🚀 Features
-
-- **utilities:** Add possibility to import single functions by appending them to the import path. (#454) ([374c145](https://github.com/sapphiredev/utilities/commit/374c145a5dd329cfc1a867ed6720abf408683a88))
-
-## 🧪 Testing
-
-- Migrate to vitest (#380) ([075ec73](https://github.com/sapphiredev/utilities/commit/075ec73c7a8e3374fad3ada612d37eb4ac36ec8d))
-
-# [@sapphire/snowflake@3.2.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.2.1...@sapphire/snowflake@3.2.2) - (2022-04-24)
-
-## Bug Fixes
-
-- Fix typo (#333) ([ae2f257](https://github.com/sapphiredev/utilities/commit/ae2f25766d5985735f2d9b257eebd27cdc8a7c52))
-
-## Documentation
-
-- Add @NotKaskus as a contributor ([00da8f1](https://github.com/sapphiredev/utilities/commit/00da8f199137b9277119823f322d1f2d168d928a))
-- Add @imranbarbhuiya as a contributor ([fb674c2](https://github.com/sapphiredev/utilities/commit/fb674c2c5594d41e71662263553dcb4bac9e37f4))
-- Add @axisiscool as a contributor ([ce1aa31](https://github.com/sapphiredev/utilities/commit/ce1aa316871a88d3663efbdf2a42d3d8dfe6a27f))
-- Add @dhruv-kaushikk as a contributor ([ebbf43f](https://github.com/sapphiredev/utilities/commit/ebbf43f63617daba96e72c50a234bf8b64f6ddc4))
-- Add @Commandtechno as a contributor ([f1d69fa](https://github.com/sapphiredev/utilities/commit/f1d69fabe1ee0abe4be08b19e63dbec03102f7ce))
-- Fix typedoc causing OOM crashes ([63ba41c](https://github.com/sapphiredev/utilities/commit/63ba41c4b6678554b1c7043a22d3296db4f59360))
-
-## [3.2.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.2.0...@sapphire/snowflake@3.2.1) (2022-04-01)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-# [3.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.1.0...@sapphire/snowflake@3.2.0) (2022-03-06)
-
-### Bug Fixes
-
-- **snowflake:** fixed the examples for `DiscordSnowflake` and `TwitterSnowflake` ([#282](https://github.com/sapphiredev/utilities/issues/282)) ([2e5ed7f](https://github.com/sapphiredev/utilities/commit/2e5ed7fdadccf261967c45f73d0dc78e2497eed3))
-
-### Features
-
-- allow module: NodeNext ([#306](https://github.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://github.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6))
-- **ts-config:** add multi-config structure ([#281](https://github.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://github.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37))
-
-# [3.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.0.1...@sapphire/snowflake@3.1.0) (2022-01-28)
-
-### Features
-
-- change build system to tsup ([#270](https://github.com/sapphiredev/utilities/issues/270)) ([365a53a](https://github.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8))
-
-## [3.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.0.0...@sapphire/snowflake@3.0.1) (2022-01-10)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-# [3.0.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.4...@sapphire/snowflake@3.0.0) (2021-12-08)
-
-### Bug Fixes
-
-- **snowflake:** remove env-based defaults ([#232](https://github.com/sapphiredev/utilities/issues/232)) ([10408e4](https://github.com/sapphiredev/utilities/commit/10408e4d3677e91490d967c3d89bf9575946090b))
-
-### Features
-
-- **Snowflake:** rework entire package ([#231](https://github.com/sapphiredev/utilities/issues/231)) ([1d02f1a](https://github.com/sapphiredev/utilities/commit/1d02f1a2f520efcbc194c3992af593d0e493873b))
-
-### BREAKING CHANGES
-
-- **Snowflake:** Renamed `processID` to `processId`
-- **Snowflake:** Renamed `workerID` to `workerId`
-- **Snowflake:** `workerId` now defaults to 0n instead of 1n
-- **Snowflake:** `DiscordSnowflake` is not longer a class, but a constructed Snowflake
-- **Snowflake:** `TwitterSnowflake` is not longer a class, but a constructed Snowflake
-
-## [2.1.4](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.3...@sapphire/snowflake@2.1.4) (2021-11-06)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [2.1.3](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.2...@sapphire/snowflake@2.1.3) (2021-10-26)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [2.1.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.1...@sapphire/snowflake@2.1.2) (2021-10-17)
-
-### Bug Fixes
-
-- allow more node & npm versions in engines field ([5977d2a](https://github.com/sapphiredev/utilities/commit/5977d2a30a4b2cfdf84aff3f33af03ffde1bbec5))
-
-## [2.1.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.0...@sapphire/snowflake@2.1.1) (2021-10-11)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-# [2.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.0.0...@sapphire/snowflake@2.1.0) (2021-10-04)
-
-### Bug Fixes
-
-- **snowflake:** fixed snowflake generating duplicate IDs ([#166](https://github.com/sapphiredev/utilities/issues/166)) ([f0cf4ad](https://github.com/sapphiredev/utilities/commit/f0cf4ad6bc0b8b2447499ca36581d2b453e52715))
-
-### Features
-
-- **snowflake:** set minimum NodeJS to v14 ([11a61c7](https://github.com/sapphiredev/utilities/commit/11a61c72bc29e683f9a4492815db3db094103bbc))
-
-# [2.0.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.6...@sapphire/snowflake@2.0.0) (2021-07-17)
-
-### Code Refactoring
-
-- **rateLimits:** rewrite all of it ([#130](https://github.com/sapphiredev/utilities/issues/130)) ([320778c](https://github.com/sapphiredev/utilities/commit/320778ca65cbf3591bd1ce0b1f2eb430693eef9a))
-
-### BREAKING CHANGES
-
-- **rateLimits:** Removed `Bucket`
-
-## [1.3.6](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.5...@sapphire/snowflake@1.3.6) (2021-07-11)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.3.5](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.4...@sapphire/snowflake@1.3.5) (2021-06-27)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.3.4](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.3...@sapphire/snowflake@1.3.4) (2021-06-19)
-
-### Bug Fixes
-
-- **doc:** change `[@link](https://github.com/link)` to `[@linkplain](https://github.com/linkplain)` for support in VSCode IntelliSense ([703d460](https://github.com/sapphiredev/utilities/commit/703d4605b547a8787aff62d6f1054ea26dfd9d1c))
-- **docs:** update-tsdoc-for-vscode-may-2021 ([#126](https://github.com/sapphiredev/utilities/issues/126)) ([f8581bf](https://github.com/sapphiredev/utilities/commit/f8581bfe97a1b2f8aac3a3d3ed342d8ba92d730b))
-
-## [1.3.3](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.2...@sapphire/snowflake@1.3.3) (2021-06-06)
-
-### Bug Fixes
-
-- remove peer deps, update dev deps, update READMEs ([#124](https://github.com/sapphiredev/utilities/issues/124)) ([67256ed](https://github.com/sapphiredev/utilities/commit/67256ed43b915b02a8b5c68230ba82d6210c5032))
-- **snowflake:** fixed parsing for timestamps as Date objects ([c17a515](https://github.com/sapphiredev/utilities/commit/c17a515b02931cf778ca69913132e8d4558504a1))
-
-## [1.3.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.1...@sapphire/snowflake@1.3.2) (2021-05-20)
-
-### Bug Fixes
-
-- **snowflake:** mark package as side effect free ([6a9bafc](https://github.com/sapphiredev/utilities/commit/6a9bafc24caba4b0ebbdd6896ac245ae6d60dede))
-
-## [1.3.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.0...@sapphire/snowflake@1.3.1) (2021-05-02)
-
-### Bug Fixes
-
-- drop the `www.` from the SapphireJS URL ([494d89f](https://github.com/sapphiredev/utilities/commit/494d89ffa04f78c195b93d7905b3232884f7d7e2))
-- update all the SapphireJS URLs from `.com` to `.dev` ([f59b46d](https://github.com/sapphiredev/utilities/commit/f59b46d1a0ebd39cad17b17d71cd3b9da808d5fd))
-
-# [1.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.8...@sapphire/snowflake@1.3.0) (2021-04-21)
-
-### Features
-
-- add @sapphire/embed-jsx ([#100](https://github.com/sapphiredev/utilities/issues/100)) ([7277a23](https://github.com/sapphiredev/utilities/commit/7277a236015236ed8e81b7882875410facc4ce17))
-
-## [1.2.8](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.7...@sapphire/snowflake@1.2.8) (2021-04-19)
-
-### Bug Fixes
-
-- change all Sapphire URLs from "project"->"community" & use our domain where applicable 👨🌾🚜 ([#102](https://github.com/sapphiredev/utilities/issues/102)) ([835b408](https://github.com/sapphiredev/utilities/commit/835b408e8e57130c3787aca2e32613346ff23e4d))
-
-## [1.2.7](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.6...@sapphire/snowflake@1.2.7) (2021-04-03)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.2.6](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.5...@sapphire/snowflake@1.2.6) (2021-03-16)
-
-### Bug Fixes
-
-- remove terser from all packages ([#79](https://github.com/sapphiredev/utilities/issues/79)) ([1cfe4e7](https://github.com/sapphiredev/utilities/commit/1cfe4e7c804e62c142495686d2b83b81d0026c02))
-
-## [1.2.5](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.4...@sapphire/snowflake@1.2.5) (2021-02-16)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.2.4](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.3...@sapphire/snowflake@1.2.4) (2021-01-16)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.2.3](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.2...@sapphire/snowflake@1.2.3) (2021-01-01)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.2.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.1...@sapphire/snowflake@1.2.2) (2020-12-26)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-## [1.2.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.0...@sapphire/snowflake@1.2.1) (2020-12-22)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-# [1.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.1.0...@sapphire/snowflake@1.2.0) (2020-11-15)
-
-### Bug Fixes
-
-- **snowflake:** pass keep_classnames to terser ([76ea062](https://github.com/sapphiredev/utilities/commit/76ea062d07000b169d9781f1a199b85ad3db0ba6))
-- **snowflake:** pass keep_fnames to terser ([b52aa76](https://github.com/sapphiredev/utilities/commit/b52aa764d8b02535496e0ceea3204a37552ce3d1))
-
-### Features
-
-- added time-utilities package ([#26](https://github.com/sapphiredev/utilities/issues/26)) ([f17a333](https://github.com/sapphiredev/utilities/commit/f17a3339667a452e8745fad7884272176e5d65e8))
-
-# [1.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.0.1...@sapphire/snowflake@1.1.0) (2020-11-04)
-
-### Bug Fixes
-
-- **ratelimits,snowflake,utilities:** fixed esm output target ([9fdab3f](https://github.com/sapphiredev/utilities/commit/9fdab3fca283c8c0b47cc32661c5cf8e0a5e583c))
-- **snowflake:** properly specify ESM and CommonJS exports ([e3278e6](https://github.com/sapphiredev/utilities/commit/e3278e6868a4f31d5b2a100710bcbce2b79bc218))
-
-### Features
-
-- added ratelimits package ([#15](https://github.com/sapphiredev/utilities/issues/15)) ([e0ae18c](https://github.com/sapphiredev/utilities/commit/e0ae18c5e1d0ae4e68a982829f1cf251fddfc80d))
-
-## [1.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.0.0...@sapphire/snowflake@1.0.1) (2020-09-20)
-
-**Note:** Version bump only for package @sapphire/snowflake
-
-# 1.0.0 (2020-09-05)
-
-### Features
-
-- implement snowflake ([5ba4e2d](https://github.com/sapphiredev/utilities/commit/5ba4e2d82557dd4ff60ffe891a7b46e46373bea2))
-- **decorators:** add decorators package ([#4](https://github.com/sapphiredev/utilities/issues/4)) ([677b3e5](https://github.com/sapphiredev/utilities/commit/677b3e59d5c6160cbe6fb410821cadd7c0f00e3c))
diff --git a/example_bot/node_modules/@sapphire/snowflake/README.md b/example_bot/node_modules/@sapphire/snowflake/README.md
deleted file mode 100644
index c8f0901..0000000
--- a/example_bot/node_modules/@sapphire/snowflake/README.md
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-# @sapphire/snowflake
-
-**Deconstruct and generate snowflake IDs using BigInts.**
-
-[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
-[](https://codecov.io/gh/sapphiredev/utilities)
-[](https://bundlephobia.com/result?p=@sapphire/snowflake)
-[](https://www.npmjs.com/package/@sapphire/snowflake)
-
-
-
-**Table of Contents**
-
-- [Description](#description)
-- [Features](#features)
-- [Installation](#installation)
-- [Usage](#usage)
- - [Constructing snowflakes](#constructing-snowflakes)
- - [Snowflakes with custom epoch](#snowflakes-with-custom-epoch)
- - [Snowflake with Discord epoch constant](#snowflake-with-discord-epoch-constant)
- - [Snowflake with Twitter epoch constant](#snowflake-with-twitter-epoch-constant)
- - [Deconstructing snowflakes](#deconstructing-snowflakes)
- - [Snowflakes with custom epoch](#snowflakes-with-custom-epoch-1)
- - [Snowflake with Discord epoch constant](#snowflake-with-discord-epoch-constant-1)
- - [Snowflake with Twitter epoch constant](#snowflake-with-twitter-epoch-constant-1)
-- [Buy us some doughnuts](#buy-us-some-doughnuts)
-- [Contributors ✨](#contributors-%E2%9C%A8)
-
-## Description
-
-There is often a need to get a unique ID for entities, be that for Discord messages/channels/servers, keys in a database or many other similar examples. There are many ways to get such a unique ID, and one of those is using a so-called "snowflake". You can read more about snowflake IDs in [this Medium article](https://medium.com/better-programming/uuid-generation-snowflake-identifiers-unique-2aed8b1771bc).
-
-## Features
-
-- Written in TypeScript
-- Bundled with esbuild so it can be used in NodeJS and browsers
-- Offers CommonJS, ESM and UMD bundles
-- Offers predefined epochs for Discord and Twitter
-- Fully tested
-
-## Installation
-
-You can use the following command to install this package, or replace `npm install` with your package manager of choice.
-
-```sh
-npm install @sapphire/snowflake
-```
-
-## Usage
-
-**Note:** While this section uses `require`, the imports match 1:1 with ESM imports. For example `const { Snowflake } = require('@sapphire/snowflake')` equals `import { Snowflake } from '@sapphire/snowflake'`.
-
-### Constructing snowflakes
-
-#### Snowflakes with custom epoch
-
-```typescript
-// Import the Snowflake class
-const { Snowflake } = require('@sapphire/snowflake');
-
-// Define a custom epoch
-const epoch = new Date('2000-01-01T00:00:00.000Z');
-
-// Create an instance of Snowflake
-const snowflake = new Snowflake(epoch);
-
-// Generate a snowflake with the given epoch
-const uniqueId = snowflake.generate();
-```
-
-#### Snowflake with Discord epoch constant
-
-```typescript
-// Import the Snowflake class
-const { DiscordSnowflake } = require('@sapphire/snowflake');
-
-// Generate a snowflake with Discord's epoch
-const uniqueId = DiscordSnowflake.generate();
-
-// Alternatively, you can use the method directly
-const uniqueId = DiscordSnowflake.generate();
-```
-
-#### Snowflake with Twitter epoch constant
-
-```typescript
-// Import the Snowflake class
-const { TwitterSnowflake } = require('@sapphire/snowflake');
-
-// Generate a snowflake with Twitter's epoch
-const uniqueId = TwitterSnowflake.generate();
-
-// Alternatively, you can use the method directly
-const uniqueId = TwitterSnowflake.generate();
-```
-
-### Deconstructing snowflakes
-
-#### Snowflakes with custom epoch
-
-```typescript
-// Import the Snowflake class
-const { Snowflake } = require('@sapphire/snowflake');
-
-// Define a custom epoch
-const epoch = new Date('2000-01-01T00:00:00.000Z');
-
-// Create an instance of Snowflake
-const snowflake = new Snowflake(epoch);
-
-// Deconstruct a snowflake with the given epoch
-const uniqueId = snowflake.deconstruct('3971046231244935168');
-```
-
-#### Snowflake with Discord epoch constant
-
-```typescript
-// Import the Snowflake class
-const { DiscordSnowflake } = require('@sapphire/snowflake');
-
-// Deconstruct a snowflake with Discord's epoch
-const uniqueId = DiscordSnowflake.deconstruct('3971046231244935168');
-
-// Alternatively, you can use the method directly
-const uniqueId = DiscordSnowflake.deconstruct('3971046231244935168');
-```
-
-#### Snowflake with Twitter epoch constant
-
-```typescript
-// Import the Snowflake class
-const { TwitterSnowflake } = require('@sapphire/snowflake');
-
-// Deconstruct a snowflake with Twitter's epoch
-const uniqueId = TwitterSnowflake.deconstruct('3971046231244935168');
-
-// Alternatively, you can use the method directly
-const uniqueId = TwitterSnowflake.deconstruct('3971046231244935168');
-```
-
----
-
-## Buy us some doughnuts
-
-Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
-
-We accept donations through Open Collective, Ko-fi, PayPal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.
-
-| Donate With | Address |
-| :-------------: | :-------------------------------------------------: |
-| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
-| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
-| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
-| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
-
-## Contributors
-
-Please make sure to read the [Contributing Guide][contributing] before making a pull request.
-
-Thank you to all the people who already contributed to Sapphire!
-
-
-
-
-
-[contributing]: https://github.com/sapphiredev/.github/blob/main/.github/CONTRIBUTING.md
diff --git a/example_bot/node_modules/@sapphire/snowflake/package.json b/example_bot/node_modules/@sapphire/snowflake/package.json
deleted file mode 100644
index da16195..0000000
--- a/example_bot/node_modules/@sapphire/snowflake/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "name": "@sapphire/snowflake",
- "version": "3.5.1",
- "description": "Deconstructs and generates snowflake IDs using BigInts",
- "author": "@sapphire",
- "license": "MIT",
- "main": "dist/index.js",
- "module": "dist/index.mjs",
- "browser": "dist/index.global.js",
- "unpkg": "dist/index.global.js",
- "types": "dist/index.d.ts",
- "exports": {
- "import": "./dist/index.mjs",
- "require": "./dist/index.js",
- "types": "./dist/index.d.ts"
- },
- "sideEffects": false,
- "homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/snowflake",
- "scripts": {
- "test": "vitest run",
- "lint": "eslint src tests --ext ts --fix -c ../../.eslintrc",
- "build": "tsup",
- "docs": "typedoc-json-parser",
- "prepack": "yarn build",
- "bump": "cliff-jumper",
- "check-update": "cliff-jumper --dry-run"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sapphiredev/utilities.git",
- "directory": "packages/snowflake"
- },
- "files": [
- "dist/**/*.js*",
- "dist/**/*.mjs*",
- "dist/**/*.d*"
- ],
- "engines": {
- "node": ">=v14.0.0",
- "npm": ">=7.0.0"
- },
- "keywords": [
- "@sapphire/snowflake",
- "bot",
- "typescript",
- "ts",
- "yarn",
- "discord",
- "sapphire",
- "standalone"
- ],
- "bugs": {
- "url": "https://github.com/sapphiredev/utilities/issues"
- },
- "publishConfig": {
- "access": "public"
- },
- "devDependencies": {
- "@favware/cliff-jumper": "^2.0.0",
- "@vitest/coverage-c8": "^0.31.0",
- "tsup": "^6.7.0",
- "typedoc": "^0.24.7",
- "typedoc-json-parser": "^7.4.0",
- "typescript": "^5.0.4",
- "vitest": "^0.31.0"
- }
-}
\ No newline at end of file
diff --git a/example_bot/node_modules/@types/node/LICENSE b/example_bot/node_modules/@types/node/LICENSE
deleted file mode 100644
index 9e841e7..0000000
--- a/example_bot/node_modules/@types/node/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
- MIT License
-
- Copyright (c) Microsoft Corporation.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE
diff --git a/example_bot/node_modules/@types/node/README.md b/example_bot/node_modules/@types/node/README.md
deleted file mode 100644
index 55401dd..0000000
--- a/example_bot/node_modules/@types/node/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Installation
-> `npm install --save @types/node`
-
-# Summary
-This package contains type definitions for node (https://nodejs.org/).
-
-# Details
-Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
-
-### Additional Details
- * Last updated: Wed, 29 Nov 2023 19:35:57 GMT
- * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
-
-# Credits
-These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
diff --git a/example_bot/node_modules/@types/node/assert.d.ts b/example_bot/node_modules/@types/node/assert.d.ts
deleted file mode 100644
index cd82143..0000000
--- a/example_bot/node_modules/@types/node/assert.d.ts
+++ /dev/null
@@ -1,996 +0,0 @@
-/**
- * The `node:assert` module provides a set of assertion functions for verifying
- * invariants.
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js)
- */
-declare module "assert" {
- /**
- * An alias of {@link ok}.
- * @since v0.5.9
- * @param value The input that is checked for being truthy.
- */
- function assert(value: unknown, message?: string | Error): asserts value;
- namespace assert {
- /**
- * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class.
- */
- class AssertionError extends Error {
- /**
- * Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
- */
- actual: unknown;
- /**
- * Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
- */
- expected: unknown;
- /**
- * Set to the passed in operator value.
- */
- operator: string;
- /**
- * Indicates if the message was auto-generated (`true`) or not.
- */
- generatedMessage: boolean;
- /**
- * Value is always `ERR_ASSERTION` to show that the error is an assertion error.
- */
- code: "ERR_ASSERTION";
- constructor(options?: {
- /** If provided, the error message is set to this value. */
- message?: string | undefined;
- /** The `actual` property on the error instance. */
- actual?: unknown | undefined;
- /** The `expected` property on the error instance. */
- expected?: unknown | undefined;
- /** The `operator` property on the error instance. */
- operator?: string | undefined;
- /** If provided, the generated stack trace omits frames before this function. */
- // eslint-disable-next-line @typescript-eslint/ban-types
- stackStartFn?: Function | undefined;
- });
- }
- /**
- * This feature is deprecated and will be removed in a future version.
- * Please consider using alternatives such as the `mock` helper function.
- * @since v14.2.0, v12.19.0
- * @deprecated Deprecated
- */
- class CallTracker {
- /**
- * The wrapper function is expected to be called exactly `exact` times. If the
- * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
- * error.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * // Creates call tracker.
- * const tracker = new assert.CallTracker();
- *
- * function func() {}
- *
- * // Returns a function that wraps func() that must be called exact times
- * // before tracker.verify().
- * const callsfunc = tracker.calls(func);
- * ```
- * @since v14.2.0, v12.19.0
- * @param [fn='A no-op function']
- * @param [exact=1]
- * @return that wraps `fn`.
- */
- calls(exact?: number): () => void;
- calls any>(fn?: Func, exact?: number): Func;
- /**
- * Example:
- *
- * ```js
- * import assert from 'node:assert';
- *
- * const tracker = new assert.CallTracker();
- *
- * function func() {}
- * const callsfunc = tracker.calls(func);
- * callsfunc(1, 2, 3);
- *
- * assert.deepStrictEqual(tracker.getCalls(callsfunc),
- * [{ thisArg: undefined, arguments: [1, 2, 3] }]);
- * ```
- * @since v18.8.0, v16.18.0
- * @param fn
- * @return An Array with all the calls to a tracked function.
- */
- getCalls(fn: Function): CallTrackerCall[];
- /**
- * The arrays contains information about the expected and actual number of calls of
- * the functions that have not been called the expected number of times.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * // Creates call tracker.
- * const tracker = new assert.CallTracker();
- *
- * function func() {}
- *
- * // Returns a function that wraps func() that must be called exact times
- * // before tracker.verify().
- * const callsfunc = tracker.calls(func, 2);
- *
- * // Returns an array containing information on callsfunc()
- * console.log(tracker.report());
- * // [
- * // {
- * // message: 'Expected the func function to be executed 2 time(s) but was
- * // executed 0 time(s).',
- * // actual: 0,
- * // expected: 2,
- * // operator: 'func',
- * // stack: stack trace
- * // }
- * // ]
- * ```
- * @since v14.2.0, v12.19.0
- * @return An Array of objects containing information about the wrapper functions returned by `calls`.
- */
- report(): CallTrackerReportInformation[];
- /**
- * Reset calls of the call tracker.
- * If a tracked function is passed as an argument, the calls will be reset for it.
- * If no arguments are passed, all tracked functions will be reset.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * const tracker = new assert.CallTracker();
- *
- * function func() {}
- * const callsfunc = tracker.calls(func);
- *
- * callsfunc();
- * // Tracker was called once
- * assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
- *
- * tracker.reset(callsfunc);
- * assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
- * ```
- * @since v18.8.0, v16.18.0
- * @param fn a tracked function to reset.
- */
- reset(fn?: Function): void;
- /**
- * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that
- * have not been called the expected number of times.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * // Creates call tracker.
- * const tracker = new assert.CallTracker();
- *
- * function func() {}
- *
- * // Returns a function that wraps func() that must be called exact times
- * // before tracker.verify().
- * const callsfunc = tracker.calls(func, 2);
- *
- * callsfunc();
- *
- * // Will throw an error since callsfunc() was only called once.
- * tracker.verify();
- * ```
- * @since v14.2.0, v12.19.0
- */
- verify(): void;
- }
- interface CallTrackerCall {
- thisArg: object;
- arguments: unknown[];
- }
- interface CallTrackerReportInformation {
- message: string;
- /** The actual number of times the function was called. */
- actual: number;
- /** The number of times the function was expected to be called. */
- expected: number;
- /** The name of the function that is wrapped. */
- operator: string;
- /** A stack trace of the function. */
- stack: object;
- }
- type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
- /**
- * Throws an `AssertionError` with the provided error message or a default
- * error message. If the `message` parameter is an instance of an `Error` then
- * it will be thrown instead of the `AssertionError`.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.fail();
- * // AssertionError [ERR_ASSERTION]: Failed
- *
- * assert.fail('boom');
- * // AssertionError [ERR_ASSERTION]: boom
- *
- * assert.fail(new TypeError('need array'));
- * // TypeError: need array
- * ```
- *
- * Using `assert.fail()` with more than two arguments is possible but deprecated.
- * See below for further details.
- * @since v0.1.21
- * @param [message='Failed']
- */
- function fail(message?: string | Error): never;
- /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
- function fail(
- actual: unknown,
- expected: unknown,
- message?: string | Error,
- operator?: string,
- // eslint-disable-next-line @typescript-eslint/ban-types
- stackStartFn?: Function,
- ): never;
- /**
- * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
- *
- * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default
- * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
- * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``.
- *
- * Be aware that in the `repl` the error message will be different to the one
- * thrown in a file! See below for further details.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.ok(true);
- * // OK
- * assert.ok(1);
- * // OK
- *
- * assert.ok();
- * // AssertionError: No value argument passed to `assert.ok()`
- *
- * assert.ok(false, 'it\'s false');
- * // AssertionError: it's false
- *
- * // In the repl:
- * assert.ok(typeof 123 === 'string');
- * // AssertionError: false == true
- *
- * // In a file (e.g. test.js):
- * assert.ok(typeof 123 === 'string');
- * // AssertionError: The expression evaluated to a falsy value:
- * //
- * // assert.ok(typeof 123 === 'string')
- *
- * assert.ok(false);
- * // AssertionError: The expression evaluated to a falsy value:
- * //
- * // assert.ok(false)
- *
- * assert.ok(0);
- * // AssertionError: The expression evaluated to a falsy value:
- * //
- * // assert.ok(0)
- * ```
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * // Using `assert()` works the same:
- * assert(0);
- * // AssertionError: The expression evaluated to a falsy value:
- * //
- * // assert(0)
- * ```
- * @since v0.1.21
- */
- function ok(value: unknown, message?: string | Error): asserts value;
- /**
- * **Strict assertion mode**
- *
- * An alias of {@link strictEqual}.
- *
- * **Legacy assertion mode**
- *
- * > Stability: 3 - Legacy: Use {@link strictEqual} instead.
- *
- * Tests shallow, coercive equality between the `actual` and `expected` parameters
- * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled
- * and treated as being identical if both sides are `NaN`.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * assert.equal(1, 1);
- * // OK, 1 == 1
- * assert.equal(1, '1');
- * // OK, 1 == '1'
- * assert.equal(NaN, NaN);
- * // OK
- *
- * assert.equal(1, 2);
- * // AssertionError: 1 == 2
- * assert.equal({ a: { b: 1 } }, { a: { b: 1 } });
- * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
- * ```
- *
- * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default
- * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
- * @since v0.1.21
- */
- function equal(actual: unknown, expected: unknown, message?: string | Error): void;
- /**
- * **Strict assertion mode**
- *
- * An alias of {@link notStrictEqual}.
- *
- * **Legacy assertion mode**
- *
- * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
- *
- * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is
- * specially handled and treated as being identical if both sides are `NaN`.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * assert.notEqual(1, 2);
- * // OK
- *
- * assert.notEqual(1, 1);
- * // AssertionError: 1 != 1
- *
- * assert.notEqual(1, '1');
- * // AssertionError: 1 != '1'
- * ```
- *
- * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error
- * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`.
- * @since v0.1.21
- */
- function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
- /**
- * **Strict assertion mode**
- *
- * An alias of {@link deepStrictEqual}.
- *
- * **Legacy assertion mode**
- *
- * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead.
- *
- * Tests for deep equality between the `actual` and `expected` parameters. Consider
- * using {@link deepStrictEqual} instead. {@link deepEqual} can have
- * surprising results.
- *
- * _Deep equality_ means that the enumerable "own" properties of child objects
- * are also recursively evaluated by the following rules.
- * @since v0.1.21
- */
- function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
- /**
- * **Strict assertion mode**
- *
- * An alias of {@link notDeepStrictEqual}.
- *
- * **Legacy assertion mode**
- *
- * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead.
- *
- * Tests for any deep inequality. Opposite of {@link deepEqual}.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * const obj1 = {
- * a: {
- * b: 1,
- * },
- * };
- * const obj2 = {
- * a: {
- * b: 2,
- * },
- * };
- * const obj3 = {
- * a: {
- * b: 1,
- * },
- * };
- * const obj4 = { __proto__: obj1 };
- *
- * assert.notDeepEqual(obj1, obj1);
- * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
- *
- * assert.notDeepEqual(obj1, obj2);
- * // OK
- *
- * assert.notDeepEqual(obj1, obj3);
- * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
- *
- * assert.notDeepEqual(obj1, obj4);
- * // OK
- * ```
- *
- * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default
- * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
- * instead of the `AssertionError`.
- * @since v0.1.21
- */
- function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
- /**
- * Tests strict equality between the `actual` and `expected` parameters as
- * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.strictEqual(1, 2);
- * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
- * //
- * // 1 !== 2
- *
- * assert.strictEqual(1, 1);
- * // OK
- *
- * assert.strictEqual('Hello foobar', 'Hello World!');
- * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
- * // + actual - expected
- * //
- * // + 'Hello foobar'
- * // - 'Hello World!'
- * // ^
- *
- * const apples = 1;
- * const oranges = 2;
- * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`);
- * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2
- *
- * assert.strictEqual(1, '1', new TypeError('Inputs are not identical'));
- * // TypeError: Inputs are not identical
- * ```
- *
- * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
- * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
- * instead of the `AssertionError`.
- * @since v0.1.21
- */
- function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
- /**
- * Tests strict inequality between the `actual` and `expected` parameters as
- * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.notStrictEqual(1, 2);
- * // OK
- *
- * assert.notStrictEqual(1, 1);
- * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to:
- * //
- * // 1
- *
- * assert.notStrictEqual(1, '1');
- * // OK
- * ```
- *
- * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a
- * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown
- * instead of the `AssertionError`.
- * @since v0.1.21
- */
- function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
- /**
- * Tests for deep equality between the `actual` and `expected` parameters.
- * "Deep" equality means that the enumerable "own" properties of child objects
- * are recursively evaluated also by the following rules.
- * @since v1.2.0
- */
- function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
- /**
- * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
- * // OK
- * ```
- *
- * If the values are deeply and strictly equal, an `AssertionError` is thrown
- * with a `message` property set equal to the value of the `message` parameter. If
- * the `message` parameter is undefined, a default error message is assigned. If
- * the `message` parameter is an instance of an `Error` then it will be thrown
- * instead of the `AssertionError`.
- * @since v1.2.0
- */
- function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
- /**
- * Expects the function `fn` to throw an error.
- *
- * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
- * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function,
- * a validation object where each property will be tested for strict deep equality,
- * or an instance of error where each property will be tested for strict deep
- * equality including the non-enumerable `message` and `name` properties. When
- * using an object, it is also possible to use a regular expression, when
- * validating against a string property. See below for examples.
- *
- * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation
- * fails.
- *
- * Custom validation object/error instance:
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * const err = new TypeError('Wrong value');
- * err.code = 404;
- * err.foo = 'bar';
- * err.info = {
- * nested: true,
- * baz: 'text',
- * };
- * err.reg = /abc/i;
- *
- * assert.throws(
- * () => {
- * throw err;
- * },
- * {
- * name: 'TypeError',
- * message: 'Wrong value',
- * info: {
- * nested: true,
- * baz: 'text',
- * },
- * // Only properties on the validation object will be tested for.
- * // Using nested objects requires all properties to be present. Otherwise
- * // the validation is going to fail.
- * },
- * );
- *
- * // Using regular expressions to validate error properties:
- * assert.throws(
- * () => {
- * throw err;
- * },
- * {
- * // The `name` and `message` properties are strings and using regular
- * // expressions on those will match against the string. If they fail, an
- * // error is thrown.
- * name: /^TypeError$/,
- * message: /Wrong/,
- * foo: 'bar',
- * info: {
- * nested: true,
- * // It is not possible to use regular expressions for nested properties!
- * baz: 'text',
- * },
- * // The `reg` property contains a regular expression and only if the
- * // validation object contains an identical regular expression, it is going
- * // to pass.
- * reg: /abc/i,
- * },
- * );
- *
- * // Fails due to the different `message` and `name` properties:
- * assert.throws(
- * () => {
- * const otherErr = new Error('Not found');
- * // Copy all enumerable properties from `err` to `otherErr`.
- * for (const [key, value] of Object.entries(err)) {
- * otherErr[key] = value;
- * }
- * throw otherErr;
- * },
- * // The error's `message` and `name` properties will also be checked when using
- * // an error as validation object.
- * err,
- * );
- * ```
- *
- * Validate instanceof using constructor:
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.throws(
- * () => {
- * throw new Error('Wrong value');
- * },
- * Error,
- * );
- * ```
- *
- * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions):
- *
- * Using a regular expression runs `.toString` on the error object, and will
- * therefore also include the error name.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.throws(
- * () => {
- * throw new Error('Wrong value');
- * },
- * /^Error: Wrong value$/,
- * );
- * ```
- *
- * Custom error validation:
- *
- * The function must return `true` to indicate all internal validations passed.
- * It will otherwise fail with an `AssertionError`.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.throws(
- * () => {
- * throw new Error('Wrong value');
- * },
- * (err) => {
- * assert(err instanceof Error);
- * assert(/value/.test(err));
- * // Avoid returning anything from validation functions besides `true`.
- * // Otherwise, it's not clear what part of the validation failed. Instead,
- * // throw an error about the specific validation that failed (as done in this
- * // example) and add as much helpful debugging information to that error as
- * // possible.
- * return true;
- * },
- * 'unexpected error',
- * );
- * ```
- *
- * `error` cannot be a string. If a string is provided as the second
- * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same
- * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using
- * a string as the second argument gets considered:
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * function throwingFirst() {
- * throw new Error('First');
- * }
- *
- * function throwingSecond() {
- * throw new Error('Second');
- * }
- *
- * function notThrowing() {}
- *
- * // The second argument is a string and the input function threw an Error.
- * // The first case will not throw as it does not match for the error message
- * // thrown by the input function!
- * assert.throws(throwingFirst, 'Second');
- * // In the next example the message has no benefit over the message from the
- * // error and since it is not clear if the user intended to actually match
- * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error.
- * assert.throws(throwingSecond, 'Second');
- * // TypeError [ERR_AMBIGUOUS_ARGUMENT]
- *
- * // The string is only used (as message) in case the function does not throw:
- * assert.throws(notThrowing, 'Second');
- * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second
- *
- * // If it was intended to match for the error message do this instead:
- * // It does not throw because the error messages match.
- * assert.throws(throwingSecond, /Second$/);
- *
- * // If the error message does not match, an AssertionError is thrown.
- * assert.throws(throwingFirst, /Second$/);
- * // AssertionError [ERR_ASSERTION]
- * ```
- *
- * Due to the confusing error-prone notation, avoid a string as the second
- * argument.
- * @since v0.1.21
- */
- function throws(block: () => unknown, message?: string | Error): void;
- function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
- /**
- * Asserts that the function `fn` does not throw an error.
- *
- * Using `assert.doesNotThrow()` is actually not useful because there
- * is no benefit in catching an error and then rethrowing it. Instead, consider
- * adding a comment next to the specific code path that should not throw and keep
- * error messages as expressive as possible.
- *
- * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function.
- *
- * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a
- * different type, or if the `error` parameter is undefined, the error is
- * propagated back to the caller.
- *
- * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
- * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation
- * function. See {@link throws} for more details.
- *
- * The following, for instance, will throw the `TypeError` because there is no
- * matching error type in the assertion:
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.doesNotThrow(
- * () => {
- * throw new TypeError('Wrong value');
- * },
- * SyntaxError,
- * );
- * ```
- *
- * However, the following will result in an `AssertionError` with the message
- * 'Got unwanted exception...':
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.doesNotThrow(
- * () => {
- * throw new TypeError('Wrong value');
- * },
- * TypeError,
- * );
- * ```
- *
- * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message:
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.doesNotThrow(
- * () => {
- * throw new TypeError('Wrong value');
- * },
- * /Wrong value/,
- * 'Whoops',
- * );
- * // Throws: AssertionError: Got unwanted exception: Whoops
- * ```
- * @since v0.1.21
- */
- function doesNotThrow(block: () => unknown, message?: string | Error): void;
- function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
- /**
- * Throws `value` if `value` is not `undefined` or `null`. This is useful when
- * testing the `error` argument in callbacks. The stack trace contains all frames
- * from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.ifError(null);
- * // OK
- * assert.ifError(0);
- * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0
- * assert.ifError('error');
- * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error'
- * assert.ifError(new Error());
- * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error
- *
- * // Create some random error frames.
- * let err;
- * (function errorFrame() {
- * err = new Error('test error');
- * })();
- *
- * (function ifErrorFrame() {
- * assert.ifError(err);
- * })();
- * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
- * // at ifErrorFrame
- * // at errorFrame
- * ```
- * @since v0.1.97
- */
- function ifError(value: unknown): asserts value is null | undefined;
- /**
- * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
- * calls the function and awaits the returned promise to complete. It will then
- * check that the promise is rejected.
- *
- * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the
- * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error
- * handler is skipped.
- *
- * Besides the async nature to await the completion behaves identically to {@link throws}.
- *
- * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
- * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function,
- * an object where each property will be tested for, or an instance of error where
- * each property will be tested for including the non-enumerable `message` and`name` properties.
- *
- * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * await assert.rejects(
- * async () => {
- * throw new TypeError('Wrong value');
- * },
- * {
- * name: 'TypeError',
- * message: 'Wrong value',
- * },
- * );
- * ```
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * await assert.rejects(
- * async () => {
- * throw new TypeError('Wrong value');
- * },
- * (err) => {
- * assert.strictEqual(err.name, 'TypeError');
- * assert.strictEqual(err.message, 'Wrong value');
- * return true;
- * },
- * );
- * ```
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.rejects(
- * Promise.reject(new Error('Wrong value')),
- * Error,
- * ).then(() => {
- * // ...
- * });
- * ```
- *
- * `error` cannot be a string. If a string is provided as the second
- * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the
- * example in {@link throws} carefully if using a string as the second
- * argument gets considered.
- * @since v10.0.0
- */
- function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise;
- function rejects(
- block: (() => Promise) | Promise,
- error: AssertPredicate,
- message?: string | Error,
- ): Promise;
- /**
- * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
- * calls the function and awaits the returned promise to complete. It will then
- * check that the promise is not rejected.
- *
- * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If
- * the function does not return a promise, `assert.doesNotReject()` will return a
- * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases
- * the error handler is skipped.
- *
- * Using `assert.doesNotReject()` is actually not useful because there is little
- * benefit in catching a rejection and then rejecting it again. Instead, consider
- * adding a comment next to the specific code path that should not reject and keep
- * error messages as expressive as possible.
- *
- * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
- * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation
- * function. See {@link throws} for more details.
- *
- * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * await assert.doesNotReject(
- * async () => {
- * throw new TypeError('Wrong value');
- * },
- * SyntaxError,
- * );
- * ```
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
- * .then(() => {
- * // ...
- * });
- * ```
- * @since v10.0.0
- */
- function doesNotReject(
- block: (() => Promise) | Promise,
- message?: string | Error,
- ): Promise;
- function doesNotReject(
- block: (() => Promise) | Promise,
- error: AssertPredicate,
- message?: string | Error,
- ): Promise;
- /**
- * Expects the `string` input to match the regular expression.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.match('I will fail', /pass/);
- * // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
- *
- * assert.match(123, /pass/);
- * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
- *
- * assert.match('I will pass', /pass/);
- * // OK
- * ```
- *
- * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
- * to the value of the `message` parameter. If the `message` parameter is
- * undefined, a default error message is assigned. If the `message` parameter is an
- * instance of an `Error` then it will be thrown instead of the `AssertionError`.
- * @since v13.6.0, v12.16.0
- */
- function match(value: string, regExp: RegExp, message?: string | Error): void;
- /**
- * Expects the `string` input not to match the regular expression.
- *
- * ```js
- * import assert from 'node:assert/strict';
- *
- * assert.doesNotMatch('I will fail', /fail/);
- * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
- *
- * assert.doesNotMatch(123, /pass/);
- * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string.
- *
- * assert.doesNotMatch('I will pass', /different/);
- * // OK
- * ```
- *
- * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal
- * to the value of the `message` parameter. If the `message` parameter is
- * undefined, a default error message is assigned. If the `message` parameter is an
- * instance of an `Error` then it will be thrown instead of the `AssertionError`.
- * @since v13.6.0, v12.16.0
- */
- function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
- const strict:
- & Omit<
- typeof assert,
- | "equal"
- | "notEqual"
- | "deepEqual"
- | "notDeepEqual"
- | "ok"
- | "strictEqual"
- | "deepStrictEqual"
- | "ifError"
- | "strict"
- >
- & {
- (value: unknown, message?: string | Error): asserts value;
- equal: typeof strictEqual;
- notEqual: typeof notStrictEqual;
- deepEqual: typeof deepStrictEqual;
- notDeepEqual: typeof notDeepStrictEqual;
- // Mapped types and assertion functions are incompatible?
- // TS2775: Assertions require every name in the call target
- // to be declared with an explicit type annotation.
- ok: typeof ok;
- strictEqual: typeof strictEqual;
- deepStrictEqual: typeof deepStrictEqual;
- ifError: typeof ifError;
- strict: typeof strict;
- };
- }
- export = assert;
-}
-declare module "node:assert" {
- import assert = require("assert");
- export = assert;
-}
diff --git a/example_bot/node_modules/@types/node/assert/strict.d.ts b/example_bot/node_modules/@types/node/assert/strict.d.ts
deleted file mode 100644
index f333913..0000000
--- a/example_bot/node_modules/@types/node/assert/strict.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-declare module "assert/strict" {
- import { strict } from "node:assert";
- export = strict;
-}
-declare module "node:assert/strict" {
- import { strict } from "node:assert";
- export = strict;
-}
diff --git a/example_bot/node_modules/@types/node/async_hooks.d.ts b/example_bot/node_modules/@types/node/async_hooks.d.ts
deleted file mode 100644
index 0667a61..0000000
--- a/example_bot/node_modules/@types/node/async_hooks.d.ts
+++ /dev/null
@@ -1,539 +0,0 @@
-/**
- * We strongly discourage the use of the `async_hooks` API.
- * Other APIs that can cover most of its use cases include:
- *
- * * `AsyncLocalStorage` tracks async context
- * * `process.getActiveResourcesInfo()` tracks active resources
- *
- * The `node:async_hooks` module provides an API to track asynchronous resources.
- * It can be accessed using:
- *
- * ```js
- * import async_hooks from 'node:async_hooks';
- * ```
- * @experimental
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
- */
-declare module "async_hooks" {
- /**
- * ```js
- * import { executionAsyncId } from 'node:async_hooks';
- * import fs from 'node:fs';
- *
- * console.log(executionAsyncId()); // 1 - bootstrap
- * const path = '.';
- * fs.open(path, 'r', (err, fd) => {
- * console.log(executionAsyncId()); // 6 - open()
- * });
- * ```
- *
- * The ID returned from `executionAsyncId()` is related to execution timing, not
- * causality (which is covered by `triggerAsyncId()`):
- *
- * ```js
- * const server = net.createServer((conn) => {
- * // Returns the ID of the server, not of the new connection, because the
- * // callback runs in the execution scope of the server's MakeCallback().
- * async_hooks.executionAsyncId();
- *
- * }).listen(port, () => {
- * // Returns the ID of a TickObject (process.nextTick()) because all
- * // callbacks passed to .listen() are wrapped in a nextTick().
- * async_hooks.executionAsyncId();
- * });
- * ```
- *
- * Promise contexts may not get precise `executionAsyncIds` by default.
- * See the section on `promise execution tracking`.
- * @since v8.1.0
- * @return The `asyncId` of the current execution context. Useful to track when something calls.
- */
- function executionAsyncId(): number;
- /**
- * Resource objects returned by `executionAsyncResource()` are most often internal
- * Node.js handle objects with undocumented APIs. Using any functions or properties
- * on the object is likely to crash your application and should be avoided.
- *
- * Using `executionAsyncResource()` in the top-level execution context will
- * return an empty object as there is no handle or request object to use,
- * but having an object representing the top-level can be helpful.
- *
- * ```js
- * import { open } from 'node:fs';
- * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks';
- *
- * console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
- * open(new URL(import.meta.url), 'r', (err, fd) => {
- * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
- * });
- * ```
- *
- * This can be used to implement continuation local storage without the
- * use of a tracking `Map` to store the metadata:
- *
- * ```js
- * import { createServer } from 'node:http';
- * import {
- * executionAsyncId,
- * executionAsyncResource,
- * createHook,
- * } from 'async_hooks';
- * const sym = Symbol('state'); // Private symbol to avoid pollution
- *
- * createHook({
- * init(asyncId, type, triggerAsyncId, resource) {
- * const cr = executionAsyncResource();
- * if (cr) {
- * resource[sym] = cr[sym];
- * }
- * },
- * }).enable();
- *
- * const server = createServer((req, res) => {
- * executionAsyncResource()[sym] = { state: req.url };
- * setTimeout(function() {
- * res.end(JSON.stringify(executionAsyncResource()[sym]));
- * }, 100);
- * }).listen(3000);
- * ```
- * @since v13.9.0, v12.17.0
- * @return The resource representing the current execution. Useful to store data within the resource.
- */
- function executionAsyncResource(): object;
- /**
- * ```js
- * const server = net.createServer((conn) => {
- * // The resource that caused (or triggered) this callback to be called
- * // was that of the new connection. Thus the return value of triggerAsyncId()
- * // is the asyncId of "conn".
- * async_hooks.triggerAsyncId();
- *
- * }).listen(port, () => {
- * // Even though all callbacks passed to .listen() are wrapped in a nextTick()
- * // the callback itself exists because the call to the server's .listen()
- * // was made. So the return value would be the ID of the server.
- * async_hooks.triggerAsyncId();
- * });
- * ```
- *
- * Promise contexts may not get valid `triggerAsyncId`s by default. See
- * the section on `promise execution tracking`.
- * @return The ID of the resource responsible for calling the callback that is currently being executed.
- */
- function triggerAsyncId(): number;
- interface HookCallbacks {
- /**
- * Called when a class is constructed that has the possibility to emit an asynchronous event.
- * @param asyncId a unique ID for the async resource
- * @param type the type of the async resource
- * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
- * @param resource reference to the resource representing the async operation, needs to be released during destroy
- */
- init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
- /**
- * When an asynchronous operation is initiated or completes a callback is called to notify the user.
- * The before callback is called just before said callback is executed.
- * @param asyncId the unique identifier assigned to the resource about to execute the callback.
- */
- before?(asyncId: number): void;
- /**
- * Called immediately after the callback specified in before is completed.
- * @param asyncId the unique identifier assigned to the resource which has executed the callback.
- */
- after?(asyncId: number): void;
- /**
- * Called when a promise has resolve() called. This may not be in the same execution id
- * as the promise itself.
- * @param asyncId the unique id for the promise that was resolve()d.
- */
- promiseResolve?(asyncId: number): void;
- /**
- * Called after the resource corresponding to asyncId is destroyed
- * @param asyncId a unique ID for the async resource
- */
- destroy?(asyncId: number): void;
- }
- interface AsyncHook {
- /**
- * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
- */
- enable(): this;
- /**
- * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
- */
- disable(): this;
- }
- /**
- * Registers functions to be called for different lifetime events of each async
- * operation.
- *
- * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
- * respective asynchronous event during a resource's lifetime.
- *
- * All callbacks are optional. For example, if only resource cleanup needs to
- * be tracked, then only the `destroy` callback needs to be passed. The
- * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
- *
- * ```js
- * import { createHook } from 'node:async_hooks';
- *
- * const asyncHook = createHook({
- * init(asyncId, type, triggerAsyncId, resource) { },
- * destroy(asyncId) { },
- * });
- * ```
- *
- * The callbacks will be inherited via the prototype chain:
- *
- * ```js
- * class MyAsyncCallbacks {
- * init(asyncId, type, triggerAsyncId, resource) { }
- * destroy(asyncId) {}
- * }
- *
- * class MyAddedCallbacks extends MyAsyncCallbacks {
- * before(asyncId) { }
- * after(asyncId) { }
- * }
- *
- * const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
- * ```
- *
- * Because promises are asynchronous resources whose lifecycle is tracked
- * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
- * @since v8.1.0
- * @param callbacks The `Hook Callbacks` to register
- * @return Instance used for disabling and enabling hooks
- */
- function createHook(callbacks: HookCallbacks): AsyncHook;
- interface AsyncResourceOptions {
- /**
- * The ID of the execution context that created this async event.
- * @default executionAsyncId()
- */
- triggerAsyncId?: number | undefined;
- /**
- * Disables automatic `emitDestroy` when the object is garbage collected.
- * This usually does not need to be set (even if `emitDestroy` is called
- * manually), unless the resource's `asyncId` is retrieved and the
- * sensitive API's `emitDestroy` is called with it.
- * @default false
- */
- requireManualDestroy?: boolean | undefined;
- }
- /**
- * The class `AsyncResource` is designed to be extended by the embedder's async
- * resources. Using this, users can easily trigger the lifetime events of their
- * own resources.
- *
- * The `init` hook will trigger when an `AsyncResource` is instantiated.
- *
- * The following is an overview of the `AsyncResource` API.
- *
- * ```js
- * import { AsyncResource, executionAsyncId } from 'node:async_hooks';
- *
- * // AsyncResource() is meant to be extended. Instantiating a
- * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
- * // async_hook.executionAsyncId() is used.
- * const asyncResource = new AsyncResource(
- * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },
- * );
- *
- * // Run a function in the execution context of the resource. This will
- * // * establish the context of the resource
- * // * trigger the AsyncHooks before callbacks
- * // * call the provided function `fn` with the supplied arguments
- * // * trigger the AsyncHooks after callbacks
- * // * restore the original execution context
- * asyncResource.runInAsyncScope(fn, thisArg, ...args);
- *
- * // Call AsyncHooks destroy callbacks.
- * asyncResource.emitDestroy();
- *
- * // Return the unique ID assigned to the AsyncResource instance.
- * asyncResource.asyncId();
- *
- * // Return the trigger ID for the AsyncResource instance.
- * asyncResource.triggerAsyncId();
- * ```
- */
- class AsyncResource {
- /**
- * AsyncResource() is meant to be extended. Instantiating a
- * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
- * async_hook.executionAsyncId() is used.
- * @param type The type of async event.
- * @param triggerAsyncId The ID of the execution context that created
- * this async event (default: `executionAsyncId()`), or an
- * AsyncResourceOptions object (since v9.3.0)
- */
- constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
- /**
- * Binds the given function to the current execution context.
- * @since v14.8.0, v12.19.0
- * @param fn The function to bind to the current execution context.
- * @param type An optional name to associate with the underlying `AsyncResource`.
- */
- static bind any, ThisArg>(
- fn: Func,
- type?: string,
- thisArg?: ThisArg,
- ): Func;
- /**
- * Binds the given function to execute to this `AsyncResource`'s scope.
- * @since v14.8.0, v12.19.0
- * @param fn The function to bind to the current `AsyncResource`.
- */
- bind any>(fn: Func): Func;
- /**
- * Call the provided function with the provided arguments in the execution context
- * of the async resource. This will establish the context, trigger the AsyncHooks
- * before callbacks, call the function, trigger the AsyncHooks after callbacks, and
- * then restore the original execution context.
- * @since v9.6.0
- * @param fn The function to call in the execution context of this async resource.
- * @param thisArg The receiver to be used for the function call.
- * @param args Optional arguments to pass to the function.
- */
- runInAsyncScope(
- fn: (this: This, ...args: any[]) => Result,
- thisArg?: This,
- ...args: any[]
- ): Result;
- /**
- * Call all `destroy` hooks. This should only ever be called once. An error will
- * be thrown if it is called more than once. This **must** be manually called. If
- * the resource is left to be collected by the GC then the `destroy` hooks will
- * never be called.
- * @return A reference to `asyncResource`.
- */
- emitDestroy(): this;
- /**
- * @return The unique `asyncId` assigned to the resource.
- */
- asyncId(): number;
- /**
- * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
- */
- triggerAsyncId(): number;
- }
- /**
- * This class creates stores that stay coherent through asynchronous operations.
- *
- * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory
- * safe implementation that involves significant optimizations that are non-obvious
- * to implement.
- *
- * The following example uses `AsyncLocalStorage` to build a simple logger
- * that assigns IDs to incoming HTTP requests and includes them in messages
- * logged within each request.
- *
- * ```js
- * import http from 'node:http';
- * import { AsyncLocalStorage } from 'node:async_hooks';
- *
- * const asyncLocalStorage = new AsyncLocalStorage();
- *
- * function logWithId(msg) {
- * const id = asyncLocalStorage.getStore();
- * console.log(`${id !== undefined ? id : '-'}:`, msg);
- * }
- *
- * let idSeq = 0;
- * http.createServer((req, res) => {
- * asyncLocalStorage.run(idSeq++, () => {
- * logWithId('start');
- * // Imagine any chain of async operations here
- * setImmediate(() => {
- * logWithId('finish');
- * res.end();
- * });
- * });
- * }).listen(8080);
- *
- * http.get('http://localhost:8080');
- * http.get('http://localhost:8080');
- * // Prints:
- * // 0: start
- * // 1: start
- * // 0: finish
- * // 1: finish
- * ```
- *
- * Each instance of `AsyncLocalStorage` maintains an independent storage context.
- * Multiple instances can safely exist simultaneously without risk of interfering
- * with each other's data.
- * @since v13.10.0, v12.17.0
- */
- class AsyncLocalStorage {
- /**
- * Binds the given function to the current execution context.
- * @since v19.8.0
- * @experimental
- * @param fn The function to bind to the current execution context.
- * @return A new function that calls `fn` within the captured execution context.
- */
- static bind any>(fn: Func): Func;
- /**
- * Captures the current execution context and returns a function that accepts a
- * function as an argument. Whenever the returned function is called, it
- * calls the function passed to it within the captured context.
- *
- * ```js
- * const asyncLocalStorage = new AsyncLocalStorage();
- * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());
- * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));
- * console.log(result); // returns 123
- * ```
- *
- * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple
- * async context tracking purposes, for example:
- *
- * ```js
- * class Foo {
- * #runInAsyncScope = AsyncLocalStorage.snapshot();
- *
- * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); }
- * }
- *
- * const foo = asyncLocalStorage.run(123, () => new Foo());
- * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
- * ```
- * @since v19.8.0
- * @experimental
- * @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
- */
- static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R;
- /**
- * Disables the instance of `AsyncLocalStorage`. All subsequent calls
- * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
- *
- * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
- * instance will be exited.
- *
- * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores
- * provided by the `asyncLocalStorage`, as those objects are garbage collected
- * along with the corresponding async resources.
- *
- * Use this method when the `asyncLocalStorage` is not in use anymore
- * in the current process.
- * @since v13.10.0, v12.17.0
- * @experimental
- */
- disable(): void;
- /**
- * Returns the current store.
- * If called outside of an asynchronous context initialized by
- * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
- * returns `undefined`.
- * @since v13.10.0, v12.17.0
- */
- getStore(): T | undefined;
- /**
- * Runs a function synchronously within a context and returns its
- * return value. The store is not accessible outside of the callback function.
- * The store is accessible to any asynchronous operations created within the
- * callback.
- *
- * The optional `args` are passed to the callback function.
- *
- * If the callback function throws an error, the error is thrown by `run()` too.
- * The stacktrace is not impacted by this call and the context is exited.
- *
- * Example:
- *
- * ```js
- * const store = { id: 2 };
- * try {
- * asyncLocalStorage.run(store, () => {
- * asyncLocalStorage.getStore(); // Returns the store object
- * setTimeout(() => {
- * asyncLocalStorage.getStore(); // Returns the store object
- * }, 200);
- * throw new Error();
- * });
- * } catch (e) {
- * asyncLocalStorage.getStore(); // Returns undefined
- * // The error will be caught here
- * }
- * ```
- * @since v13.10.0, v12.17.0
- */
- run(store: T, callback: () => R): R;
- run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
- /**
- * Runs a function synchronously outside of a context and returns its
- * return value. The store is not accessible within the callback function or
- * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`.
- *
- * The optional `args` are passed to the callback function.
- *
- * If the callback function throws an error, the error is thrown by `exit()` too.
- * The stacktrace is not impacted by this call and the context is re-entered.
- *
- * Example:
- *
- * ```js
- * // Within a call to run
- * try {
- * asyncLocalStorage.getStore(); // Returns the store object or value
- * asyncLocalStorage.exit(() => {
- * asyncLocalStorage.getStore(); // Returns undefined
- * throw new Error();
- * });
- * } catch (e) {
- * asyncLocalStorage.getStore(); // Returns the same object or value
- * // The error will be caught here
- * }
- * ```
- * @since v13.10.0, v12.17.0
- * @experimental
- */
- exit(callback: (...args: TArgs) => R, ...args: TArgs): R;
- /**
- * Transitions into the context for the remainder of the current
- * synchronous execution and then persists the store through any following
- * asynchronous calls.
- *
- * Example:
- *
- * ```js
- * const store = { id: 1 };
- * // Replaces previous store with the given store object
- * asyncLocalStorage.enterWith(store);
- * asyncLocalStorage.getStore(); // Returns the store object
- * someAsyncOperation(() => {
- * asyncLocalStorage.getStore(); // Returns the same object
- * });
- * ```
- *
- * This transition will continue for the _entire_ synchronous execution.
- * This means that if, for example, the context is entered within an event
- * handler subsequent event handlers will also run within that context unless
- * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons
- * to use the latter method.
- *
- * ```js
- * const store = { id: 1 };
- *
- * emitter.on('my-event', () => {
- * asyncLocalStorage.enterWith(store);
- * });
- * emitter.on('my-event', () => {
- * asyncLocalStorage.getStore(); // Returns the same object
- * });
- *
- * asyncLocalStorage.getStore(); // Returns undefined
- * emitter.emit('my-event');
- * asyncLocalStorage.getStore(); // Returns the same object
- * ```
- * @since v13.11.0, v12.17.0
- * @experimental
- */
- enterWith(store: T): void;
- }
-}
-declare module "node:async_hooks" {
- export * from "async_hooks";
-}
diff --git a/example_bot/node_modules/@types/node/buffer.d.ts b/example_bot/node_modules/@types/node/buffer.d.ts
deleted file mode 100644
index 1ee5c01..0000000
--- a/example_bot/node_modules/@types/node/buffer.d.ts
+++ /dev/null
@@ -1,2362 +0,0 @@
-/**
- * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
- * Node.js APIs support `Buffer`s.
- *
- * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
- * extends it with methods that cover additional use cases. Node.js APIs accept
- * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
- *
- * While the `Buffer` class is available within the global scope, it is still
- * recommended to explicitly reference it via an import or require statement.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Creates a zero-filled Buffer of length 10.
- * const buf1 = Buffer.alloc(10);
- *
- * // Creates a Buffer of length 10,
- * // filled with bytes which all have the value `1`.
- * const buf2 = Buffer.alloc(10, 1);
- *
- * // Creates an uninitialized buffer of length 10.
- * // This is faster than calling Buffer.alloc() but the returned
- * // Buffer instance might contain old data that needs to be
- * // overwritten using fill(), write(), or other functions that fill the Buffer's
- * // contents.
- * const buf3 = Buffer.allocUnsafe(10);
- *
- * // Creates a Buffer containing the bytes [1, 2, 3].
- * const buf4 = Buffer.from([1, 2, 3]);
- *
- * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
- * // are all truncated using `(value & 255)` to fit into the range 0–255.
- * const buf5 = Buffer.from([257, 257.5, -255, '1']);
- *
- * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
- * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
- * // [116, 195, 169, 115, 116] (in decimal notation)
- * const buf6 = Buffer.from('tést');
- *
- * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
- * const buf7 = Buffer.from('tést', 'latin1');
- * ```
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js)
- */
-declare module "buffer" {
- import { BinaryLike } from "node:crypto";
- import { ReadableStream as WebReadableStream } from "node:stream/web";
- /**
- * This function returns `true` if `input` contains only valid UTF-8-encoded data,
- * including the case in which `input` is empty.
- *
- * Throws if the `input` is a detached array buffer.
- * @since v19.4.0, v18.14.0
- * @param input The input to validate.
- */
- export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
- /**
- * This function returns `true` if `input` contains only valid ASCII-encoded data,
- * including the case in which `input` is empty.
- *
- * Throws if the `input` is a detached array buffer.
- * @since v19.6.0, v18.15.0
- * @param input The input to validate.
- */
- export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
- export const INSPECT_MAX_BYTES: number;
- export const kMaxLength: number;
- export const kStringMaxLength: number;
- export const constants: {
- MAX_LENGTH: number;
- MAX_STRING_LENGTH: number;
- };
- export type TranscodeEncoding =
- | "ascii"
- | "utf8"
- | "utf-8"
- | "utf16le"
- | "utf-16le"
- | "ucs2"
- | "ucs-2"
- | "latin1"
- | "binary";
- /**
- * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
- * encoding to another. Returns a new `Buffer` instance.
- *
- * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
- * conversion from `fromEnc` to `toEnc` is not permitted.
- *
- * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
- *
- * The transcoding process will use substitution characters if a given byte
- * sequence cannot be adequately represented in the target encoding. For instance:
- *
- * ```js
- * import { Buffer, transcode } from 'node:buffer';
- *
- * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
- * console.log(newBuf.toString('ascii'));
- * // Prints: '?'
- * ```
- *
- * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
- * with `?` in the transcoded `Buffer`.
- * @since v7.1.0
- * @param source A `Buffer` or `Uint8Array` instance.
- * @param fromEnc The current encoding.
- * @param toEnc To target encoding.
- */
- export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
- export const SlowBuffer: {
- /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
- new(size: number): Buffer;
- prototype: Buffer;
- };
- /**
- * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
- * a prior call to `URL.createObjectURL()`.
- * @since v16.7.0
- * @experimental
- * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
- */
- export function resolveObjectURL(id: string): Blob | undefined;
- export { Buffer };
- /**
- * @experimental
- */
- export interface BlobOptions {
- /**
- * @default 'utf8'
- */
- encoding?: BufferEncoding | undefined;
- /**
- * The Blob content-type. The intent is for `type` to convey
- * the MIME media type of the data, however no validation of the type format
- * is performed.
- */
- type?: string | undefined;
- }
- /**
- * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
- * multiple worker threads.
- * @since v15.7.0, v14.18.0
- */
- export class Blob {
- /**
- * The total size of the `Blob` in bytes.
- * @since v15.7.0, v14.18.0
- */
- readonly size: number;
- /**
- * The content-type of the `Blob`.
- * @since v15.7.0, v14.18.0
- */
- readonly type: string;
- /**
- * Creates a new `Blob` object containing a concatenation of the given sources.
- *
- * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
- * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
- *
- * String sources are also copied into the `Blob`.
- */
- constructor(sources: Array, options?: BlobOptions);
- /**
- * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
- * the `Blob` data.
- * @since v15.7.0, v14.18.0
- */
- arrayBuffer(): Promise;
- /**
- * Creates and returns a new `Blob` containing a subset of this `Blob` objects
- * data. The original `Blob` is not altered.
- * @since v15.7.0, v14.18.0
- * @param start The starting index.
- * @param end The ending index.
- * @param type The content-type for the new `Blob`
- */
- slice(start?: number, end?: number, type?: string): Blob;
- /**
- * Returns a promise that fulfills with the contents of the `Blob` decoded as a
- * UTF-8 string.
- * @since v15.7.0, v14.18.0
- */
- text(): Promise;
- /**
- * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
- * @since v16.7.0
- */
- stream(): WebReadableStream;
- }
- export interface FileOptions {
- /**
- * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
- * converted to the platform native line-ending as specified by `require('node:os').EOL`.
- */
- endings?: "native" | "transparent";
- /** The File content-type. */
- type?: string;
- /** The last modified date of the file. `Default`: Date.now(). */
- lastModified?: number;
- }
- /**
- * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
- * @since v19.2.0, v18.13.0
- */
- export class File extends Blob {
- constructor(sources: Array, fileName: string, options?: FileOptions);
- /**
- * The name of the `File`.
- * @since v19.2.0, v18.13.0
- */
- readonly name: string;
- /**
- * The last modified date of the `File`.
- * @since v19.2.0, v18.13.0
- */
- readonly lastModified: number;
- }
- export import atob = globalThis.atob;
- export import btoa = globalThis.btoa;
- import { Blob as NodeBlob } from "buffer";
- // This conditional type will be the existing global Blob in a browser, or
- // the copy below in a Node environment.
- type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
- global {
- namespace NodeJS {
- export { BufferEncoding };
- }
- // Buffer class
- type BufferEncoding =
- | "ascii"
- | "utf8"
- | "utf-8"
- | "utf16le"
- | "utf-16le"
- | "ucs2"
- | "ucs-2"
- | "base64"
- | "base64url"
- | "latin1"
- | "binary"
- | "hex";
- type WithImplicitCoercion =
- | T
- | {
- valueOf(): T;
- };
- /**
- * Raw data is stored in instances of the Buffer class.
- * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
- * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
- */
- interface BufferConstructor {
- /**
- * Allocates a new buffer containing the given {str}.
- *
- * @param str String to store in buffer.
- * @param encoding encoding to use, optional. Default is 'utf8'
- * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
- */
- new(str: string, encoding?: BufferEncoding): Buffer;
- /**
- * Allocates a new buffer of {size} octets.
- *
- * @param size count of octets to allocate.
- * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
- */
- new(size: number): Buffer;
- /**
- * Allocates a new buffer containing the given {array} of octets.
- *
- * @param array The octets to store.
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
- */
- new(array: Uint8Array): Buffer;
- /**
- * Produces a Buffer backed by the same allocated memory as
- * the given {ArrayBuffer}/{SharedArrayBuffer}.
- *
- * @param arrayBuffer The ArrayBuffer with which to share memory.
- * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
- */
- new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
- /**
- * Allocates a new buffer containing the given {array} of octets.
- *
- * @param array The octets to store.
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
- */
- new(array: readonly any[]): Buffer;
- /**
- * Copies the passed {buffer} data onto a new {Buffer} instance.
- *
- * @param buffer The buffer to copy.
- * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
- */
- new(buffer: Buffer): Buffer;
- /**
- * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
- * Array entries outside that range will be truncated to fit into it.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
- * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
- * ```
- *
- * If `array` is an `Array`\-like object (that is, one with a `length` property of
- * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
- * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
- *
- * A `TypeError` will be thrown if `array` is not an `Array` or another type
- * appropriate for `Buffer.from()` variants.
- *
- * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
- * @since v5.10.0
- */
- from(
- arrayBuffer: WithImplicitCoercion,
- byteOffset?: number,
- length?: number,
- ): Buffer;
- /**
- * Creates a new Buffer using the passed {data}
- * @param data data to create a new Buffer
- */
- from(data: Uint8Array | readonly number[]): Buffer;
- from(data: WithImplicitCoercion): Buffer;
- /**
- * Creates a new Buffer containing the given JavaScript string {str}.
- * If provided, the {encoding} parameter identifies the character encoding.
- * If not provided, {encoding} defaults to 'utf8'.
- */
- from(
- str:
- | WithImplicitCoercion
- | {
- [Symbol.toPrimitive](hint: "string"): string;
- },
- encoding?: BufferEncoding,
- ): Buffer;
- /**
- * Creates a new Buffer using the passed {data}
- * @param values to create a new Buffer
- */
- of(...items: number[]): Buffer;
- /**
- * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * Buffer.isBuffer(Buffer.alloc(10)); // true
- * Buffer.isBuffer(Buffer.from('foo')); // true
- * Buffer.isBuffer('a string'); // false
- * Buffer.isBuffer([]); // false
- * Buffer.isBuffer(new Uint8Array(1024)); // false
- * ```
- * @since v0.1.101
- */
- isBuffer(obj: any): obj is Buffer;
- /**
- * Returns `true` if `encoding` is the name of a supported character encoding,
- * or `false` otherwise.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * console.log(Buffer.isEncoding('utf8'));
- * // Prints: true
- *
- * console.log(Buffer.isEncoding('hex'));
- * // Prints: true
- *
- * console.log(Buffer.isEncoding('utf/8'));
- * // Prints: false
- *
- * console.log(Buffer.isEncoding(''));
- * // Prints: false
- * ```
- * @since v0.9.1
- * @param encoding A character encoding name to check.
- */
- isEncoding(encoding: string): encoding is BufferEncoding;
- /**
- * Returns the byte length of a string when encoded using `encoding`.
- * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
- * for the encoding that is used to convert the string into bytes.
- *
- * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
- * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
- * return value might be greater than the length of a `Buffer` created from the
- * string.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const str = '\u00bd + \u00bc = \u00be';
- *
- * console.log(`${str}: ${str.length} characters, ` +
- * `${Buffer.byteLength(str, 'utf8')} bytes`);
- * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
- * ```
- *
- * When `string` is a
- * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
- * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
- * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
- * @since v0.1.90
- * @param string A value to calculate the length of.
- * @param [encoding='utf8'] If `string` is a string, this is its encoding.
- * @return The number of bytes contained within `string`.
- */
- byteLength(
- string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- encoding?: BufferEncoding,
- ): number;
- /**
- * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
- *
- * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned.
- *
- * If `totalLength` is not provided, it is calculated from the `Buffer` instances
- * in `list` by adding their lengths.
- *
- * If `totalLength` is provided, it is coerced to an unsigned integer. If the
- * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
- * truncated to `totalLength`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Create a single `Buffer` from a list of three `Buffer` instances.
- *
- * const buf1 = Buffer.alloc(10);
- * const buf2 = Buffer.alloc(14);
- * const buf3 = Buffer.alloc(18);
- * const totalLength = buf1.length + buf2.length + buf3.length;
- *
- * console.log(totalLength);
- * // Prints: 42
- *
- * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
- *
- * console.log(bufA);
- * // Prints:
- * console.log(bufA.length);
- * // Prints: 42
- * ```
- *
- * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
- * @since v0.7.11
- * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
- * @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
- */
- concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
- /**
- * Copies the underlying memory of `view` into a new `Buffer`.
- *
- * ```js
- * const u16 = new Uint16Array([0, 0xffff]);
- * const buf = Buffer.copyBytesFrom(u16, 1, 1);
- * u16[1] = 0;
- * console.log(buf.length); // 2
- * console.log(buf[0]); // 255
- * console.log(buf[1]); // 255
- * ```
- * @since v19.8.0
- * @param view The {TypedArray} to copy.
- * @param [offset=': 0'] The starting offset within `view`.
- * @param [length=view.length - offset] The number of elements from `view` to copy.
- */
- copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
- /**
- * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from('1234');
- * const buf2 = Buffer.from('0123');
- * const arr = [buf1, buf2];
- *
- * console.log(arr.sort(Buffer.compare));
- * // Prints: [ , ]
- * // (This result is equal to: [buf2, buf1].)
- * ```
- * @since v0.11.13
- * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
- */
- compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
- /**
- * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.alloc(5);
- *
- * console.log(buf);
- * // Prints:
- * ```
- *
- * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
- *
- * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.alloc(5, 'a');
- *
- * console.log(buf);
- * // Prints:
- * ```
- *
- * If both `fill` and `encoding` are specified, the allocated `Buffer` will be
- * initialized by calling `buf.fill(fill, encoding)`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
- *
- * console.log(buf);
- * // Prints:
- * ```
- *
- * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
- * contents will never contain sensitive data from previous allocations, including
- * data that might not have been allocated for `Buffer`s.
- *
- * A `TypeError` will be thrown if `size` is not a number.
- * @since v5.10.0
- * @param size The desired length of the new `Buffer`.
- * @param [fill=0] A value to pre-fill the new `Buffer` with.
- * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
- */
- alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
- /**
- * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
- *
- * The underlying memory for `Buffer` instances created in this way is _not_
- * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(10);
- *
- * console.log(buf);
- * // Prints (contents may vary):
- *
- * buf.fill(0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- *
- * A `TypeError` will be thrown if `size` is not a number.
- *
- * The `Buffer` module pre-allocates an internal `Buffer` instance of
- * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
- * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
- *
- * Use of this pre-allocated internal memory pool is a key difference between
- * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
- * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
- * than or equal to half `Buffer.poolSize`. The
- * difference is subtle but can be important when an application requires the
- * additional performance that `Buffer.allocUnsafe()` provides.
- * @since v5.10.0
- * @param size The desired length of the new `Buffer`.
- */
- allocUnsafe(size: number): Buffer;
- /**
- * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
- * `size` is 0.
- *
- * The underlying memory for `Buffer` instances created in this way is _not_
- * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
- * such `Buffer` instances with zeroes.
- *
- * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
- * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
- * allows applications to avoid the garbage collection overhead of creating many
- * individually allocated `Buffer` instances. This approach improves both
- * performance and memory usage by eliminating the need to track and clean up as
- * many individual `ArrayBuffer` objects.
- *
- * However, in the case where a developer may need to retain a small chunk of
- * memory from a pool for an indeterminate amount of time, it may be appropriate
- * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
- * then copying out the relevant bits.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Need to keep around a few small chunks of memory.
- * const store = [];
- *
- * socket.on('readable', () => {
- * let data;
- * while (null !== (data = readable.read())) {
- * // Allocate for retained data.
- * const sb = Buffer.allocUnsafeSlow(10);
- *
- * // Copy the data into the new allocation.
- * data.copy(sb, 0, 0, 10);
- *
- * store.push(sb);
- * }
- * });
- * ```
- *
- * A `TypeError` will be thrown if `size` is not a number.
- * @since v5.12.0
- * @param size The desired length of the new `Buffer`.
- */
- allocUnsafeSlow(size: number): Buffer;
- /**
- * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
- * for pooling. This value may be modified.
- * @since v0.11.3
- */
- poolSize: number;
- }
- interface Buffer extends Uint8Array {
- /**
- * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
- * not contain enough space to fit the entire string, only part of `string` will be
- * written. However, partially encoded characters will not be written.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.alloc(256);
- *
- * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
- *
- * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
- * // Prints: 12 bytes: ½ + ¼ = ¾
- *
- * const buffer = Buffer.alloc(10);
- *
- * const length = buffer.write('abcd', 8);
- *
- * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
- * // Prints: 2 bytes : ab
- * ```
- * @since v0.1.90
- * @param string String to write to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write `string`.
- * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
- * @param [encoding='utf8'] The character encoding of `string`.
- * @return Number of bytes written.
- */
- write(string: string, encoding?: BufferEncoding): number;
- write(string: string, offset: number, encoding?: BufferEncoding): number;
- write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
- /**
- * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
- *
- * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
- * then each invalid byte is replaced with the replacement character `U+FFFD`.
- *
- * The maximum length of a string instance (in UTF-16 code units) is available
- * as {@link constants.MAX_STRING_LENGTH}.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.allocUnsafe(26);
- *
- * for (let i = 0; i < 26; i++) {
- * // 97 is the decimal ASCII value for 'a'.
- * buf1[i] = i + 97;
- * }
- *
- * console.log(buf1.toString('utf8'));
- * // Prints: abcdefghijklmnopqrstuvwxyz
- * console.log(buf1.toString('utf8', 0, 5));
- * // Prints: abcde
- *
- * const buf2 = Buffer.from('tést');
- *
- * console.log(buf2.toString('hex'));
- * // Prints: 74c3a97374
- * console.log(buf2.toString('utf8', 0, 3));
- * // Prints: té
- * console.log(buf2.toString(undefined, 0, 3));
- * // Prints: té
- * ```
- * @since v0.1.90
- * @param [encoding='utf8'] The character encoding to use.
- * @param [start=0] The byte offset to start decoding at.
- * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
- */
- toString(encoding?: BufferEncoding, start?: number, end?: number): string;
- /**
- * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
- * this function when stringifying a `Buffer` instance.
- *
- * `Buffer.from()` accepts objects in the format returned from this method.
- * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
- * const json = JSON.stringify(buf);
- *
- * console.log(json);
- * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
- *
- * const copy = JSON.parse(json, (key, value) => {
- * return value && value.type === 'Buffer' ?
- * Buffer.from(value) :
- * value;
- * });
- *
- * console.log(copy);
- * // Prints:
- * ```
- * @since v0.9.2
- */
- toJSON(): {
- type: "Buffer";
- data: number[];
- };
- /**
- * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from('ABC');
- * const buf2 = Buffer.from('414243', 'hex');
- * const buf3 = Buffer.from('ABCD');
- *
- * console.log(buf1.equals(buf2));
- * // Prints: true
- * console.log(buf1.equals(buf3));
- * // Prints: false
- * ```
- * @since v0.11.13
- * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
- */
- equals(otherBuffer: Uint8Array): boolean;
- /**
- * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
- * Comparison is based on the actual sequence of bytes in each `Buffer`.
- *
- * * `0` is returned if `target` is the same as `buf`
- * * `1` is returned if `target` should come _before_`buf` when sorted.
- * * `-1` is returned if `target` should come _after_`buf` when sorted.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from('ABC');
- * const buf2 = Buffer.from('BCD');
- * const buf3 = Buffer.from('ABCD');
- *
- * console.log(buf1.compare(buf1));
- * // Prints: 0
- * console.log(buf1.compare(buf2));
- * // Prints: -1
- * console.log(buf1.compare(buf3));
- * // Prints: -1
- * console.log(buf2.compare(buf1));
- * // Prints: 1
- * console.log(buf2.compare(buf3));
- * // Prints: 1
- * console.log([buf1, buf2, buf3].sort(Buffer.compare));
- * // Prints: [ , , ]
- * // (This result is equal to: [buf1, buf3, buf2].)
- * ```
- *
- * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
- * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
- *
- * console.log(buf1.compare(buf2, 5, 9, 0, 4));
- * // Prints: 0
- * console.log(buf1.compare(buf2, 0, 6, 4));
- * // Prints: -1
- * console.log(buf1.compare(buf2, 5, 6, 5));
- * // Prints: 1
- * ```
- *
- * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
- * @since v0.11.13
- * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
- * @param [targetStart=0] The offset within `target` at which to begin comparison.
- * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
- * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
- * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
- */
- compare(
- target: Uint8Array,
- targetStart?: number,
- targetEnd?: number,
- sourceStart?: number,
- sourceEnd?: number,
- ): -1 | 0 | 1;
- /**
- * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
- *
- * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
- * for all TypedArrays, including Node.js `Buffer`s, although it takes
- * different function arguments.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Create two `Buffer` instances.
- * const buf1 = Buffer.allocUnsafe(26);
- * const buf2 = Buffer.allocUnsafe(26).fill('!');
- *
- * for (let i = 0; i < 26; i++) {
- * // 97 is the decimal ASCII value for 'a'.
- * buf1[i] = i + 97;
- * }
- *
- * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
- * buf1.copy(buf2, 8, 16, 20);
- * // This is equivalent to:
- * // buf2.set(buf1.subarray(16, 20), 8);
- *
- * console.log(buf2.toString('ascii', 0, 25));
- * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
- * ```
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Create a `Buffer` and copy data from one region to an overlapping region
- * // within the same `Buffer`.
- *
- * const buf = Buffer.allocUnsafe(26);
- *
- * for (let i = 0; i < 26; i++) {
- * // 97 is the decimal ASCII value for 'a'.
- * buf[i] = i + 97;
- * }
- *
- * buf.copy(buf, 0, 4, 10);
- *
- * console.log(buf.toString());
- * // Prints: efghijghijklmnopqrstuvwxyz
- * ```
- * @since v0.1.90
- * @param target A `Buffer` or {@link Uint8Array} to copy into.
- * @param [targetStart=0] The offset within `target` at which to begin writing.
- * @param [sourceStart=0] The offset within `buf` from which to begin copying.
- * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
- * @return The number of bytes copied.
- */
- copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
- /**
- * Returns a new `Buffer` that references the same memory as the original, but
- * offset and cropped by the `start` and `end` indices.
- *
- * This method is not compatible with the `Uint8Array.prototype.slice()`,
- * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('buffer');
- *
- * const copiedBuf = Uint8Array.prototype.slice.call(buf);
- * copiedBuf[0]++;
- * console.log(copiedBuf.toString());
- * // Prints: cuffer
- *
- * console.log(buf.toString());
- * // Prints: buffer
- *
- * // With buf.slice(), the original buffer is modified.
- * const notReallyCopiedBuf = buf.slice();
- * notReallyCopiedBuf[0]++;
- * console.log(notReallyCopiedBuf.toString());
- * // Prints: cuffer
- * console.log(buf.toString());
- * // Also prints: cuffer (!)
- * ```
- * @since v0.3.0
- * @deprecated Use `subarray` instead.
- * @param [start=0] Where the new `Buffer` will start.
- * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
- */
- slice(start?: number, end?: number): Buffer;
- /**
- * Returns a new `Buffer` that references the same memory as the original, but
- * offset and cropped by the `start` and `end` indices.
- *
- * Specifying `end` greater than `buf.length` will return the same result as
- * that of `end` equal to `buf.length`.
- *
- * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
- *
- * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
- * // from the original `Buffer`.
- *
- * const buf1 = Buffer.allocUnsafe(26);
- *
- * for (let i = 0; i < 26; i++) {
- * // 97 is the decimal ASCII value for 'a'.
- * buf1[i] = i + 97;
- * }
- *
- * const buf2 = buf1.subarray(0, 3);
- *
- * console.log(buf2.toString('ascii', 0, buf2.length));
- * // Prints: abc
- *
- * buf1[0] = 33;
- *
- * console.log(buf2.toString('ascii', 0, buf2.length));
- * // Prints: !bc
- * ```
- *
- * Specifying negative indexes causes the slice to be generated relative to the
- * end of `buf` rather than the beginning.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('buffer');
- *
- * console.log(buf.subarray(-6, -1).toString());
- * // Prints: buffe
- * // (Equivalent to buf.subarray(0, 5).)
- *
- * console.log(buf.subarray(-6, -2).toString());
- * // Prints: buff
- * // (Equivalent to buf.subarray(0, 4).)
- *
- * console.log(buf.subarray(-5, -2).toString());
- * // Prints: uff
- * // (Equivalent to buf.subarray(1, 4).)
- * ```
- * @since v3.0.0
- * @param [start=0] Where the new `Buffer` will start.
- * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
- */
- subarray(start?: number, end?: number): Buffer;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian.
- *
- * `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(8);
- *
- * buf.writeBigInt64BE(0x0102030405060708n, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v12.0.0, v10.20.0
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
- * @return `offset` plus the number of bytes written.
- */
- writeBigInt64BE(value: bigint, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian.
- *
- * `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(8);
- *
- * buf.writeBigInt64LE(0x0102030405060708n, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v12.0.0, v10.20.0
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
- * @return `offset` plus the number of bytes written.
- */
- writeBigInt64LE(value: bigint, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian.
- *
- * This function is also available under the `writeBigUint64BE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(8);
- *
- * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v12.0.0, v10.20.0
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
- * @return `offset` plus the number of bytes written.
- */
- writeBigUInt64BE(value: bigint, offset?: number): number;
- /**
- * @alias Buffer.writeBigUInt64BE
- * @since v14.10.0, v12.19.0
- */
- writeBigUint64BE(value: bigint, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(8);
- *
- * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- *
- * This function is also available under the `writeBigUint64LE` alias.
- * @since v12.0.0, v10.20.0
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
- * @return `offset` plus the number of bytes written.
- */
- writeBigUInt64LE(value: bigint, offset?: number): number;
- /**
- * @alias Buffer.writeBigUInt64LE
- * @since v14.10.0, v12.19.0
- */
- writeBigUint64LE(value: bigint, offset?: number): number;
- /**
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
- * when `value` is anything other than an unsigned integer.
- *
- * This function is also available under the `writeUintLE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(6);
- *
- * buf.writeUIntLE(0x1234567890ab, 0, 6);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
- * @return `offset` plus the number of bytes written.
- */
- writeUIntLE(value: number, offset: number, byteLength: number): number;
- /**
- * @alias Buffer.writeUIntLE
- * @since v14.9.0, v12.19.0
- */
- writeUintLE(value: number, offset: number, byteLength: number): number;
- /**
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
- * when `value` is anything other than an unsigned integer.
- *
- * This function is also available under the `writeUintBE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(6);
- *
- * buf.writeUIntBE(0x1234567890ab, 0, 6);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
- * @return `offset` plus the number of bytes written.
- */
- writeUIntBE(value: number, offset: number, byteLength: number): number;
- /**
- * @alias Buffer.writeUIntBE
- * @since v14.9.0, v12.19.0
- */
- writeUintBE(value: number, offset: number, byteLength: number): number;
- /**
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
- * when `value` is anything other than a signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(6);
- *
- * buf.writeIntLE(0x1234567890ab, 0, 6);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.11.15
- * @param value Number to be written to `buf`.
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
- * @return `offset` plus the number of bytes written.
- */
- writeIntLE(value: number, offset: number, byteLength: number): number;
- /**
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
- * signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(6);
- *
- * buf.writeIntBE(0x1234567890ab, 0, 6);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.11.15
- * @param value Number to be written to `buf`.
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
- * @return `offset` plus the number of bytes written.
- */
- writeIntBE(value: number, offset: number, byteLength: number): number;
- /**
- * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
- *
- * This function is also available under the `readBigUint64BE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
- *
- * console.log(buf.readBigUInt64BE(0));
- * // Prints: 4294967295n
- * ```
- * @since v12.0.0, v10.20.0
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
- */
- readBigUInt64BE(offset?: number): bigint;
- /**
- * @alias Buffer.readBigUInt64BE
- * @since v14.10.0, v12.19.0
- */
- readBigUint64BE(offset?: number): bigint;
- /**
- * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
- *
- * This function is also available under the `readBigUint64LE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
- *
- * console.log(buf.readBigUInt64LE(0));
- * // Prints: 18446744069414584320n
- * ```
- * @since v12.0.0, v10.20.0
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
- */
- readBigUInt64LE(offset?: number): bigint;
- /**
- * @alias Buffer.readBigUInt64LE
- * @since v14.10.0, v12.19.0
- */
- readBigUint64LE(offset?: number): bigint;
- /**
- * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed
- * values.
- * @since v12.0.0, v10.20.0
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
- */
- readBigInt64BE(offset?: number): bigint;
- /**
- * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed
- * values.
- * @since v12.0.0, v10.20.0
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
- */
- readBigInt64LE(offset?: number): bigint;
- /**
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting
- * up to 48 bits of accuracy.
- *
- * This function is also available under the `readUintLE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
- *
- * console.log(buf.readUIntLE(0, 6).toString(16));
- * // Prints: ab9078563412
- * ```
- * @since v0.11.15
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
- */
- readUIntLE(offset: number, byteLength: number): number;
- /**
- * @alias Buffer.readUIntLE
- * @since v14.9.0, v12.19.0
- */
- readUintLE(offset: number, byteLength: number): number;
- /**
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting
- * up to 48 bits of accuracy.
- *
- * This function is also available under the `readUintBE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
- *
- * console.log(buf.readUIntBE(0, 6).toString(16));
- * // Prints: 1234567890ab
- * console.log(buf.readUIntBE(1, 6).toString(16));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.11.15
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
- */
- readUIntBE(offset: number, byteLength: number): number;
- /**
- * @alias Buffer.readUIntBE
- * @since v14.9.0, v12.19.0
- */
- readUintBE(offset: number, byteLength: number): number;
- /**
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value
- * supporting up to 48 bits of accuracy.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
- *
- * console.log(buf.readIntLE(0, 6).toString(16));
- * // Prints: -546f87a9cbee
- * ```
- * @since v0.11.15
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
- */
- readIntLE(offset: number, byteLength: number): number;
- /**
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value
- * supporting up to 48 bits of accuracy.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
- *
- * console.log(buf.readIntBE(0, 6).toString(16));
- * // Prints: 1234567890ab
- * console.log(buf.readIntBE(1, 6).toString(16));
- * // Throws ERR_OUT_OF_RANGE.
- * console.log(buf.readIntBE(1, 0).toString(16));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.11.15
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
- */
- readIntBE(offset: number, byteLength: number): number;
- /**
- * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
- *
- * This function is also available under the `readUint8` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([1, -2]);
- *
- * console.log(buf.readUInt8(0));
- * // Prints: 1
- * console.log(buf.readUInt8(1));
- * // Prints: 254
- * console.log(buf.readUInt8(2));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.5.0
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
- */
- readUInt8(offset?: number): number;
- /**
- * @alias Buffer.readUInt8
- * @since v14.9.0, v12.19.0
- */
- readUint8(offset?: number): number;
- /**
- * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`.
- *
- * This function is also available under the `readUint16LE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56]);
- *
- * console.log(buf.readUInt16LE(0).toString(16));
- * // Prints: 3412
- * console.log(buf.readUInt16LE(1).toString(16));
- * // Prints: 5634
- * console.log(buf.readUInt16LE(2).toString(16));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
- */
- readUInt16LE(offset?: number): number;
- /**
- * @alias Buffer.readUInt16LE
- * @since v14.9.0, v12.19.0
- */
- readUint16LE(offset?: number): number;
- /**
- * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
- *
- * This function is also available under the `readUint16BE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56]);
- *
- * console.log(buf.readUInt16BE(0).toString(16));
- * // Prints: 1234
- * console.log(buf.readUInt16BE(1).toString(16));
- * // Prints: 3456
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
- */
- readUInt16BE(offset?: number): number;
- /**
- * @alias Buffer.readUInt16BE
- * @since v14.9.0, v12.19.0
- */
- readUint16BE(offset?: number): number;
- /**
- * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
- *
- * This function is also available under the `readUint32LE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
- *
- * console.log(buf.readUInt32LE(0).toString(16));
- * // Prints: 78563412
- * console.log(buf.readUInt32LE(1).toString(16));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
- */
- readUInt32LE(offset?: number): number;
- /**
- * @alias Buffer.readUInt32LE
- * @since v14.9.0, v12.19.0
- */
- readUint32LE(offset?: number): number;
- /**
- * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
- *
- * This function is also available under the `readUint32BE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
- *
- * console.log(buf.readUInt32BE(0).toString(16));
- * // Prints: 12345678
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
- */
- readUInt32BE(offset?: number): number;
- /**
- * @alias Buffer.readUInt32BE
- * @since v14.9.0, v12.19.0
- */
- readUint32BE(offset?: number): number;
- /**
- * Reads a signed 8-bit integer from `buf` at the specified `offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([-1, 5]);
- *
- * console.log(buf.readInt8(0));
- * // Prints: -1
- * console.log(buf.readInt8(1));
- * // Prints: 5
- * console.log(buf.readInt8(2));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.5.0
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
- */
- readInt8(offset?: number): number;
- /**
- * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0, 5]);
- *
- * console.log(buf.readInt16LE(0));
- * // Prints: 1280
- * console.log(buf.readInt16LE(1));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
- */
- readInt16LE(offset?: number): number;
- /**
- * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0, 5]);
- *
- * console.log(buf.readInt16BE(0));
- * // Prints: 5
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
- */
- readInt16BE(offset?: number): number;
- /**
- * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0, 0, 0, 5]);
- *
- * console.log(buf.readInt32LE(0));
- * // Prints: 83886080
- * console.log(buf.readInt32LE(1));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
- */
- readInt32LE(offset?: number): number;
- /**
- * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
- *
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([0, 0, 0, 5]);
- *
- * console.log(buf.readInt32BE(0));
- * // Prints: 5
- * ```
- * @since v0.5.5
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
- */
- readInt32BE(offset?: number): number;
- /**
- * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([1, 2, 3, 4]);
- *
- * console.log(buf.readFloatLE(0));
- * // Prints: 1.539989614439558e-36
- * console.log(buf.readFloatLE(1));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.11.15
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
- */
- readFloatLE(offset?: number): number;
- /**
- * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([1, 2, 3, 4]);
- *
- * console.log(buf.readFloatBE(0));
- * // Prints: 2.387939260590663e-38
- * ```
- * @since v0.11.15
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
- */
- readFloatBE(offset?: number): number;
- /**
- * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
- *
- * console.log(buf.readDoubleLE(0));
- * // Prints: 5.447603722011605e-270
- * console.log(buf.readDoubleLE(1));
- * // Throws ERR_OUT_OF_RANGE.
- * ```
- * @since v0.11.15
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
- */
- readDoubleLE(offset?: number): number;
- /**
- * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
- *
- * console.log(buf.readDoubleBE(0));
- * // Prints: 8.20788039913184e-304
- * ```
- * @since v0.11.15
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
- */
- readDoubleBE(offset?: number): number;
- reverse(): this;
- /**
- * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
- * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
- *
- * console.log(buf1);
- * // Prints:
- *
- * buf1.swap16();
- *
- * console.log(buf1);
- * // Prints:
- *
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
- *
- * buf2.swap16();
- * // Throws ERR_INVALID_BUFFER_SIZE.
- * ```
- *
- * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
- * between UTF-16 little-endian and UTF-16 big-endian:
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
- * buf.swap16(); // Convert to big-endian UTF-16 text.
- * ```
- * @since v5.10.0
- * @return A reference to `buf`.
- */
- swap16(): Buffer;
- /**
- * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
- * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
- *
- * console.log(buf1);
- * // Prints:
- *
- * buf1.swap32();
- *
- * console.log(buf1);
- * // Prints:
- *
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
- *
- * buf2.swap32();
- * // Throws ERR_INVALID_BUFFER_SIZE.
- * ```
- * @since v5.10.0
- * @return A reference to `buf`.
- */
- swap32(): Buffer;
- /**
- * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
- * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
- *
- * console.log(buf1);
- * // Prints:
- *
- * buf1.swap64();
- *
- * console.log(buf1);
- * // Prints:
- *
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
- *
- * buf2.swap64();
- * // Throws ERR_INVALID_BUFFER_SIZE.
- * ```
- * @since v6.3.0
- * @return A reference to `buf`.
- */
- swap64(): Buffer;
- /**
- * Writes `value` to `buf` at the specified `offset`. `value` must be a
- * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
- * other than an unsigned 8-bit integer.
- *
- * This function is also available under the `writeUint8` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeUInt8(0x3, 0);
- * buf.writeUInt8(0x4, 1);
- * buf.writeUInt8(0x23, 2);
- * buf.writeUInt8(0x42, 3);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.0
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
- * @return `offset` plus the number of bytes written.
- */
- writeUInt8(value: number, offset?: number): number;
- /**
- * @alias Buffer.writeUInt8
- * @since v14.9.0, v12.19.0
- */
- writeUint8(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
- * anything other than an unsigned 16-bit integer.
- *
- * This function is also available under the `writeUint16LE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeUInt16LE(0xdead, 0);
- * buf.writeUInt16LE(0xbeef, 2);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
- * @return `offset` plus the number of bytes written.
- */
- writeUInt16LE(value: number, offset?: number): number;
- /**
- * @alias Buffer.writeUInt16LE
- * @since v14.9.0, v12.19.0
- */
- writeUint16LE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
- * unsigned 16-bit integer.
- *
- * This function is also available under the `writeUint16BE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeUInt16BE(0xdead, 0);
- * buf.writeUInt16BE(0xbeef, 2);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
- * @return `offset` plus the number of bytes written.
- */
- writeUInt16BE(value: number, offset?: number): number;
- /**
- * @alias Buffer.writeUInt16BE
- * @since v14.9.0, v12.19.0
- */
- writeUint16BE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
- * anything other than an unsigned 32-bit integer.
- *
- * This function is also available under the `writeUint32LE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeUInt32LE(0xfeedface, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
- * @return `offset` plus the number of bytes written.
- */
- writeUInt32LE(value: number, offset?: number): number;
- /**
- * @alias Buffer.writeUInt32LE
- * @since v14.9.0, v12.19.0
- */
- writeUint32LE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
- * unsigned 32-bit integer.
- *
- * This function is also available under the `writeUint32BE` alias.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeUInt32BE(0xfeedface, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
- * @return `offset` plus the number of bytes written.
- */
- writeUInt32BE(value: number, offset?: number): number;
- /**
- * @alias Buffer.writeUInt32BE
- * @since v14.9.0, v12.19.0
- */
- writeUint32BE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
- * signed 8-bit integer. Behavior is undefined when `value` is anything other than
- * a signed 8-bit integer.
- *
- * `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(2);
- *
- * buf.writeInt8(2, 0);
- * buf.writeInt8(-2, 1);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.0
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
- * @return `offset` plus the number of bytes written.
- */
- writeInt8(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
- * anything other than a signed 16-bit integer.
- *
- * The `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(2);
- *
- * buf.writeInt16LE(0x0304, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
- * @return `offset` plus the number of bytes written.
- */
- writeInt16LE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
- * anything other than a signed 16-bit integer.
- *
- * The `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(2);
- *
- * buf.writeInt16BE(0x0102, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
- * @return `offset` plus the number of bytes written.
- */
- writeInt16BE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
- * anything other than a signed 32-bit integer.
- *
- * The `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeInt32LE(0x05060708, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
- * @return `offset` plus the number of bytes written.
- */
- writeInt32LE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
- * anything other than a signed 32-bit integer.
- *
- * The `value` is interpreted and written as a two's complement signed integer.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeInt32BE(0x01020304, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.5.5
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
- * @return `offset` plus the number of bytes written.
- */
- writeInt32BE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
- * undefined when `value` is anything other than a JavaScript number.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeFloatLE(0xcafebabe, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.11.15
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
- * @return `offset` plus the number of bytes written.
- */
- writeFloatLE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
- * undefined when `value` is anything other than a JavaScript number.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(4);
- *
- * buf.writeFloatBE(0xcafebabe, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.11.15
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
- * @return `offset` plus the number of bytes written.
- */
- writeFloatBE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
- * other than a JavaScript number.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(8);
- *
- * buf.writeDoubleLE(123.456, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.11.15
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
- * @return `offset` plus the number of bytes written.
- */
- writeDoubleLE(value: number, offset?: number): number;
- /**
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
- * other than a JavaScript number.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(8);
- *
- * buf.writeDoubleBE(123.456, 0);
- *
- * console.log(buf);
- * // Prints:
- * ```
- * @since v0.11.15
- * @param value Number to be written to `buf`.
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
- * @return `offset` plus the number of bytes written.
- */
- writeDoubleBE(value: number, offset?: number): number;
- /**
- * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
- * the entire `buf` will be filled:
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Fill a `Buffer` with the ASCII character 'h'.
- *
- * const b = Buffer.allocUnsafe(50).fill('h');
- *
- * console.log(b.toString());
- * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
- *
- * // Fill a buffer with empty string
- * const c = Buffer.allocUnsafe(5).fill('');
- *
- * console.log(c.fill(''));
- * // Prints:
- * ```
- *
- * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
- * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
- * filled with `value & 255`.
- *
- * If the final write of a `fill()` operation falls on a multi-byte character,
- * then only the bytes of that character that fit into `buf` are written:
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
- *
- * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
- * // Prints:
- * ```
- *
- * If `value` contains invalid characters, it is truncated; if no valid
- * fill data remains, an exception is thrown:
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.allocUnsafe(5);
- *
- * console.log(buf.fill('a'));
- * // Prints:
- * console.log(buf.fill('aazz', 'hex'));
- * // Prints:
- * console.log(buf.fill('zz', 'hex'));
- * // Throws an exception.
- * ```
- * @since v0.5.0
- * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.
- * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
- * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
- * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
- * @return A reference to `buf`.
- */
- fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
- /**
- * If `value` is:
- *
- * * a string, `value` is interpreted according to the character encoding in`encoding`.
- * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
- * To compare a partial `Buffer`, use `buf.subarray`.
- * * a number, `value` will be interpreted as an unsigned 8-bit integer
- * value between `0` and `255`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('this is a buffer');
- *
- * console.log(buf.indexOf('this'));
- * // Prints: 0
- * console.log(buf.indexOf('is'));
- * // Prints: 2
- * console.log(buf.indexOf(Buffer.from('a buffer')));
- * // Prints: 8
- * console.log(buf.indexOf(97));
- * // Prints: 8 (97 is the decimal ASCII value for 'a')
- * console.log(buf.indexOf(Buffer.from('a buffer example')));
- * // Prints: -1
- * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
- * // Prints: 8
- *
- * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
- *
- * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
- * // Prints: 4
- * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
- * // Prints: 6
- * ```
- *
- * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
- * an integer between 0 and 255.
- *
- * If `byteOffset` is not a number, it will be coerced to a number. If the result
- * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
- * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const b = Buffer.from('abcdef');
- *
- * // Passing a value that's a number, but not a valid byte.
- * // Prints: 2, equivalent to searching for 99 or 'c'.
- * console.log(b.indexOf(99.9));
- * console.log(b.indexOf(256 + 99));
- *
- * // Passing a byteOffset that coerces to NaN or 0.
- * // Prints: 1, searching the whole buffer.
- * console.log(b.indexOf('b', undefined));
- * console.log(b.indexOf('b', {}));
- * console.log(b.indexOf('b', null));
- * console.log(b.indexOf('b', []));
- * ```
- *
- * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
- * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
- * @since v1.5.0
- * @param value What to search for.
- * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
- * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
- * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
- */
- indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
- /**
- * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
- * rather than the first occurrence.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('this buffer is a buffer');
- *
- * console.log(buf.lastIndexOf('this'));
- * // Prints: 0
- * console.log(buf.lastIndexOf('buffer'));
- * // Prints: 17
- * console.log(buf.lastIndexOf(Buffer.from('buffer')));
- * // Prints: 17
- * console.log(buf.lastIndexOf(97));
- * // Prints: 15 (97 is the decimal ASCII value for 'a')
- * console.log(buf.lastIndexOf(Buffer.from('yolo')));
- * // Prints: -1
- * console.log(buf.lastIndexOf('buffer', 5));
- * // Prints: 5
- * console.log(buf.lastIndexOf('buffer', 4));
- * // Prints: -1
- *
- * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
- *
- * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
- * // Prints: 6
- * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
- * // Prints: 4
- * ```
- *
- * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
- * an integer between 0 and 255.
- *
- * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
- * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
- * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const b = Buffer.from('abcdef');
- *
- * // Passing a value that's a number, but not a valid byte.
- * // Prints: 2, equivalent to searching for 99 or 'c'.
- * console.log(b.lastIndexOf(99.9));
- * console.log(b.lastIndexOf(256 + 99));
- *
- * // Passing a byteOffset that coerces to NaN.
- * // Prints: 1, searching the whole buffer.
- * console.log(b.lastIndexOf('b', undefined));
- * console.log(b.lastIndexOf('b', {}));
- *
- * // Passing a byteOffset that coerces to 0.
- * // Prints: -1, equivalent to passing 0.
- * console.log(b.lastIndexOf('b', null));
- * console.log(b.lastIndexOf('b', []));
- * ```
- *
- * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
- * @since v6.0.0
- * @param value What to search for.
- * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
- * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
- * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
- */
- lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
- /**
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents
- * of `buf`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * // Log the entire contents of a `Buffer`.
- *
- * const buf = Buffer.from('buffer');
- *
- * for (const pair of buf.entries()) {
- * console.log(pair);
- * }
- * // Prints:
- * // [0, 98]
- * // [1, 117]
- * // [2, 102]
- * // [3, 102]
- * // [4, 101]
- * // [5, 114]
- * ```
- * @since v1.1.0
- */
- entries(): IterableIterator<[number, number]>;
- /**
- * Equivalent to `buf.indexOf() !== -1`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('this is a buffer');
- *
- * console.log(buf.includes('this'));
- * // Prints: true
- * console.log(buf.includes('is'));
- * // Prints: true
- * console.log(buf.includes(Buffer.from('a buffer')));
- * // Prints: true
- * console.log(buf.includes(97));
- * // Prints: true (97 is the decimal ASCII value for 'a')
- * console.log(buf.includes(Buffer.from('a buffer example')));
- * // Prints: false
- * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
- * // Prints: true
- * console.log(buf.includes('this', 4));
- * // Prints: false
- * ```
- * @since v5.3.0
- * @param value What to search for.
- * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
- * @param [encoding='utf8'] If `value` is a string, this is its encoding.
- * @return `true` if `value` was found in `buf`, `false` otherwise.
- */
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
- /**
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('buffer');
- *
- * for (const key of buf.keys()) {
- * console.log(key);
- * }
- * // Prints:
- * // 0
- * // 1
- * // 2
- * // 3
- * // 4
- * // 5
- * ```
- * @since v1.1.0
- */
- keys(): IterableIterator;
- /**
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is
- * called automatically when a `Buffer` is used in a `for..of` statement.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- *
- * const buf = Buffer.from('buffer');
- *
- * for (const value of buf.values()) {
- * console.log(value);
- * }
- * // Prints:
- * // 98
- * // 117
- * // 102
- * // 102
- * // 101
- * // 114
- *
- * for (const value of buf) {
- * console.log(value);
- * }
- * // Prints:
- * // 98
- * // 117
- * // 102
- * // 102
- * // 101
- * // 114
- * ```
- * @since v1.1.0
- */
- values(): IterableIterator;
- }
- var Buffer: BufferConstructor;
- /**
- * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
- * into a string using Latin-1 (ISO-8859-1).
- *
- * The `data` may be any JavaScript-value that can be coerced into a string.
- *
- * **This function is only provided for compatibility with legacy web platform APIs**
- * **and should never be used in new code, because they use strings to represent**
- * **binary data and predate the introduction of typed arrays in JavaScript.**
- * **For code running using Node.js APIs, converting between base64-encoded strings**
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
- * @since v15.13.0, v14.17.0
- * @legacy Use `Buffer.from(data, 'base64')` instead.
- * @param data The Base64-encoded input string.
- */
- function atob(data: string): string;
- /**
- * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
- * into a string using Base64.
- *
- * The `data` may be any JavaScript-value that can be coerced into a string.
- *
- * **This function is only provided for compatibility with legacy web platform APIs**
- * **and should never be used in new code, because they use strings to represent**
- * **binary data and predate the introduction of typed arrays in JavaScript.**
- * **For code running using Node.js APIs, converting between base64-encoded strings**
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
- * @since v15.13.0, v14.17.0
- * @legacy Use `buf.toString('base64')` instead.
- * @param data An ASCII (Latin1) string.
- */
- function btoa(data: string): string;
- interface Blob extends __Blob {}
- /**
- * `Blob` class is a global reference for `require('node:buffer').Blob`
- * https://nodejs.org/api/buffer.html#class-blob
- * @since v18.0.0
- */
- var Blob: typeof globalThis extends {
- onmessage: any;
- Blob: infer T;
- } ? T
- : typeof NodeBlob;
- }
-}
-declare module "node:buffer" {
- export * from "buffer";
-}
diff --git a/example_bot/node_modules/@types/node/child_process.d.ts b/example_bot/node_modules/@types/node/child_process.d.ts
deleted file mode 100644
index a97532b..0000000
--- a/example_bot/node_modules/@types/node/child_process.d.ts
+++ /dev/null
@@ -1,1540 +0,0 @@
-/**
- * The `node:child_process` module provides the ability to spawn subprocesses in
- * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
- * is primarily provided by the {@link spawn} function:
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const ls = spawn('ls', ['-lh', '/usr']);
- *
- * ls.stdout.on('data', (data) => {
- * console.log(`stdout: ${data}`);
- * });
- *
- * ls.stderr.on('data', (data) => {
- * console.error(`stderr: ${data}`);
- * });
- *
- * ls.on('close', (code) => {
- * console.log(`child process exited with code ${code}`);
- * });
- * ```
- *
- * By default, pipes for `stdin`, `stdout`, and `stderr` are established between
- * the parent Node.js process and the spawned subprocess. These pipes have
- * limited (and platform-specific) capacity. If the subprocess writes to
- * stdout in excess of that limit without the output being captured, the
- * subprocess blocks waiting for the pipe buffer to accept more data. This is
- * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
- *
- * The command lookup is performed using the `options.env.PATH` environment
- * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
- * used. If `options.env` is set without `PATH`, lookup on Unix is performed
- * on a default search path search of `/usr/bin:/bin` (see your operating system's
- * manual for execvpe/execvp), on Windows the current processes environment
- * variable `PATH` is used.
- *
- * On Windows, environment variables are case-insensitive. Node.js
- * lexicographically sorts the `env` keys and uses the first one that
- * case-insensitively matches. Only first (in lexicographic order) entry will be
- * passed to the subprocess. This might lead to issues on Windows when passing
- * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
- *
- * The {@link spawn} method spawns the child process asynchronously,
- * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
- * the event loop until the spawned process either exits or is terminated.
- *
- * For convenience, the `node:child_process` module provides a handful of
- * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
- * top of {@link spawn} or {@link spawnSync}.
- *
- * * {@link exec}: spawns a shell and runs a command within that
- * shell, passing the `stdout` and `stderr` to a callback function when
- * complete.
- * * {@link execFile}: similar to {@link exec} except
- * that it spawns the command directly without first spawning a shell by
- * default.
- * * {@link fork}: spawns a new Node.js process and invokes a
- * specified module with an IPC communication channel established that allows
- * sending messages between parent and child.
- * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
- * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
- *
- * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
- * the synchronous methods can have significant impact on performance due to
- * stalling the event loop while spawned processes complete.
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js)
- */
-declare module "child_process" {
- import { ObjectEncodingOptions } from "node:fs";
- import { Abortable, EventEmitter } from "node:events";
- import * as net from "node:net";
- import { Pipe, Readable, Stream, Writable } from "node:stream";
- import { URL } from "node:url";
- type Serializable = string | object | number | boolean | bigint;
- type SendHandle = net.Socket | net.Server;
- /**
- * Instances of the `ChildProcess` represent spawned child processes.
- *
- * Instances of `ChildProcess` are not intended to be created directly. Rather,
- * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create
- * instances of `ChildProcess`.
- * @since v2.2.0
- */
- class ChildProcess extends EventEmitter {
- /**
- * A `Writable Stream` that represents the child process's `stdin`.
- *
- * If a child process waits to read all of its input, the child will not continue
- * until this stream has been closed via `end()`.
- *
- * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`,
- * then this will be `null`.
- *
- * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
- * refer to the same value.
- *
- * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned.
- * @since v0.1.90
- */
- stdin: Writable | null;
- /**
- * A `Readable Stream` that represents the child process's `stdout`.
- *
- * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`,
- * then this will be `null`.
- *
- * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will
- * refer to the same value.
- *
- * ```js
- * const { spawn } = require('node:child_process');
- *
- * const subprocess = spawn('ls');
- *
- * subprocess.stdout.on('data', (data) => {
- * console.log(`Received chunk ${data}`);
- * });
- * ```
- *
- * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned.
- * @since v0.1.90
- */
- stdout: Readable | null;
- /**
- * A `Readable Stream` that represents the child process's `stderr`.
- *
- * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`,
- * then this will be `null`.
- *
- * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
- * refer to the same value.
- *
- * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned.
- * @since v0.1.90
- */
- stderr: Readable | null;
- /**
- * The `subprocess.channel` property is a reference to the child's IPC channel. If
- * no IPC channel exists, this property is `undefined`.
- * @since v7.1.0
- */
- readonly channel?: Pipe | null | undefined;
- /**
- * A sparse array of pipes to the child process, corresponding with positions in
- * the `stdio` option passed to {@link spawn} that have been set
- * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
- * respectively.
- *
- * In the following example, only the child's fd `1` (stdout) is configured as a
- * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values
- * in the array are `null`.
- *
- * ```js
- * const assert = require('node:assert');
- * const fs = require('node:fs');
- * const child_process = require('node:child_process');
- *
- * const subprocess = child_process.spawn('ls', {
- * stdio: [
- * 0, // Use parent's stdin for child.
- * 'pipe', // Pipe child's stdout to parent.
- * fs.openSync('err.out', 'w'), // Direct child's stderr to a file.
- * ],
- * });
- *
- * assert.strictEqual(subprocess.stdio[0], null);
- * assert.strictEqual(subprocess.stdio[0], subprocess.stdin);
- *
- * assert(subprocess.stdout);
- * assert.strictEqual(subprocess.stdio[1], subprocess.stdout);
- *
- * assert.strictEqual(subprocess.stdio[2], null);
- * assert.strictEqual(subprocess.stdio[2], subprocess.stderr);
- * ```
- *
- * The `subprocess.stdio` property can be `undefined` if the child process could
- * not be successfully spawned.
- * @since v0.7.10
- */
- readonly stdio: [
- Writable | null,
- // stdin
- Readable | null,
- // stdout
- Readable | null,
- // stderr
- Readable | Writable | null | undefined,
- // extra
- Readable | Writable | null | undefined, // extra
- ];
- /**
- * The `subprocess.killed` property indicates whether the child process
- * successfully received a signal from `subprocess.kill()`. The `killed` property
- * does not indicate that the child process has been terminated.
- * @since v0.5.10
- */
- readonly killed: boolean;
- /**
- * Returns the process identifier (PID) of the child process. If the child process
- * fails to spawn due to errors, then the value is `undefined` and `error` is
- * emitted.
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const grep = spawn('grep', ['ssh']);
- *
- * console.log(`Spawned child pid: ${grep.pid}`);
- * grep.stdin.end();
- * ```
- * @since v0.1.90
- */
- readonly pid?: number | undefined;
- /**
- * The `subprocess.connected` property indicates whether it is still possible to
- * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
- * @since v0.7.2
- */
- readonly connected: boolean;
- /**
- * The `subprocess.exitCode` property indicates the exit code of the child process.
- * If the child process is still running, the field will be `null`.
- */
- readonly exitCode: number | null;
- /**
- * The `subprocess.signalCode` property indicates the signal received by
- * the child process if any, else `null`.
- */
- readonly signalCode: NodeJS.Signals | null;
- /**
- * The `subprocess.spawnargs` property represents the full list of command-line
- * arguments the child process was launched with.
- */
- readonly spawnargs: string[];
- /**
- * The `subprocess.spawnfile` property indicates the executable file name of
- * the child process that is launched.
- *
- * For {@link fork}, its value will be equal to `process.execPath`.
- * For {@link spawn}, its value will be the name of
- * the executable file.
- * For {@link exec}, its value will be the name of the shell
- * in which the child process is launched.
- */
- readonly spawnfile: string;
- /**
- * The `subprocess.kill()` method sends a signal to the child process. If no
- * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
- * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const grep = spawn('grep', ['ssh']);
- *
- * grep.on('close', (code, signal) => {
- * console.log(
- * `child process terminated due to receipt of signal ${signal}`);
- * });
- *
- * // Send SIGHUP to process.
- * grep.kill('SIGHUP');
- * ```
- *
- * The `ChildProcess` object may emit an `'error'` event if the signal
- * cannot be delivered. Sending a signal to a child process that has already exited
- * is not an error but may have unforeseen consequences. Specifically, if the
- * process identifier (PID) has been reassigned to another process, the signal will
- * be delivered to that process instead which can have unexpected results.
- *
- * While the function is called `kill`, the signal delivered to the child process
- * may not actually terminate the process.
- *
- * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
- *
- * On Windows, where POSIX signals do not exist, the `signal` argument will be
- * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
- * See `Signal Events` for more details.
- *
- * On Linux, child processes of child processes will not be terminated
- * when attempting to kill their parent. This is likely to happen when running a
- * new process in a shell or with the use of the `shell` option of `ChildProcess`:
- *
- * ```js
- * 'use strict';
- * const { spawn } = require('node:child_process');
- *
- * const subprocess = spawn(
- * 'sh',
- * [
- * '-c',
- * `node -e "setInterval(() => {
- * console.log(process.pid, 'is alive')
- * }, 500);"`,
- * ], {
- * stdio: ['inherit', 'inherit', 'inherit'],
- * },
- * );
- *
- * setTimeout(() => {
- * subprocess.kill(); // Does not terminate the Node.js process in the shell.
- * }, 2000);
- * ```
- * @since v0.1.90
- */
- kill(signal?: NodeJS.Signals | number): boolean;
- /**
- * Calls {@link ChildProcess.kill} with `'SIGTERM'`.
- * @since v20.5.0
- */
- [Symbol.dispose](): void;
- /**
- * When an IPC channel has been established between the parent and child (
- * i.e. when using {@link fork}), the `subprocess.send()` method can
- * be used to send messages to the child process. When the child process is a
- * Node.js instance, these messages can be received via the `'message'` event.
- *
- * The message goes through serialization and parsing. The resulting
- * message might not be the same as what is originally sent.
- *
- * For example, in the parent script:
- *
- * ```js
- * const cp = require('node:child_process');
- * const n = cp.fork(`${__dirname}/sub.js`);
- *
- * n.on('message', (m) => {
- * console.log('PARENT got message:', m);
- * });
- *
- * // Causes the child to print: CHILD got message: { hello: 'world' }
- * n.send({ hello: 'world' });
- * ```
- *
- * And then the child script, `'sub.js'` might look like this:
- *
- * ```js
- * process.on('message', (m) => {
- * console.log('CHILD got message:', m);
- * });
- *
- * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null }
- * process.send({ foo: 'bar', baz: NaN });
- * ```
- *
- * Child Node.js processes will have a `process.send()` method of their own
- * that allows the child to send messages back to the parent.
- *
- * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
- * containing a `NODE_` prefix in the `cmd` property are reserved for use within
- * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
- * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
- *
- * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
- * for passing a TCP server or socket object to the child process. The child will
- * receive the object as the second argument passed to the callback function
- * registered on the `'message'` event. Any data that is received
- * and buffered in the socket will not be sent to the child.
- *
- * The optional `callback` is a function that is invoked after the message is
- * sent but before the child may have received it. The function is called with a
- * single argument: `null` on success, or an `Error` object on failure.
- *
- * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
- * happen, for instance, when the child process has already exited.
- *
- * `subprocess.send()` will return `false` if the channel has closed or when the
- * backlog of unsent messages exceeds a threshold that makes it unwise to send
- * more. Otherwise, the method returns `true`. The `callback` function can be
- * used to implement flow control.
- *
- * #### Example: sending a server object
- *
- * The `sendHandle` argument can be used, for instance, to pass the handle of
- * a TCP server object to the child process as illustrated in the example below:
- *
- * ```js
- * const subprocess = require('node:child_process').fork('subprocess.js');
- *
- * // Open up the server object and send the handle.
- * const server = require('node:net').createServer();
- * server.on('connection', (socket) => {
- * socket.end('handled by parent');
- * });
- * server.listen(1337, () => {
- * subprocess.send('server', server);
- * });
- * ```
- *
- * The child would then receive the server object as:
- *
- * ```js
- * process.on('message', (m, server) => {
- * if (m === 'server') {
- * server.on('connection', (socket) => {
- * socket.end('handled by child');
- * });
- * }
- * });
- * ```
- *
- * Once the server is now shared between the parent and child, some connections
- * can be handled by the parent and some by the child.
- *
- * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of
- * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only
- * supported on Unix platforms.
- *
- * #### Example: sending a socket object
- *
- * Similarly, the `sendHandler` argument can be used to pass the handle of a
- * socket to the child process. The example below spawns two children that each
- * handle connections with "normal" or "special" priority:
- *
- * ```js
- * const { fork } = require('node:child_process');
- * const normal = fork('subprocess.js', ['normal']);
- * const special = fork('subprocess.js', ['special']);
- *
- * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
- * // the sockets from being read before they are sent to the child process.
- * const server = require('node:net').createServer({ pauseOnConnect: true });
- * server.on('connection', (socket) => {
- *
- * // If this is special priority...
- * if (socket.remoteAddress === '74.125.127.100') {
- * special.send('socket', socket);
- * return;
- * }
- * // This is normal priority.
- * normal.send('socket', socket);
- * });
- * server.listen(1337);
- * ```
- *
- * The `subprocess.js` would receive the socket handle as the second argument
- * passed to the event callback function:
- *
- * ```js
- * process.on('message', (m, socket) => {
- * if (m === 'socket') {
- * if (socket) {
- * // Check that the client socket exists.
- * // It is possible for the socket to be closed between the time it is
- * // sent and the time it is received in the child process.
- * socket.end(`Request handled with ${process.argv[2]} priority`);
- * }
- * }
- * });
- * ```
- *
- * Do not use `.maxConnections` on a socket that has been passed to a subprocess.
- * The parent cannot track when the socket is destroyed.
- *
- * Any `'message'` handlers in the subprocess should verify that `socket` exists,
- * as the connection may have been closed during the time it takes to send the
- * connection to the child.
- * @since v0.5.9
- * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
- */
- send(message: Serializable, callback?: (error: Error | null) => void): boolean;
- send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
- send(
- message: Serializable,
- sendHandle?: SendHandle,
- options?: MessageOptions,
- callback?: (error: Error | null) => void,
- ): boolean;
- /**
- * Closes the IPC channel between parent and child, allowing the child to exit
- * gracefully once there are no other connections keeping it alive. After calling
- * this method the `subprocess.connected` and `process.connected` properties in
- * both the parent and child (respectively) will be set to `false`, and it will be
- * no longer possible to pass messages between the processes.
- *
- * The `'disconnect'` event will be emitted when there are no messages in the
- * process of being received. This will most often be triggered immediately after
- * calling `subprocess.disconnect()`.
- *
- * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked
- * within the child process to close the IPC channel as well.
- * @since v0.7.2
- */
- disconnect(): void;
- /**
- * By default, the parent will wait for the detached child to exit. To prevent the
- * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
- * include the child in its reference count, allowing the parent to exit
- * independently of the child, unless there is an established IPC channel between
- * the child and the parent.
- *
- * ```js
- * const { spawn } = require('node:child_process');
- *
- * const subprocess = spawn(process.argv[0], ['child_program.js'], {
- * detached: true,
- * stdio: 'ignore',
- * });
- *
- * subprocess.unref();
- * ```
- * @since v0.7.10
- */
- unref(): void;
- /**
- * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will
- * restore the removed reference count for the child process, forcing the parent
- * to wait for the child to exit before exiting itself.
- *
- * ```js
- * const { spawn } = require('node:child_process');
- *
- * const subprocess = spawn(process.argv[0], ['child_program.js'], {
- * detached: true,
- * stdio: 'ignore',
- * });
- *
- * subprocess.unref();
- * subprocess.ref();
- * ```
- * @since v0.7.10
- */
- ref(): void;
- /**
- * events.EventEmitter
- * 1. close
- * 2. disconnect
- * 3. error
- * 4. exit
- * 5. message
- * 6. spawn
- */
- addListener(event: string, listener: (...args: any[]) => void): this;
- addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- addListener(event: "disconnect", listener: () => void): this;
- addListener(event: "error", listener: (err: Error) => void): this;
- addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
- addListener(event: "spawn", listener: () => void): this;
- emit(event: string | symbol, ...args: any[]): boolean;
- emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
- emit(event: "disconnect"): boolean;
- emit(event: "error", err: Error): boolean;
- emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
- emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
- emit(event: "spawn", listener: () => void): boolean;
- on(event: string, listener: (...args: any[]) => void): this;
- on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- on(event: "disconnect", listener: () => void): this;
- on(event: "error", listener: (err: Error) => void): this;
- on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
- on(event: "spawn", listener: () => void): this;
- once(event: string, listener: (...args: any[]) => void): this;
- once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- once(event: "disconnect", listener: () => void): this;
- once(event: "error", listener: (err: Error) => void): this;
- once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
- once(event: "spawn", listener: () => void): this;
- prependListener(event: string, listener: (...args: any[]) => void): this;
- prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- prependListener(event: "disconnect", listener: () => void): this;
- prependListener(event: "error", listener: (err: Error) => void): this;
- prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
- prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
- prependListener(event: "spawn", listener: () => void): this;
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
- prependOnceListener(
- event: "close",
- listener: (code: number | null, signal: NodeJS.Signals | null) => void,
- ): this;
- prependOnceListener(event: "disconnect", listener: () => void): this;
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
- prependOnceListener(
- event: "exit",
- listener: (code: number | null, signal: NodeJS.Signals | null) => void,
- ): this;
- prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
- prependOnceListener(event: "spawn", listener: () => void): this;
- }
- // return this object when stdio option is undefined or not specified
- interface ChildProcessWithoutNullStreams extends ChildProcess {
- stdin: Writable;
- stdout: Readable;
- stderr: Readable;
- readonly stdio: [
- Writable,
- Readable,
- Readable,
- // stderr
- Readable | Writable | null | undefined,
- // extra, no modification
- Readable | Writable | null | undefined, // extra, no modification
- ];
- }
- // return this object when stdio option is a tuple of 3
- interface ChildProcessByStdio
- extends ChildProcess
- {
- stdin: I;
- stdout: O;
- stderr: E;
- readonly stdio: [
- I,
- O,
- E,
- Readable | Writable | null | undefined,
- // extra, no modification
- Readable | Writable | null | undefined, // extra, no modification
- ];
- }
- interface MessageOptions {
- keepOpen?: boolean | undefined;
- }
- type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
- type StdioOptions = IOType | Array;
- type SerializationType = "json" | "advanced";
- interface MessagingOptions extends Abortable {
- /**
- * Specify the kind of serialization used for sending messages between processes.
- * @default 'json'
- */
- serialization?: SerializationType | undefined;
- /**
- * The signal value to be used when the spawned process will be killed by the abort signal.
- * @default 'SIGTERM'
- */
- killSignal?: NodeJS.Signals | number | undefined;
- /**
- * In milliseconds the maximum amount of time the process is allowed to run.
- */
- timeout?: number | undefined;
- }
- interface ProcessEnvOptions {
- uid?: number | undefined;
- gid?: number | undefined;
- cwd?: string | URL | undefined;
- env?: NodeJS.ProcessEnv | undefined;
- }
- interface CommonOptions extends ProcessEnvOptions {
- /**
- * @default false
- */
- windowsHide?: boolean | undefined;
- /**
- * @default 0
- */
- timeout?: number | undefined;
- }
- interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable {
- argv0?: string | undefined;
- /**
- * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
- * If passed as an array, the first element is used for `stdin`, the second for
- * `stdout`, and the third for `stderr`. A fourth element can be used to
- * specify the `stdio` behavior beyond the standard streams. See
- * {@link ChildProcess.stdio} for more information.
- *
- * @default 'pipe'
- */
- stdio?: StdioOptions | undefined;
- shell?: boolean | string | undefined;
- windowsVerbatimArguments?: boolean | undefined;
- }
- interface SpawnOptions extends CommonSpawnOptions {
- detached?: boolean | undefined;
- }
- interface SpawnOptionsWithoutStdio extends SpawnOptions {
- stdio?: StdioPipeNamed | StdioPipe[] | undefined;
- }
- type StdioNull = "inherit" | "ignore" | Stream;
- type StdioPipeNamed = "pipe" | "overlapped";
- type StdioPipe = undefined | null | StdioPipeNamed;
- interface SpawnOptionsWithStdioTuple<
- Stdin extends StdioNull | StdioPipe,
- Stdout extends StdioNull | StdioPipe,
- Stderr extends StdioNull | StdioPipe,
- > extends SpawnOptions {
- stdio: [Stdin, Stdout, Stderr];
- }
- /**
- * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
- * to an empty array.
- *
- * **If the `shell` option is enabled, do not pass unsanitized user input to this**
- * **function. Any input containing shell metacharacters may be used to trigger**
- * **arbitrary command execution.**
- *
- * A third argument may be used to specify additional options, with these defaults:
- *
- * ```js
- * const defaults = {
- * cwd: undefined,
- * env: process.env,
- * };
- * ```
- *
- * Use `cwd` to specify the working directory from which the process is spawned.
- * If not given, the default is to inherit the current working directory. If given,
- * but the path does not exist, the child process emits an `ENOENT` error
- * and exits immediately. `ENOENT` is also emitted when the command
- * does not exist.
- *
- * Use `env` to specify environment variables that will be visible to the new
- * process, the default is `process.env`.
- *
- * `undefined` values in `env` will be ignored.
- *
- * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the
- * exit code:
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const ls = spawn('ls', ['-lh', '/usr']);
- *
- * ls.stdout.on('data', (data) => {
- * console.log(`stdout: ${data}`);
- * });
- *
- * ls.stderr.on('data', (data) => {
- * console.error(`stderr: ${data}`);
- * });
- *
- * ls.on('close', (code) => {
- * console.log(`child process exited with code ${code}`);
- * });
- * ```
- *
- * Example: A very elaborate way to run `ps ax | grep ssh`
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const ps = spawn('ps', ['ax']);
- * const grep = spawn('grep', ['ssh']);
- *
- * ps.stdout.on('data', (data) => {
- * grep.stdin.write(data);
- * });
- *
- * ps.stderr.on('data', (data) => {
- * console.error(`ps stderr: ${data}`);
- * });
- *
- * ps.on('close', (code) => {
- * if (code !== 0) {
- * console.log(`ps process exited with code ${code}`);
- * }
- * grep.stdin.end();
- * });
- *
- * grep.stdout.on('data', (data) => {
- * console.log(data.toString());
- * });
- *
- * grep.stderr.on('data', (data) => {
- * console.error(`grep stderr: ${data}`);
- * });
- *
- * grep.on('close', (code) => {
- * if (code !== 0) {
- * console.log(`grep process exited with code ${code}`);
- * }
- * });
- * ```
- *
- * Example of checking for failed `spawn`:
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const subprocess = spawn('bad_command');
- *
- * subprocess.on('error', (err) => {
- * console.error('Failed to start subprocess.');
- * });
- * ```
- *
- * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
- * title while others (Windows, SunOS) will use `command`.
- *
- * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve
- * it with the`process.argv0` property instead.
- *
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
- * the error passed to the callback will be an `AbortError`:
- *
- * ```js
- * const { spawn } = require('node:child_process');
- * const controller = new AbortController();
- * const { signal } = controller;
- * const grep = spawn('grep', ['ssh'], { signal });
- * grep.on('error', (err) => {
- * // This will be called with err being an AbortError if the controller aborts
- * });
- * controller.abort(); // Stops the child process
- * ```
- * @since v0.1.90
- * @param command The command to run.
- * @param args List of string arguments.
- */
- function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(command: string, options: SpawnOptions): ChildProcess;
- // overloads of spawn with 'args'
- function spawn(
- command: string,
- args?: readonly string[],
- options?: SpawnOptionsWithoutStdio,
- ): ChildProcessWithoutNullStreams;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(
- command: string,
- args: readonly string[],
- options: SpawnOptionsWithStdioTuple,
- ): ChildProcessByStdio;
- function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess;
- interface ExecOptions extends CommonOptions {
- shell?: string | undefined;
- signal?: AbortSignal | undefined;
- maxBuffer?: number | undefined;
- killSignal?: NodeJS.Signals | number | undefined;
- }
- interface ExecOptionsWithStringEncoding extends ExecOptions {
- encoding: BufferEncoding;
- }
- interface ExecOptionsWithBufferEncoding extends ExecOptions {
- encoding: BufferEncoding | null; // specify `null`.
- }
- interface ExecException extends Error {
- cmd?: string | undefined;
- killed?: boolean | undefined;
- code?: number | undefined;
- signal?: NodeJS.Signals | undefined;
- }
- /**
- * Spawns a shell then executes the `command` within that shell, buffering any
- * generated output. The `command` string passed to the exec function is processed
- * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters))
- * need to be dealt with accordingly:
- *
- * ```js
- * const { exec } = require('node:child_process');
- *
- * exec('"/path/to/test file/test.sh" arg1 arg2');
- * // Double quotes are used so that the space in the path is not interpreted as
- * // a delimiter of multiple arguments.
- *
- * exec('echo "The \\$HOME variable is $HOME"');
- * // The $HOME variable is escaped in the first instance, but not in the second.
- * ```
- *
- * **Never pass unsanitized user input to this function. Any input containing shell**
- * **metacharacters may be used to trigger arbitrary command execution.**
- *
- * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The
- * `error.code` property will be
- * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the
- * process.
- *
- * The `stdout` and `stderr` arguments passed to the callback will contain the
- * stdout and stderr output of the child process. By default, Node.js will decode
- * the output as UTF-8 and pass strings to the callback. The `encoding` option
- * can be used to specify the character encoding used to decode the stdout and
- * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
- * encoding, `Buffer` objects will be passed to the callback instead.
- *
- * ```js
- * const { exec } = require('node:child_process');
- * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
- * if (error) {
- * console.error(`exec error: ${error}`);
- * return;
- * }
- * console.log(`stdout: ${stdout}`);
- * console.error(`stderr: ${stderr}`);
- * });
- * ```
- *
- * If `timeout` is greater than `0`, the parent will send the signal
- * identified by the `killSignal` property (the default is `'SIGTERM'`) if the
- * child runs longer than `timeout` milliseconds.
- *
- * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace
- * the existing process and uses a shell to execute the command.
- *
- * If this method is invoked as its `util.promisify()` ed version, it returns
- * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
- * case of an error (including any error resulting in an exit code other than 0), a
- * rejected promise is returned, with the same `error` object given in the
- * callback, but with two additional properties `stdout` and `stderr`.
- *
- * ```js
- * const util = require('node:util');
- * const exec = util.promisify(require('node:child_process').exec);
- *
- * async function lsExample() {
- * const { stdout, stderr } = await exec('ls');
- * console.log('stdout:', stdout);
- * console.error('stderr:', stderr);
- * }
- * lsExample();
- * ```
- *
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
- * the error passed to the callback will be an `AbortError`:
- *
- * ```js
- * const { exec } = require('node:child_process');
- * const controller = new AbortController();
- * const { signal } = controller;
- * const child = exec('grep ssh', { signal }, (error) => {
- * console.error(error); // an AbortError
- * });
- * controller.abort();
- * ```
- * @since v0.1.90
- * @param command The command to run, with space-separated arguments.
- * @param callback called with the output when process terminates.
- */
- function exec(
- command: string,
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
- function exec(
- command: string,
- options: {
- encoding: "buffer" | null;
- } & ExecOptions,
- callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
- ): ChildProcess;
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
- function exec(
- command: string,
- options: {
- encoding: BufferEncoding;
- } & ExecOptions,
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
- function exec(
- command: string,
- options: {
- encoding: BufferEncoding;
- } & ExecOptions,
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
- ): ChildProcess;
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
- function exec(
- command: string,
- options: ExecOptions,
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- // fallback if nothing else matches. Worst case is always `string | Buffer`.
- function exec(
- command: string,
- options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
- ): ChildProcess;
- interface PromiseWithChild extends Promise {
- child: ChildProcess;
- }
- namespace exec {
- function __promisify__(command: string): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- command: string,
- options: {
- encoding: "buffer" | null;
- } & ExecOptions,
- ): PromiseWithChild<{
- stdout: Buffer;
- stderr: Buffer;
- }>;
- function __promisify__(
- command: string,
- options: {
- encoding: BufferEncoding;
- } & ExecOptions,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- command: string,
- options: ExecOptions,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- command: string,
- options?: (ObjectEncodingOptions & ExecOptions) | null,
- ): PromiseWithChild<{
- stdout: string | Buffer;
- stderr: string | Buffer;
- }>;
- }
- interface ExecFileOptions extends CommonOptions, Abortable {
- maxBuffer?: number | undefined;
- killSignal?: NodeJS.Signals | number | undefined;
- windowsVerbatimArguments?: boolean | undefined;
- shell?: boolean | string | undefined;
- signal?: AbortSignal | undefined;
- }
- interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
- encoding: BufferEncoding;
- }
- interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
- encoding: "buffer" | null;
- }
- interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
- encoding: BufferEncoding;
- }
- type ExecFileException =
- & Omit
- & Omit
- & { code?: string | number | undefined | null };
- /**
- * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
- * executable `file` is spawned directly as a new process making it slightly more
- * efficient than {@link exec}.
- *
- * The same options as {@link exec} are supported. Since a shell is
- * not spawned, behaviors such as I/O redirection and file globbing are not
- * supported.
- *
- * ```js
- * const { execFile } = require('node:child_process');
- * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
- * if (error) {
- * throw error;
- * }
- * console.log(stdout);
- * });
- * ```
- *
- * The `stdout` and `stderr` arguments passed to the callback will contain the
- * stdout and stderr output of the child process. By default, Node.js will decode
- * the output as UTF-8 and pass strings to the callback. The `encoding` option
- * can be used to specify the character encoding used to decode the stdout and
- * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
- * encoding, `Buffer` objects will be passed to the callback instead.
- *
- * If this method is invoked as its `util.promisify()` ed version, it returns
- * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
- * case of an error (including any error resulting in an exit code other than 0), a
- * rejected promise is returned, with the same `error` object given in the
- * callback, but with two additional properties `stdout` and `stderr`.
- *
- * ```js
- * const util = require('node:util');
- * const execFile = util.promisify(require('node:child_process').execFile);
- * async function getVersion() {
- * const { stdout } = await execFile('node', ['--version']);
- * console.log(stdout);
- * }
- * getVersion();
- * ```
- *
- * **If the `shell` option is enabled, do not pass unsanitized user input to this**
- * **function. Any input containing shell metacharacters may be used to trigger**
- * **arbitrary command execution.**
- *
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
- * the error passed to the callback will be an `AbortError`:
- *
- * ```js
- * const { execFile } = require('node:child_process');
- * const controller = new AbortController();
- * const { signal } = controller;
- * const child = execFile('node', ['--version'], { signal }, (error) => {
- * console.error(error); // an AbortError
- * });
- * controller.abort();
- * ```
- * @since v0.1.91
- * @param file The name or path of the executable file to run.
- * @param args List of string arguments.
- * @param callback Called with the output when process terminates.
- */
- function execFile(file: string): ChildProcess;
- function execFile(
- file: string,
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
- ): ChildProcess;
- function execFile(file: string, args?: readonly string[] | null): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
- ): ChildProcess;
- // no `options` definitely means stdout/stderr are `string`.
- function execFile(
- file: string,
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
- function execFile(
- file: string,
- options: ExecFileOptionsWithBufferEncoding,
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
- ): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptionsWithBufferEncoding,
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
- ): ChildProcess;
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
- function execFile(
- file: string,
- options: ExecFileOptionsWithStringEncoding,
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptionsWithStringEncoding,
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
- function execFile(
- file: string,
- options: ExecFileOptionsWithOtherEncoding,
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
- ): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptionsWithOtherEncoding,
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
- ): ChildProcess;
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
- function execFile(
- file: string,
- options: ExecFileOptions,
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptions,
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
- ): ChildProcess;
- // fallback if nothing else matches. Worst case is always `string | Buffer`.
- function execFile(
- file: string,
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
- callback:
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
- | undefined
- | null,
- ): ChildProcess;
- function execFile(
- file: string,
- args: readonly string[] | undefined | null,
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
- callback:
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
- | undefined
- | null,
- ): ChildProcess;
- namespace execFile {
- function __promisify__(file: string): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- file: string,
- args: readonly string[] | undefined | null,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- file: string,
- options: ExecFileOptionsWithBufferEncoding,
- ): PromiseWithChild<{
- stdout: Buffer;
- stderr: Buffer;
- }>;
- function __promisify__(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptionsWithBufferEncoding,
- ): PromiseWithChild<{
- stdout: Buffer;
- stderr: Buffer;
- }>;
- function __promisify__(
- file: string,
- options: ExecFileOptionsWithStringEncoding,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptionsWithStringEncoding,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- file: string,
- options: ExecFileOptionsWithOtherEncoding,
- ): PromiseWithChild<{
- stdout: string | Buffer;
- stderr: string | Buffer;
- }>;
- function __promisify__(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptionsWithOtherEncoding,
- ): PromiseWithChild<{
- stdout: string | Buffer;
- stderr: string | Buffer;
- }>;
- function __promisify__(
- file: string,
- options: ExecFileOptions,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- file: string,
- args: readonly string[] | undefined | null,
- options: ExecFileOptions,
- ): PromiseWithChild<{
- stdout: string;
- stderr: string;
- }>;
- function __promisify__(
- file: string,
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
- ): PromiseWithChild<{
- stdout: string | Buffer;
- stderr: string | Buffer;
- }>;
- function __promisify__(
- file: string,
- args: readonly string[] | undefined | null,
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
- ): PromiseWithChild<{
- stdout: string | Buffer;
- stderr: string | Buffer;
- }>;
- }
- interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
- execPath?: string | undefined;
- execArgv?: string[] | undefined;
- silent?: boolean | undefined;
- /**
- * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings.
- * If passed as an array, the first element is used for `stdin`, the second for
- * `stdout`, and the third for `stderr`. A fourth element can be used to
- * specify the `stdio` behavior beyond the standard streams. See
- * {@link ChildProcess.stdio} for more information.
- *
- * @default 'pipe'
- */
- stdio?: StdioOptions | undefined;
- detached?: boolean | undefined;
- windowsVerbatimArguments?: boolean | undefined;
- }
- /**
- * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes.
- * Like {@link spawn}, a `ChildProcess` object is returned. The
- * returned `ChildProcess` will have an additional communication channel
- * built-in that allows messages to be passed back and forth between the parent and
- * child. See `subprocess.send()` for details.
- *
- * Keep in mind that spawned Node.js child processes are
- * independent of the parent with exception of the IPC communication channel
- * that is established between the two. Each process has its own memory, with
- * their own V8 instances. Because of the additional resource allocations
- * required, spawning a large number of child Node.js processes is not
- * recommended.
- *
- * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative
- * execution path to be used.
- *
- * Node.js processes launched with a custom `execPath` will communicate with the
- * parent process using the file descriptor (fd) identified using the
- * environment variable `NODE_CHANNEL_FD` on the child process.
- *
- * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
- * current process.
- *
- * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
- *
- * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
- * the error passed to the callback will be an `AbortError`:
- *
- * ```js
- * if (process.argv[2] === 'child') {
- * setTimeout(() => {
- * console.log(`Hello from ${process.argv[2]}!`);
- * }, 1_000);
- * } else {
- * const { fork } = require('node:child_process');
- * const controller = new AbortController();
- * const { signal } = controller;
- * const child = fork(__filename, ['child'], { signal });
- * child.on('error', (err) => {
- * // This will be called with err being an AbortError if the controller aborts
- * });
- * controller.abort(); // Stops the child process
- * }
- * ```
- * @since v0.5.0
- * @param modulePath The module to run in the child.
- * @param args List of string arguments.
- */
- function fork(modulePath: string, options?: ForkOptions): ChildProcess;
- function fork(modulePath: string, args?: readonly string[], options?: ForkOptions): ChildProcess;
- interface SpawnSyncOptions extends CommonSpawnOptions {
- input?: string | NodeJS.ArrayBufferView | undefined;
- maxBuffer?: number | undefined;
- encoding?: BufferEncoding | "buffer" | null | undefined;
- }
- interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
- encoding: BufferEncoding;
- }
- interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
- encoding?: "buffer" | null | undefined;
- }
- interface SpawnSyncReturns {
- pid: number;
- output: Array;
- stdout: T;
- stderr: T;
- status: number | null;
- signal: NodeJS.Signals | null;
- error?: Error | undefined;
- }
- /**
- * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
- * until the child process has fully closed. When a timeout has been encountered
- * and `killSignal` is sent, the method won't return until the process has
- * completely exited. If the process intercepts and handles the `SIGTERM` signal
- * and doesn't exit, the parent process will wait until the child process has
- * exited.
- *
- * **If the `shell` option is enabled, do not pass unsanitized user input to this**
- * **function. Any input containing shell metacharacters may be used to trigger**
- * **arbitrary command execution.**
- * @since v0.11.12
- * @param command The command to run.
- * @param args List of string arguments.
- */
- function spawnSync(command: string): SpawnSyncReturns;
- function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns;
- function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns;
- function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns;
- function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns;
- function spawnSync(
- command: string,
- args: readonly string[],
- options: SpawnSyncOptionsWithStringEncoding,
- ): SpawnSyncReturns;
- function spawnSync(
- command: string,
- args: readonly string[],
- options: SpawnSyncOptionsWithBufferEncoding,
- ): SpawnSyncReturns;
- function spawnSync(
- command: string,
- args?: readonly string[],
- options?: SpawnSyncOptions,
- ): SpawnSyncReturns;
- interface CommonExecOptions extends CommonOptions {
- input?: string | NodeJS.ArrayBufferView | undefined;
- /**
- * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings.
- * If passed as an array, the first element is used for `stdin`, the second for
- * `stdout`, and the third for `stderr`. A fourth element can be used to
- * specify the `stdio` behavior beyond the standard streams. See
- * {@link ChildProcess.stdio} for more information.
- *
- * @default 'pipe'
- */
- stdio?: StdioOptions | undefined;
- killSignal?: NodeJS.Signals | number | undefined;
- maxBuffer?: number | undefined;
- encoding?: BufferEncoding | "buffer" | null | undefined;
- }
- interface ExecSyncOptions extends CommonExecOptions {
- shell?: string | undefined;
- }
- interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
- encoding: BufferEncoding;
- }
- interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
- encoding?: "buffer" | null | undefined;
- }
- /**
- * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
- * until the child process has fully closed. When a timeout has been encountered
- * and `killSignal` is sent, the method won't return until the process has
- * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process
- * has exited.
- *
- * If the process times out or has a non-zero exit code, this method will throw.
- * The `Error` object will contain the entire result from {@link spawnSync}.
- *
- * **Never pass unsanitized user input to this function. Any input containing shell**
- * **metacharacters may be used to trigger arbitrary command execution.**
- * @since v0.11.12
- * @param command The command to run.
- * @return The stdout from the command.
- */
- function execSync(command: string): Buffer;
- function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
- function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
- function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
- interface ExecFileSyncOptions extends CommonExecOptions {
- shell?: boolean | string | undefined;
- }
- interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
- encoding: BufferEncoding;
- }
- interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
- encoding?: "buffer" | null; // specify `null`.
- }
- /**
- * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
- * return until the child process has fully closed. When a timeout has been
- * encountered and `killSignal` is sent, the method won't return until the process
- * has completely exited.
- *
- * If the child process intercepts and handles the `SIGTERM` signal and
- * does not exit, the parent process will still wait until the child process has
- * exited.
- *
- * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}.
- *
- * **If the `shell` option is enabled, do not pass unsanitized user input to this**
- * **function. Any input containing shell metacharacters may be used to trigger**
- * **arbitrary command execution.**
- * @since v0.11.12
- * @param file The name or path of the executable file to run.
- * @param args List of string arguments.
- * @return The stdout from the command.
- */
- function execFileSync(file: string): Buffer;
- function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
- function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
- function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
- function execFileSync(file: string, args: readonly string[]): Buffer;
- function execFileSync(
- file: string,
- args: readonly string[],
- options: ExecFileSyncOptionsWithStringEncoding,
- ): string;
- function execFileSync(
- file: string,
- args: readonly string[],
- options: ExecFileSyncOptionsWithBufferEncoding,
- ): Buffer;
- function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
-}
-declare module "node:child_process" {
- export * from "child_process";
-}
diff --git a/example_bot/node_modules/@types/node/cluster.d.ts b/example_bot/node_modules/@types/node/cluster.d.ts
deleted file mode 100644
index 39cd56a..0000000
--- a/example_bot/node_modules/@types/node/cluster.d.ts
+++ /dev/null
@@ -1,432 +0,0 @@
-/**
- * Clusters of Node.js processes can be used to run multiple instances of Node.js
- * that can distribute workloads among their application threads. When process
- * isolation is not needed, use the `worker_threads` module instead, which
- * allows running multiple application threads within a single Node.js instance.
- *
- * The cluster module allows easy creation of child processes that all share
- * server ports.
- *
- * ```js
- * import cluster from 'node:cluster';
- * import http from 'node:http';
- * import { availableParallelism } from 'node:os';
- * import process from 'node:process';
- *
- * const numCPUs = availableParallelism();
- *
- * if (cluster.isPrimary) {
- * console.log(`Primary ${process.pid} is running`);
- *
- * // Fork workers.
- * for (let i = 0; i < numCPUs; i++) {
- * cluster.fork();
- * }
- *
- * cluster.on('exit', (worker, code, signal) => {
- * console.log(`worker ${worker.process.pid} died`);
- * });
- * } else {
- * // Workers can share any TCP connection
- * // In this case it is an HTTP server
- * http.createServer((req, res) => {
- * res.writeHead(200);
- * res.end('hello world\n');
- * }).listen(8000);
- *
- * console.log(`Worker ${process.pid} started`);
- * }
- * ```
- *
- * Running Node.js will now share port 8000 between the workers:
- *
- * ```console
- * $ node server.js
- * Primary 3596 is running
- * Worker 4324 started
- * Worker 4520 started
- * Worker 6056 started
- * Worker 5644 started
- * ```
- *
- * On Windows, it is not yet possible to set up a named pipe server in a worker.
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js)
- */
-declare module "cluster" {
- import * as child from "node:child_process";
- import EventEmitter = require("node:events");
- import * as net from "node:net";
- type SerializationType = "json" | "advanced";
- export interface ClusterSettings {
- execArgv?: string[] | undefined; // default: process.execArgv
- exec?: string | undefined;
- args?: string[] | undefined;
- silent?: boolean | undefined;
- stdio?: any[] | undefined;
- uid?: number | undefined;
- gid?: number | undefined;
- inspectPort?: number | (() => number) | undefined;
- serialization?: SerializationType | undefined;
- cwd?: string | undefined;
- windowsHide?: boolean | undefined;
- }
- export interface Address {
- address: string;
- port: number;
- addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
- }
- /**
- * A `Worker` object contains all public information and method about a worker.
- * In the primary it can be obtained using `cluster.workers`. In a worker
- * it can be obtained using `cluster.worker`.
- * @since v0.7.0
- */
- export class Worker extends EventEmitter {
- /**
- * Each new worker is given its own unique id, this id is stored in the`id`.
- *
- * While a worker is alive, this is the key that indexes it in`cluster.workers`.
- * @since v0.8.0
- */
- id: number;
- /**
- * All workers are created using `child_process.fork()`, the returned object
- * from this function is stored as `.process`. In a worker, the global `process`is stored.
- *
- * See: `Child Process module`.
- *
- * Workers will call `process.exit(0)` if the `'disconnect'` event occurs
- * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
- * accidental disconnection.
- * @since v0.7.0
- */
- process: child.ChildProcess;
- /**
- * Send a message to a worker or primary, optionally with a handle.
- *
- * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`.
- *
- * In a worker, this sends a message to the primary. It is identical to`process.send()`.
- *
- * This example will echo back all messages from the primary:
- *
- * ```js
- * if (cluster.isPrimary) {
- * const worker = cluster.fork();
- * worker.send('hi there');
- *
- * } else if (cluster.isWorker) {
- * process.on('message', (msg) => {
- * process.send(msg);
- * });
- * }
- * ```
- * @since v0.7.0
- * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
- */
- send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
- send(
- message: child.Serializable,
- sendHandle: child.SendHandle,
- callback?: (error: Error | null) => void,
- ): boolean;
- send(
- message: child.Serializable,
- sendHandle: child.SendHandle,
- options?: child.MessageOptions,
- callback?: (error: Error | null) => void,
- ): boolean;
- /**
- * This function will kill the worker. In the primary worker, it does this by
- * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`.
- *
- * The `kill()` function kills the worker process without waiting for a graceful
- * disconnect, it has the same behavior as `worker.process.kill()`.
- *
- * This method is aliased as `worker.destroy()` for backwards compatibility.
- *
- * In a worker, `process.kill()` exists, but it is not this function;
- * it is `kill()`.
- * @since v0.9.12
- * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
- */
- kill(signal?: string): void;
- destroy(signal?: string): void;
- /**
- * In a worker, this function will close all servers, wait for the `'close'` event
- * on those servers, and then disconnect the IPC channel.
- *
- * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself.
- *
- * Causes `.exitedAfterDisconnect` to be set.
- *
- * After a server is closed, it will no longer accept new connections,
- * but connections may be accepted by any other listening worker. Existing
- * connections will be allowed to close as usual. When no more connections exist,
- * see `server.close()`, the IPC channel to the worker will close allowing it
- * to die gracefully.
- *
- * The above applies _only_ to server connections, client connections are not
- * automatically closed by workers, and disconnect does not wait for them to close
- * before exiting.
- *
- * In a worker, `process.disconnect` exists, but it is not this function;
- * it is `disconnect()`.
- *
- * Because long living server connections may block workers from disconnecting, it
- * may be useful to send a message, so application specific actions may be taken to
- * close them. It also may be useful to implement a timeout, killing a worker if
- * the `'disconnect'` event has not been emitted after some time.
- *
- * ```js
- * if (cluster.isPrimary) {
- * const worker = cluster.fork();
- * let timeout;
- *
- * worker.on('listening', (address) => {
- * worker.send('shutdown');
- * worker.disconnect();
- * timeout = setTimeout(() => {
- * worker.kill();
- * }, 2000);
- * });
- *
- * worker.on('disconnect', () => {
- * clearTimeout(timeout);
- * });
- *
- * } else if (cluster.isWorker) {
- * const net = require('node:net');
- * const server = net.createServer((socket) => {
- * // Connections never end
- * });
- *
- * server.listen(8000);
- *
- * process.on('message', (msg) => {
- * if (msg === 'shutdown') {
- * // Initiate graceful close of any connections to server
- * }
- * });
- * }
- * ```
- * @since v0.7.7
- * @return A reference to `worker`.
- */
- disconnect(): void;
- /**
- * This function returns `true` if the worker is connected to its primary via its
- * IPC channel, `false` otherwise. A worker is connected to its primary after it
- * has been created. It is disconnected after the `'disconnect'` event is emitted.
- * @since v0.11.14
- */
- isConnected(): boolean;
- /**
- * This function returns `true` if the worker's process has terminated (either
- * because of exiting or being signaled). Otherwise, it returns `false`.
- *
- * ```js
- * import cluster from 'node:cluster';
- * import http from 'node:http';
- * import { availableParallelism } from 'node:os';
- * import process from 'node:process';
- *
- * const numCPUs = availableParallelism();
- *
- * if (cluster.isPrimary) {
- * console.log(`Primary ${process.pid} is running`);
- *
- * // Fork workers.
- * for (let i = 0; i < numCPUs; i++) {
- * cluster.fork();
- * }
- *
- * cluster.on('fork', (worker) => {
- * console.log('worker is dead:', worker.isDead());
- * });
- *
- * cluster.on('exit', (worker, code, signal) => {
- * console.log('worker is dead:', worker.isDead());
- * });
- * } else {
- * // Workers can share any TCP connection. In this case, it is an HTTP server.
- * http.createServer((req, res) => {
- * res.writeHead(200);
- * res.end(`Current process\n ${process.pid}`);
- * process.kill(process.pid);
- * }).listen(8000);
- * }
- * ```
- * @since v0.11.14
- */
- isDead(): boolean;
- /**
- * This property is `true` if the worker exited due to `.disconnect()`.
- * If the worker exited any other way, it is `false`. If the
- * worker has not exited, it is `undefined`.
- *
- * The boolean `worker.exitedAfterDisconnect` allows distinguishing between
- * voluntary and accidental exit, the primary may choose not to respawn a worker
- * based on this value.
- *
- * ```js
- * cluster.on('exit', (worker, code, signal) => {
- * if (worker.exitedAfterDisconnect === true) {
- * console.log('Oh, it was just voluntary – no need to worry');
- * }
- * });
- *
- * // kill worker
- * worker.kill();
- * ```
- * @since v6.0.0
- */
- exitedAfterDisconnect: boolean;
- /**
- * events.EventEmitter
- * 1. disconnect
- * 2. error
- * 3. exit
- * 4. listening
- * 5. message
- * 6. online
- */
- addListener(event: string, listener: (...args: any[]) => void): this;
- addListener(event: "disconnect", listener: () => void): this;
- addListener(event: "error", listener: (error: Error) => void): this;
- addListener(event: "exit", listener: (code: number, signal: string) => void): this;
- addListener(event: "listening", listener: (address: Address) => void): this;
- addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- addListener(event: "online", listener: () => void): this;
- emit(event: string | symbol, ...args: any[]): boolean;
- emit(event: "disconnect"): boolean;
- emit(event: "error", error: Error): boolean;
- emit(event: "exit", code: number, signal: string): boolean;
- emit(event: "listening", address: Address): boolean;
- emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
- emit(event: "online"): boolean;
- on(event: string, listener: (...args: any[]) => void): this;
- on(event: "disconnect", listener: () => void): this;
- on(event: "error", listener: (error: Error) => void): this;
- on(event: "exit", listener: (code: number, signal: string) => void): this;
- on(event: "listening", listener: (address: Address) => void): this;
- on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- on(event: "online", listener: () => void): this;
- once(event: string, listener: (...args: any[]) => void): this;
- once(event: "disconnect", listener: () => void): this;
- once(event: "error", listener: (error: Error) => void): this;
- once(event: "exit", listener: (code: number, signal: string) => void): this;
- once(event: "listening", listener: (address: Address) => void): this;
- once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- once(event: "online", listener: () => void): this;
- prependListener(event: string, listener: (...args: any[]) => void): this;
- prependListener(event: "disconnect", listener: () => void): this;
- prependListener(event: "error", listener: (error: Error) => void): this;
- prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
- prependListener(event: "listening", listener: (address: Address) => void): this;
- prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- prependListener(event: "online", listener: () => void): this;
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
- prependOnceListener(event: "disconnect", listener: () => void): this;
- prependOnceListener(event: "error", listener: (error: Error) => void): this;
- prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
- prependOnceListener(event: "listening", listener: (address: Address) => void): this;
- prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- prependOnceListener(event: "online", listener: () => void): this;
- }
- export interface Cluster extends EventEmitter {
- disconnect(callback?: () => void): void;
- fork(env?: any): Worker;
- /** @deprecated since v16.0.0 - use isPrimary. */
- readonly isMaster: boolean;
- readonly isPrimary: boolean;
- readonly isWorker: boolean;
- schedulingPolicy: number;
- readonly settings: ClusterSettings;
- /** @deprecated since v16.0.0 - use setupPrimary. */
- setupMaster(settings?: ClusterSettings): void;
- /**
- * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings.
- */
- setupPrimary(settings?: ClusterSettings): void;
- readonly worker?: Worker | undefined;
- readonly workers?: NodeJS.Dict | undefined;
- readonly SCHED_NONE: number;
- readonly SCHED_RR: number;
- /**
- * events.EventEmitter
- * 1. disconnect
- * 2. exit
- * 3. fork
- * 4. listening
- * 5. message
- * 6. online
- * 7. setup
- */
- addListener(event: string, listener: (...args: any[]) => void): this;
- addListener(event: "disconnect", listener: (worker: Worker) => void): this;
- addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
- addListener(event: "fork", listener: (worker: Worker) => void): this;
- addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
- addListener(
- event: "message",
- listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
- ): this; // the handle is a net.Socket or net.Server object, or undefined.
- addListener(event: "online", listener: (worker: Worker) => void): this;
- addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
- emit(event: string | symbol, ...args: any[]): boolean;
- emit(event: "disconnect", worker: Worker): boolean;
- emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
- emit(event: "fork", worker: Worker): boolean;
- emit(event: "listening", worker: Worker, address: Address): boolean;
- emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
- emit(event: "online", worker: Worker): boolean;
- emit(event: "setup", settings: ClusterSettings): boolean;
- on(event: string, listener: (...args: any[]) => void): this;
- on(event: "disconnect", listener: (worker: Worker) => void): this;
- on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
- on(event: "fork", listener: (worker: Worker) => void): this;
- on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
- on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- on(event: "online", listener: (worker: Worker) => void): this;
- on(event: "setup", listener: (settings: ClusterSettings) => void): this;
- once(event: string, listener: (...args: any[]) => void): this;
- once(event: "disconnect", listener: (worker: Worker) => void): this;
- once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
- once(event: "fork", listener: (worker: Worker) => void): this;
- once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
- once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
- once(event: "online", listener: (worker: Worker) => void): this;
- once(event: "setup", listener: (settings: ClusterSettings) => void): this;
- prependListener(event: string, listener: (...args: any[]) => void): this;
- prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
- prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
- prependListener(event: "fork", listener: (worker: Worker) => void): this;
- prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
- // the handle is a net.Socket or net.Server object, or undefined.
- prependListener(
- event: "message",
- listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
- ): this;
- prependListener(event: "online", listener: (worker: Worker) => void): this;
- prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
- prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
- prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
- prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
- prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
- // the handle is a net.Socket or net.Server object, or undefined.
- prependOnceListener(
- event: "message",
- listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
- ): this;
- prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
- prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
- }
- const cluster: Cluster;
- export default cluster;
-}
-declare module "node:cluster" {
- export * from "cluster";
- export { default as default } from "cluster";
-}
diff --git a/example_bot/node_modules/@types/node/console.d.ts b/example_bot/node_modules/@types/node/console.d.ts
deleted file mode 100644
index bcc3450..0000000
--- a/example_bot/node_modules/@types/node/console.d.ts
+++ /dev/null
@@ -1,415 +0,0 @@
-/**
- * The `node:console` module provides a simple debugging console that is similar to
- * the JavaScript console mechanism provided by web browsers.
- *
- * The module exports two specific components:
- *
- * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream.
- * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`.
- *
- * _**Warning**_: The global console object's methods are neither consistently
- * synchronous like the browser APIs they resemble, nor are they consistently
- * asynchronous like all other Node.js streams. See the `note on process I/O` for
- * more information.
- *
- * Example using the global `console`:
- *
- * ```js
- * console.log('hello world');
- * // Prints: hello world, to stdout
- * console.log('hello %s', 'world');
- * // Prints: hello world, to stdout
- * console.error(new Error('Whoops, something bad happened'));
- * // Prints error message and stack trace to stderr:
- * // Error: Whoops, something bad happened
- * // at [eval]:5:15
- * // at Script.runInThisContext (node:vm:132:18)
- * // at Object.runInThisContext (node:vm:309:38)
- * // at node:internal/process/execution:77:19
- * // at [eval]-wrapper:6:22
- * // at evalScript (node:internal/process/execution:76:60)
- * // at node:internal/main/eval_string:23:3
- *
- * const name = 'Will Robinson';
- * console.warn(`Danger ${name}! Danger!`);
- * // Prints: Danger Will Robinson! Danger!, to stderr
- * ```
- *
- * Example using the `Console` class:
- *
- * ```js
- * const out = getStreamSomehow();
- * const err = getStreamSomehow();
- * const myConsole = new console.Console(out, err);
- *
- * myConsole.log('hello world');
- * // Prints: hello world, to out
- * myConsole.log('hello %s', 'world');
- * // Prints: hello world, to out
- * myConsole.error(new Error('Whoops, something bad happened'));
- * // Prints: [Error: Whoops, something bad happened], to err
- *
- * const name = 'Will Robinson';
- * myConsole.warn(`Danger ${name}! Danger!`);
- * // Prints: Danger Will Robinson! Danger!, to err
- * ```
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js)
- */
-declare module "console" {
- import console = require("node:console");
- export = console;
-}
-declare module "node:console" {
- import { InspectOptions } from "node:util";
- global {
- // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
- interface Console {
- Console: console.ConsoleConstructor;
- /**
- * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
- * writes a message and does not otherwise affect execution. The output always
- * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`.
- *
- * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
- *
- * ```js
- * console.assert(true, 'does nothing');
- *
- * console.assert(false, 'Whoops %s work', 'didn\'t');
- * // Assertion failed: Whoops didn't work
- *
- * console.assert();
- * // Assertion failed
- * ```
- * @since v0.1.101
- * @param value The value tested for being truthy.
- * @param message All arguments besides `value` are used as error message.
- */
- assert(value: any, message?: string, ...optionalParams: any[]): void;
- /**
- * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the
- * TTY. When `stdout` is not a TTY, this method does nothing.
- *
- * The specific operation of `console.clear()` can vary across operating systems
- * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the
- * current terminal viewport for the Node.js
- * binary.
- * @since v8.3.0
- */
- clear(): void;
- /**
- * Maintains an internal counter specific to `label` and outputs to `stdout` the
- * number of times `console.count()` has been called with the given `label`.
- *
- * ```js
- * > console.count()
- * default: 1
- * undefined
- * > console.count('default')
- * default: 2
- * undefined
- * > console.count('abc')
- * abc: 1
- * undefined
- * > console.count('xyz')
- * xyz: 1
- * undefined
- * > console.count('abc')
- * abc: 2
- * undefined
- * > console.count()
- * default: 3
- * undefined
- * >
- * ```
- * @since v8.3.0
- * @param [label='default'] The display label for the counter.
- */
- count(label?: string): void;
- /**
- * Resets the internal counter specific to `label`.
- *
- * ```js
- * > console.count('abc');
- * abc: 1
- * undefined
- * > console.countReset('abc');
- * undefined
- * > console.count('abc');
- * abc: 1
- * undefined
- * >
- * ```
- * @since v8.3.0
- * @param [label='default'] The display label for the counter.
- */
- countReset(label?: string): void;
- /**
- * The `console.debug()` function is an alias for {@link log}.
- * @since v8.0.0
- */
- debug(message?: any, ...optionalParams: any[]): void;
- /**
- * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`.
- * This function bypasses any custom `inspect()` function defined on `obj`.
- * @since v0.1.101
- */
- dir(obj: any, options?: InspectOptions): void;
- /**
- * This method calls `console.log()` passing it the arguments received.
- * This method does not produce any XML formatting.
- * @since v8.0.0
- */
- dirxml(...data: any[]): void;
- /**
- * Prints to `stderr` with newline. Multiple arguments can be passed, with the
- * first used as the primary message and all additional used as substitution
- * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
- *
- * ```js
- * const code = 5;
- * console.error('error #%d', code);
- * // Prints: error #5, to stderr
- * console.error('error', code);
- * // Prints: error 5, to stderr
- * ```
- *
- * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string
- * values are concatenated. See `util.format()` for more information.
- * @since v0.1.100
- */
- error(message?: any, ...optionalParams: any[]): void;
- /**
- * Increases indentation of subsequent lines by spaces for `groupIndentation`length.
- *
- * If one or more `label`s are provided, those are printed first without the
- * additional indentation.
- * @since v8.5.0
- */
- group(...label: any[]): void;
- /**
- * An alias for {@link group}.
- * @since v8.5.0
- */
- groupCollapsed(...label: any[]): void;
- /**
- * Decreases indentation of subsequent lines by spaces for `groupIndentation`length.
- * @since v8.5.0
- */
- groupEnd(): void;
- /**
- * The `console.info()` function is an alias for {@link log}.
- * @since v0.1.100
- */
- info(message?: any, ...optionalParams: any[]): void;
- /**
- * Prints to `stdout` with newline. Multiple arguments can be passed, with the
- * first used as the primary message and all additional used as substitution
- * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
- *
- * ```js
- * const count = 5;
- * console.log('count: %d', count);
- * // Prints: count: 5, to stdout
- * console.log('count:', count);
- * // Prints: count: 5, to stdout
- * ```
- *
- * See `util.format()` for more information.
- * @since v0.1.100
- */
- log(message?: any, ...optionalParams: any[]): void;
- /**
- * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
- * logging the argument if it can't be parsed as tabular.
- *
- * ```js
- * // These can't be parsed as tabular data
- * console.table(Symbol());
- * // Symbol()
- *
- * console.table(undefined);
- * // undefined
- *
- * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
- * // ┌─────────┬─────┬─────┐
- * // │ (index) │ a │ b │
- * // ├─────────┼─────┼─────┤
- * // │ 0 │ 1 │ 'Y' │
- * // │ 1 │ 'Z' │ 2 │
- * // └─────────┴─────┴─────┘
- *
- * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
- * // ┌─────────┬─────┐
- * // │ (index) │ a │
- * // ├─────────┼─────┤
- * // │ 0 │ 1 │
- * // │ 1 │ 'Z' │
- * // └─────────┴─────┘
- * ```
- * @since v10.0.0
- * @param properties Alternate properties for constructing the table.
- */
- table(tabularData: any, properties?: readonly string[]): void;
- /**
- * Starts a timer that can be used to compute the duration of an operation. Timers
- * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in
- * suitable time units to `stdout`. For example, if the elapsed
- * time is 3869ms, `console.timeEnd()` displays "3.869s".
- * @since v0.1.104
- * @param [label='default']
- */
- time(label?: string): void;
- /**
- * Stops a timer that was previously started by calling {@link time} and
- * prints the result to `stdout`:
- *
- * ```js
- * console.time('bunch-of-stuff');
- * // Do a bunch of stuff.
- * console.timeEnd('bunch-of-stuff');
- * // Prints: bunch-of-stuff: 225.438ms
- * ```
- * @since v0.1.104
- * @param [label='default']
- */
- timeEnd(label?: string): void;
- /**
- * For a timer that was previously started by calling {@link time}, prints
- * the elapsed time and other `data` arguments to `stdout`:
- *
- * ```js
- * console.time('process');
- * const value = expensiveProcess1(); // Returns 42
- * console.timeLog('process', value);
- * // Prints "process: 365.227ms 42".
- * doExpensiveProcess2(value);
- * console.timeEnd('process');
- * ```
- * @since v10.7.0
- * @param [label='default']
- */
- timeLog(label?: string, ...data: any[]): void;
- /**
- * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code.
- *
- * ```js
- * console.trace('Show me');
- * // Prints: (stack trace will vary based on where trace is called)
- * // Trace: Show me
- * // at repl:2:9
- * // at REPLServer.defaultEval (repl.js:248:27)
- * // at bound (domain.js:287:14)
- * // at REPLServer.runBound [as eval] (domain.js:300:12)
- * // at REPLServer. (repl.js:412:12)
- * // at emitOne (events.js:82:20)
- * // at REPLServer.emit (events.js:169:7)
- * // at REPLServer.Interface._onLine (readline.js:210:10)
- * // at REPLServer.Interface._line (readline.js:549:8)
- * // at REPLServer.Interface._ttyWrite (readline.js:826:14)
- * ```
- * @since v0.1.104
- */
- trace(message?: any, ...optionalParams: any[]): void;
- /**
- * The `console.warn()` function is an alias for {@link error}.
- * @since v0.1.100
- */
- warn(message?: any, ...optionalParams: any[]): void;
- // --- Inspector mode only ---
- /**
- * This method does not display anything unless used in the inspector.
- * Starts a JavaScript CPU profile with an optional label.
- */
- profile(label?: string): void;
- /**
- * This method does not display anything unless used in the inspector.
- * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
- */
- profileEnd(label?: string): void;
- /**
- * This method does not display anything unless used in the inspector.
- * Adds an event with the label `label` to the Timeline panel of the inspector.
- */
- timeStamp(label?: string): void;
- }
- /**
- * The `console` module provides a simple debugging console that is similar to the
- * JavaScript console mechanism provided by web browsers.
- *
- * The module exports two specific components:
- *
- * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream.
- * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`.
- *
- * _**Warning**_: The global console object's methods are neither consistently
- * synchronous like the browser APIs they resemble, nor are they consistently
- * asynchronous like all other Node.js streams. See the `note on process I/O` for
- * more information.
- *
- * Example using the global `console`:
- *
- * ```js
- * console.log('hello world');
- * // Prints: hello world, to stdout
- * console.log('hello %s', 'world');
- * // Prints: hello world, to stdout
- * console.error(new Error('Whoops, something bad happened'));
- * // Prints error message and stack trace to stderr:
- * // Error: Whoops, something bad happened
- * // at [eval]:5:15
- * // at Script.runInThisContext (node:vm:132:18)
- * // at Object.runInThisContext (node:vm:309:38)
- * // at node:internal/process/execution:77:19
- * // at [eval]-wrapper:6:22
- * // at evalScript (node:internal/process/execution:76:60)
- * // at node:internal/main/eval_string:23:3
- *
- * const name = 'Will Robinson';
- * console.warn(`Danger ${name}! Danger!`);
- * // Prints: Danger Will Robinson! Danger!, to stderr
- * ```
- *
- * Example using the `Console` class:
- *
- * ```js
- * const out = getStreamSomehow();
- * const err = getStreamSomehow();
- * const myConsole = new console.Console(out, err);
- *
- * myConsole.log('hello world');
- * // Prints: hello world, to out
- * myConsole.log('hello %s', 'world');
- * // Prints: hello world, to out
- * myConsole.error(new Error('Whoops, something bad happened'));
- * // Prints: [Error: Whoops, something bad happened], to err
- *
- * const name = 'Will Robinson';
- * myConsole.warn(`Danger ${name}! Danger!`);
- * // Prints: Danger Will Robinson! Danger!, to err
- * ```
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js)
- */
- namespace console {
- interface ConsoleConstructorOptions {
- stdout: NodeJS.WritableStream;
- stderr?: NodeJS.WritableStream | undefined;
- ignoreErrors?: boolean | undefined;
- colorMode?: boolean | "auto" | undefined;
- inspectOptions?: InspectOptions | undefined;
- /**
- * Set group indentation
- * @default 2
- */
- groupIndentation?: number | undefined;
- }
- interface ConsoleConstructor {
- prototype: Console;
- new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
- new(options: ConsoleConstructorOptions): Console;
- }
- }
- var console: Console;
- }
- export = globalThis.console;
-}
diff --git a/example_bot/node_modules/@types/node/constants.d.ts b/example_bot/node_modules/@types/node/constants.d.ts
deleted file mode 100644
index c3ac2b8..0000000
--- a/example_bot/node_modules/@types/node/constants.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
-declare module "constants" {
- import { constants as osConstants, SignalConstants } from "node:os";
- import { constants as cryptoConstants } from "node:crypto";
- import { constants as fsConstants } from "node:fs";
-
- const exp:
- & typeof osConstants.errno
- & typeof osConstants.priority
- & SignalConstants
- & typeof cryptoConstants
- & typeof fsConstants;
- export = exp;
-}
-
-declare module "node:constants" {
- import constants = require("constants");
- export = constants;
-}
diff --git a/example_bot/node_modules/@types/node/crypto.d.ts b/example_bot/node_modules/@types/node/crypto.d.ts
deleted file mode 100644
index 2f2038e..0000000
--- a/example_bot/node_modules/@types/node/crypto.d.ts
+++ /dev/null
@@ -1,4456 +0,0 @@
-/**
- * The `node:crypto` module provides cryptographic functionality that includes a
- * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
- * functions.
- *
- * ```js
- * const { createHmac } = await import('node:crypto');
- *
- * const secret = 'abcdefg';
- * const hash = createHmac('sha256', secret)
- * .update('I love cupcakes')
- * .digest('hex');
- * console.log(hash);
- * // Prints:
- * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
- * ```
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js)
- */
-declare module "crypto" {
- import * as stream from "node:stream";
- import { PeerCertificate } from "node:tls";
- /**
- * SPKAC is a Certificate Signing Request mechanism originally implemented by
- * Netscape and was specified formally as part of HTML5's `keygen` element.
- *
- * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
- * should not use this element anymore.
- *
- * The `node:crypto` module provides the `Certificate` class for working with SPKAC
- * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC
- * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally.
- * @since v0.11.8
- */
- class Certificate {
- /**
- * ```js
- * const { Certificate } = await import('node:crypto');
- * const spkac = getSpkacSomehow();
- * const challenge = Certificate.exportChallenge(spkac);
- * console.log(challenge.toString('utf8'));
- * // Prints: the challenge as a UTF8 string
- * ```
- * @since v9.0.0
- * @param encoding The `encoding` of the `spkac` string.
- * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
- */
- static exportChallenge(spkac: BinaryLike): Buffer;
- /**
- * ```js
- * const { Certificate } = await import('node:crypto');
- * const spkac = getSpkacSomehow();
- * const publicKey = Certificate.exportPublicKey(spkac);
- * console.log(publicKey);
- * // Prints: the public key as
- * ```
- * @since v9.0.0
- * @param encoding The `encoding` of the `spkac` string.
- * @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
- */
- static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
- /**
- * ```js
- * import { Buffer } from 'node:buffer';
- * const { Certificate } = await import('node:crypto');
- *
- * const spkac = getSpkacSomehow();
- * console.log(Certificate.verifySpkac(Buffer.from(spkac)));
- * // Prints: true or false
- * ```
- * @since v9.0.0
- * @param encoding The `encoding` of the `spkac` string.
- * @return `true` if the given `spkac` data structure is valid, `false` otherwise.
- */
- static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
- /**
- * @deprecated
- * @param spkac
- * @returns The challenge component of the `spkac` data structure,
- * which includes a public key and a challenge.
- */
- exportChallenge(spkac: BinaryLike): Buffer;
- /**
- * @deprecated
- * @param spkac
- * @param encoding The encoding of the spkac string.
- * @returns The public key component of the `spkac` data structure,
- * which includes a public key and a challenge.
- */
- exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
- /**
- * @deprecated
- * @param spkac
- * @returns `true` if the given `spkac` data structure is valid,
- * `false` otherwise.
- */
- verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
- }
- namespace constants {
- // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants
- const OPENSSL_VERSION_NUMBER: number;
- /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
- const SSL_OP_ALL: number;
- /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
- const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
- /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
- const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
- /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */
- const SSL_OP_CISCO_ANYCONNECT: number;
- /** Instructs OpenSSL to turn on cookie exchange. */
- const SSL_OP_COOKIE_EXCHANGE: number;
- /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */
- const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
- /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
- const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
- /** Allows initial connection to servers that do not support RI. */
- const SSL_OP_LEGACY_SERVER_CONNECT: number;
- /** Instructs OpenSSL to disable support for SSL/TLS compression. */
- const SSL_OP_NO_COMPRESSION: number;
- const SSL_OP_NO_QUERY_MTU: number;
- /** Instructs OpenSSL to always start a new session when performing renegotiation. */
- const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
- const SSL_OP_NO_SSLv2: number;
- const SSL_OP_NO_SSLv3: number;
- const SSL_OP_NO_TICKET: number;
- const SSL_OP_NO_TLSv1: number;
- const SSL_OP_NO_TLSv1_1: number;
- const SSL_OP_NO_TLSv1_2: number;
- /** Instructs OpenSSL to disable version rollback attack detection. */
- const SSL_OP_TLS_ROLLBACK_BUG: number;
- const ENGINE_METHOD_RSA: number;
- const ENGINE_METHOD_DSA: number;
- const ENGINE_METHOD_DH: number;
- const ENGINE_METHOD_RAND: number;
- const ENGINE_METHOD_EC: number;
- const ENGINE_METHOD_CIPHERS: number;
- const ENGINE_METHOD_DIGESTS: number;
- const ENGINE_METHOD_PKEY_METHS: number;
- const ENGINE_METHOD_PKEY_ASN1_METHS: number;
- const ENGINE_METHOD_ALL: number;
- const ENGINE_METHOD_NONE: number;
- const DH_CHECK_P_NOT_SAFE_PRIME: number;
- const DH_CHECK_P_NOT_PRIME: number;
- const DH_UNABLE_TO_CHECK_GENERATOR: number;
- const DH_NOT_SUITABLE_GENERATOR: number;
- const RSA_PKCS1_PADDING: number;
- const RSA_SSLV23_PADDING: number;
- const RSA_NO_PADDING: number;
- const RSA_PKCS1_OAEP_PADDING: number;
- const RSA_X931_PADDING: number;
- const RSA_PKCS1_PSS_PADDING: number;
- /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */
- const RSA_PSS_SALTLEN_DIGEST: number;
- /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */
- const RSA_PSS_SALTLEN_MAX_SIGN: number;
- /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */
- const RSA_PSS_SALTLEN_AUTO: number;
- const POINT_CONVERSION_COMPRESSED: number;
- const POINT_CONVERSION_UNCOMPRESSED: number;
- const POINT_CONVERSION_HYBRID: number;
- /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */
- const defaultCoreCipherList: string;
- /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */
- const defaultCipherList: string;
- }
- interface HashOptions extends stream.TransformOptions {
- /**
- * For XOF hash functions such as `shake256`, the
- * outputLength option can be used to specify the desired output length in bytes.
- */
- outputLength?: number | undefined;
- }
- /** @deprecated since v10.0.0 */
- const fips: boolean;
- /**
- * Creates and returns a `Hash` object that can be used to generate hash digests
- * using the given `algorithm`. Optional `options` argument controls stream
- * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
- * can be used to specify the desired output length in bytes.
- *
- * The `algorithm` is dependent on the available algorithms supported by the
- * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
- * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
- * display the available digest algorithms.
- *
- * Example: generating the sha256 sum of a file
- *
- * ```js
- * import {
- * createReadStream,
- * } from 'node:fs';
- * import { argv } from 'node:process';
- * const {
- * createHash,
- * } = await import('node:crypto');
- *
- * const filename = argv[2];
- *
- * const hash = createHash('sha256');
- *
- * const input = createReadStream(filename);
- * input.on('readable', () => {
- * // Only one element is going to be produced by the
- * // hash stream.
- * const data = input.read();
- * if (data)
- * hash.update(data);
- * else {
- * console.log(`${hash.digest('hex')} ${filename}`);
- * }
- * });
- * ```
- * @since v0.1.92
- * @param options `stream.transform` options
- */
- function createHash(algorithm: string, options?: HashOptions): Hash;
- /**
- * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
- * Optional `options` argument controls stream behavior.
- *
- * The `algorithm` is dependent on the available algorithms supported by the
- * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
- * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
- * display the available digest algorithms.
- *
- * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
- * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was
- * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not
- * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256).
- *
- * Example: generating the sha256 HMAC of a file
- *
- * ```js
- * import {
- * createReadStream,
- * } from 'node:fs';
- * import { argv } from 'node:process';
- * const {
- * createHmac,
- * } = await import('node:crypto');
- *
- * const filename = argv[2];
- *
- * const hmac = createHmac('sha256', 'a secret');
- *
- * const input = createReadStream(filename);
- * input.on('readable', () => {
- * // Only one element is going to be produced by the
- * // hash stream.
- * const data = input.read();
- * if (data)
- * hmac.update(data);
- * else {
- * console.log(`${hmac.digest('hex')} ${filename}`);
- * }
- * });
- * ```
- * @since v0.1.94
- * @param options `stream.transform` options
- */
- function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
- // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
- type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
- type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1";
- type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
- type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
- type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
- /**
- * The `Hash` class is a utility for creating hash digests of data. It can be
- * used in one of two ways:
- *
- * * As a `stream` that is both readable and writable, where data is written
- * to produce a computed hash digest on the readable side, or
- * * Using the `hash.update()` and `hash.digest()` methods to produce the
- * computed hash.
- *
- * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword.
- *
- * Example: Using `Hash` objects as streams:
- *
- * ```js
- * const {
- * createHash,
- * } = await import('node:crypto');
- *
- * const hash = createHash('sha256');
- *
- * hash.on('readable', () => {
- * // Only one element is going to be produced by the
- * // hash stream.
- * const data = hash.read();
- * if (data) {
- * console.log(data.toString('hex'));
- * // Prints:
- * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
- * }
- * });
- *
- * hash.write('some data to hash');
- * hash.end();
- * ```
- *
- * Example: Using `Hash` and piped streams:
- *
- * ```js
- * import { createReadStream } from 'node:fs';
- * import { stdout } from 'node:process';
- * const { createHash } = await import('node:crypto');
- *
- * const hash = createHash('sha256');
- *
- * const input = createReadStream('test.js');
- * input.pipe(hash).setEncoding('hex').pipe(stdout);
- * ```
- *
- * Example: Using the `hash.update()` and `hash.digest()` methods:
- *
- * ```js
- * const {
- * createHash,
- * } = await import('node:crypto');
- *
- * const hash = createHash('sha256');
- *
- * hash.update('some data to hash');
- * console.log(hash.digest('hex'));
- * // Prints:
- * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
- * ```
- * @since v0.1.92
- */
- class Hash extends stream.Transform {
- private constructor();
- /**
- * Creates a new `Hash` object that contains a deep copy of the internal state
- * of the current `Hash` object.
- *
- * The optional `options` argument controls stream behavior. For XOF hash
- * functions such as `'shake256'`, the `outputLength` option can be used to
- * specify the desired output length in bytes.
- *
- * An error is thrown when an attempt is made to copy the `Hash` object after
- * its `hash.digest()` method has been called.
- *
- * ```js
- * // Calculate a rolling hash.
- * const {
- * createHash,
- * } = await import('node:crypto');
- *
- * const hash = createHash('sha256');
- *
- * hash.update('one');
- * console.log(hash.copy().digest('hex'));
- *
- * hash.update('two');
- * console.log(hash.copy().digest('hex'));
- *
- * hash.update('three');
- * console.log(hash.copy().digest('hex'));
- *
- * // Etc.
- * ```
- * @since v13.1.0
- * @param options `stream.transform` options
- */
- copy(options?: stream.TransformOptions): Hash;
- /**
- * Updates the hash content with the given `data`, the encoding of which
- * is given in `inputEncoding`.
- * If `encoding` is not provided, and the `data` is a string, an
- * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
- *
- * This can be called many times with new data as it is streamed.
- * @since v0.1.92
- * @param inputEncoding The `encoding` of the `data` string.
- */
- update(data: BinaryLike): Hash;
- update(data: string, inputEncoding: Encoding): Hash;
- /**
- * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method).
- * If `encoding` is provided a string will be returned; otherwise
- * a `Buffer` is returned.
- *
- * The `Hash` object can not be used again after `hash.digest()` method has been
- * called. Multiple calls will cause an error to be thrown.
- * @since v0.1.92
- * @param encoding The `encoding` of the return value.
- */
- digest(): Buffer;
- digest(encoding: BinaryToTextEncoding): string;
- }
- /**
- * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can
- * be used in one of two ways:
- *
- * * As a `stream` that is both readable and writable, where data is written
- * to produce a computed HMAC digest on the readable side, or
- * * Using the `hmac.update()` and `hmac.digest()` methods to produce the
- * computed HMAC digest.
- *
- * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword.
- *
- * Example: Using `Hmac` objects as streams:
- *
- * ```js
- * const {
- * createHmac,
- * } = await import('node:crypto');
- *
- * const hmac = createHmac('sha256', 'a secret');
- *
- * hmac.on('readable', () => {
- * // Only one element is going to be produced by the
- * // hash stream.
- * const data = hmac.read();
- * if (data) {
- * console.log(data.toString('hex'));
- * // Prints:
- * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
- * }
- * });
- *
- * hmac.write('some data to hash');
- * hmac.end();
- * ```
- *
- * Example: Using `Hmac` and piped streams:
- *
- * ```js
- * import { createReadStream } from 'node:fs';
- * import { stdout } from 'node:process';
- * const {
- * createHmac,
- * } = await import('node:crypto');
- *
- * const hmac = createHmac('sha256', 'a secret');
- *
- * const input = createReadStream('test.js');
- * input.pipe(hmac).pipe(stdout);
- * ```
- *
- * Example: Using the `hmac.update()` and `hmac.digest()` methods:
- *
- * ```js
- * const {
- * createHmac,
- * } = await import('node:crypto');
- *
- * const hmac = createHmac('sha256', 'a secret');
- *
- * hmac.update('some data to hash');
- * console.log(hmac.digest('hex'));
- * // Prints:
- * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
- * ```
- * @since v0.1.94
- */
- class Hmac extends stream.Transform {
- private constructor();
- /**
- * Updates the `Hmac` content with the given `data`, the encoding of which
- * is given in `inputEncoding`.
- * If `encoding` is not provided, and the `data` is a string, an
- * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
- *
- * This can be called many times with new data as it is streamed.
- * @since v0.1.94
- * @param inputEncoding The `encoding` of the `data` string.
- */
- update(data: BinaryLike): Hmac;
- update(data: string, inputEncoding: Encoding): Hmac;
- /**
- * Calculates the HMAC digest of all of the data passed using `hmac.update()`.
- * If `encoding` is
- * provided a string is returned; otherwise a `Buffer` is returned;
- *
- * The `Hmac` object can not be used again after `hmac.digest()` has been
- * called. Multiple calls to `hmac.digest()` will result in an error being thrown.
- * @since v0.1.94
- * @param encoding The `encoding` of the return value.
- */
- digest(): Buffer;
- digest(encoding: BinaryToTextEncoding): string;
- }
- type KeyObjectType = "secret" | "public" | "private";
- interface KeyExportOptions {
- type: "pkcs1" | "spki" | "pkcs8" | "sec1";
- format: T;
- cipher?: string | undefined;
- passphrase?: string | Buffer | undefined;
- }
- interface JwkKeyExportOptions {
- format: "jwk";
- }
- interface JsonWebKey {
- crv?: string | undefined;
- d?: string | undefined;
- dp?: string | undefined;
- dq?: string | undefined;
- e?: string | undefined;
- k?: string | undefined;
- kty?: string | undefined;
- n?: string | undefined;
- p?: string | undefined;
- q?: string | undefined;
- qi?: string | undefined;
- x?: string | undefined;
- y?: string | undefined;
- [key: string]: unknown;
- }
- interface AsymmetricKeyDetails {
- /**
- * Key size in bits (RSA, DSA).
- */
- modulusLength?: number | undefined;
- /**
- * Public exponent (RSA).
- */
- publicExponent?: bigint | undefined;
- /**
- * Name of the message digest (RSA-PSS).
- */
- hashAlgorithm?: string | undefined;
- /**
- * Name of the message digest used by MGF1 (RSA-PSS).
- */
- mgf1HashAlgorithm?: string | undefined;
- /**
- * Minimal salt length in bytes (RSA-PSS).
- */
- saltLength?: number | undefined;
- /**
- * Size of q in bits (DSA).
- */
- divisorLength?: number | undefined;
- /**
- * Name of the curve (EC).
- */
- namedCurve?: string | undefined;
- }
- /**
- * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
- * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject`
- * objects are not to be created directly using the `new`keyword.
- *
- * Most applications should consider using the new `KeyObject` API instead of
- * passing keys as strings or `Buffer`s due to improved security features.
- *
- * `KeyObject` instances can be passed to other threads via `postMessage()`.
- * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to
- * be listed in the `transferList` argument.
- * @since v11.6.0
- */
- class KeyObject {
- private constructor();
- /**
- * Example: Converting a `CryptoKey` instance to a `KeyObject`:
- *
- * ```js
- * const { KeyObject } = await import('node:crypto');
- * const { subtle } = globalThis.crypto;
- *
- * const key = await subtle.generateKey({
- * name: 'HMAC',
- * hash: 'SHA-256',
- * length: 256,
- * }, true, ['sign', 'verify']);
- *
- * const keyObject = KeyObject.from(key);
- * console.log(keyObject.symmetricKeySize);
- * // Prints: 32 (symmetric key size in bytes)
- * ```
- * @since v15.0.0
- */
- static from(key: webcrypto.CryptoKey): KeyObject;
- /**
- * For asymmetric keys, this property represents the type of the key. Supported key
- * types are:
- *
- * * `'rsa'` (OID 1.2.840.113549.1.1.1)
- * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
- * * `'dsa'` (OID 1.2.840.10040.4.1)
- * * `'ec'` (OID 1.2.840.10045.2.1)
- * * `'x25519'` (OID 1.3.101.110)
- * * `'x448'` (OID 1.3.101.111)
- * * `'ed25519'` (OID 1.3.101.112)
- * * `'ed448'` (OID 1.3.101.113)
- * * `'dh'` (OID 1.2.840.113549.1.3.1)
- *
- * This property is `undefined` for unrecognized `KeyObject` types and symmetric
- * keys.
- * @since v11.6.0
- */
- asymmetricKeyType?: KeyType | undefined;
- /**
- * For asymmetric keys, this property represents the size of the embedded key in
- * bytes. This property is `undefined` for symmetric keys.
- */
- asymmetricKeySize?: number | undefined;
- /**
- * This property exists only on asymmetric keys. Depending on the type of the key,
- * this object contains information about the key. None of the information obtained
- * through this property can be used to uniquely identify a key or to compromise
- * the security of the key.
- *
- * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence,
- * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be
- * set.
- *
- * Other key details might be exposed via this API using additional attributes.
- * @since v15.7.0
- */
- asymmetricKeyDetails?: AsymmetricKeyDetails | undefined;
- /**
- * For symmetric keys, the following encoding options can be used:
- *
- * For public keys, the following encoding options can be used:
- *
- * For private keys, the following encoding options can be used:
- *
- * The result type depends on the selected encoding format, when PEM the
- * result is a string, when DER it will be a buffer containing the data
- * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
- *
- * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are
- * ignored.
- *
- * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of
- * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be
- * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for
- * encrypted private keys. Since PKCS#8 defines its own
- * encryption mechanism, PEM-level encryption is not supported when encrypting
- * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for
- * PKCS#1 and SEC1 encryption.
- * @since v11.6.0
- */
- export(options: KeyExportOptions<"pem">): string | Buffer;
- export(options?: KeyExportOptions<"der">): Buffer;
- export(options?: JwkKeyExportOptions): JsonWebKey;
- /**
- * For secret keys, this property represents the size of the key in bytes. This
- * property is `undefined` for asymmetric keys.
- * @since v11.6.0
- */
- symmetricKeySize?: number | undefined;
- /**
- * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys
- * or `'private'` for private (asymmetric) keys.
- * @since v11.6.0
- */
- type: KeyObjectType;
- }
- type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
- type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
- type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
- type BinaryLike = string | NodeJS.ArrayBufferView;
- type CipherKey = BinaryLike | KeyObject;
- interface CipherCCMOptions extends stream.TransformOptions {
- authTagLength: number;
- }
- interface CipherGCMOptions extends stream.TransformOptions {
- authTagLength?: number | undefined;
- }
- interface CipherOCBOptions extends stream.TransformOptions {
- authTagLength: number;
- }
- /**
- * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`.
- *
- * The `options` argument controls stream behavior and is optional except when a
- * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
- * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
- * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
- * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
- *
- * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
- * recent OpenSSL releases, `openssl list -cipher-algorithms` will
- * display the available cipher algorithms.
- *
- * The `password` is used to derive the cipher key and initialization vector (IV).
- * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`.
- *
- * **This function is semantically insecure for all**
- * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,**
- * **GCM, or CCM).**
- *
- * The implementation of `crypto.createCipher()` derives keys using the OpenSSL
- * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
- * iteration, and no salt. The lack of salt allows dictionary attacks as the same
- * password always creates the same key. The low iteration count and
- * non-cryptographically secure hash algorithm allow passwords to be tested very
- * rapidly.
- *
- * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that
- * developers derive a key and IV on
- * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode
- * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when
- * they are used in order to avoid the risk of IV reuse that causes
- * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details.
- * @since v0.1.94
- * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead.
- * @param options `stream.transform` options
- */
- function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM;
- /** @deprecated since v10.0.0 use `createCipheriv()` */
- function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
- /** @deprecated since v10.0.0 use `createCipheriv()` */
- function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
- /**
- * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
- * initialization vector (`iv`).
- *
- * The `options` argument controls stream behavior and is optional except when a
- * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
- * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
- * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
- * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
- *
- * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
- * recent OpenSSL releases, `openssl list -cipher-algorithms` will
- * display the available cipher algorithms.
- *
- * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
- * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
- * a `KeyObject` of type `secret`. If the cipher does not need
- * an initialization vector, `iv` may be `null`.
- *
- * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
- *
- * Initialization vectors should be unpredictable and unique; ideally, they will be
- * cryptographically random. They do not have to be secret: IVs are typically just
- * added to ciphertext messages unencrypted. It may sound contradictory that
- * something has to be unpredictable and unique, but does not have to be secret;
- * remember that an attacker must not be able to predict ahead of time what a
- * given IV will be.
- * @since v0.1.94
- * @param options `stream.transform` options
- */
- function createCipheriv(
- algorithm: CipherCCMTypes,
- key: CipherKey,
- iv: BinaryLike,
- options: CipherCCMOptions,
- ): CipherCCM;
- function createCipheriv(
- algorithm: CipherOCBTypes,
- key: CipherKey,
- iv: BinaryLike,
- options: CipherOCBOptions,
- ): CipherOCB;
- function createCipheriv(
- algorithm: CipherGCMTypes,
- key: CipherKey,
- iv: BinaryLike,
- options?: CipherGCMOptions,
- ): CipherGCM;
- function createCipheriv(
- algorithm: string,
- key: CipherKey,
- iv: BinaryLike | null,
- options?: stream.TransformOptions,
- ): Cipher;
- /**
- * Instances of the `Cipher` class are used to encrypt data. The class can be
- * used in one of two ways:
- *
- * * As a `stream` that is both readable and writable, where plain unencrypted
- * data is written to produce encrypted data on the readable side, or
- * * Using the `cipher.update()` and `cipher.final()` methods to produce
- * the encrypted data.
- *
- * The {@link createCipher} or {@link createCipheriv} methods are
- * used to create `Cipher` instances. `Cipher` objects are not to be created
- * directly using the `new` keyword.
- *
- * Example: Using `Cipher` objects as streams:
- *
- * ```js
- * const {
- * scrypt,
- * randomFill,
- * createCipheriv,
- * } = await import('node:crypto');
- *
- * const algorithm = 'aes-192-cbc';
- * const password = 'Password used to generate key';
- *
- * // First, we'll generate the key. The key length is dependent on the algorithm.
- * // In this case for aes192, it is 24 bytes (192 bits).
- * scrypt(password, 'salt', 24, (err, key) => {
- * if (err) throw err;
- * // Then, we'll generate a random initialization vector
- * randomFill(new Uint8Array(16), (err, iv) => {
- * if (err) throw err;
- *
- * // Once we have the key and iv, we can create and use the cipher...
- * const cipher = createCipheriv(algorithm, key, iv);
- *
- * let encrypted = '';
- * cipher.setEncoding('hex');
- *
- * cipher.on('data', (chunk) => encrypted += chunk);
- * cipher.on('end', () => console.log(encrypted));
- *
- * cipher.write('some clear text data');
- * cipher.end();
- * });
- * });
- * ```
- *
- * Example: Using `Cipher` and piped streams:
- *
- * ```js
- * import {
- * createReadStream,
- * createWriteStream,
- * } from 'node:fs';
- *
- * import {
- * pipeline,
- * } from 'node:stream';
- *
- * const {
- * scrypt,
- * randomFill,
- * createCipheriv,
- * } = await import('node:crypto');
- *
- * const algorithm = 'aes-192-cbc';
- * const password = 'Password used to generate key';
- *
- * // First, we'll generate the key. The key length is dependent on the algorithm.
- * // In this case for aes192, it is 24 bytes (192 bits).
- * scrypt(password, 'salt', 24, (err, key) => {
- * if (err) throw err;
- * // Then, we'll generate a random initialization vector
- * randomFill(new Uint8Array(16), (err, iv) => {
- * if (err) throw err;
- *
- * const cipher = createCipheriv(algorithm, key, iv);
- *
- * const input = createReadStream('test.js');
- * const output = createWriteStream('test.enc');
- *
- * pipeline(input, cipher, output, (err) => {
- * if (err) throw err;
- * });
- * });
- * });
- * ```
- *
- * Example: Using the `cipher.update()` and `cipher.final()` methods:
- *
- * ```js
- * const {
- * scrypt,
- * randomFill,
- * createCipheriv,
- * } = await import('node:crypto');
- *
- * const algorithm = 'aes-192-cbc';
- * const password = 'Password used to generate key';
- *
- * // First, we'll generate the key. The key length is dependent on the algorithm.
- * // In this case for aes192, it is 24 bytes (192 bits).
- * scrypt(password, 'salt', 24, (err, key) => {
- * if (err) throw err;
- * // Then, we'll generate a random initialization vector
- * randomFill(new Uint8Array(16), (err, iv) => {
- * if (err) throw err;
- *
- * const cipher = createCipheriv(algorithm, key, iv);
- *
- * let encrypted = cipher.update('some clear text data', 'utf8', 'hex');
- * encrypted += cipher.final('hex');
- * console.log(encrypted);
- * });
- * });
- * ```
- * @since v0.1.94
- */
- class Cipher extends stream.Transform {
- private constructor();
- /**
- * Updates the cipher with `data`. If the `inputEncoding` argument is given,
- * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`,
- * `TypedArray`, or `DataView`, then`inputEncoding` is ignored.
- *
- * The `outputEncoding` specifies the output format of the enciphered
- * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
- *
- * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being
- * thrown.
- * @since v0.1.94
- * @param inputEncoding The `encoding` of the data.
- * @param outputEncoding The `encoding` of the return value.
- */
- update(data: BinaryLike): Buffer;
- update(data: string, inputEncoding: Encoding): Buffer;
- update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
- update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
- /**
- * Once the `cipher.final()` method has been called, the `Cipher` object can no
- * longer be used to encrypt data. Attempts to call `cipher.final()` more than
- * once will result in an error being thrown.
- * @since v0.1.94
- * @param outputEncoding The `encoding` of the return value.
- * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
- */
- final(): Buffer;
- final(outputEncoding: BufferEncoding): string;
- /**
- * When using block encryption algorithms, the `Cipher` class will automatically
- * add padding to the input data to the appropriate block size. To disable the
- * default padding call `cipher.setAutoPadding(false)`.
- *
- * When `autoPadding` is `false`, the length of the entire input data must be a
- * multiple of the cipher's block size or `cipher.final()` will throw an error.
- * Disabling automatic padding is useful for non-standard padding, for instance
- * using `0x0` instead of PKCS padding.
- *
- * The `cipher.setAutoPadding()` method must be called before `cipher.final()`.
- * @since v0.7.1
- * @param [autoPadding=true]
- * @return for method chaining.
- */
- setAutoPadding(autoPadding?: boolean): this;
- }
- interface CipherCCM extends Cipher {
- setAAD(
- buffer: NodeJS.ArrayBufferView,
- options: {
- plaintextLength: number;
- },
- ): this;
- getAuthTag(): Buffer;
- }
- interface CipherGCM extends Cipher {
- setAAD(
- buffer: NodeJS.ArrayBufferView,
- options?: {
- plaintextLength: number;
- },
- ): this;
- getAuthTag(): Buffer;
- }
- interface CipherOCB extends Cipher {
- setAAD(
- buffer: NodeJS.ArrayBufferView,
- options?: {
- plaintextLength: number;
- },
- ): this;
- getAuthTag(): Buffer;
- }
- /**
- * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
- *
- * The `options` argument controls stream behavior and is optional except when a
- * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
- * authentication tag in bytes, see `CCM mode`.
- * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
- *
- * **This function is semantically insecure for all**
- * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,**
- * **GCM, or CCM).**
- *
- * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
- * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
- * iteration, and no salt. The lack of salt allows dictionary attacks as the same
- * password always creates the same key. The low iteration count and
- * non-cryptographically secure hash algorithm allow passwords to be tested very
- * rapidly.
- *
- * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that
- * developers derive a key and IV on
- * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object.
- * @since v0.1.94
- * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead.
- * @param options `stream.transform` options
- */
- function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM;
- /** @deprecated since v10.0.0 use `createDecipheriv()` */
- function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
- /** @deprecated since v10.0.0 use `createDecipheriv()` */
- function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
- /**
- * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
- *
- * The `options` argument controls stream behavior and is optional except when a
- * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
- * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags
- * to those with the specified length.
- * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
- *
- * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
- * recent OpenSSL releases, `openssl list -cipher-algorithms` will
- * display the available cipher algorithms.
- *
- * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
- * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
- * a `KeyObject` of type `secret`. If the cipher does not need
- * an initialization vector, `iv` may be `null`.
- *
- * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
- *
- * Initialization vectors should be unpredictable and unique; ideally, they will be
- * cryptographically random. They do not have to be secret: IVs are typically just
- * added to ciphertext messages unencrypted. It may sound contradictory that
- * something has to be unpredictable and unique, but does not have to be secret;
- * remember that an attacker must not be able to predict ahead of time what a given
- * IV will be.
- * @since v0.1.94
- * @param options `stream.transform` options
- */
- function createDecipheriv(
- algorithm: CipherCCMTypes,
- key: CipherKey,
- iv: BinaryLike,
- options: CipherCCMOptions,
- ): DecipherCCM;
- function createDecipheriv(
- algorithm: CipherOCBTypes,
- key: CipherKey,
- iv: BinaryLike,
- options: CipherOCBOptions,
- ): DecipherOCB;
- function createDecipheriv(
- algorithm: CipherGCMTypes,
- key: CipherKey,
- iv: BinaryLike,
- options?: CipherGCMOptions,
- ): DecipherGCM;
- function createDecipheriv(
- algorithm: string,
- key: CipherKey,
- iv: BinaryLike | null,
- options?: stream.TransformOptions,
- ): Decipher;
- /**
- * Instances of the `Decipher` class are used to decrypt data. The class can be
- * used in one of two ways:
- *
- * * As a `stream` that is both readable and writable, where plain encrypted
- * data is written to produce unencrypted data on the readable side, or
- * * Using the `decipher.update()` and `decipher.final()` methods to
- * produce the unencrypted data.
- *
- * The {@link createDecipher} or {@link createDecipheriv} methods are
- * used to create `Decipher` instances. `Decipher` objects are not to be created
- * directly using the `new` keyword.
- *
- * Example: Using `Decipher` objects as streams:
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- * const {
- * scryptSync,
- * createDecipheriv,
- * } = await import('node:crypto');
- *
- * const algorithm = 'aes-192-cbc';
- * const password = 'Password used to generate key';
- * // Key length is dependent on the algorithm. In this case for aes192, it is
- * // 24 bytes (192 bits).
- * // Use the async `crypto.scrypt()` instead.
- * const key = scryptSync(password, 'salt', 24);
- * // The IV is usually passed along with the ciphertext.
- * const iv = Buffer.alloc(16, 0); // Initialization vector.
- *
- * const decipher = createDecipheriv(algorithm, key, iv);
- *
- * let decrypted = '';
- * decipher.on('readable', () => {
- * let chunk;
- * while (null !== (chunk = decipher.read())) {
- * decrypted += chunk.toString('utf8');
- * }
- * });
- * decipher.on('end', () => {
- * console.log(decrypted);
- * // Prints: some clear text data
- * });
- *
- * // Encrypted with same algorithm, key and iv.
- * const encrypted =
- * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
- * decipher.write(encrypted, 'hex');
- * decipher.end();
- * ```
- *
- * Example: Using `Decipher` and piped streams:
- *
- * ```js
- * import {
- * createReadStream,
- * createWriteStream,
- * } from 'node:fs';
- * import { Buffer } from 'node:buffer';
- * const {
- * scryptSync,
- * createDecipheriv,
- * } = await import('node:crypto');
- *
- * const algorithm = 'aes-192-cbc';
- * const password = 'Password used to generate key';
- * // Use the async `crypto.scrypt()` instead.
- * const key = scryptSync(password, 'salt', 24);
- * // The IV is usually passed along with the ciphertext.
- * const iv = Buffer.alloc(16, 0); // Initialization vector.
- *
- * const decipher = createDecipheriv(algorithm, key, iv);
- *
- * const input = createReadStream('test.enc');
- * const output = createWriteStream('test.js');
- *
- * input.pipe(decipher).pipe(output);
- * ```
- *
- * Example: Using the `decipher.update()` and `decipher.final()` methods:
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- * const {
- * scryptSync,
- * createDecipheriv,
- * } = await import('node:crypto');
- *
- * const algorithm = 'aes-192-cbc';
- * const password = 'Password used to generate key';
- * // Use the async `crypto.scrypt()` instead.
- * const key = scryptSync(password, 'salt', 24);
- * // The IV is usually passed along with the ciphertext.
- * const iv = Buffer.alloc(16, 0); // Initialization vector.
- *
- * const decipher = createDecipheriv(algorithm, key, iv);
- *
- * // Encrypted using same algorithm, key and iv.
- * const encrypted =
- * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
- * let decrypted = decipher.update(encrypted, 'hex', 'utf8');
- * decrypted += decipher.final('utf8');
- * console.log(decrypted);
- * // Prints: some clear text data
- * ```
- * @since v0.1.94
- */
- class Decipher extends stream.Transform {
- private constructor();
- /**
- * Updates the decipher with `data`. If the `inputEncoding` argument is given,
- * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is
- * ignored.
- *
- * The `outputEncoding` specifies the output format of the enciphered
- * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
- *
- * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error
- * being thrown.
- * @since v0.1.94
- * @param inputEncoding The `encoding` of the `data` string.
- * @param outputEncoding The `encoding` of the return value.
- */
- update(data: NodeJS.ArrayBufferView): Buffer;
- update(data: string, inputEncoding: Encoding): Buffer;
- update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
- update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
- /**
- * Once the `decipher.final()` method has been called, the `Decipher` object can
- * no longer be used to decrypt data. Attempts to call `decipher.final()` more
- * than once will result in an error being thrown.
- * @since v0.1.94
- * @param outputEncoding The `encoding` of the return value.
- * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
- */
- final(): Buffer;
- final(outputEncoding: BufferEncoding): string;
- /**
- * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
- * removing padding.
- *
- * Turning auto padding off will only work if the input data's length is a
- * multiple of the ciphers block size.
- *
- * The `decipher.setAutoPadding()` method must be called before `decipher.final()`.
- * @since v0.7.1
- * @param [autoPadding=true]
- * @return for method chaining.
- */
- setAutoPadding(auto_padding?: boolean): this;
- }
- interface DecipherCCM extends Decipher {
- setAuthTag(buffer: NodeJS.ArrayBufferView): this;
- setAAD(
- buffer: NodeJS.ArrayBufferView,
- options: {
- plaintextLength: number;
- },
- ): this;
- }
- interface DecipherGCM extends Decipher {
- setAuthTag(buffer: NodeJS.ArrayBufferView): this;
- setAAD(
- buffer: NodeJS.ArrayBufferView,
- options?: {
- plaintextLength: number;
- },
- ): this;
- }
- interface DecipherOCB extends Decipher {
- setAuthTag(buffer: NodeJS.ArrayBufferView): this;
- setAAD(
- buffer: NodeJS.ArrayBufferView,
- options?: {
- plaintextLength: number;
- },
- ): this;
- }
- interface PrivateKeyInput {
- key: string | Buffer;
- format?: KeyFormat | undefined;
- type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
- passphrase?: string | Buffer | undefined;
- encoding?: string | undefined;
- }
- interface PublicKeyInput {
- key: string | Buffer;
- format?: KeyFormat | undefined;
- type?: "pkcs1" | "spki" | undefined;
- encoding?: string | undefined;
- }
- /**
- * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
- *
- * ```js
- * const {
- * generateKey,
- * } = await import('node:crypto');
- *
- * generateKey('hmac', { length: 512 }, (err, key) => {
- * if (err) throw err;
- * console.log(key.export().toString('hex')); // 46e..........620
- * });
- * ```
- *
- * The size of a generated HMAC key should not exceed the block size of the
- * underlying hash function. See {@link createHmac} for more information.
- * @since v15.0.0
- * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
- */
- function generateKey(
- type: "hmac" | "aes",
- options: {
- length: number;
- },
- callback: (err: Error | null, key: KeyObject) => void,
- ): void;
- /**
- * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
- *
- * ```js
- * const {
- * generateKeySync,
- * } = await import('node:crypto');
- *
- * const key = generateKeySync('hmac', { length: 512 });
- * console.log(key.export().toString('hex')); // e89..........41e
- * ```
- *
- * The size of a generated HMAC key should not exceed the block size of the
- * underlying hash function. See {@link createHmac} for more information.
- * @since v15.0.0
- * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
- */
- function generateKeySync(
- type: "hmac" | "aes",
- options: {
- length: number;
- },
- ): KeyObject;
- interface JsonWebKeyInput {
- key: JsonWebKey;
- format: "jwk";
- }
- /**
- * Creates and returns a new key object containing a private key. If `key` is a
- * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above.
- *
- * If the private key is encrypted, a `passphrase` must be specified. The length
- * of the passphrase is limited to 1024 bytes.
- * @since v11.6.0
- */
- function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
- /**
- * Creates and returns a new key object containing a public key. If `key` is a
- * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key;
- * otherwise, `key` must be an object with the properties described above.
- *
- * If the format is `'pem'`, the `'key'` may also be an X.509 certificate.
- *
- * Because public keys can be derived from private keys, a private key may be
- * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the
- * returned `KeyObject` will be `'public'` and that the private key cannot be
- * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned
- * and it will be impossible to extract the private key from the returned object.
- * @since v11.6.0
- */
- function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
- /**
- * Creates and returns a new key object containing a secret key for symmetric
- * encryption or `Hmac`.
- * @since v11.6.0
- * @param encoding The string encoding when `key` is a string.
- */
- function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
- function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
- /**
- * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms.
- * Optional `options` argument controls the `stream.Writable` behavior.
- *
- * In some cases, a `Sign` instance can be created using the name of a signature
- * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
- * the corresponding digest algorithm. This does not work for all signature
- * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
- * algorithm names.
- * @since v0.1.92
- * @param options `stream.Writable` options
- */
- function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
- type DSAEncoding = "der" | "ieee-p1363";
- interface SigningOptions {
- /**
- * @see crypto.constants.RSA_PKCS1_PADDING
- */
- padding?: number | undefined;
- saltLength?: number | undefined;
- dsaEncoding?: DSAEncoding | undefined;
- }
- interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
- interface SignKeyObjectInput extends SigningOptions {
- key: KeyObject;
- }
- interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
- interface VerifyKeyObjectInput extends SigningOptions {
- key: KeyObject;
- }
- interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
- type KeyLike = string | Buffer | KeyObject;
- /**
- * The `Sign` class is a utility for generating signatures. It can be used in one
- * of two ways:
- *
- * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or
- * * Using the `sign.update()` and `sign.sign()` methods to produce the
- * signature.
- *
- * The {@link createSign} method is used to create `Sign` instances. The
- * argument is the string name of the hash function to use. `Sign` objects are not
- * to be created directly using the `new` keyword.
- *
- * Example: Using `Sign` and `Verify` objects as streams:
- *
- * ```js
- * const {
- * generateKeyPairSync,
- * createSign,
- * createVerify,
- * } = await import('node:crypto');
- *
- * const { privateKey, publicKey } = generateKeyPairSync('ec', {
- * namedCurve: 'sect239k1',
- * });
- *
- * const sign = createSign('SHA256');
- * sign.write('some data to sign');
- * sign.end();
- * const signature = sign.sign(privateKey, 'hex');
- *
- * const verify = createVerify('SHA256');
- * verify.write('some data to sign');
- * verify.end();
- * console.log(verify.verify(publicKey, signature, 'hex'));
- * // Prints: true
- * ```
- *
- * Example: Using the `sign.update()` and `verify.update()` methods:
- *
- * ```js
- * const {
- * generateKeyPairSync,
- * createSign,
- * createVerify,
- * } = await import('node:crypto');
- *
- * const { privateKey, publicKey } = generateKeyPairSync('rsa', {
- * modulusLength: 2048,
- * });
- *
- * const sign = createSign('SHA256');
- * sign.update('some data to sign');
- * sign.end();
- * const signature = sign.sign(privateKey);
- *
- * const verify = createVerify('SHA256');
- * verify.update('some data to sign');
- * verify.end();
- * console.log(verify.verify(publicKey, signature));
- * // Prints: true
- * ```
- * @since v0.1.92
- */
- class Sign extends stream.Writable {
- private constructor();
- /**
- * Updates the `Sign` content with the given `data`, the encoding of which
- * is given in `inputEncoding`.
- * If `encoding` is not provided, and the `data` is a string, an
- * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
- *
- * This can be called many times with new data as it is streamed.
- * @since v0.1.92
- * @param inputEncoding The `encoding` of the `data` string.
- */
- update(data: BinaryLike): this;
- update(data: string, inputEncoding: Encoding): this;
- /**
- * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
- *
- * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
- * object, the following additional properties can be passed:
- *
- * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned.
- *
- * The `Sign` object can not be again used after `sign.sign()` method has been
- * called. Multiple calls to `sign.sign()` will result in an error being thrown.
- * @since v0.1.92
- */
- sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
- sign(
- privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
- outputFormat: BinaryToTextEncoding,
- ): string;
- }
- /**
- * Creates and returns a `Verify` object that uses the given algorithm.
- * Use {@link getHashes} to obtain an array of names of the available
- * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior.
- *
- * In some cases, a `Verify` instance can be created using the name of a signature
- * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
- * the corresponding digest algorithm. This does not work for all signature
- * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
- * algorithm names.
- * @since v0.1.92
- * @param options `stream.Writable` options
- */
- function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
- /**
- * The `Verify` class is a utility for verifying signatures. It can be used in one
- * of two ways:
- *
- * * As a writable `stream` where written data is used to validate against the
- * supplied signature, or
- * * Using the `verify.update()` and `verify.verify()` methods to verify
- * the signature.
- *
- * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword.
- *
- * See `Sign` for examples.
- * @since v0.1.92
- */
- class Verify extends stream.Writable {
- private constructor();
- /**
- * Updates the `Verify` content with the given `data`, the encoding of which
- * is given in `inputEncoding`.
- * If `inputEncoding` is not provided, and the `data` is a string, an
- * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
- *
- * This can be called many times with new data as it is streamed.
- * @since v0.1.92
- * @param inputEncoding The `encoding` of the `data` string.
- */
- update(data: BinaryLike): Verify;
- update(data: string, inputEncoding: Encoding): Verify;
- /**
- * Verifies the provided data using the given `object` and `signature`.
- *
- * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an
- * object, the following additional properties can be passed:
- *
- * The `signature` argument is the previously calculated signature for the data, in
- * the `signatureEncoding`.
- * If a `signatureEncoding` is specified, the `signature` is expected to be a
- * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
- *
- * The `verify` object can not be used again after `verify.verify()` has been
- * called. Multiple calls to `verify.verify()` will result in an error being
- * thrown.
- *
- * Because public keys can be derived from private keys, a private key may
- * be passed instead of a public key.
- * @since v0.1.92
- */
- verify(
- object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
- signature: NodeJS.ArrayBufferView,
- ): boolean;
- verify(
- object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
- signature: string,
- signature_format?: BinaryToTextEncoding,
- ): boolean;
- }
- /**
- * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
- * optional specific `generator`.
- *
- * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used.
- *
- * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise
- * a `Buffer`, `TypedArray`, or `DataView` is expected.
- *
- * If `generatorEncoding` is specified, `generator` is expected to be a string;
- * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected.
- * @since v0.11.12
- * @param primeEncoding The `encoding` of the `prime` string.
- * @param [generator=2]
- * @param generatorEncoding The `encoding` of the `generator` string.
- */
- function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
- function createDiffieHellman(
- prime: ArrayBuffer | NodeJS.ArrayBufferView,
- generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
- ): DiffieHellman;
- function createDiffieHellman(
- prime: ArrayBuffer | NodeJS.ArrayBufferView,
- generator: string,
- generatorEncoding: BinaryToTextEncoding,
- ): DiffieHellman;
- function createDiffieHellman(
- prime: string,
- primeEncoding: BinaryToTextEncoding,
- generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
- ): DiffieHellman;
- function createDiffieHellman(
- prime: string,
- primeEncoding: BinaryToTextEncoding,
- generator: string,
- generatorEncoding: BinaryToTextEncoding,
- ): DiffieHellman;
- /**
- * The `DiffieHellman` class is a utility for creating Diffie-Hellman key
- * exchanges.
- *
- * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * const {
- * createDiffieHellman,
- * } = await import('node:crypto');
- *
- * // Generate Alice's keys...
- * const alice = createDiffieHellman(2048);
- * const aliceKey = alice.generateKeys();
- *
- * // Generate Bob's keys...
- * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());
- * const bobKey = bob.generateKeys();
- *
- * // Exchange and generate the secret...
- * const aliceSecret = alice.computeSecret(bobKey);
- * const bobSecret = bob.computeSecret(aliceKey);
- *
- * // OK
- * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
- * ```
- * @since v0.5.0
- */
- class DiffieHellman {
- private constructor();
- /**
- * Generates private and public Diffie-Hellman key values unless they have been
- * generated or computed already, and returns
- * the public key in the specified `encoding`. This key should be
- * transferred to the other party.
- * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
- *
- * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
- * once a private key has been generated or set, calling this function only updates
- * the public key but does not generate a new private key.
- * @since v0.5.0
- * @param encoding The `encoding` of the return value.
- */
- generateKeys(): Buffer;
- generateKeys(encoding: BinaryToTextEncoding): string;
- /**
- * Computes the shared secret using `otherPublicKey` as the other
- * party's public key and returns the computed shared secret. The supplied
- * key is interpreted using the specified `inputEncoding`, and secret is
- * encoded using specified `outputEncoding`.
- * If the `inputEncoding` is not
- * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
- *
- * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned.
- * @since v0.5.0
- * @param inputEncoding The `encoding` of an `otherPublicKey` string.
- * @param outputEncoding The `encoding` of the return value.
- */
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
- computeSecret(
- otherPublicKey: NodeJS.ArrayBufferView,
- inputEncoding: null,
- outputEncoding: BinaryToTextEncoding,
- ): string;
- computeSecret(
- otherPublicKey: string,
- inputEncoding: BinaryToTextEncoding,
- outputEncoding: BinaryToTextEncoding,
- ): string;
- /**
- * Returns the Diffie-Hellman prime in the specified `encoding`.
- * If `encoding` is provided a string is
- * returned; otherwise a `Buffer` is returned.
- * @since v0.5.0
- * @param encoding The `encoding` of the return value.
- */
- getPrime(): Buffer;
- getPrime(encoding: BinaryToTextEncoding): string;
- /**
- * Returns the Diffie-Hellman generator in the specified `encoding`.
- * If `encoding` is provided a string is
- * returned; otherwise a `Buffer` is returned.
- * @since v0.5.0
- * @param encoding The `encoding` of the return value.
- */
- getGenerator(): Buffer;
- getGenerator(encoding: BinaryToTextEncoding): string;
- /**
- * Returns the Diffie-Hellman public key in the specified `encoding`.
- * If `encoding` is provided a
- * string is returned; otherwise a `Buffer` is returned.
- * @since v0.5.0
- * @param encoding The `encoding` of the return value.
- */
- getPublicKey(): Buffer;
- getPublicKey(encoding: BinaryToTextEncoding): string;
- /**
- * Returns the Diffie-Hellman private key in the specified `encoding`.
- * If `encoding` is provided a
- * string is returned; otherwise a `Buffer` is returned.
- * @since v0.5.0
- * @param encoding The `encoding` of the return value.
- */
- getPrivateKey(): Buffer;
- getPrivateKey(encoding: BinaryToTextEncoding): string;
- /**
- * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected
- * to be a string. If no `encoding` is provided, `publicKey` is expected
- * to be a `Buffer`, `TypedArray`, or `DataView`.
- * @since v0.5.0
- * @param encoding The `encoding` of the `publicKey` string.
- */
- setPublicKey(publicKey: NodeJS.ArrayBufferView): void;
- setPublicKey(publicKey: string, encoding: BufferEncoding): void;
- /**
- * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
- * to be a string. If no `encoding` is provided, `privateKey` is expected
- * to be a `Buffer`, `TypedArray`, or `DataView`.
- *
- * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be
- * used to manually provide the public key or to automatically derive it.
- * @since v0.5.0
- * @param encoding The `encoding` of the `privateKey` string.
- */
- setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
- setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
- /**
- * A bit field containing any warnings and/or errors resulting from a check
- * performed during initialization of the `DiffieHellman` object.
- *
- * The following values are valid for this property (as defined in `node:constants` module):
- *
- * * `DH_CHECK_P_NOT_SAFE_PRIME`
- * * `DH_CHECK_P_NOT_PRIME`
- * * `DH_UNABLE_TO_CHECK_GENERATOR`
- * * `DH_NOT_SUITABLE_GENERATOR`
- * @since v0.11.12
- */
- verifyError: number;
- }
- /**
- * The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
- * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
- * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
- *
- * ```js
- * const { createDiffieHellmanGroup } = await import('node:crypto');
- * const dh = createDiffieHellmanGroup('modp1');
- * ```
- * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt):
- * ```bash
- * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
- * modp1 # 768 bits
- * modp2 # 1024 bits
- * modp5 # 1536 bits
- * modp14 # 2048 bits
- * modp15 # etc.
- * modp16
- * modp17
- * modp18
- * ```
- * @since v0.7.5
- */
- const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
- interface DiffieHellmanGroupConstructor {
- new(name: string): DiffieHellmanGroup;
- (name: string): DiffieHellmanGroup;
- readonly prototype: DiffieHellmanGroup;
- }
- type DiffieHellmanGroup = Omit;
- /**
- * Creates a predefined `DiffieHellmanGroup` key exchange object. The
- * supported groups are listed in the documentation for `DiffieHellmanGroup`.
- *
- * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
- * the keys (with `diffieHellman.setPublicKey()`, for example). The
- * advantage of using this method is that the parties do not have to
- * generate nor exchange a group modulus beforehand, saving both processor
- * and communication time.
- *
- * Example (obtaining a shared secret):
- *
- * ```js
- * const {
- * getDiffieHellman,
- * } = await import('node:crypto');
- * const alice = getDiffieHellman('modp14');
- * const bob = getDiffieHellman('modp14');
- *
- * alice.generateKeys();
- * bob.generateKeys();
- *
- * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');
- * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');
- *
- * // aliceSecret and bobSecret should be the same
- * console.log(aliceSecret === bobSecret);
- * ```
- * @since v0.7.5
- */
- function getDiffieHellman(groupName: string): DiffieHellmanGroup;
- /**
- * An alias for {@link getDiffieHellman}
- * @since v0.9.3
- */
- function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
- /**
- * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
- * implementation. A selected HMAC digest algorithm specified by `digest` is
- * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
- *
- * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set;
- * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be
- * thrown if any of the input arguments specify invalid values or types.
- *
- * The `iterations` argument must be a number set as high as possible. The
- * higher the number of iterations, the more secure the derived key will be,
- * but will take a longer amount of time to complete.
- *
- * The `salt` should be as unique as possible. It is recommended that a salt is
- * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
- *
- * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
- *
- * ```js
- * const {
- * pbkdf2,
- * } = await import('node:crypto');
- *
- * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
- * if (err) throw err;
- * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
- * });
- * ```
- *
- * An array of supported digest functions can be retrieved using {@link getHashes}.
- *
- * This API uses libuv's threadpool, which can have surprising and
- * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
- * @since v0.5.5
- */
- function pbkdf2(
- password: BinaryLike,
- salt: BinaryLike,
- iterations: number,
- keylen: number,
- digest: string,
- callback: (err: Error | null, derivedKey: Buffer) => void,
- ): void;
- /**
- * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
- * implementation. A selected HMAC digest algorithm specified by `digest` is
- * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`.
- *
- * If an error occurs an `Error` will be thrown, otherwise the derived key will be
- * returned as a `Buffer`.
- *
- * The `iterations` argument must be a number set as high as possible. The
- * higher the number of iterations, the more secure the derived key will be,
- * but will take a longer amount of time to complete.
- *
- * The `salt` should be as unique as possible. It is recommended that a salt is
- * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
- *
- * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
- *
- * ```js
- * const {
- * pbkdf2Sync,
- * } = await import('node:crypto');
- *
- * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
- * console.log(key.toString('hex')); // '3745e48...08d59ae'
- * ```
- *
- * An array of supported digest functions can be retrieved using {@link getHashes}.
- * @since v0.9.3
- */
- function pbkdf2Sync(
- password: BinaryLike,
- salt: BinaryLike,
- iterations: number,
- keylen: number,
- digest: string,
- ): Buffer;
- /**
- * Generates cryptographically strong pseudorandom data. The `size` argument
- * is a number indicating the number of bytes to generate.
- *
- * If a `callback` function is provided, the bytes are generated asynchronously
- * and the `callback` function is invoked with two arguments: `err` and `buf`.
- * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes.
- *
- * ```js
- * // Asynchronous
- * const {
- * randomBytes,
- * } = await import('node:crypto');
- *
- * randomBytes(256, (err, buf) => {
- * if (err) throw err;
- * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);
- * });
- * ```
- *
- * If the `callback` function is not provided, the random bytes are generated
- * synchronously and returned as a `Buffer`. An error will be thrown if
- * there is a problem generating the bytes.
- *
- * ```js
- * // Synchronous
- * const {
- * randomBytes,
- * } = await import('node:crypto');
- *
- * const buf = randomBytes(256);
- * console.log(
- * `${buf.length} bytes of random data: ${buf.toString('hex')}`);
- * ```
- *
- * The `crypto.randomBytes()` method will not complete until there is
- * sufficient entropy available.
- * This should normally never take longer than a few milliseconds. The only time
- * when generating the random bytes may conceivably block for a longer period of
- * time is right after boot, when the whole system is still low on entropy.
- *
- * This API uses libuv's threadpool, which can have surprising and
- * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
- *
- * The asynchronous version of `crypto.randomBytes()` is carried out in a single
- * threadpool request. To minimize threadpool task length variation, partition
- * large `randomBytes` requests when doing so as part of fulfilling a client
- * request.
- * @since v0.5.8
- * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
- * @return if the `callback` function is not provided.
- */
- function randomBytes(size: number): Buffer;
- function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
- function pseudoRandomBytes(size: number): Buffer;
- function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
- /**
- * Return a random integer `n` such that `min <= n < max`. This
- * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
- *
- * The range (`max - min`) must be less than 248. `min` and `max` must
- * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
- *
- * If the `callback` function is not provided, the random integer is
- * generated synchronously.
- *
- * ```js
- * // Asynchronous
- * const {
- * randomInt,
- * } = await import('node:crypto');
- *
- * randomInt(3, (err, n) => {
- * if (err) throw err;
- * console.log(`Random number chosen from (0, 1, 2): ${n}`);
- * });
- * ```
- *
- * ```js
- * // Synchronous
- * const {
- * randomInt,
- * } = await import('node:crypto');
- *
- * const n = randomInt(3);
- * console.log(`Random number chosen from (0, 1, 2): ${n}`);
- * ```
- *
- * ```js
- * // With `min` argument
- * const {
- * randomInt,
- * } = await import('node:crypto');
- *
- * const n = randomInt(1, 7);
- * console.log(`The dice rolled: ${n}`);
- * ```
- * @since v14.10.0, v12.19.0
- * @param [min=0] Start of random range (inclusive).
- * @param max End of random range (exclusive).
- * @param callback `function(err, n) {}`.
- */
- function randomInt(max: number): number;
- function randomInt(min: number, max: number): number;
- function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
- function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
- /**
- * Synchronous version of {@link randomFill}.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- * const { randomFillSync } = await import('node:crypto');
- *
- * const buf = Buffer.alloc(10);
- * console.log(randomFillSync(buf).toString('hex'));
- *
- * randomFillSync(buf, 5);
- * console.log(buf.toString('hex'));
- *
- * // The above is equivalent to the following:
- * randomFillSync(buf, 5, 5);
- * console.log(buf.toString('hex'));
- * ```
- *
- * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- * const { randomFillSync } = await import('node:crypto');
- *
- * const a = new Uint32Array(10);
- * console.log(Buffer.from(randomFillSync(a).buffer,
- * a.byteOffset, a.byteLength).toString('hex'));
- *
- * const b = new DataView(new ArrayBuffer(10));
- * console.log(Buffer.from(randomFillSync(b).buffer,
- * b.byteOffset, b.byteLength).toString('hex'));
- *
- * const c = new ArrayBuffer(10);
- * console.log(Buffer.from(randomFillSync(c)).toString('hex'));
- * ```
- * @since v7.10.0, v6.13.0
- * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
- * @param [offset=0]
- * @param [size=buffer.length - offset]
- * @return The object passed as `buffer` argument.
- */
- function randomFillSync(buffer: T, offset?: number, size?: number): T;
- /**
- * This function is similar to {@link randomBytes} but requires the first
- * argument to be a `Buffer` that will be filled. It also
- * requires that a callback is passed in.
- *
- * If the `callback` function is not provided, an error will be thrown.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- * const { randomFill } = await import('node:crypto');
- *
- * const buf = Buffer.alloc(10);
- * randomFill(buf, (err, buf) => {
- * if (err) throw err;
- * console.log(buf.toString('hex'));
- * });
- *
- * randomFill(buf, 5, (err, buf) => {
- * if (err) throw err;
- * console.log(buf.toString('hex'));
- * });
- *
- * // The above is equivalent to the following:
- * randomFill(buf, 5, 5, (err, buf) => {
- * if (err) throw err;
- * console.log(buf.toString('hex'));
- * });
- * ```
- *
- * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`.
- *
- * While this includes instances of `Float32Array` and `Float64Array`, this
- * function should not be used to generate random floating-point numbers. The
- * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array
- * contains finite numbers only, they are not drawn from a uniform random
- * distribution and have no meaningful lower or upper bounds.
- *
- * ```js
- * import { Buffer } from 'node:buffer';
- * const { randomFill } = await import('node:crypto');
- *
- * const a = new Uint32Array(10);
- * randomFill(a, (err, buf) => {
- * if (err) throw err;
- * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
- * .toString('hex'));
- * });
- *
- * const b = new DataView(new ArrayBuffer(10));
- * randomFill(b, (err, buf) => {
- * if (err) throw err;
- * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
- * .toString('hex'));
- * });
- *
- * const c = new ArrayBuffer(10);
- * randomFill(c, (err, buf) => {
- * if (err) throw err;
- * console.log(Buffer.from(buf).toString('hex'));
- * });
- * ```
- *
- * This API uses libuv's threadpool, which can have surprising and
- * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
- *
- * The asynchronous version of `crypto.randomFill()` is carried out in a single
- * threadpool request. To minimize threadpool task length variation, partition
- * large `randomFill` requests when doing so as part of fulfilling a client
- * request.
- * @since v7.10.0, v6.13.0
- * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
- * @param [offset=0]
- * @param [size=buffer.length - offset]
- * @param callback `function(err, buf) {}`.
- */
- function randomFill(
- buffer: T,
- callback: (err: Error | null, buf: T) => void,
- ): void;
- function randomFill(
- buffer: T,
- offset: number,
- callback: (err: Error | null, buf: T) => void,
- ): void;
- function randomFill(
- buffer: T,
- offset: number,
- size: number,
- callback: (err: Error | null, buf: T) => void,
- ): void;
- interface ScryptOptions {
- cost?: number | undefined;
- blockSize?: number | undefined;
- parallelization?: number | undefined;
- N?: number | undefined;
- r?: number | undefined;
- p?: number | undefined;
- maxmem?: number | undefined;
- }
- /**
- * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
- * key derivation function that is designed to be expensive computationally and
- * memory-wise in order to make brute-force attacks unrewarding.
- *
- * The `salt` should be as unique as possible. It is recommended that a salt is
- * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
- *
- * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
- *
- * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the
- * callback as a `Buffer`.
- *
- * An exception is thrown when any of the input arguments specify invalid values
- * or types.
- *
- * ```js
- * const {
- * scrypt,
- * } = await import('node:crypto');
- *
- * // Using the factory defaults.
- * scrypt('password', 'salt', 64, (err, derivedKey) => {
- * if (err) throw err;
- * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
- * });
- * // Using a custom N parameter. Must be a power of two.
- * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
- * if (err) throw err;
- * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
- * });
- * ```
- * @since v10.5.0
- */
- function scrypt(
- password: BinaryLike,
- salt: BinaryLike,
- keylen: number,
- callback: (err: Error | null, derivedKey: Buffer) => void,
- ): void;
- function scrypt(
- password: BinaryLike,
- salt: BinaryLike,
- keylen: number,
- options: ScryptOptions,
- callback: (err: Error | null, derivedKey: Buffer) => void,
- ): void;
- /**
- * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
- * key derivation function that is designed to be expensive computationally and
- * memory-wise in order to make brute-force attacks unrewarding.
- *
- * The `salt` should be as unique as possible. It is recommended that a salt is
- * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
- *
- * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
- *
- * An exception is thrown when key derivation fails, otherwise the derived key is
- * returned as a `Buffer`.
- *
- * An exception is thrown when any of the input arguments specify invalid values
- * or types.
- *
- * ```js
- * const {
- * scryptSync,
- * } = await import('node:crypto');
- * // Using the factory defaults.
- *
- * const key1 = scryptSync('password', 'salt', 64);
- * console.log(key1.toString('hex')); // '3745e48...08d59ae'
- * // Using a custom N parameter. Must be a power of two.
- * const key2 = scryptSync('password', 'salt', 64, { N: 1024 });
- * console.log(key2.toString('hex')); // '3745e48...aa39b34'
- * ```
- * @since v10.5.0
- */
- function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
- interface RsaPublicKey {
- key: KeyLike;
- padding?: number | undefined;
- }
- interface RsaPrivateKey {
- key: KeyLike;
- passphrase?: string | undefined;
- /**
- * @default 'sha1'
- */
- oaepHash?: string | undefined;
- oaepLabel?: NodeJS.TypedArray | undefined;
- padding?: number | undefined;
- }
- /**
- * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using
- * the corresponding private key, for example using {@link privateDecrypt}.
- *
- * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
- * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
- *
- * Because RSA public keys can be derived from private keys, a private key may
- * be passed instead of a public key.
- * @since v0.11.14
- */
- function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
- /**
- * Decrypts `buffer` with `key`.`buffer` was previously encrypted using
- * the corresponding private key, for example using {@link privateEncrypt}.
- *
- * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an
- * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
- *
- * Because RSA public keys can be derived from private keys, a private key may
- * be passed instead of a public key.
- * @since v1.1.0
- */
- function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
- /**
- * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
- * the corresponding public key, for example using {@link publicEncrypt}.
- *
- * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
- * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
- * @since v0.11.14
- */
- function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
- /**
- * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
- * the corresponding public key, for example using {@link publicDecrypt}.
- *
- * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an
- * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
- * @since v1.1.0
- */
- function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
- /**
- * ```js
- * const {
- * getCiphers,
- * } = await import('node:crypto');
- *
- * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]
- * ```
- * @since v0.9.3
- * @return An array with the names of the supported cipher algorithms.
- */
- function getCiphers(): string[];
- /**
- * ```js
- * const {
- * getCurves,
- * } = await import('node:crypto');
- *
- * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
- * ```
- * @since v2.3.0
- * @return An array with the names of the supported elliptic curves.
- */
- function getCurves(): string[];
- /**
- * @since v10.0.0
- * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.
- */
- function getFips(): 1 | 0;
- /**
- * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build.
- * Throws an error if FIPS mode is not available.
- * @since v10.0.0
- * @param bool `true` to enable FIPS mode.
- */
- function setFips(bool: boolean): void;
- /**
- * ```js
- * const {
- * getHashes,
- * } = await import('node:crypto');
- *
- * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
- * ```
- * @since v0.9.3
- * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms.
- */
- function getHashes(): string[];
- /**
- * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)
- * key exchanges.
- *
- * Instances of the `ECDH` class can be created using the {@link createECDH} function.
- *
- * ```js
- * import assert from 'node:assert';
- *
- * const {
- * createECDH,
- * } = await import('node:crypto');
- *
- * // Generate Alice's keys...
- * const alice = createECDH('secp521r1');
- * const aliceKey = alice.generateKeys();
- *
- * // Generate Bob's keys...
- * const bob = createECDH('secp521r1');
- * const bobKey = bob.generateKeys();
- *
- * // Exchange and generate the secret...
- * const aliceSecret = alice.computeSecret(bobKey);
- * const bobSecret = bob.computeSecret(aliceKey);
- *
- * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
- * // OK
- * ```
- * @since v0.11.14
- */
- class ECDH {
- private constructor();
- /**
- * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the
- * format specified by `format`. The `format` argument specifies point encoding
- * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is
- * interpreted using the specified `inputEncoding`, and the returned key is encoded
- * using the specified `outputEncoding`.
- *
- * Use {@link getCurves} to obtain a list of available curve names.
- * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display
- * the name and description of each available elliptic curve.
- *
- * If `format` is not specified the point will be returned in `'uncompressed'`format.
- *
- * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
- *
- * Example (uncompressing a key):
- *
- * ```js
- * const {
- * createECDH,
- * ECDH,
- * } = await import('node:crypto');
- *
- * const ecdh = createECDH('secp256k1');
- * ecdh.generateKeys();
- *
- * const compressedKey = ecdh.getPublicKey('hex', 'compressed');
- *
- * const uncompressedKey = ECDH.convertKey(compressedKey,
- * 'secp256k1',
- * 'hex',
- * 'hex',
- * 'uncompressed');
- *
- * // The converted key and the uncompressed public key should be the same
- * console.log(uncompressedKey === ecdh.getPublicKey('hex'));
- * ```
- * @since v10.0.0
- * @param inputEncoding The `encoding` of the `key` string.
- * @param outputEncoding The `encoding` of the return value.
- * @param [format='uncompressed']
- */
- static convertKey(
- key: BinaryLike,
- curve: string,
- inputEncoding?: BinaryToTextEncoding,
- outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
- format?: "uncompressed" | "compressed" | "hybrid",
- ): Buffer | string;
- /**
- * Generates private and public EC Diffie-Hellman key values, and returns
- * the public key in the specified `format` and `encoding`. This key should be
- * transferred to the other party.
- *
- * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format.
- *
- * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
- * @since v0.11.14
- * @param encoding The `encoding` of the return value.
- * @param [format='uncompressed']
- */
- generateKeys(): Buffer;
- generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
- /**
- * Computes the shared secret using `otherPublicKey` as the other
- * party's public key and returns the computed shared secret. The supplied
- * key is interpreted using specified `inputEncoding`, and the returned secret
- * is encoded using the specified `outputEncoding`.
- * If the `inputEncoding` is not
- * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`.
- *
- * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned.
- *
- * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is
- * usually supplied from a remote user over an insecure network,
- * be sure to handle this exception accordingly.
- * @since v0.11.14
- * @param inputEncoding The `encoding` of the `otherPublicKey` string.
- * @param outputEncoding The `encoding` of the return value.
- */
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
- computeSecret(
- otherPublicKey: string,
- inputEncoding: BinaryToTextEncoding,
- outputEncoding: BinaryToTextEncoding,
- ): string;
- /**
- * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
- * returned.
- * @since v0.11.14
- * @param encoding The `encoding` of the return value.
- * @return The EC Diffie-Hellman in the specified `encoding`.
- */
- getPrivateKey(): Buffer;
- getPrivateKey(encoding: BinaryToTextEncoding): string;
- /**
- * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
- *
- * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
- * returned.
- * @since v0.11.14
- * @param encoding The `encoding` of the return value.
- * @param [format='uncompressed']
- * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
- */
- getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer;
- getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
- /**
- * Sets the EC Diffie-Hellman private key.
- * If `encoding` is provided, `privateKey` is expected
- * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`.
- *
- * If `privateKey` is not valid for the curve specified when the `ECDH` object was
- * created, an error is thrown. Upon setting the private key, the associated
- * public point (key) is also generated and set in the `ECDH` object.
- * @since v0.11.14
- * @param encoding The `encoding` of the `privateKey` string.
- */
- setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
- setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
- }
- /**
- * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
- * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent
- * OpenSSL releases, `openssl ecparam -list_curves` will also display the name
- * and description of each available elliptic curve.
- * @since v0.11.14
- */
- function createECDH(curveName: string): ECDH;
- /**
- * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time
- * algorithm.
- *
- * This function does not leak timing information that
- * would allow an attacker to guess one of the values. This is suitable for
- * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
- *
- * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
- * must have the same byte length. An error is thrown if `a` and `b` have
- * different byte lengths.
- *
- * If at least one of `a` and `b` is a `TypedArray` with more than one byte per
- * entry, such as `Uint16Array`, the result will be computed using the platform
- * byte order.
- *
- * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754**
- * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point**
- * **numbers `x` and `y` are equal.**
- *
- * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code
- * is timing-safe. Care should be taken to ensure that the surrounding code does
- * not introduce timing vulnerabilities.
- * @since v6.6.0
- */
- function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
- type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
- type KeyFormat = "pem" | "der" | "jwk";
- interface BasePrivateKeyEncodingOptions {
- format: T;
- cipher?: string | undefined;
- passphrase?: string | undefined;
- }
- interface KeyPairKeyObjectResult {
- publicKey: KeyObject;
- privateKey: KeyObject;
- }
- interface ED25519KeyPairKeyObjectOptions {}
- interface ED448KeyPairKeyObjectOptions {}
- interface X25519KeyPairKeyObjectOptions {}
- interface X448KeyPairKeyObjectOptions {}
- interface ECKeyPairKeyObjectOptions {
- /**
- * Name of the curve to use
- */
- namedCurve: string;
- }
- interface RSAKeyPairKeyObjectOptions {
- /**
- * Key size in bits
- */
- modulusLength: number;
- /**
- * Public exponent
- * @default 0x10001
- */
- publicExponent?: number | undefined;
- }
- interface RSAPSSKeyPairKeyObjectOptions {
- /**
- * Key size in bits
- */
- modulusLength: number;
- /**
- * Public exponent
- * @default 0x10001
- */
- publicExponent?: number | undefined;
- /**
- * Name of the message digest
- */
- hashAlgorithm?: string;
- /**
- * Name of the message digest used by MGF1
- */
- mgf1HashAlgorithm?: string;
- /**
- * Minimal salt length in bytes
- */
- saltLength?: string;
- }
- interface DSAKeyPairKeyObjectOptions {
- /**
- * Key size in bits
- */
- modulusLength: number;
- /**
- * Size of q in bits
- */
- divisorLength: number;
- }
- interface RSAKeyPairOptions {
- /**
- * Key size in bits
- */
- modulusLength: number;
- /**
- * Public exponent
- * @default 0x10001
- */
- publicExponent?: number | undefined;
- publicKeyEncoding: {
- type: "pkcs1" | "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs1" | "pkcs8";
- };
- }
- interface RSAPSSKeyPairOptions {
- /**
- * Key size in bits
- */
- modulusLength: number;
- /**
- * Public exponent
- * @default 0x10001
- */
- publicExponent?: number | undefined;
- /**
- * Name of the message digest
- */
- hashAlgorithm?: string;
- /**
- * Name of the message digest used by MGF1
- */
- mgf1HashAlgorithm?: string;
- /**
- * Minimal salt length in bytes
- */
- saltLength?: string;
- publicKeyEncoding: {
- type: "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs8";
- };
- }
- interface DSAKeyPairOptions {
- /**
- * Key size in bits
- */
- modulusLength: number;
- /**
- * Size of q in bits
- */
- divisorLength: number;
- publicKeyEncoding: {
- type: "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs8";
- };
- }
- interface ECKeyPairOptions {
- /**
- * Name of the curve to use.
- */
- namedCurve: string;
- publicKeyEncoding: {
- type: "pkcs1" | "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "sec1" | "pkcs8";
- };
- }
- interface ED25519KeyPairOptions {
- publicKeyEncoding: {
- type: "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs8";
- };
- }
- interface ED448KeyPairOptions {
- publicKeyEncoding: {
- type: "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs8";
- };
- }
- interface X25519KeyPairOptions {
- publicKeyEncoding: {
- type: "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs8";
- };
- }
- interface X448KeyPairOptions {
- publicKeyEncoding: {
- type: "spki";
- format: PubF;
- };
- privateKeyEncoding: BasePrivateKeyEncodingOptions & {
- type: "pkcs8";
- };
- }
- interface KeyPairSyncResult {
- publicKey: T1;
- privateKey: T2;
- }
- /**
- * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
- * Ed25519, Ed448, X25519, X448, and DH are currently supported.
- *
- * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
- * behaves as if `keyObject.export()` had been called on its result. Otherwise,
- * the respective part of the key is returned as a `KeyObject`.
- *
- * When encoding public keys, it is recommended to use `'spki'`. When encoding
- * private keys, it is recommended to use `'pkcs8'` with a strong passphrase,
- * and to keep the passphrase confidential.
- *
- * ```js
- * const {
- * generateKeyPairSync,
- * } = await import('node:crypto');
- *
- * const {
- * publicKey,
- * privateKey,
- * } = generateKeyPairSync('rsa', {
- * modulusLength: 4096,
- * publicKeyEncoding: {
- * type: 'spki',
- * format: 'pem',
- * },
- * privateKeyEncoding: {
- * type: 'pkcs8',
- * format: 'pem',
- * cipher: 'aes-256-cbc',
- * passphrase: 'top secret',
- * },
- * });
- * ```
- *
- * The return value `{ publicKey, privateKey }` represents the generated key pair.
- * When PEM encoding was selected, the respective key will be a string, otherwise
- * it will be a buffer containing the data encoded as DER.
- * @since v10.12.0
- * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
- */
- function generateKeyPairSync(
- type: "rsa",
- options: RSAKeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "rsa",
- options: RSAKeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "rsa",
- options: RSAKeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "rsa",
- options: RSAKeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "rsa-pss",
- options: RSAPSSKeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "rsa-pss",
- options: RSAPSSKeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "rsa-pss",
- options: RSAPSSKeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "rsa-pss",
- options: RSAPSSKeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "dsa",
- options: DSAKeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "dsa",
- options: DSAKeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "dsa",
- options: DSAKeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "dsa",
- options: DSAKeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "ec",
- options: ECKeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ec",
- options: ECKeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ec",
- options: ECKeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ec",
- options: ECKeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "ed25519",
- options: ED25519KeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ed25519",
- options: ED25519KeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ed25519",
- options: ED25519KeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ed25519",
- options: ED25519KeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "ed448",
- options: ED448KeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ed448",
- options: ED448KeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ed448",
- options: ED448KeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "ed448",
- options: ED448KeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "x25519",
- options: X25519KeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "x25519",
- options: X25519KeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "x25519",
- options: X25519KeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "x25519",
- options: X25519KeyPairOptions<"der", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
- function generateKeyPairSync(
- type: "x448",
- options: X448KeyPairOptions<"pem", "pem">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "x448",
- options: X448KeyPairOptions<"pem", "der">,
- ): KeyPairSyncResult;
- function generateKeyPairSync(
- type: "x448",
- options: X448KeyPairOptions<"der", "pem">,
- ): KeyPairSyncResult