diff --git a/.github/workflows/automatic-vercel-deploy.yml b/.github/workflows/automatic-vercel-deploy.yml new file mode 100644 index 00000000..4f71d45f --- /dev/null +++ b/.github/workflows/automatic-vercel-deploy.yml @@ -0,0 +1,16 @@ +name: Automatic Vercel Deploys + +on: + # TODO: Enable pre-merge + # schedule: + # - cron: '30 3 * * *' + workflow_dispatch: + +jobs: + AutomaticVercelDeploy: + runs-on: ubuntu-latest + steps: + - name: Trigger Vercel Deploy + run: curl -X POST ${VERCEL_DEPLOY_HOOK_URL} + env: + VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }} diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml deleted file mode 100644 index 39738d52..00000000 --- a/.github/workflows/update-submodules.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Update Git Submodules - -on: - schedule: - - cron: '30 3 * * *' - workflow_dispatch: - -jobs: - SubmoduleSync: - runs-on: ubuntu-latest - - steps: - - name: Update any submodules - run: | - REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - - echo -e "\n# Checkout the repo in the target branch" - TARGET_BRANCH="main" - git clone --recurse-submodules -j8 -b $TARGET_BRANCH $REPO sapphiredev-website - - echo -e "\n# Moving to newly cloned repository" - cd sapphiredev-website - - echo -e "\n# Updating submodules" - git pull --recurse-submodules && git submodule update --remote --recursive - - echo -e "\n# Add all files in current directory" - git add --all . - - if git diff-index --quiet HEAD --; then - echo "No changes to commit, exiting with code 0" - exit 0; - else - echo -e "\n# Before pushing changes we update the lockfile" - echo -e "\nenableImmutableInstalls: false" >> ./.yarnrc.yml - rm -rf ./node_modules ./yarn.lock || true - yarn install - echo -e "\n# Adding yarn lockfile" - git add yarn.lock - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_EMAIL}" - git commit -snm "chore: updated GitHub Submodules at $(date '+%F %H:%M.%S')" || true - git push origin $TARGET_BRANCH - fi - env: - GITHUB_TOKEN: ${{ secrets.SKYRA_TOKEN }} - GITHUB_ACTOR: NM-EEA-Y - GITHUB_EMAIL: contact@skyra.pw diff --git a/.gitignore b/.gitignore index 29062804..8736c036 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ build/ .docusaurus/ .cache-loader/ docs/Documentation/ -tsconfig.tsbuildinfo +*.tsbuildinfo # misc .DS_Store @@ -32,3 +32,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* *.log + +# TODO: Remove later +dist/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 77232eee..00000000 --- a/.gitmodules +++ /dev/null @@ -1,24 +0,0 @@ -[submodule "projects/framework"] - path = projects/framework - url = https://github.com/sapphiredev/framework - branch = main -[submodule "projects/pieces"] - path = projects/pieces - url = https://github.com/sapphiredev/pieces - branch = main -[submodule "projects/utilities"] - path = projects/utilities - url = https://github.com/sapphiredev/utilities - branch = main -[submodule "projects/plugins"] - path = projects/plugins - url = https://github.com/sapphiredev/plugins - branch = main -[submodule "projects/type"] - path = projects/type - url = https://github.com/sapphiredev/type - branch = main -[submodule "projects/shapeshift"] - path = projects/shapeshift - url = https://github.com/sapphiredev/shapeshift - branch = main diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..4a58d76a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + "configurations": [ + { + "type": "pwa-node", + "request": "launch", + "runtimeArgs": ["run-script", "debug"], + "name": "Debug Docgen", + "runtimeExecutable": "npm", + "skipFiles": ["/**", "node_modules/tslib/**"], + "internalConsoleOptions": "openOnSessionStart", + "cwd": "${workspaceFolder}/docusaurus-discordjs-docgen", + "console": "internalConsole", + "outputCapture": "std", + "outFiles": ["${workspaceFolder}/docusaurus-discordjs-docgen/dist/**/*.js"] + } + ] +} diff --git a/data/framework.json b/data/framework.json new file mode 100644 index 00000000..0d4395db --- /dev/null +++ b/data/framework.json @@ -0,0 +1,44646 @@ +{ + "meta": { + "version": "0.3.4", + "format": 20, + "date": 1650918806062 + }, + "custom": { + "general": { + "name": "General", + "files": { + "welcome": { + "name": "Welcome", + "type": "md", + "content": "
\n\n![Sapphire Logo](https://cdn.skyra.pw/gh-assets/sapphire-banner.png)\n\n# Sapphire\n\n**A pleasant Discord Bot framework**\n\n[![GitHub](https://img.shields.io/github/license/sapphiredev/framework)](https://github.com/sapphiredev/framework/blob/main/LICENSE.md)\n[![codecov](https://codecov.io/gh/sapphiredev/framework/branch/main/graph/badge.svg?token=AHPITY8WY9)](https://codecov.io/gh/sapphiredev/framework)\n[![npm](https://img.shields.io/npm/v/@sapphire/framework?color=crimson&logo=npm&style=flat-square)](https://www.npmjs.com/package/@sapphire/framework)\n\n[![Support Server](https://discord.com/api/guilds/737141877803057244/embed.png?style=banner2)](https://sapphirejs.dev/discord)\n\n
\n\n---\n\n## Description\n\nSapphire is a Discord bot framework built on top of [discord.js] for advanced and amazing bots.\n\n
\n\n| [**Click here for the documentation and guides**](https://www.sapphirejs.dev/) |\n| ------------------------------------------------------------------------------ |\n\n
\n\n## Features\n\n- Written in TypeScript\n- Command Handler, Arguments, Pre-conditions and Listeners Store\n- Completely Modular and Extendable\n- Advanced Plugins Support\n- Supports many [plugins](https://github.com/sapphiredev/plugins)\n- Full TypeScript & JavaScript support\n\n## Installation\n\n`@sapphire/framework` depends on the following packages. Be sure to install these along with this package!\n\n- [`discord.js`](https://www.npmjs.com/package/discord.js)\n\nYou can use the following command to install this package, or replace `npm install` with your package manager of choice.\n\n```sh\nnpm install @sapphire/framework discord.js\n```\n\n---\n\n## Buy us some doughnuts\n\nSapphire 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!\n\nWe 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.\n\n| Donate With | Address |\n| :-------------: | :-------------------------------------------------: |\n| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |\n| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |\n| Patreon | [Click Here](https://sapphirejs.dev/patreon) |\n| PayPal | [Click Here](https://sapphirejs.dev/paypal) |\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\"\"/
Antonio RomΓ‘n

πŸ’» πŸ“– 🎨 πŸ€” πŸš‡ πŸ“† πŸ”Œ
\"\"/
Jeroen Claassens

πŸ’» πŸ“– πŸš‡ πŸ“† πŸ”Œ
\"\"/
Charalampos Fanoulis

πŸ’»
\"\"/
Aditya N. Tripathi

πŸ’» πŸ“–
\"\"/
LeonardSSH

πŸ“–
\"\"/
Nejc Drobnič

πŸ’» πŸ”Œ
\"\"/
David Gustavo Herrera De La Cruz

πŸ’»
\"\"/
Ed L

πŸ“–
\"\"/
Kovacs Alex

πŸ’»
\"\"/
Ivan Lieder

πŸ’» πŸ‘€
\"\"/
Tyler J Russell

πŸ’» πŸš‡ πŸ”Œ
\"\"/
Stitch07

πŸ’»
\"\"/
lavgup

πŸ“–
\"\"/
Vlad Frangu

πŸ’» πŸš‡ πŸ‘€
\"\"/
Elliot

πŸ“– πŸ’»
\"\"/
Kaname

πŸ’» πŸ›
\"\"/
Lioness100

πŸ’» πŸ“– πŸ›
\"\"/
GC

πŸ’»
\"\"/
Mark Fisher

πŸ’»
\"\"/
bitomic

πŸ’»
\"\"/
c43721

πŸ’»
\"\"/
depfu[bot]

🚧
\"\"/
renovate[bot]

🚧
\"\"/
dependabot[bot]

🚧
\"\"/
allcontributors[bot]

πŸ“–
\"\"/
megatank58

πŸ’»
\"\"/
Feralheart

πŸ’»
\n\n\n\n\n\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n[discord.js]: https://github.com/discordjs/discord.js\n", + "path": "README.md" + } + } + } + }, + "classes": [ + { + "name": "AliasPiece", + "description": "The piece to be stored in {@link AliasStore} instances.", + "extends": [ + "Piece" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "AliasPieceOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasPiece", + "<" + ], + [ + "O", + ">" + ] + ] + ], + "meta": { + "line": 691, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 690, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this alias piece.", + "returns": [ + [ + [ + "AliasPieceJSON" + ] + ] + ], + "meta": { + "line": 695, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 686, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "AliasStore", + "description": "The store class which contains {@link AliasPiece}s.", + "extends": [ + "Store" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "constructor", + "description": "The piece constructor this store loads.", + "optional": false, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "description": "The options for the store.", + "optional": false, + "type": [ + [ + [ + "StoreOptions", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "aliases", + "description": "The aliases referencing to pieces.", + "readonly": true, + "type": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 712, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "T", + "]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + " | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "T", + "]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "description": "Looks up the name by the store, falling back to an alias lookup.", + "params": [ + { + "name": "key", + "description": "The key to look for.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "meta": { + "line": 717, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "has", + "description": "Checks whether a key is in the store, or is an alias", + "params": [ + { + "name": "key", + "description": "The key to check", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 722, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store, and adds all the aliases.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 734, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "T", + ">>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 326, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "T", + ">, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "T", + ">]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "AliasStore", + "<" + ], + [ + "T", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AliasStore", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name, and removes all the aliases.", + "params": [ + { + "name": "name", + "description": "The name of the file to load.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 728, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "T", + ">>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "meta": { + "line": 708, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "AllFlowsPrecondition", + "extends": [ + "Precondition" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AllFlowsPrecondition" + ] + ] + ] + }, + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "PreconditionOptions" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "position", + "readonly": true, + "type": [ + [ + [ + "null", + " | " + ], + [ + "number" + ] + ] + ], + "meta": { + "line": 14, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "chatInputRun", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 52, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "contextMenuRun", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 54, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "error", + "description": "Constructs a {@link PreconditionError} with the precondition parameter set to `this`.", + "params": [ + { + "name": "options", + "description": "The information.", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "Omit", + "<" + ], + [ + "Options", + ", " + ], + [ + "'precondition'", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 35, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "fetchChannelFromInteraction", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "BaseCommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "TextBasedChannel", + ">" + ] + ] + ], + "meta": { + "line": 39, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "messageRun", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 50, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ok", + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 27, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this piece.", + "returns": [ + [ + [ + "PieceJSON" + ] + ] + ], + "meta": { + "line": 479, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 49, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ApplicationCommandRegistry", + "construct": { + "name": "constructor", + "params": [ + { + "name": "commandName", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 35, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + "props": [ + { + "name": "apiCalls", + "access": "private", + "readonly": true, + "default": "[]", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "InternalAPICall", + ">" + ] + ] + ], + "meta": { + "line": 33, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "chatInputCommands", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 30, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "commandName", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 28, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "contextMenuCommands", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 31, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "command", + "readonly": true, + "type": [ + [ + [ + "undefined", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "meta": { + "line": 39, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + } + ], + "methods": [ + { + "name": "addChatInputCommandIds", + "params": [ + { + "name": "commandIds", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + "> | " + ], + [ + "Array", + "<" + ], + [ + "Array", + "<" + ], + [ + "string", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 135, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "addChatInputCommandNames", + "params": [ + { + "name": "names", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + "> | " + ], + [ + "Array", + "<" + ], + [ + "Array", + "<" + ], + [ + "string", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 105, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "addContextMenuCommandIds", + "params": [ + { + "name": "commandIds", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + "> | " + ], + [ + "Array", + "<" + ], + [ + "Array", + "<" + ], + [ + "string", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 156, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "addContextMenuCommandNames", + "params": [ + { + "name": "names", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + "> | " + ], + [ + "Array", + "<" + ], + [ + "Array", + "<" + ], + [ + "string", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 120, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "createMissingCommand", + "access": "private", + "params": [ + { + "name": "commandsManager", + "optional": false, + "type": [ + [ + [ + "ApplicationCommandManager", + "<" + ], + [ + "ApplicationCommand", + "<{" + ], + [ + "\nguild", + ": " + ], + [ + "GuildResolvable\n", + "}>, {" + ], + [ + "\nguild", + ": " + ], + [ + "GuildResolvable\n", + "}, " + ], + [ + "null", + ">" + ] + ] + ] + }, + { + "name": "apiData", + "optional": false, + "type": [ + [ + [ + "RESTPostAPIChatInputApplicationCommandsJSONBody", + " | " + ], + [ + "RESTPostAPIContextMenuApplicationCommandsJSONBody" + ] + ] + ] + }, + { + "name": "type", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "guildId", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 401, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "debug", + "access": "private", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "other", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 448, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "error", + "access": "private", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "other", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 440, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "handleAPICall", + "access": "private", + "params": [ + { + "name": "commandsManager", + "optional": false, + "type": [ + [ + [ + "ApplicationCommandManager", + "<" + ], + [ + "ApplicationCommand", + "<{" + ], + [ + "\nguild", + ": " + ], + [ + "GuildResolvable\n", + "}>, {" + ], + [ + "\nguild", + ": " + ], + [ + "GuildResolvable\n", + "}, " + ], + [ + "null", + ">" + ] + ] + ] + }, + { + "name": "globalCommands", + "optional": false, + "type": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "ApplicationCommand", + "<{}>>" + ] + ] + ] + }, + { + "name": "allGuildsCommands", + "optional": false, + "type": [ + [ + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "ApplicationCommand", + "<{}>>>" + ] + ] + ] + }, + { + "name": "apiCall", + "optional": false, + "type": [ + [ + [ + "InternalAPICall" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 223, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "handleCommandPresent", + "access": "private", + "params": [ + { + "name": "applicationCommand", + "optional": false, + "type": [ + [ + [ + "ApplicationCommand", + "<{}>" + ] + ] + ] + }, + { + "name": "apiData", + "optional": false, + "type": [ + [ + [ + "RESTPostAPIChatInputApplicationCommandsJSONBody", + " | " + ], + [ + "RESTPostAPIContextMenuApplicationCommandsJSONBody" + ] + ] + ] + }, + { + "name": "behaviorIfNotEqual", + "optional": false, + "type": [ + [ + [ + "RegisterBehavior" + ] + ] + ] + }, + { + "name": "guildId", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 341, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "info", + "access": "private", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "other", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 436, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "logCommandDifferences", + "access": "private", + "params": [ + { + "name": "differences", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "CommandDifference", + ">" + ] + ] + ] + }, + { + "name": "applicationCommand", + "optional": false, + "type": [ + [ + [ + "ApplicationCommand", + "<{}>" + ] + ] + ] + }, + { + "name": "logAsWarn", + "optional": false, + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 381, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "registerChatInputCommand", + "params": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputApplicationCommandData", + " | " + ], + [ + "SlashCommandBuilder", + " | " + ], + [ + "SlashCommandSubcommandsOnlyBuilder", + " | " + ], + [ + "SlashCommandOptionsOnlyBuilder", + " | " + ], + [ + "Omit", + "<" + ], + [ + "SlashCommandBuilder", + ", " + ], + [ + "'addSubcommand'", + " | " + ], + [ + "'addSubcommandGroup'", + "> | (" + ], + [ + "builder", + ": " + ], + [ + "SlashCommandBuilder", + ") => " + ], + [ + "SlashCommandBuilder", + " | " + ], + [ + "SlashCommandSubcommandsOnlyBuilder", + " | " + ], + [ + "SlashCommandOptionsOnlyBuilder", + " | " + ], + [ + "Omit", + "<" + ], + [ + "SlashCommandBuilder", + ", " + ], + [ + "'addSubcommand'", + " | " + ], + [ + "'addSubcommandGroup'", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "RegisterOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 43, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "registerContextMenuCommand", + "params": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "UserApplicationCommandData", + " | " + ], + [ + "MessageApplicationCommandData", + " | " + ], + [ + "ContextMenuCommandBuilder", + " | (" + ], + [ + "builder", + ": " + ], + [ + "ContextMenuCommandBuilder", + ") => " + ], + [ + "ContextMenuCommandBuilder" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "RegisterOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 78, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "runAPICalls", + "params": [ + { + "name": "applicationCommands", + "optional": false, + "type": [ + [ + [ + "ApplicationCommandManager", + "<" + ], + [ + "ApplicationCommand", + "<{" + ], + [ + "\nguild", + ": " + ], + [ + "GuildResolvable\n", + "}>, {" + ], + [ + "\nguild", + ": " + ], + [ + "GuildResolvable\n", + "}, " + ], + [ + "null", + ">" + ] + ] + ] + }, + { + "name": "globalCommands", + "optional": false, + "type": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "ApplicationCommand", + "<{}>>" + ] + ] + ] + }, + { + "name": "guildCommands", + "optional": false, + "type": [ + [ + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "ApplicationCommand", + "<{}>>>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 177, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "trace", + "access": "private", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "other", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 452, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "warn", + "access": "private", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "other", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 444, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + } + ], + "meta": { + "line": 27, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "Args", + "description": "The argument parser to be used in {@link Command}.", + "construct": { + "name": "constructor", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "parser", + "optional": false, + "type": [ + [ + [ + "Args" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Args" + ] + ] + ], + "meta": { + "line": 57, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + "props": [ + { + "name": "command", + "description": "The command that is being run.", + "readonly": true, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ], + "meta": { + "line": 38, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "commandContext", + "description": "The context of the command being run.", + "readonly": true, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ], + "meta": { + "line": 43, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "message", + "description": "The original message that triggered the command.", + "readonly": true, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ], + "meta": { + "line": 33, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "parser", + "description": "The internal Lexure parser.", + "readonly": true, + "type": [ + [ + [ + "Args" + ] + ] + ], + "meta": { + "line": 48, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "states", + "description": "The states stored in the args.", + "see": [ + "Args#save", + "Args#restore" + ], + "access": "private", + "readonly": true, + "abstract": false, + "deprecated": false, + "default": "[]", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ArgsState", + ">" + ] + ] + ], + "meta": { + "line": 55, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "finished", + "description": "Whether all arguments have been consumed.", + "readonly": true, + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 633, + "file": "Args.ts", + "path": "src/lib/parsers" + } + } + ], + "methods": [ + { + "name": "getFlags", + "description": "Checks if one or more flag were given.", + "see": [], + "examples": [ + "```typescript\n// Suppose args are from '--f --g'.\nconsole.log(args.getFlags('f'));\n// >>> true\n\nconsole.log(args.getFlags('g', 'h'));\n// >>> true\n\nconsole.log(args.getFlags('h'));\n// >>> false\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "keys", + "description": "The name(s) of the flag.", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 570, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "getOption", + "description": "Gets the last value of one or more options.", + "see": [], + "examples": [ + "```typescript\n// Suppose args are from '--a=1 --b=2 --c=3'.\nconsole.log(args.getOption('a'));\n// >>> '1'\n\nconsole.log(args.getOption('b', 'c'));\n// >>> '2'\n\nconsole.log(args.getOption('d'));\n// >>> null\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "keys", + "description": "The name(s) of the option.", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 590, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "getOptions", + "description": "Gets all the values of one or more option.", + "see": [], + "examples": [ + "```typescript\n// Suppose args are from '--a=1 --a=1 --b=2 --c=3'.\nconsole.log(args.getOptions('a'));\n// >>> ['1', '1']\n\nconsole.log(args.getOptions('b', 'c'));\n// >>> ['2', '3']\n\nconsole.log(args.getOptions('d'));\n// >>> null\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "keys", + "description": "The name(s) of the option.", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "null", + " | " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 610, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "missingArguments", + "returns": [ + [ + [ + "Err", + "<" + ], + [ + "UserError", + ">" + ] + ] + ], + "meta": { + "line": 655, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "next", + "description": "Similar to {@link Args.nextMaybe} but returns the value on success, null otherwise.", + "see": [], + "examples": [ + "```typescript\n// !numbers 1 2 3\n\nconsole.log(args.next());\n// -> '1'\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 531, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "nextMaybe", + "description": "Retrieves the next raw argument from the parser.", + "see": [], + "examples": [ + "```typescript\n// !numbers 1 2 3\n\nconsole.log(args.nextMaybe());\n// -> { exists: true, value: '1' }\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Maybe", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 498, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "peek", + "description": "Similar to {@link Args.peekResult} but returns the value on success, throwing otherwise.", + "see": [], + "examples": [ + "```typescript\n// !bigintsumthensquarefirst 25 50 75\nconst resolver = Args.make((arg) => {\n try {\n return ok(BigInt(arg));\n } catch {\n return err(new UserError('InvalidBigInt', 'You must specify a valid number for a bigint.'));\n }\n});\n\nconst peeked = await args.peek(() => args.repeatResult(resolver));\nawait message.channel.send(`Sum: **${peeked.reduce((x, y) => x + y, 0)}**`); // Sum: 150\n\nconst first = await args.pick(resolver);\nawait message.channel.send(`First bigint squared: ${first**2n}`); // First bigint squared: 625\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The function, custom argument, or argument name.", + "optional": false, + "type": [ + [ + [ + "(..." + ], + [ + "args", + ": " + ], + [ + "unknown", + "[]) => " + ], + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 442, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "peekResult", + "description": "Peeks the following parameter(s) without advancing the parser's state.\nPassing a function as a parameter allows for returning {@link Args.pickResult}, {@link Args.repeatResult},\nor {@link Args.restResult}; otherwise, passing the custom argument or the argument type with options\nwill use {@link Args.pickResult} and only peek a single argument.", + "see": [], + "examples": [ + "```typescript\n// !reversedandscreamfirst hello world\nconst resolver = Args.make((arg) => ok(arg.split('').reverse().join('')));\n\nconst result = await args.peekResult(() => args.repeatResult(resolver));\nif (isOk(result)) await message.channel.send(\n `Reversed ${result.value.length} word(s): ${result.value.join(' ')}`\n); // Reversed 2 word(s): olleh dlrow\n\nconst firstWord = await args.pickResult('string');\nif (isOk(firstWord)) await message.channel.send(firstWord.value.toUpperCase()); // HELLO\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The function, custom argument, or argument name.", + "optional": false, + "type": [ + [ + [ + "(..." + ], + [ + "args", + ": " + ], + [ + "unknown", + "[]) => " + ], + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Result", + "<" + ], + [ + "T", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 368, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "pick", + "description": "Similar to {@link Args.pickResult} but returns the value on success, throwing otherwise.", + "see": [], + "examples": [ + "```typescript\n// !square 5\nconst resolver = Args.make((arg) => {\n const parsed = Number(argument);\n if (Number.isNaN(parsed)) return err(new UserError('ArgumentNumberNaN', 'You must write a valid number.'));\n return ok(parsed);\n});\nconst a = await args.pick(resolver);\n\nawait message.channel.send(`The result is: ${a ** 2}!`);\n// Sends \"The result is: 25\"\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The type of the argument.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "ArgOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 150, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "pickResult", + "description": "Retrieves the next parameter and parses it. Advances index on success.", + "see": [], + "examples": [ + "```typescript\n// !square 5\nconst resolver = Args.make((arg) => {\n const parsed = Number(argument);\n if (Number.isNaN(parsed)) return err(new UserError('ArgumentNumberNaN', 'You must write a valid number.'));\n return ok(parsed);\n});\nconst a = await args.pickResult(resolver);\nif (!a.success) throw new UserError('ArgumentNumberNaN', 'You must write a valid number.');\n\nawait message.channel.send(`The result is: ${a.value ** 2}!`);\n// Sends \"The result is: 25\"\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The type of the argument.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "ArgOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Result", + "<" + ], + [ + "T", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 94, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "repeat", + "description": "Similar to {@link Args.repeatResult} but returns the value on success, throwing otherwise.", + "see": [], + "examples": [ + "```typescript\n// !reverse-each 2 Hello World!\nconst resolver = Args.make((arg) => ok(arg.split('').reverse()));\nconst result = await args.repeat(resolver, { times: 5 });\nawait message.channel.send(`You have written ${result.length} word(s): ${result.join(' ')}`);\n// Sends \"You have written 2 word(s): Hello World!\"\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The type of the argument.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "RepeatArgOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "T", + ">>" + ] + ] + ], + "meta": { + "line": 329, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "repeatResult", + "description": "Retrieves all the following arguments.", + "see": [], + "examples": [ + "```typescript\n// !add 2 Hello World!\nconst resolver = Args.make((arg) => ok(arg.split('').reverse()));\nconst result = await args.repeatResult(resolver, { times: 5 });\nif (!result.success) throw new UserError('CountArgumentError', 'You must write up to 5 words.');\n\nawait message.channel.send(`You have written ${result.value.length} word(s): ${result.value.join(' ')}`);\n// Sends \"You have written 2 word(s): olleH !dlroW\"\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The type of the argument.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "RepeatArgOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Result", + "<" + ], + [ + "Array", + "<" + ], + [ + "T", + ">, " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 269, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "resolveArgument", + "description": "Resolves an argument.", + "access": "private", + "params": [ + { + "name": "arg", + "description": "The argument name or {@link IArgument} instance.", + "optional": false, + "type": [ + [ + [ + "keyof", + " " + ], + [ + "ArgType", + " | " + ], + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 663, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "rest", + "description": "Similar to {@link Args.restResult} but returns the value on success, throwing otherwise.", + "see": [], + "examples": [ + "```typescript\n// !reverse Hello world!\nconst resolver = Args.make((arg) => ok(arg.split('').reverse()));\nconst a = await args.rest(resolver);\nawait message.channel.send(`The reversed value is... ${a}`);\n// Sends \"The reversed value is... !dlrow olleH\"\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The type of the argument.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "ArgOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 235, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "restResult", + "description": "Retrieves all the following arguments.", + "see": [], + "examples": [ + "```typescript\n// !reverse Hello world!\nconst resolver = Args.make((arg) => ok(arg.split('').reverse()));\nconst a = await args.restResult(resolver);\nif (!a.success) throw new UserError('AddArgumentError', 'You must write some text.');\n\nawait message.channel.send(`The reversed value is... ${a.value}`);\n// Sends \"The reversed value is... !dlrow olleH\"\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "type", + "description": "The type of the argument.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "ArgOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Result", + "<" + ], + [ + "T", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 184, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "restore", + "description": "Restores the previously saved state from the stack.", + "see": [ + "Args#save" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 626, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "save", + "description": "Saves the current state into the stack following a FILO strategy (first-in, last-out).", + "see": [ + "Args#restore" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 618, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "start", + "description": "Sets the parser to the first token.", + "returns": [ + [ + [ + "Args" + ] + ] + ], + "meta": { + "line": 67, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` override.", + "returns": [ + [ + [ + "{" + ], + [ + "\ncommand", + ": " + ], + [ + "MessageCommand", + "," + ], + [ + "\ncommandContext", + ": " + ], + [ + "MessageCommandContext", + "," + ], + [ + "\nmessage", + ": " + ], + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ], + [ + "\n", + "}" + ] + ] + ], + "meta": { + "line": 640, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "unavailableArgument", + "params": [ + { + "name": "type", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Err", + "<" + ], + [ + "UserError", + ">" + ] + ] + ], + "meta": { + "line": 644, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "error", + "description": "Constructs an {@link Err} result containing an {@link ArgumentError}.", + "scope": "static", + "params": [ + { + "name": "options", + "description": "The options for the argument error.", + "optional": false, + "type": [ + [ + [ + "Options", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Err", + "<" + ], + [ + "ArgumentError", + "<" + ], + [ + "T", + ">>" + ] + ] + ], + "meta": { + "line": 688, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "make", + "description": "Converts a callback into an usable argument.", + "scope": "static", + "params": [ + { + "name": "cb", + "description": "The callback to convert into an {@link IArgument}.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "parameter", + ": " + ], + [ + "string", + ", " + ], + [ + "context", + ": " + ], + [ + "Context", + "<" + ], + [ + "T", + ">) => " + ], + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 672, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "ok", + "description": "Constructs an {@link Ok} result.", + "scope": "static", + "params": [ + { + "name": "value", + "description": "The value to pass.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Ok", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 680, + "file": "Args.ts", + "path": "src/lib/parsers" + } + } + ], + "meta": { + "line": 29, + "file": "Args.ts", + "path": "src/lib/parsers" + } + }, + { + "name": "Argument", + "description": "The base argument class. This class is abstract and is to be extended by subclasses implementing the methods. In\nSapphire's workflow, arguments are called when using {@link Args}'s methods (usually used inside {@link Command}s by default).", + "see": [], + "extends": [ + "AliasPiece" + ], + "implements": [ + "IArgument" + ], + "examples": [ + "```typescript\nimport { Argument, PieceContext } from '@sapphire/framework';\nimport { URL } from 'url';\n\nexport class CoreArgument extends Argument {\n public constructor(context: PieceContext) {\n super(context, { name: 'hyperlink', aliases: ['url'] });\n }\n\n public run(argument: string): Argument.Result {\n try {\n return this.ok(new URL(argument));\n } catch {\n return this.error(argument, 'ArgumentHyperlinkInvalidURL', 'The argument did not resolve to a valid URL.');\n }\n }\n}\n\n// Augment the ArgType structure so `args.pick('url')`, `args.repeat('url')`\n// and others have a return type of `URL`.\ndeclare module '@sapphire/framework' {\n export interface ArgType {\n url: URL;\n }\n}\n```" + ], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "AliasPieceOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Argument", + "<" + ], + [ + "T", + ", " + ], + [ + "O", + ">" + ] + ] + ] + }, + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 690, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "error", + "description": "Constructs an {@link ArgumentError} with a custom type.", + "params": [ + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "Omit", + "<" + ], + [ + "Options", + "<" + ], + [ + "T", + ">, " + ], + [ + "'argument'", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 83, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ok", + "description": "Wraps a value into a successful value.", + "params": [ + { + "name": "value", + "description": "The value to wrap.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 73, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "run", + "description": "The method which is called when invoking the argument.", + "params": [ + { + "name": "parameter", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "Context", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 67, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this alias piece.", + "returns": [ + [ + [ + "AliasPieceJSON" + ] + ] + ], + "meta": { + "line": 695, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 66, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ArgumentError", + "description": "Errors thrown by the argument parser", + "see": [], + "extends": [ + "UserError" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "description": "Constructs an UserError.", + "params": [ + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "Options", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ArgumentError", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 13, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + } + }, + "props": [ + { + "name": "argument", + "readonly": true, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 10, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "cause", + "type": [ + [ + [ + "Error" + ] + ] + ], + "meta": { + "line": 26, + "file": "lib.es2022.error.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "context", + "description": "User-provided context.", + "readonly": true, + "type": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 14, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "identifier", + "description": "An identifier, useful to localize emitted errors.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 9, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "message", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1023, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "parameter", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 11, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "stack", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1024, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "prepareStackTrace", + "description": "Optional override for formatting stack traces", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "err", + ": " + ], + [ + "Error", + ", " + ], + [ + "stackTraces", + ": " + ], + [ + "Array", + "<" + ], + [ + "CallSite", + ">) => " + ], + [ + "any" + ] + ] + ], + "meta": { + "line": 11, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "stackTraceLimit", + "scope": "static", + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 13, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 20, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + } + } + ], + "methods": [ + { + "name": "captureStackTrace", + "description": "Create .stack property on a target object", + "scope": "static", + "params": [ + { + "name": "targetObject", + "optional": false, + "type": [ + [ + [ + "object" + ] + ] + ] + }, + { + "name": "constructorOpt", + "optional": true, + "type": [ + [ + [ + "Function" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + } + ], + "meta": { + "line": 9, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "ArgumentStore", + "extends": [ + "AliasStore" + ], + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ], + "meta": { + "line": 5, + "file": "ArgumentStore.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "aliases", + "description": "The aliases referencing to pieces.", + "readonly": true, + "type": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 712, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + "> | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "description": "Looks up the name by the store, falling back to an alias lookup.", + "params": [ + { + "name": "key", + "description": "The key to look for.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "meta": { + "line": 717, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "has", + "description": "Checks whether a key is in the store, or is an alias", + "params": [ + { + "name": "key", + "description": "The key to check", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 722, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store, and adds all the aliases.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 734, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 326, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "ArgumentStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ArgumentStore" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name, and removes all the aliases.", + "params": [ + { + "name": "name", + "description": "The name of the file to load.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 728, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "Argument", + "<" + ], + [ + "unknown", + ", " + ], + [ + "ArgumentOptions", + ">>" + ] + ] + ] + } + ], + "meta": { + "line": 4, + "file": "ArgumentStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ClientPermissionsPrecondition", + "description": "Constructs a contextful permissions precondition requirement.", + "see": [], + "implements": [ + "PreconditionSingleResolvableDetails<'ClientPermissions'>" + ], + "examples": [ + "```typescript\nexport class CoreCommand extends Command {\n public constructor(context: PieceContext) {\n super(context, {\n preconditions: [\n 'GuildOnly',\n new ClientPermissionsPrecondition('ADD_REACTIONS')\n ]\n });\n }\n\n public messageRun(message: Message, args: Args) {\n // ...\n }\n}\n```" + ], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "description": "Constructs a precondition container entry.", + "params": [ + { + "name": "permissions", + "description": "The permissions that will be required by this command.", + "optional": false, + "type": [ + [ + [ + "PermissionResolvable" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ClientPermissionsPrecondition" + ] + ] + ], + "meta": { + "line": 33, + "file": "ClientPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + }, + "props": [ + { + "name": "context", + "description": "The context to be set at {@link PreconditionContainerSingle.context}.", + "type": [ + [ + [ + "{" + ], + [ + "\npermissions", + ": " + ], + [ + "Permissions\n", + "}" + ] + ] + ], + "meta": { + "line": 27, + "file": "ClientPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + }, + { + "name": "name", + "description": "The name of the precondition to retrieve from {@link SapphireClient.preconditions}.", + "type": [ + [ + [ + "'ClientPermissions'" + ] + ] + ], + "meta": { + "line": 26, + "file": "ClientPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + } + ], + "meta": { + "line": 25, + "file": "ClientPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + }, + { + "name": "Command", + "extends": [ + "AliasPiece" + ], + "construct": { + "name": "constructor", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "context", + "description": "The context.", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "description": "Optional Command settings.", + "optional": true, + "type": [ + [ + [ + "O" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Command", + "<" + ], + [ + "PreParseReturn", + ", " + ], + [ + "O", + ">" + ] + ] + ], + "meta": { + "line": 89, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 690, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "applicationCommandRegistry", + "description": "The application command registry associated with this command.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 68, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "chatInputCommandOptions", + "description": "Options used to easily register chat input commands", + "see": [], + "access": "private", + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "CommandChatInputRegisterShortcut" + ] + ] + ], + "meta": { + "line": 75, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "description", + "description": "A basic summary about the command", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 27, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "detailedDescription", + "description": "Longer version of command's summary and how to use it", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "DetailedDescriptionCommand" + ] + ] + ], + "meta": { + "line": 39, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "fullCategory", + "description": "The full category for the command. Either an array of strings that denote every (sub)folder the command is in,\nor `null` if it could not be resolved automatically.", + "extendedDescription": "If this is `null` for how you setup your code then you can overwrite how the `fullCategory` is resolved by\nextending this class and overwriting the assignment in the constructor.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 49, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "lexer", + "description": "The lexer to be used for command parsing", + "see": [], + "access": "private", + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Lexer" + ] + ] + ], + "meta": { + "line": 82, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "preconditions", + "description": "The preconditions to be run.", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "PreconditionContainerArray" + ] + ] + ], + "meta": { + "line": 33, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "strategy", + "description": "The strategy to use for the lexer.", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "UnorderedStrategy" + ] + ] + ], + "meta": { + "line": 55, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "typing", + "description": "If {@link SapphireClient.typing} is true, it can be overridden for a specific command using this property, set via its options.\nOtherwise, this property will be ignored.", + "see": [], + "abstract": false, + "deprecated": false, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 62, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "category", + "description": "The main category for the command, if any.", + "extendedDescription": "This getter retrieves the first value of {@link Command.fullCategory}, if it has at least one item, otherwise it\nreturns `null`.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 151, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "parentCategory", + "description": "The parent category for the command.", + "extendedDescription": "This getter retrieves the last value of {@link Command.fullCategory}, if it has at least one item, otherwise it\nreturns `null`.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 175, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "subCategory", + "description": "The sub-category for the command, if any.", + "extendedDescription": "This getter retrieves the second value of {@link Command.fullCategory}, if it has at least two items, otherwise\nit returns `null`.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 163, + "file": "Command.ts", + "path": "src/lib/structures" + } + } + ], + "methods": [ + { + "name": "autocompleteRun", + "description": "Executes the autocomplete logic.", + "extendDescription": ":::tip\n\nYou may use this, or alternatively create an {@link InteractionHandler interaction handler} to handle autocomplete interactions.\nKeep in mind that commands take precedence over interaction handlers.\n\n:::", + "params": [ + { + "name": "interaction", + "description": "The interaction that triggered the autocomplete.", + "optional": false, + "type": [ + [ + [ + "AutocompleteInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 211, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "chatInputRun", + "description": "Executes the application command's logic.", + "params": [ + { + "name": "interaction", + "description": "The interaction that triggered the command.", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 191, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "contextMenuRun", + "description": "Executes the context menu's logic.", + "params": [ + { + "name": "interaction", + "description": "The interaction that triggered the command.", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 197, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "messagePreParse", + "description": "The message pre-parse method. This method can be overridden by plugins to define their own argument parser.", + "params": [ + { + "name": "message", + "description": "The message that triggered the command.", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "description": "The raw parameters as a single string.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "context", + "description": "The command-context used in this execution.", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Awaitable", + "<" + ], + [ + "PreParseReturn", + ">" + ] + ] + ], + "meta": { + "line": 137, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "messageRun", + "description": "Executes the message command's logic.", + "params": [ + { + "name": "message", + "description": "The message that triggered the command.", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "args", + "description": "The value returned by {@link Command.messagePreParse}, by default an instance of {@link Args}.", + "optional": false, + "type": [ + [ + [ + "PreParseReturn" + ] + ] + ] + }, + { + "name": "context", + "description": "The context in which the command was executed.", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 185, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "parseConstructorPreConditions", + "description": "Parses the command's options and processes them, calling {@link Command#parseConstructorPreConditionsRunIn},\n{@link Command#parseConstructorPreConditionsNsfw},\n{@link Command#parseConstructorPreConditionsRequiredClientPermissions}, and\n{@link Command#parseConstructorPreConditionsCooldown}.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "options", + "description": "The command options given from the constructor.", + "optional": false, + "type": [ + [ + [ + "CommandOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 340, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "parseConstructorPreConditionsCooldown", + "description": "Appends the `Cooldown` precondition when {@link Command.Options.cooldownLimit} and\n{@link Command.Options.cooldownDelay} are both non-zero.", + "params": [ + { + "name": "options", + "description": "The command options given from the constructor.", + "optional": false, + "type": [ + [ + [ + "CommandOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 396, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "parseConstructorPreConditionsNsfw", + "description": "Appends the `NSFW` precondition if {@link Command.Options.nsfw} is set to true.", + "params": [ + { + "name": "options", + "description": "The command options given from the constructor.", + "optional": false, + "type": [ + [ + [ + "CommandOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 352, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "parseConstructorPreConditionsRequiredClientPermissions", + "description": "Appends the `ClientPermissions` precondition when {@link Command.Options.requiredClientPermissions} resolves to a\nnon-zero bitfield.", + "params": [ + { + "name": "options", + "description": "The command options given from the constructor.", + "optional": false, + "type": [ + [ + [ + "CommandOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 372, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "parseConstructorPreConditionsRequiredUserPermissions", + "description": "Appends the `UserPermissions` precondition when {@link Command.Options.requiredUserPermissions} resolves to a\nnon-zero bitfield.", + "params": [ + { + "name": "options", + "description": "The command options given from the constructor.", + "optional": false, + "type": [ + [ + [ + "CommandOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 384, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "parseConstructorPreConditionsRunIn", + "description": "Appends the `DMOnly`, `GuildOnly`, `NewsOnly`, and `TextOnly` preconditions based on the values passed in\n{@link Command.Options.runIn}, optimizing in specific cases (`NewsOnly` + `TextOnly` = `GuildOnly`; `DMOnly` +\n`GuildOnly` = `null`), defaulting to `null`, which doesn't add a precondition.", + "params": [ + { + "name": "options", + "description": "The command options given from the constructor.", + "optional": false, + "type": [ + [ + [ + "CommandOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 362, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "registerApplicationCommands", + "description": "Registers the application commands that should be handled by this command.", + "params": [ + { + "name": "registry", + "description": "This command's registry", + "optional": false, + "type": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Awaitable", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 229, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 279, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "resolveConstructorPreConditionsRunType", + "access": "private", + "params": [ + { + "name": "runIn", + "optional": false, + "type": [ + [ + [ + "undefined", + " | " + ], + [ + "null", + " | " + ], + [ + "CommandOptionsRunType", + " | " + ], + [ + "CommandOptionsRunTypeEnum", + " | " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "CommandOptionsRunType", + " | " + ], + [ + "CommandOptionsRunTypeEnum", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "null", + " | " + ], + [ + "PreconditionContainerArray", + " | " + ], + [ + "CommandPreConditions" + ] + ] + ], + "meta": { + "line": 416, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "supportsAutocompleteInteractions", + "description": "Type-guard that ensures the command supports handling autocompletes by checking if the handler for it is present", + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "AutocompleteCommand" + ] + ] + ], + "meta": { + "line": 275, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "supportsChatInputCommands", + "description": "Type-guard that ensures the command supports chat input commands by checking if the handler for it is present", + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "ChatInputCommand" + ] + ] + ], + "meta": { + "line": 261, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "supportsContextMenuCommands", + "description": "Type-guard that ensures the command supports context menu commands by checking if the handler for it is present", + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "ContextMenuCommand" + ] + ] + ], + "meta": { + "line": 268, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "supportsMessageCommands", + "description": "Type-guard that ensures the command supports message commands by checking if the handler for it is present", + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "MessageCommand" + ] + ] + ], + "meta": { + "line": 254, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "toJSON", + "description": "Defines the JSON.stringify behavior of the command.", + "returns": [ + [ + [ + "CommandJSON" + ] + ] + ], + "meta": { + "line": 216, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 22, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "CommandStore", + "description": "Stores all Command pieces", + "see": [], + "extends": [ + "AliasStore" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "CommandStore" + ] + ] + ], + "meta": { + "line": 11, + "file": "CommandStore.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "aliases", + "description": "The aliases referencing to pieces.", + "readonly": true, + "type": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 712, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "categories", + "description": "Get all the command categories.", + "readonly": true, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 18, + "file": "CommandStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + "> | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "CommandStore" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "description": "Looks up the name by the store, falling back to an alias lookup.", + "params": [ + { + "name": "key", + "description": "The key to look for.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "meta": { + "line": 717, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "has", + "description": "Checks whether a key is in the store, or is an alias", + "params": [ + { + "name": "key", + "description": "The key to check", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 722, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store, and adds all the aliases.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 734, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 48, + "file": "CommandStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "CommandStore" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "CommandStore" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "CommandStore" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "CommandStore" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "CommandStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "CommandStore" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name, and removes all the aliases.", + "params": [ + { + "name": "name", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 24, + "file": "CommandStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">>" + ] + ] + ] + } + ], + "meta": { + "line": 10, + "file": "CommandStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ExtendedArgument", + "see": [], + "extends": [ + "Argument" + ], + "examples": [ + "```typescript\nimport { ApplyOptions } from '@sapphire/decorators';\nimport { ExtendedArgument, ExtendedArgumentContext, ExtendedArgumentOptions } from '@sapphire/framework';\nimport type { Channel, TextChannel } from 'discord.js';\n\n(at)ApplyOptions({\n name: 'textChannel',\n baseArgument: 'channel'\n})\nexport class TextChannelArgument extends ExtendedArgument<'channel', TextChannel> {\n public handle(parsed: Channel, { argument }: ExtendedArgumentContext): Argument.Result {\n return parsed.type === 'text'\n ? this.ok(parsed as TextChannel)\n : this.error({ identifier: 'ArgumentTextChannelInvalidTextChannel', message: 'The argument did not resolve to a text channel.' });\n }\n}\n```" + ], + "abstract": false, + "deprecated": true, + "construct": { + "name": "constructor", + "see": [], + "examples": [], + "abstract": false, + "deprecated": true, + "emits": [], + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "ExtendedArgumentOptions", + "<" + ], + [ + "K", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ExtendedArgument", + "<" + ], + [ + "K", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 41, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 690, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "baseArgument", + "type": [ + [ + [ + "K" + ] + ] + ], + "meta": { + "line": 36, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "ArgumentOptions" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "base", + "description": "Represents the underlying argument that transforms the raw argument\ninto the value used to compute the extended argument's value.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": true, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "ArgType", + "[" + ], + [ + "K", + "]>" + ] + ] + ], + "meta": { + "line": 51, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "error", + "description": "Constructs an {@link ArgumentError} with a custom type.", + "params": [ + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "Omit", + "<" + ], + [ + "Options", + "<" + ], + [ + "T", + ">, " + ], + [ + "'argument'", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 83, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "handle", + "see": [], + "examples": [], + "abstract": false, + "deprecated": true, + "emits": [], + "params": [ + { + "name": "parsed", + "optional": false, + "type": [ + [ + [ + "ArgType", + "[" + ], + [ + "K", + "]" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ExtendedArgumentContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 69, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ok", + "description": "Wraps a value into a successful value.", + "params": [ + { + "name": "value", + "description": "The value to wrap.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 73, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "run", + "see": [], + "examples": [], + "abstract": false, + "deprecated": true, + "emits": [], + "params": [ + { + "name": "parameter", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "Context", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AsyncResult", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 58, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this alias piece.", + "returns": [ + [ + [ + "AliasPieceJSON" + ] + ] + ], + "meta": { + "line": 695, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 35, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "InteractionHandler", + "extends": [ + "Piece" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "InteractionHandlerOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "O", + ">" + ] + ] + ], + "meta": { + "line": 13, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "interactionHandlerType", + "description": "The type for this handler", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "InteractionHandlerTypes" + ] + ] + ], + "meta": { + "line": 11, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "none", + "returns": [ + [ + [ + "None" + ] + ] + ], + "meta": { + "line": 74, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "parse", + "description": "A custom function that will be called when checking if an interaction should be passed to this handler.\nYou can use this method to not only filter by ids, but also pre-parse the data from the id for use in the run method.", + "extendDescription": "By default, all interactions of the type you specified will run in a handler. You should override this method\nto change that behavior.", + "see": [], + "examples": [ + "```typescript\n// Parsing a button handler\npublic override parse(interaction: ButtonInteraction) {\n if (interaction.customId.startsWith('my-awesome-clicky-button')) {\n\t // Returning a `some` here means that the run method should be called next!\n return this.some({ isMyBotAwesome: true, awesomenessLevel: 9001 });\n }\n\n // Returning a `none` means this interaction shouldn't run in this handler\n return this.none();\n}\n```", + "```typescript\n// Getting data from a database based on the custom id\npublic override async parse(interaction: ButtonInteraction) {\n // This code is purely for demonstration purposes only!\n if (interaction.customId.startsWith('example-data')) {\n const [, userId, channelId] = interaction.customId.split('.');\n\n\t const dataFromDatabase = await container.prisma.exampleData.findFirst({ where: { userId, channelId } });\n\n // Returning a `some` here means that the run method should be called next!\n return this.some(dataFromDatabase);\n }\n\n // Returning a `none` means this interaction shouldn't run in this handler\n return this.none();\n}\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "_interaction", + "optional": false, + "type": [ + [ + [ + "Interaction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Awaitable", + "<" + ], + [ + "Maybe", + "<" + ], + [ + "unknown", + ">>" + ] + ] + ], + "returnsDescription": "A {@link Maybe} (or a {@link Promise Promised} {@link Maybe}) that indicates if this interaction should be\nhandled by this handler, and any extra data that should be passed to the {@link InteractionHandler.run run method}", + "meta": { + "line": 64, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "run", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "Interaction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "parsedData", + "optional": true, + "type": [ + [ + [ + "unknown" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 19, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "some", + "returns": [ + [ + [ + "Maybe", + "<" + ], + [ + "never", + ">" + ] + ] + ], + "meta": { + "line": 68, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this piece.", + "returns": [ + [ + [ + "InteractionHandlerJSON" + ] + ] + ], + "meta": { + "line": 78, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 6, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "InteractionHandlerStore", + "extends": [ + "Store" + ], + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ], + "meta": { + "line": 8, + "file": "InteractionHandlerStore.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + "> | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + }, + { + "name": "has", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 338, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 326, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "run", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "Interaction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "boolean", + ">" + ] + ] + ], + "meta": { + "line": 12, + "file": "InteractionHandlerStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "InteractionHandlerStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name.", + "params": [ + { + "name": "name", + "description": "The name of the file to load.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 318, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">>" + ] + ] + ] + } + ], + "meta": { + "line": 7, + "file": "InteractionHandlerStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "Listener", + "description": "The base event class. This class is abstract and is to be extended by subclasses, which should implement the methods. In\nSapphire's workflow, listeners are called when the emitter they listen on emits a new message with the same event name.", + "see": [], + "extends": [ + "Piece" + ], + "examples": [ + "```typescript\nimport { Events, Listener } from '@sapphire/framework';\n\nexport class CoreListener extends Listener {\n public constructor(context: Listener.Context) {\n super(context, { event: Events.Ready, once: true });\n }\n\n public run() {\n this.container.client.id ??= this.container.client.user?.id ?? null;\n }\n}\n```" + ], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "O" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Listener", + "<" + ], + [ + "E", + ", " + ], + [ + "O", + ">" + ] + ] + ], + "meta": { + "line": 47, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "_listener", + "access": "private", + "type": [ + [ + [ + "null", + " | (" + ], + [ + "args", + ": " + ], + [ + "Array", + "<" + ], + [ + "any", + ">) => " + ], + [ + "void" + ] + ] + ], + "meta": { + "line": 45, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "emitter", + "description": "The emitter, if any.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "EventEmitter" + ] + ] + ], + "meta": { + "line": 31, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "event", + "description": "The name of the event the listener listens to.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ], + "meta": { + "line": 37, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "once", + "description": "Whether or not the listener will be unloaded after the first run.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 43, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "_run", + "access": "private", + "params": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 102, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "_runOnce", + "access": "private", + "params": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 110, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 66, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 79, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "run", + "params": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "E", + " " + ], + [ + "extends", + " " + ], + [ + "keyof", + " " + ], + [ + "ClientEvents", + " ? " + ], + [ + "ClientEvents", + "[" + ], + [ + "E", + "] : " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 64, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this piece.", + "returns": [ + [ + [ + "ListenerJSON" + ] + ] + ], + "meta": { + "line": 94, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 26, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ListenerStore", + "extends": [ + "Store" + ], + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ], + "meta": { + "line": 5, + "file": "ListenerStore.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + "> | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + }, + { + "name": "has", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 338, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 326, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "ListenerStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "ListenerStore" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name.", + "params": [ + { + "name": "name", + "description": "The name of the file to load.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 318, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">>" + ] + ] + ] + } + ], + "meta": { + "line": 4, + "file": "ListenerStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "LoaderError", + "description": "Describes a loader error with a type for easy indentification.", + "extends": [ + "Error" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "type", + "optional": false, + "type": [ + [ + [ + "LoaderErrorType" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "LoaderError" + ] + ] + ], + "meta": { + "line": 17, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + "props": [ + { + "name": "cause", + "type": [ + [ + [ + "Error" + ] + ] + ], + "meta": { + "line": 26, + "file": "lib.es2022.error.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "message", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1023, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "stack", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1024, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "type", + "description": "The type of the error that was thrown.", + "readonly": true, + "type": [ + [ + [ + "LoaderErrorType" + ] + ] + ], + "meta": { + "line": 16, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "prepareStackTrace", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "err", + ": " + ], + [ + "Error", + ", " + ], + [ + "stackTraces", + ": " + ], + [ + "Array", + "<" + ], + [ + "CallSite", + ">) => " + ], + [ + "any" + ] + ] + ], + "meta": { + "line": 11, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "stackTraceLimit", + "scope": "static", + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 13, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 18, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "captureStackTrace", + "description": "Create .stack property on a target object", + "scope": "static", + "params": [ + { + "name": "targetObject", + "optional": false, + "type": [ + [ + [ + "object" + ] + ] + ] + }, + { + "name": "constructorOpt", + "optional": true, + "type": [ + [ + [ + "Function" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + } + ], + "meta": { + "line": 12, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "Logger", + "implements": [ + "ILogger" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "level", + "optional": false, + "type": [ + [ + [ + "LogLevel" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Logger" + ] + ] + ], + "meta": { + "line": 6, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + "props": [ + { + "name": "level", + "type": [ + [ + [ + "LogLevel" + ] + ] + ], + "meta": { + "line": 4, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "levels", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "Map", + "<" + ], + [ + "LogLevel", + ", " + ], + [ + "LogMethods", + ">" + ] + ] + ], + "meta": { + "line": 44, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + } + ], + "methods": [ + { + "name": "debug", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Debug} as level.", + "params": [ + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 18, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "error", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Error} as level.", + "params": [ + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 30, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "fatal", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Fatal} as level.", + "params": [ + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 34, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "has", + "description": "Checks whether a level is supported.", + "params": [ + { + "name": "level", + "optional": false, + "type": [ + [ + [ + "LogLevel" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 10, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "info", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Info} as level.", + "params": [ + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 22, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "trace", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Trace} as level.", + "params": [ + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 14, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "warn", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Warn} as level.", + "params": [ + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 26, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "write", + "description": "Writes the log message given a level and the value(s).", + "params": [ + { + "name": "level", + "optional": false, + "type": [ + [ + [ + "LogLevel" + ] + ] + ] + }, + { + "name": "values", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 38, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + } + ], + "meta": { + "line": 3, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + } + }, + { + "name": "MissingExportsError", + "description": "Describes a {@link LoaderErrorType.EmptyModule} loader error and adds a path for easy identification.", + "extends": [ + "LoaderError" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "path", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "MissingExportsError" + ] + ] + ], + "meta": { + "line": 29, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + "props": [ + { + "name": "cause", + "type": [ + [ + [ + "Error" + ] + ] + ], + "meta": { + "line": 26, + "file": "lib.es2022.error.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "message", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1023, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "path", + "description": "The path of the module that did not have exports.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "stack", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1024, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "type", + "description": "The type of the error that was thrown.", + "readonly": true, + "type": [ + [ + [ + "LoaderErrorType" + ] + ] + ], + "meta": { + "line": 16, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "prepareStackTrace", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "err", + ": " + ], + [ + "Error", + ", " + ], + [ + "stackTraces", + ": " + ], + [ + "Array", + "<" + ], + [ + "CallSite", + ">) => " + ], + [ + "any" + ] + ] + ], + "meta": { + "line": 11, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "stackTraceLimit", + "scope": "static", + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 13, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 18, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "captureStackTrace", + "description": "Create .stack property on a target object", + "scope": "static", + "params": [ + { + "name": "targetObject", + "optional": false, + "type": [ + [ + [ + "object" + ] + ] + ] + }, + { + "name": "constructorOpt", + "optional": true, + "type": [ + [ + [ + "Function" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + } + ], + "meta": { + "line": 24, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "Piece", + "description": "The piece to be stored in {@link Store} instances.", + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "PieceOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Piece", + "<" + ], + [ + "O", + ">" + ] + ] + ], + "meta": { + "line": 452, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this piece.", + "returns": [ + [ + [ + "PieceJSON" + ] + ] + ], + "meta": { + "line": 479, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 431, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "Plugin", + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "Plugin" + ] + ] + ] + }, + "props": [ + { + "name": "[postInitialization]", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "this", + ": " + ], + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "options", + ": " + ], + [ + "ClientOptions", + ") => " + ], + [ + "void" + ] + ] + ], + "meta": { + "line": 10, + "file": "Plugin.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "[postLogin]", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "this", + ": " + ], + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "options", + ": " + ], + [ + "ClientOptions", + ") => " + ], + [ + "Awaitable", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 12, + "file": "Plugin.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "[preGenericsInitialization]", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "this", + ": " + ], + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "options", + ": " + ], + [ + "ClientOptions", + ") => " + ], + [ + "void" + ] + ] + ], + "meta": { + "line": 8, + "file": "Plugin.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "[preInitialization]", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "this", + ": " + ], + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "options", + ": " + ], + [ + "ClientOptions", + ") => " + ], + [ + "void" + ] + ] + ], + "meta": { + "line": 9, + "file": "Plugin.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "[preLogin]", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "this", + ": " + ], + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "options", + ": " + ], + [ + "ClientOptions", + ") => " + ], + [ + "Awaitable", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 11, + "file": "Plugin.ts", + "path": "src/lib/plugins" + } + } + ], + "meta": { + "line": 7, + "file": "Plugin.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "PluginManager", + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "PluginManager" + ] + ] + ] + }, + "props": [ + { + "name": "registry", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "SapphirePluginHookEntry", + "<" + ], + [ + "SapphirePluginAsyncHook", + " | " + ], + [ + "SapphirePluginHook", + ">>" + ] + ] + ], + "meta": { + "line": 25, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + } + ], + "methods": [ + { + "name": "registerHook", + "params": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "SapphirePluginHook" + ] + ] + ] + }, + { + "name": "type", + "optional": false, + "type": [ + [ + [ + "SyncPluginHooks" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 27, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "registerPostInitializationHook", + "params": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "SapphirePluginHook" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 43, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "registerPostLoginHook", + "params": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "SapphirePluginAsyncHook" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 51, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "registerPreGenericsInitializationHook", + "params": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "SapphirePluginHook" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 35, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "registerPreInitializationHook", + "params": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "SapphirePluginHook" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 39, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "registerPreLoginHook", + "params": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "SapphirePluginAsyncHook" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 47, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "use", + "params": [ + { + "name": "plugin", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Plugin", + ")" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 55, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "values", + "returns": [ + [ + [ + "Generator", + "<" + ], + [ + "SapphirePluginHookEntry", + "<" + ], + [ + "SapphirePluginAsyncHook", + " | " + ], + [ + "SapphirePluginHook", + ">, " + ], + [ + "void", + ", " + ], + [ + "unknown", + ">" + ] + ] + ], + "meta": { + "line": 71, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + } + ], + "meta": { + "line": 24, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + } + }, + { + "name": "Precondition", + "extends": [ + "Piece" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PieceContext" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Precondition", + "<" + ], + [ + "O", + ">" + ] + ] + ], + "meta": { + "line": 16, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece is enabled.", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 447, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "location", + "description": "The location metadata for the piece's file.", + "readonly": true, + "type": [ + [ + [ + "PieceLocation" + ] + ] + ], + "meta": { + "line": 439, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "description": "The name of the piece.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 443, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "options", + "description": "The raw options passed to this {@link Piece}", + "readonly": true, + "type": [ + [ + [ + "O" + ] + ] + ], + "meta": { + "line": 451, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "position", + "readonly": true, + "type": [ + [ + [ + "null", + " | " + ], + [ + "number" + ] + ] + ], + "meta": { + "line": 14, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "store", + "description": "The store that contains the piece.", + "readonly": true, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ], + "meta": { + "line": 435, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 457, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "chatInputRun", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 23, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "contextMenuRun", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 25, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "error", + "description": "Constructs a {@link PreconditionError} with the precondition parameter set to `this`.", + "params": [ + { + "name": "options", + "description": "The information.", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "Omit", + "<" + ], + [ + "Options", + ", " + ], + [ + "'precondition'", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 35, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "fetchChannelFromInteraction", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "BaseCommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "TextBasedChannel", + ">" + ] + ] + ], + "meta": { + "line": 39, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "messageRun", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 21, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ok", + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 27, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "onLoad", + "description": "Per-piece listener that is called when the piece is loaded into the store.\nUseful to set-up asynchronous initialization tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 462, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "onUnload", + "description": "Per-piece listener that is called when the piece is unloaded from the store.\nUseful to set-up clean-up tasks.", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 467, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reload", + "description": "Reloads the piece by loading the same path in the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 475, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "toJSON", + "description": "Defines the `JSON.stringify` behavior of this piece.", + "returns": [ + [ + [ + "PieceJSON" + ] + ] + ], + "meta": { + "line": 479, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unload", + "description": "Unloads and disables the piece.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 471, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "meta": { + "line": 13, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "PreconditionContainerArray", + "description": "An {@link IPreconditionContainer} that defines an array of multiple {@link IPreconditionContainer}s.", + "extendedDescription": "By default, array containers run either of two conditions: AND and OR ({@link PreconditionRunCondition}), the top level\nwill always default to AND, where the nested one flips the logic (OR, then children arrays are AND, then OR...).\n\nThis allows `['Connect', ['Moderator', ['DJ', 'SongAuthor']]]` to become a thrice-nested precondition container, where:\n- Level 1: [Single(Connect), Array] runs AND, both containers must return a successful value.\n- Level 2: [Single(Moderator), Array] runs OR, either container must return a successful value.\n- Level 3: [Single(DJ), Single(SongAuthor)] runs AND, both containers must return a successful value.\n\nIn other words, it is identical to doing:\n```typescript\nConnect && (Moderator || (DJ && SongAuthor));\n```", + "see": [], + "implements": [ + "IPreconditionContainer" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "params": [ + { + "name": "data", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "PreconditionArrayResolvable" + ] + ] + ] + }, + { + "name": "parent", + "optional": true, + "default": "null", + "type": [ + [ + [ + "null", + " | " + ], + [ + "PreconditionContainerArray" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerArray" + ] + ] + ], + "meta": { + "line": 127, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + "props": [ + { + "name": "entries", + "description": "The {@link IPreconditionContainer}s the array holds.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">" + ] + ] + ], + "meta": { + "line": 119, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "mode", + "description": "The mode at which this precondition will run.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "PreconditionRunMode" + ] + ] + ], + "meta": { + "line": 113, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "runCondition", + "description": "The {@link PreconditionRunCondition} that defines how entries must be handled.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "PreconditionRunCondition" + ] + ] + ], + "meta": { + "line": 125, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "conditions", + "description": "The preconditions to be run. Extra ones can be added by augmenting {@link PreconditionRunCondition} and then\ninserting {@link IPreconditionCondition}s.", + "see": [], + "scope": "static", + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Collection", + "<" + ], + [ + "PreconditionRunCondition", + ", " + ], + [ + "IPreconditionCondition", + ">" + ] + ] + ], + "meta": { + "line": 247, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "condition", + "description": "Retrieves a condition from {@link PreconditionContainerArray.conditions}, assuming existence.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "IPreconditionCondition" + ] + ] + ], + "meta": { + "line": 222, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + } + ], + "methods": [ + { + "name": "add", + "description": "Adds a new entry to the array.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "entry", + "description": "The value to add to the entries.", + "optional": false, + "type": [ + [ + [ + "IPreconditionContainer" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerArray" + ] + ] + ], + "meta": { + "line": 149, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "append", + "params": [ + { + "name": "keyOrEntries", + "optional": false, + "type": [ + [ + [ + "PreconditionContainerArray", + " | " + ], + [ + "SimplePreconditionKeys", + " | " + ], + [ + "SimplePreconditionSingleResolvableDetails" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerArray" + ] + ] + ], + "meta": { + "line": 154, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "chatInputRun", + "description": "Runs the container.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "interaction", + "description": "The interaction that ran this precondition.", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "description": "The command the interaction invoked.", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerReturn" + ] + ] + ], + "meta": { + "line": 179, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "contextMenuRun", + "description": "Runs the container.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "interaction", + "description": "The interaction that ran this precondition.", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "description": "The command the interaction invoked.", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerReturn" + ] + ] + ], + "meta": { + "line": 191, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "messageRun", + "description": "Runs the container.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "message", + "description": "The message that ran this precondition.", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "command", + "description": "The command the message invoked.", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerReturn" + ] + ] + ], + "meta": { + "line": 167, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "parse", + "description": "Parses the precondition entry resolvables, and adds them to the entries.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "entries", + "description": "The entries to parse.", + "optional": false, + "type": [ + [ + [ + "Iterable", + "<" + ], + [ + "PreconditionEntryResolvable", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerArray" + ] + ] + ], + "meta": { + "line": 206, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + } + ], + "meta": { + "line": 108, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "PreconditionContainerSingle", + "description": "An {@link IPreconditionContainer} which runs a single precondition from {@link SapphireClient.preconditions}.", + "see": [], + "implements": [ + "IPreconditionContainer" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "params": [ + { + "name": "data", + "optional": false, + "type": [ + [ + [ + "PreconditionSingleResolvable" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionContainerSingle" + ] + ] + ], + "meta": { + "line": 64, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + }, + "props": [ + { + "name": "context", + "description": "The context to be used when calling {@link Precondition.run}. This will always be an empty object (`{}`) when the\ncontainer was constructed with a string, otherwise it is a direct reference to the value from\n{@link PreconditionSingleResolvableDetails.context}.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Record", + "<" + ], + [ + "PropertyKey", + ", " + ], + [ + "unknown", + ">" + ] + ] + ], + "meta": { + "line": 56, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "name", + "description": "The name of the precondition to run.", + "see": [], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 62, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + } + ], + "methods": [ + { + "name": "chatInputRun", + "description": "Runs the container.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "interaction", + "description": "The interaction that ran this precondition.", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "description": "The command the interaction invoked.", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 97, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "contextMenuRun", + "description": "Runs the container.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "interaction", + "description": "The interaction that ran this precondition.", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "description": "The command the interaction invoked.", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 114, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "messageRun", + "description": "Runs the container.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "message", + "description": "The message that ran this precondition.", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "command", + "description": "The command the message invoked.", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 80, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + } + ], + "meta": { + "line": 49, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + } + }, + { + "name": "PreconditionError", + "description": "Errors thrown by preconditions", + "see": [], + "extends": [ + "UserError" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "description": "Constructs an UserError.", + "params": [ + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "Options" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionError" + ] + ] + ], + "meta": { + "line": 11, + "file": "PreconditionError.ts", + "path": "src/lib/errors" + } + }, + "props": [ + { + "name": "cause", + "type": [ + [ + [ + "Error" + ] + ] + ], + "meta": { + "line": 26, + "file": "lib.es2022.error.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "context", + "description": "User-provided context.", + "readonly": true, + "type": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 14, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "identifier", + "description": "An identifier, useful to localize emitted errors.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 9, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "message", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1023, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "precondition", + "readonly": true, + "type": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "meta": { + "line": 9, + "file": "PreconditionError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "stack", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1024, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "prepareStackTrace", + "description": "Optional override for formatting stack traces", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "err", + ": " + ], + [ + "Error", + ", " + ], + [ + "stackTraces", + ": " + ], + [ + "Array", + "<" + ], + [ + "CallSite", + ">) => " + ], + [ + "any" + ] + ] + ], + "meta": { + "line": 11, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "stackTraceLimit", + "scope": "static", + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 13, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 17, + "file": "PreconditionError.ts", + "path": "src/lib/errors" + } + } + ], + "methods": [ + { + "name": "captureStackTrace", + "description": "Create .stack property on a target object", + "scope": "static", + "params": [ + { + "name": "targetObject", + "optional": false, + "type": [ + [ + [ + "object" + ] + ] + ] + }, + { + "name": "constructorOpt", + "optional": true, + "type": [ + [ + [ + "Function" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + } + ], + "meta": { + "line": 8, + "file": "PreconditionError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "PreconditionStore", + "extends": [ + "Store" + ], + "construct": { + "name": "constructor", + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 11, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "globalPreconditions", + "access": "private", + "readonly": true, + "default": "[]", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 9, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "chatInputRun", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AsyncPreconditionResult" + ] + ] + ], + "meta": { + "line": 30, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 89, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "contextMenuRun", + "params": [ + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AsyncPreconditionResult" + ] + ] + ], + "meta": { + "line": 49, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 80, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + "> | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + }, + { + "name": "has", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 338, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 326, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "messageRun", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": true, + "default": "{}", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AsyncPreconditionResult" + ] + ] + ], + "meta": { + "line": 15, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 68, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">, " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "PreconditionStore", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "PreconditionStore" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name.", + "params": [ + { + "name": "name", + "description": "The name of the file to load.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 318, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">>" + ] + ] + ] + } + ], + "meta": { + "line": 8, + "file": "PreconditionStore.ts", + "path": "src/lib/structures" + } + }, + { + "name": "SapphireClient", + "description": "The base {@link Client} extension that makes Sapphire work. When building a Discord bot with the framework, the developer\nmust either use this class, or extend it.", + "extendedDescription": "Sapphire also automatically detects the folders to scan for pieces, please read {@link StoreRegistry.registerPath}\nfor reference. This method is called at the start of the {@link SapphireClient.login} method.", + "see": [ + "{@link SapphireClientOptions} for all options available to the Sapphire Client. You can also provide all of discord.js' [ClientOptions](https://discord.js.org/#/docs/main/stable/typedef/ClientOptions)" + ], + "extends": [ + "Client" + ], + "examples": [ + "```typescript\nconst client = new SapphireClient({\n presence: {\n activity: {\n name: 'for commands!',\n type: 'LISTENING'\n }\n }\n});\n\nclient.login(process.env.DISCORD_TOKEN)\n .catch(console.error);\n```", + "```typescript\n// Automatically scan from a specific directory, e.g. the main\n// file is at `/home/me/bot/index.js` and all your pieces are at\n// `/home/me/bot/pieces` (e.g. `/home/me/bot/pieces/commands/MyCommand.js`):\nconst client = new SapphireClient({\n baseUserDirectory: join(__dirname, 'pieces'),\n // More options...\n});\n```", + "```typescript\n// Opt-out automatic scanning:\nconst client = new SapphireClient({\n baseUserDirectory: null,\n // More options...\n});\n```" + ], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "params": [ + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "ClientOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ], + "meta": { + "line": 262, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + "props": [ + { + "name": "application", + "type": [ + [ + [ + "If", + "<" + ], + [ + "Ready", + ", " + ], + [ + "ClientApplication", + ", " + ], + [ + "null", + ">" + ] + ] + ], + "meta": { + "line": 543, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "channels", + "type": [ + [ + [ + "ChannelManager" + ] + ] + ], + "meta": { + "line": 544, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "disableMentionPrefix", + "description": "Whether the bot has mention as a prefix disabled", + "see": [], + "abstract": false, + "deprecated": false, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "emojis", + "readonly": true, + "type": [ + [ + [ + "BaseGuildEmojiManager" + ] + ] + ], + "meta": { + "line": 545, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchPrefix", + "description": "The method to be overridden by the developer.", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "SapphirePrefixHook" + ] + ] + ], + "meta": { + "line": 237, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "guilds", + "type": [ + [ + [ + "GuildManager" + ] + ] + ], + "meta": { + "line": 546, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "id", + "description": "The client's ID, used for the user prefix.", + "see": [], + "abstract": false, + "deprecated": false, + "default": "null", + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 207, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "logger", + "description": "The logger to be used by the framework and plugins. By default, a {@link Logger} instance is used, which emits the\nmessages to the console.", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "ILogger" + ] + ] + ], + "meta": { + "line": 244, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "options", + "type": [ + [ + [ + "ClientOptions" + ] + ] + ], + "meta": { + "line": 547, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "readyAt", + "type": [ + [ + [ + "If", + "<" + ], + [ + "Ready", + ", " + ], + [ + "Date", + ", " + ], + [ + "null", + ">" + ] + ] + ], + "meta": { + "line": 548, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "readyTimestamp", + "readonly": true, + "type": [ + [ + [ + "If", + "<" + ], + [ + "Ready", + ", " + ], + [ + "number", + ", " + ], + [ + "null", + ">" + ] + ] + ], + "meta": { + "line": 549, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "shard", + "type": [ + [ + [ + "null", + " | " + ], + [ + "ShardClientUtil" + ] + ] + ], + "meta": { + "line": 551, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "stores", + "description": "The registered stores.", + "see": [], + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 260, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "sweepers", + "type": [ + [ + [ + "Sweepers" + ] + ] + ], + "meta": { + "line": 550, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "token", + "type": [ + [ + [ + "If", + "<" + ], + [ + "Ready", + ", " + ], + [ + "string", + ", " + ], + [ + "null", + " | " + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 552, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "uptime", + "type": [ + [ + [ + "If", + "<" + ], + [ + "Ready", + ", " + ], + [ + "number", + ", " + ], + [ + "null", + ">" + ] + ] + ], + "meta": { + "line": 553, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "user", + "type": [ + [ + [ + "If", + "<" + ], + [ + "Ready", + ", " + ], + [ + "ClientUser", + ", " + ], + [ + "null", + ">" + ] + ] + ], + "meta": { + "line": 554, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "users", + "type": [ + [ + [ + "UserManager" + ] + ] + ], + "meta": { + "line": 555, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "voice", + "type": [ + [ + [ + "ClientVoiceManager" + ] + ] + ], + "meta": { + "line": 556, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "ws", + "type": [ + [ + [ + "WebSocketManager" + ] + ] + ], + "meta": { + "line": 557, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "captureRejectionSymbol", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "captureRejectionSymbol", + ")" + ] + ] + ], + "meta": { + "line": 301, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "captureRejections", + "description": "Sets or gets the default captureRejection value for all emitters.", + "scope": "static", + "type": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 306, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "defaultMaxListeners", + "scope": "static", + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 307, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "errorMonitor", + "description": "This symbol shall be used to install a listener for only monitoring `'error'`\nevents. Listeners installed using this symbol are called before the regular\n`'error'` listeners are called.", + "extendedDescription": "Installing a listener using this symbol does not change the behavior once an\n`'error'` event is emitted, therefore the process will still crash if no\nregular `'error'` listener is installed.", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "errorMonitor", + ")" + ] + ] + ], + "meta": { + "line": 300, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "plugins", + "scope": "static", + "type": [ + [ + [ + "PluginManager" + ] + ] + ], + "meta": { + "line": 345, + "file": "SapphireClient.ts", + "path": "src/lib" + } + } + ], + "methods": [ + { + "name": "addListener", + "description": "Alias for `emitter.on(eventName, listener)`.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "listener", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "Array", + "<" + ], + [ + "any", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ] + }, + { + "name": "destroy", + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 558, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "emit", + "params": [ + { + "name": "event", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + }, + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "ClientEvents", + "[" + ], + [ + "K", + "]" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 586, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "eventNames", + "description": "Returns an array listing the events for which the emitter has registered\nlisteners. The values in the array are strings or `Symbol`s.", + "extendDescription": "```js\nconst EventEmitter = require('events');\nconst myEE = new EventEmitter();\nmyEE.on('foo', () => {});\nmyEE.on('bar', () => {});\n\nconst sym = Symbol('symbol');\nmyEE.on(sym, () => {});\n\nconsole.log(myEE.eventNames());\n// Prints: [ 'foo', 'bar', Symbol(symbol) ]\n```", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "string", + " | " + ], + [ + "symbol", + ">" + ] + ] + ] + }, + { + "name": "fetchGuildPreview", + "params": [ + { + "name": "guild", + "optional": false, + "type": [ + [ + [ + "GuildResolvable" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "GuildPreview", + ">" + ] + ] + ], + "meta": { + "line": 559, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchGuildTemplate", + "params": [ + { + "name": "template", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "GuildTemplate", + ">" + ] + ] + ], + "meta": { + "line": 561, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchGuildWidget", + "params": [ + { + "name": "guild", + "optional": false, + "type": [ + [ + [ + "GuildResolvable" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Widget", + ">" + ] + ] + ], + "meta": { + "line": 566, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchInvite", + "params": [ + { + "name": "invite", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "ClientFetchInviteOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Invite", + ">" + ] + ] + ], + "meta": { + "line": 560, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchPremiumStickerPacks", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "StickerPack", + ">>" + ] + ] + ], + "meta": { + "line": 564, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchSticker", + "params": [ + { + "name": "id", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Sticker", + ">" + ] + ] + ], + "meta": { + "line": 563, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchVoiceRegions", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "VoiceRegion", + ">>" + ] + ] + ], + "meta": { + "line": 562, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "fetchWebhook", + "params": [ + { + "name": "id", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "token", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Webhook", + ">" + ] + ] + ], + "meta": { + "line": 565, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "generateInvite", + "params": [ + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "InviteGenerationOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 567, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "getMaxListeners", + "description": "Returns the current max listener value for the `EventEmitter` which is either\nset by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "isReady", + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Client", + "<" + ], + [ + "true", + ">" + ] + ] + ], + "meta": { + "line": 569, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "listenerCount", + "description": "Returns the number of listeners listening to the event named `eventName`.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "description": "The name of the event being listened for", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "listeners", + "description": "Returns a copy of the array of listeners for the event named `eventName`.", + "extendDescription": "```js\nserver.on('connection', (stream) => {\n console.log('someone connected!');\n});\nconsole.log(util.inspect(server.listeners('connection')));\n// Prints: [ [Function] ]\n```", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Function", + ">" + ] + ] + ] + }, + { + "name": "login", + "description": "Loads all pieces, then logs the client in, establishing a websocket connection to Discord.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "token", + "description": "Token of the account to log in with.", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "returnsDescription": "Token of the account used.", + "meta": { + "line": 320, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "off", + "params": [ + { + "name": "event", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + }, + { + "name": "listener", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "ClientEvents", + "[" + ], + [ + "K", + "]) => " + ], + [ + "Awaitable", + "<" + ], + [ + "void", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ], + "meta": { + "line": 589, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "on", + "params": [ + { + "name": "event", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + }, + { + "name": "listener", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "ClientEvents", + "[" + ], + [ + "K", + "]) => " + ], + [ + "Awaitable", + "<" + ], + [ + "void", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ], + "meta": { + "line": 574, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "once", + "params": [ + { + "name": "event", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + }, + { + "name": "listener", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "ClientEvents", + "[" + ], + [ + "K", + "]) => " + ], + [ + "Awaitable", + "<" + ], + [ + "void", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ], + "meta": { + "line": 580, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "prependListener", + "description": "Adds the `listener` function to the _beginning_ of the listeners array for the\nevent named `eventName`. No checks are made to see if the `listener` has\nalready been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple\ntimes.", + "extendDescription": "```js\nserver.prependListener('connection', (stream) => {\n console.log('someone connected!');\n});\n```\n\nReturns a reference to the `EventEmitter`, so that calls can be chained.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "description": "The name of the event.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "listener", + "description": "The callback function", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "Array", + "<" + ], + [ + "any", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ] + }, + { + "name": "prependOnceListener", + "description": "Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this\nlistener is removed, and then invoked.", + "extendDescription": "```js\nserver.prependOnceListener('connection', (stream) => {\n console.log('Ah, we have our first user!');\n});\n```\n\nReturns a reference to the `EventEmitter`, so that calls can be chained.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "description": "The name of the event.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "listener", + "description": "The callback function", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "Array", + "<" + ], + [ + "any", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ] + }, + { + "name": "rawListeners", + "description": "Returns a copy of the array of listeners for the event named `eventName`,\nincluding any wrappers (such as those created by `.once()`).", + "extendDescription": "```js\nconst emitter = new EventEmitter();\nemitter.once('log', () => console.log('log once'));\n\n// Returns a new Array with a function `onceWrapper` which has a property\n// `listener` which contains the original listener bound above\nconst listeners = emitter.rawListeners('log');\nconst logFnWrapper = listeners[0];\n\n// Logs \"log once\" to the console and does not unbind the `once` event\nlogFnWrapper.listener();\n\n// Logs \"log once\" to the console and removes the listener\nlogFnWrapper();\n\nemitter.on('log', () => console.log('log persistently'));\n// Will return a new Array with a single function bound by `.on()` above\nconst newListeners = emitter.rawListeners('log');\n\n// Logs \"log persistently\" twice\nnewListeners[0]();\nemitter.emit('log');\n```", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Function", + ">" + ] + ] + ] + }, + { + "name": "removeAllListeners", + "params": [ + { + "name": "event", + "optional": true, + "type": [ + [ + [ + "K" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ], + "meta": { + "line": 595, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "removeListener", + "description": "Removes the specified `listener` from the listener array for the event named`eventName`.", + "extendDescription": "```js\nconst callback = (stream) => {\n console.log('someone connected!');\n};\nserver.on('connection', callback);\n// ...\nserver.removeListener('connection', callback);\n```\n\n`removeListener()` will remove, at most, one instance of a listener from the\nlistener array. If any single listener has been added multiple times to the\nlistener array for the specified `eventName`, then `removeListener()` must be\ncalled multiple times to remove each instance.\n\nOnce an event is emitted, all listeners attached to it at the\ntime of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will\nnot remove them from`emit()` in progress. Subsequent events behave as expected.\n\n```js\nconst myEmitter = new MyEmitter();\n\nconst callbackA = () => {\n console.log('A');\n myEmitter.removeListener('event', callbackB);\n};\n\nconst callbackB = () => {\n console.log('B');\n};\n\nmyEmitter.on('event', callbackA);\n\nmyEmitter.on('event', callbackB);\n\n// callbackA removes listener callbackB but it will still be called.\n// Internal listener array at time of emit [callbackA, callbackB]\nmyEmitter.emit('event');\n// Prints:\n// A\n// B\n\n// callbackB is now removed.\n// Internal listener array [callbackA]\nmyEmitter.emit('event');\n// Prints:\n// A\n```\n\nBecause listeners are managed using an internal array, calling this will\nchange the position indices of any listener registered _after_ the listener\nbeing removed. This will not impact the order in which listeners are called,\nbut it means that any copies of the listener array as returned by\nthe `emitter.listeners()` method will need to be recreated.\n\nWhen a single function has been added as a handler multiple times for a single\nevent (as in the example below), `removeListener()` will remove the most\nrecently added instance. In the example the `once('ping')`listener is removed:\n\n```js\nconst ee = new EventEmitter();\n\nfunction pong() {\n console.log('pong');\n}\n\nee.on('ping', pong);\nee.once('ping', pong);\nee.removeListener('ping', pong);\n\nee.emit('ping');\nee.emit('ping');\n```\n\nReturns a reference to the `EventEmitter`, so that calls can be chained.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "eventName", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "listener", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "args", + ": " + ], + [ + "Array", + "<" + ], + [ + "any", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ] + }, + { + "name": "setMaxListeners", + "description": "By default `EventEmitter`s will print a warning if more than `10` listeners are\nadded for a particular event. This is a useful default that helps finding\nmemory leaks. The `emitter.setMaxListeners()` method allows the limit to be\nmodified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.", + "extendDescription": "Returns a reference to the `EventEmitter`, so that calls can be chained.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "n", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "Ready", + ">" + ] + ] + ] + }, + { + "name": "sweepMessages", + "see": [], + "examples": [], + "abstract": false, + "deprecated": true, + "emits": [], + "params": [ + { + "name": "lifetime", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 571, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 572, + "file": "index.d.ts", + "path": "node_modules/discord.js/typings" + } + }, + { + "name": "getEventListeners", + "description": "Returns a copy of the array of listeners for the event named `eventName`.", + "extendDescription": "For `EventEmitter`s this behaves exactly the same as calling `.listeners` on\nthe emitter.\n\nFor `EventTarget`s this is the only way to get the event listeners for the\nevent target. This is useful for debugging and diagnostic purposes.\n\n```js\nconst { getEventListeners, EventEmitter } = require('events');\n\n{\n const ee = new EventEmitter();\n const listener = () => console.log('Events are fun');\n ee.on('foo', listener);\n getEventListeners(ee, 'foo'); // [listener]\n}\n{\n const et = new EventTarget();\n const listener = () => console.log('Events are fun');\n et.addEventListener('foo', listener);\n getEventListeners(et, 'foo'); // [listener]\n}\n```", + "see": [], + "scope": "static", + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "emitter", + "optional": false, + "type": [ + [ + [ + "EventEmitter", + " | " + ], + [ + "DOMEventTarget" + ] + ] + ] + }, + { + "name": "name", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Function", + ">" + ] + ] + ], + "meta": { + "line": 270, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "listenerCount", + "description": "A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.", + "extendDescription": "```js\nconst { EventEmitter, listenerCount } = require('events');\nconst myEmitter = new EventEmitter();\nmyEmitter.on('event', () => {});\nmyEmitter.on('event', () => {});\nconsole.log(listenerCount(myEmitter, 'event'));\n// Prints: 2\n```", + "see": [], + "scope": "static", + "examples": [], + "abstract": false, + "deprecated": true, + "emits": [], + "params": [ + { + "name": "emitter", + "description": "The emitter to query", + "optional": false, + "type": [ + [ + [ + "EventEmitter" + ] + ] + ] + }, + { + "name": "eventName", + "description": "The event name", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 242, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "on", + "description": "```js\nconst { on, EventEmitter } = require('events');", + "extendDescription": "(async () => {\n const ee = new EventEmitter();\n\n // Emit later on\n process.nextTick(() => {\n ee.emit('foo', 'bar');\n ee.emit('foo', 42);\n });\n\n for await (const event of on(ee, 'foo')) {\n // The execution of this inner block is synchronous and it\n // processes one event at a time (even with await). Do not use\n // if concurrent execution is required.\n console.log(event); // prints ['bar'] [42]\n }\n // Unreachable here\n})();\n```\n\nReturns an `AsyncIterator` that iterates `eventName` events. It will throw\nif the `EventEmitter` emits `'error'`. It removes all listeners when\nexiting the loop. The `value` returned by each iteration is an array\ncomposed of the emitted event arguments.\n\nAn `AbortSignal` can be used to cancel waiting on events:\n\n```js\nconst { on, EventEmitter } = require('events');\nconst ac = new AbortController();\n\n(async () => {\n const ee = new EventEmitter();\n\n // Emit later on\n process.nextTick(() => {\n ee.emit('foo', 'bar');\n ee.emit('foo', 42);\n });\n\n for await (const event of on(ee, 'foo', { signal: ac.signal })) {\n // The execution of this inner block is synchronous and it\n // processes one event at a time (even with await). Do not use\n // if concurrent execution is required.\n console.log(event); // prints ['bar'] [42]\n }\n // Unreachable here\n})();\n\nprocess.nextTick(() => ac.abort());\n```", + "see": [], + "scope": "static", + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "emitter", + "optional": false, + "type": [ + [ + [ + "EventEmitter" + ] + ] + ] + }, + { + "name": "eventName", + "description": "The name of the event being listened for", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "StaticEventEmitterOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "AsyncIterableIterator", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "returnsDescription": "that iterates `eventName` events emitted by the `emitter`", + "meta": { + "line": 221, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "once", + "description": "Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given\nevent or that is rejected if the `EventEmitter` emits `'error'` while waiting.\nThe `Promise` will resolve with an array of all the arguments emitted to the\ngiven event.", + "extendDescription": "This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event\nsemantics and does not listen to the `'error'` event.\n\n```js\nconst { once, EventEmitter } = require('events');\n\nasync function run() {\n const ee = new EventEmitter();\n\n process.nextTick(() => {\n ee.emit('myevent', 42);\n });\n\n const [value] = await once(ee, 'myevent');\n console.log(value);\n\n const err = new Error('kaboom');\n process.nextTick(() => {\n ee.emit('error', err);\n });\n\n try {\n await once(ee, 'myevent');\n } catch (err) {\n console.log('error happened', err);\n }\n}\n\nrun();\n```\n\nThe special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the\n'`error'` event itself, then it is treated as any other kind of event without\nspecial handling:\n\n```js\nconst { EventEmitter, once } = require('events');\n\nconst ee = new EventEmitter();\n\nonce(ee, 'error')\n .then(([err]) => console.log('ok', err.message))\n .catch((err) => console.log('error', err.message));\n\nee.emit('error', new Error('boom'));\n\n// Prints: ok boom\n```\n\nAn `AbortSignal` can be used to cancel waiting for the event:\n\n```js\nconst { EventEmitter, once } = require('events');\n\nconst ee = new EventEmitter();\nconst ac = new AbortController();\n\nasync function foo(emitter, event, signal) {\n try {\n await once(emitter, event, { signal });\n console.log('event emitted!');\n } catch (error) {\n if (error.name === 'AbortError') {\n console.error('Waiting for the event was canceled!');\n } else {\n console.error('There was an error', error.message);\n }\n }\n}\n\nfoo(ee, 'foo', ac.signal);\nac.abort(); // Abort waiting for the event\nee.emit('foo'); // Prints: Waiting for the event was canceled!\n```", + "see": [], + "scope": "static", + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "emitter", + "optional": false, + "type": [ + [ + [ + "NodeEventTarget" + ] + ] + ] + }, + { + "name": "eventName", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "options", + "optional": true, + "type": [ + [ + [ + "StaticEventEmitterOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "any", + ">>" + ] + ] + ], + "meta": { + "line": 157, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "setMaxListeners", + "description": "By default `EventEmitter`s will print a warning if more than `10` listeners are\nadded for a particular event. This is a useful default that helps finding\nmemory leaks. The `EventEmitter.setMaxListeners()` method allows the default limit to be\nmodified (if eventTargets is empty) or modify the limit specified in every `EventTarget` | `EventEmitter` passed as arguments.\nThe value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.", + "extendDescription": "```js\nEventEmitter.setMaxListeners(20);\n// Equivalent to\nEventEmitter.defaultMaxListeners = 20;\n\nconst eventTarget = new EventTarget();\n// Only way to increase limit for `EventTarget` instances\n// as these doesn't expose its own `setMaxListeners` method\nEventEmitter.setMaxListeners(20, eventTarget);\n```", + "see": [], + "scope": "static", + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "n", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "eventTargets", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "EventEmitter", + " | " + ], + [ + "DOMEventTarget", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 290, + "file": "events.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "use", + "scope": "static", + "params": [ + { + "name": "plugin", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Plugin", + ")" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "SapphireClient", + ")" + ] + ] + ], + "meta": { + "line": 347, + "file": "SapphireClient.ts", + "path": "src/lib" + } + } + ], + "meta": { + "line": 202, + "file": "SapphireClient.ts", + "path": "src/lib" + } + }, + { + "name": "Store", + "description": "The store class which contains {@link Piece}s.", + "extends": [ + "Collection" + ], + "construct": { + "name": "constructor", + "params": [ + { + "name": "constructor", + "description": "The piece constructor this store loads.", + "optional": false, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "options", + "description": "The options for the store.", + "optional": false, + "type": [ + [ + [ + "StoreOptions", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 289, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + "props": [ + { + "name": "Constructor", + "readonly": true, + "type": [ + [ + [ + "Constructor", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 281, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hydrateModuleData", + "description": "Adds the final module data properties.", + "see": [], + "access": "private", + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "any" + ] + ] + ], + "meta": { + "line": 352, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadPath", + "description": "Loads a directory into the store.", + "see": [], + "access": "private", + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "any" + ] + ] + ], + "meta": { + "line": 358, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 282, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "paths", + "readonly": true, + "type": [ + [ + [ + "Set", + "<" + ], + [ + "string", + ">" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "strategy", + "readonly": true, + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 284, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "walk", + "description": "Retrieves all possible pieces.", + "see": [], + "access": "private", + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "any" + ] + ] + ], + "meta": { + "line": 364, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "defaultStrategy", + "description": "The default strategy, defaults to {@link LoaderStrategy}, which is constructed on demand when a store is constructed,\nwhen none was set beforehand.", + "scope": "static", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "any", + ">" + ] + ] + ], + "meta": { + "line": 369, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "logger", + "description": "The default logger, defaults to `null`.", + "scope": "static", + "type": [ + [ + [ + "null", + " | " + ], + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 373, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "container", + "description": "A reference to the {@link Container} object for ease of use.", + "see": [ + "container" + ], + "readonly": true, + "abstract": false, + "deprecated": false, + "type": [ + [ + [ + "Container" + ] + ] + ], + "meta": { + "line": 294, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "T", + "]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "construct", + "description": "Constructs a {@link Piece} instance.", + "params": [ + { + "name": "Ctor", + "description": "The {@link Piece}'s constructor used to build the instance.", + "optional": false, + "type": [ + [ + [ + "ILoaderResultEntry", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "data", + "description": "The module's information", + "optional": false, + "type": [ + [ + [ + "HydratedModuleData" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "returnsDescription": "An instance of the constructed piece.", + "meta": { + "line": 345, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + " | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "string", + ", " + ], + [ + "T", + "]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "has", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "insert", + "description": "Inserts a piece into the store.", + "params": [ + { + "name": "piece", + "description": "The piece to be inserted into the store.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "returnsDescription": "The inserted piece.", + "meta": { + "line": 338, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads one or more pieces from a path.", + "params": [ + { + "name": "root", + "description": "The root directory the file is from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path of the file to load, relative to the `root`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "T", + ">>" + ] + ] + ], + "returnsDescription": "All the loaded pieces.", + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "loadAll", + "description": "Loads all pieces from all directories specified by {@link paths}.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 326, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "T", + ">, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "string", + ", " + ], + [ + "K2", + ">, " + ], + [ + "T", + ">]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "T" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "string" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "registerPath", + "description": "Registers a directory into the store.", + "see": [], + "examples": [ + "```typescript\nstore\n .registerPath(resolve('commands'))\n .registerPath(resolve('third-party', 'commands'));\n```" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "path", + "description": "The path to be added.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 305, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "resolve", + "description": "Resolves a piece by its name or its instance.", + "params": [ + { + "name": "name", + "description": "The name of the piece or the instance itself.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "returnsDescription": "The resolved piece.", + "meta": { + "line": 332, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "string", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "T", + ", " + ], + [ + "key", + ": " + ], + [ + "string", + ", " + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "Store", + "<" + ], + [ + "T", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "unload", + "description": "Unloads a piece given its instance or its name.", + "params": [ + { + "name": "name", + "description": "The name of the file to load.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "returnsDescription": "Returns the piece that was unloaded.", + "meta": { + "line": 318, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "unloadAll", + "description": "Unloads all pieces from the store.", + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "Array", + "<" + ], + [ + "T", + ">>" + ] + ] + ], + "meta": { + "line": 322, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "meta": { + "line": 280, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "StoreRegistry", + "description": "A strict-typed store registry. This is available in {@link container}.", + "see": [], + "extends": [ + "Collection" + ], + "examples": [ + "```typescript\n// Adding new stores\n\n// Register the store:\ncontainer.stores.register(new RouteStore());\n\n// Augment Sapphire to add the new store, in case of a JavaScript\n// project, this can be moved to an `Augments.d.ts` (or any other name)\n// file somewhere:\ndeclare module '@sapphire/pieces' {\n export interface StoreRegistryEntries {\n routes: RouteStore;\n }\n}\n```" + ], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "params": [ + { + "name": "entries", + "optional": true, + "type": [ + [ + [ + "null", + " | " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "readonly", + " [" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + "]>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ] + }, + "props": [ + { + "name": "[toStringTag]", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 135, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "constructor", + "type": [ + [ + [ + "CollectionConstructor" + ] + ] + ], + "meta": { + "line": 21, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "size", + "readonly": true, + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 28, + "file": "lib.es2015.collection.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "[species]", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "MapConstructor" + ] + ] + ], + "meta": { + "line": 317, + "file": "lib.es2015.symbol.wellknown.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "default", + "scope": "static", + "readonly": true, + "type": [ + [ + [ + "(" + ], + [ + "typeof", + " " + ], + [ + "Collection", + ")" + ] + ] + ], + "meta": { + "line": 28, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + } + ], + "methods": [ + { + "name": "[iterator]", + "description": "Returns an iterable of entries in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + "]>" + ] + ] + ] + }, + { + "name": "at", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the item at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the element to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Value" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "clear", + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "clone", + "description": "Creates an identical shallow copy of this collection.", + "see": [], + "examples": [ + "const newColl = someColl.clone();" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">" + ] + ] + ], + "meta": { + "line": 320, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "concat", + "description": "Combines this collection with others into a new collection. None of the source collections are modified.", + "see": [], + "examples": [ + "const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "collections", + "description": "Collections to merge", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "ReadonlyCollection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">>" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">" + ] + ] + ], + "meta": { + "line": 329, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "delete", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "deregister", + "description": "Deregisters a store.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "store", + "description": "The store to deregister.", + "optional": false, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 553, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "difference", + "description": "The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + " | " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 363, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "each", + "description": "Identical to\n[Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),\nbut returns the collection instead of undefined.", + "see": [], + "examples": [ + "collection\n .each(user => console.log(user.username))\n .filter(user => user.bot)\n .each(user => console.log(user.username));" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute for each element", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 298, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "ensure", + "description": "Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.", + "see": [], + "examples": [ + "collection.ensure(guildId, () => defaultGuildConfig);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "key", + "description": "The key to get if it exists, or set otherwise", + "optional": false, + "type": [ + [ + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ] + }, + { + "name": "defaultValueGenerator", + "description": "A function that generates the default value", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "Value" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Value" + ] + ] + ], + "meta": { + "line": 38, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "entries", + "description": "Returns an iterable of key, value pairs for every entry in the map.", + "returns": [ + [ + [ + "IterableIterator", + "<[" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + "]>" + ] + ] + ] + }, + { + "name": "equals", + "description": "Checks if this collection shares identical items with another.\nThis is different to checking for equality using equal-signs, because\nthe collections may be different objects, but contain the same data.", + "params": [ + { + "name": "collection", + "description": "Collection to compare with", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "Whether the collections have identical contents", + "meta": { + "line": 339, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "every", + "description": "Checks if all items passes a test. Identical in behavior to\n[Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).", + "see": [], + "examples": [ + "collection.every(user => !user.bot);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "this", + " " + ], + [ + "is", + " " + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Value", + ">" + ] + ] + ], + "meta": { + "line": 266, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "filter", + "description": "Identical to\n[Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\nbut returns a Collection instead of an Array.", + "see": [], + "examples": [ + "collection.filter(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Value", + ">" + ] + ] + ], + "meta": { + "line": 186, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "find", + "description": "Searches for a single item where the given function returns a truthy value. This behaves like\n[Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\nAll collections used in Discord.js are mapped using their `id` property, and if you want to find by id you\nshould use the `get` method. See\n[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.", + "see": [], + "examples": [ + "collection.find(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "value", + " " + ], + [ + "is", + " " + ], + [ + "V2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "V2" + ] + ] + ], + "meta": { + "line": 146, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "findKey", + "description": "Searches for the key of a single item where the given function returns a truthy value. This behaves like\n[Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),\nbut returns the key rather than the positional index.", + "see": [], + "examples": [ + "collection.findKey(user => user.username === 'Bob');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "The function to test with (should return boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "K2" + ] + ] + ], + "meta": { + "line": 161, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "first", + "description": "Obtains the first value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Value" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the end if amount is negative", + "meta": { + "line": 62, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "firstKey", + "description": "Obtains the first key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the end if\namount is negative", + "meta": { + "line": 72, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "flatMap", + "description": "Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to\n[Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).", + "see": [], + "examples": [ + "collection.flatMap(guild => guild.members.cache);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces a new Collection", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 218, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "forEach", + "params": [ + { + "name": "callbackfn", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "map", + ": " + ], + [ + "Map", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "thisArg", + "optional": true, + "type": [ + [ + [ + "any" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + }, + { + "name": "get", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistryEntries", + "[" + ], + [ + "K", + "]" + ] + ] + ] + }, + { + "name": "has", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "true" + ] + ] + ] + }, + { + "name": "hasAll", + "description": "Checks if all of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if all of the elements exist, `false` if at least one does not exist.", + "meta": { + "line": 46, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "hasAny", + "description": "Checks if any of the elements exist in the collection.", + "params": [ + { + "name": "keys", + "description": "The keys of the elements to check for", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "returnsDescription": "`true` if any of the elements exist, `false` if none exist.", + "meta": { + "line": 54, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "intersect", + "description": "The intersect method returns a new structure containing items where the keys and values are present in both original structures.", + "params": [ + { + "name": "other", + "description": "The other Collection to filter against", + "optional": false, + "type": [ + [ + [ + "ReadonlyCollection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 357, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keyAt", + "description": "Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).\nReturns the key at a given index, allowing for positive and negative integers.\nNegative integers count back from the last item in the collection.", + "params": [ + { + "name": "index", + "description": "The index of the key to obtain", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ], + "meta": { + "line": 109, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "keys", + "description": "Returns an iterable of keys in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ">" + ] + ] + ] + }, + { + "name": "last", + "description": "Obtains the last value(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Value" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values, starting from the start if\namount is negative", + "meta": { + "line": 82, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "lastKey", + "description": "Obtains the last key(s) in this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array of keys, starting from the start if\namount is negative", + "meta": { + "line": 92, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "load", + "description": "Loads all the registered stores.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "returns": [ + [ + [ + "Promise", + "<" + ], + [ + "void", + ">" + ] + ] + ], + "meta": { + "line": 516, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "map", + "description": "Maps each item to another value into an array. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.map(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new array, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 230, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "mapValues", + "description": "Maps each item to another value into a collection. Identical in behavior to\n[Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).", + "see": [], + "examples": [ + "collection.mapValues(user => user.tag);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function that produces an element of the new collection, taking three arguments", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 242, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "partition", + "description": "Partitions the collection into two collections where the first collection\ncontains the items that passed and the second contains the items that failed.", + "see": [], + "examples": [ + "const [big, small] = collection.partition(guild => guild.memberCount > 250);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "key", + " " + ], + [ + "is", + " " + ], + [ + "K2" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "[" + ], + [ + "Collection", + "<" + ], + [ + "K2", + ", " + ], + [ + "Value", + ">, " + ], + [ + "Collection", + "<" + ], + [ + "Exclude", + "<" + ], + [ + "'arguments'", + ", " + ], + [ + "K2", + "> | " + ], + [ + "Exclude", + "<" + ], + [ + "'commands'", + ", " + ], + [ + "K2", + "> | " + ], + [ + "Exclude", + "<" + ], + [ + "'interaction", + "-" + ], + [ + "handlers'", + ", " + ], + [ + "K2", + "> | " + ], + [ + "Exclude", + "<" + ], + [ + "'listeners'", + ", " + ], + [ + "K2", + "> | " + ], + [ + "Exclude", + "<" + ], + [ + "'preconditions'", + ", " + ], + [ + "K2", + ">, " + ], + [ + "Value", + ">]" + ] + ] + ], + "meta": { + "line": 202, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "random", + "description": "Obtains unique random value(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "Value" + ] + ] + ], + "returnsDescription": "A single value if no amount is provided or an array of values", + "meta": { + "line": 117, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "randomKey", + "description": "Obtains unique random key(s) from this collection.", + "returns": [ + [ + [ + "undefined", + " | " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ], + "returnsDescription": "A single key if no amount is provided or an array", + "meta": { + "line": 126, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "reduce", + "description": "Applies a function to produce a single value. Identical in behavior to\n[Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).", + "see": [], + "examples": [ + "collection.reduce((acc, guild) => acc + guild.memberCount, 0);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\nand `collection`", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "accumulator", + ": " + ], + [ + "T", + ", " + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "T" + ] + ] + ] + }, + { + "name": "initialValue", + "description": "Starting value for the accumulator", + "optional": true, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "T" + ] + ] + ], + "meta": { + "line": 283, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "register", + "description": "Registers a store.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "store", + "description": "The store to register.", + "optional": false, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 547, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "registerPath", + "description": "Registers all user directories from the process working directory, the default value is obtained by assuming\nCommonJS (high accuracy) but with fallback for ECMAScript Modules (reads package.json's `main` entry, fallbacks\nto `process.cwd()`).", + "extendDescription": "By default, if you have this folder structure:\n```\n/home/me/my-bot\nβ”œβ”€ src\nβ”‚ β”œβ”€ commands\nβ”‚ β”œβ”€ events\nβ”‚ └─ main.js\n└─ package.json\n```\n\nAnd you run `node src/main.js`, the directories `/home/me/my-bot/src/commands` and `/home/me/my-bot/src/events` will\nbe registered for the commands and events stores respectively, since both directories are located in the same\ndirectory as your main file.\n\n**Note**: this also registers directories for all other stores, even if they don't have a folder, this allows you\nto create new pieces and hot-load them later anytime.", + "see": [], + "examples": [], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "rootDirectory", + "description": "The root directory to register pieces at.", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ], + "meta": { + "line": 541, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + } + }, + { + "name": "reverse", + "description": "Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)\nbut returns a Collection instead of an Array.", + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 132, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "set", + "params": [ + { + "name": "key", + "optional": false, + "type": [ + [ + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries" + ] + ] + ] + }, + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "Value" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ] + }, + { + "name": "some", + "description": "Checks if there exists an item that passes a test. Identical in behavior to\n[Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).", + "see": [], + "examples": [ + "collection.some(user => user.discriminator === '0000');" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "boolean" + ] + ] + ], + "meta": { + "line": 254, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sort", + "description": "The sort method sorts the items of a collection in place and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value, according to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 351, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sorted", + "description": "The sorted method sorts the items of a collection and returns it.\nThe sort is not necessarily stable in Node 10 or older.\nThe default sort order is according to string Unicode code points.", + "see": [], + "examples": [ + "collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "compareFunction", + "description": "Specifies a function that defines the sort order.\nIf omitted, the collection is sorted according to each character's Unicode code point value,\naccording to the string conversion of each element.", + "optional": true, + "type": [ + [ + [ + "Comparator", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Collection", + "<" + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "Value", + ">" + ] + ] + ], + "meta": { + "line": 376, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "sweep", + "description": "Removes items that satisfy the provided filter function.", + "params": [ + { + "name": "fn", + "description": "Function used to test (should return a boolean)", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "value", + ": " + ], + [ + "Value", + ", " + ], + [ + "key", + ": " + ], + [ + "keyof", + " " + ], + [ + "StoreRegistryEntries", + ", " + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "boolean" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "number" + ] + ] + ], + "returnsDescription": "The number of removed entries", + "meta": { + "line": 173, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "tap", + "description": "Runs a function on the collection and returns the collection.", + "see": [], + "examples": [ + "collection\n .tap(coll => console.log(coll.size))\n .filter(user => user.bot)\n .tap(coll => console.log(coll.size))" + ], + "abstract": false, + "deprecated": false, + "emits": [], + "params": [ + { + "name": "fn", + "description": "Function to execute", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "collection", + ": " + ], + [ + "StoreRegistry", + ") => " + ], + [ + "void" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "StoreRegistry" + ] + ] + ], + "meta": { + "line": 312, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "toJSON", + "returns": [ + [ + [ + "Array", + "<" + ], + [ + "Value", + ">" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@discordjs/collection/dist" + } + }, + { + "name": "values", + "description": "Returns an iterable of values in the map", + "returns": [ + [ + [ + "IterableIterator", + "<" + ], + [ + "Value", + ">" + ] + ] + ] + } + ], + "meta": { + "line": 511, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "UserError", + "description": "The UserError class to be emitted in the pieces.", + "see": [], + "extends": [ + "Error" + ], + "examples": [], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "description": "Constructs an UserError.", + "params": [ + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "Options" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "UserError" + ] + ] + ], + "meta": { + "line": 21, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + "props": [ + { + "name": "cause", + "type": [ + [ + [ + "Error" + ] + ] + ], + "meta": { + "line": 26, + "file": "lib.es2022.error.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "context", + "description": "User-provided context.", + "readonly": true, + "type": [ + [ + [ + "unknown" + ] + ] + ], + "meta": { + "line": 14, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "identifier", + "description": "An identifier, useful to localize emitted errors.", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 9, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "message", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1023, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "stack", + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 1024, + "file": "lib.es5.d.ts", + "path": "node_modules/typescript/lib" + } + }, + { + "name": "prepareStackTrace", + "scope": "static", + "type": [ + [ + [ + "(" + ], + [ + "err", + ": " + ], + [ + "Error", + ", " + ], + [ + "stackTraces", + ": " + ], + [ + "Array", + "<" + ], + [ + "CallSite", + ">) => " + ], + [ + "any" + ] + ] + ], + "meta": { + "line": 11, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "stackTraceLimit", + "scope": "static", + "type": [ + [ + [ + "number" + ] + ] + ], + "meta": { + "line": 13, + "file": "globals.d.ts", + "path": "node_modules/@types/node" + } + }, + { + "name": "name", + "readonly": true, + "type": [ + [ + [ + "string" + ] + ] + ], + "meta": { + "line": 28, + "file": "UserError.ts", + "path": "src/lib/errors" + } + } + ], + "methods": [ + { + "name": "captureStackTrace", + "description": "Create .stack property on a target object", + "scope": "static", + "params": [ + { + "name": "targetObject", + "optional": false, + "type": [ + [ + [ + "object" + ] + ] + ] + }, + { + "name": "constructorOpt", + "optional": true, + "type": [ + [ + [ + "Function" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "void" + ] + ] + ] + } + ], + "meta": { + "line": 5, + "file": "UserError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "UserPermissionsPrecondition", + "description": "Constructs a contextful permissions precondition requirement.", + "see": [], + "implements": [ + "PreconditionSingleResolvableDetails<'UserPermissions'>" + ], + "examples": [ + "```typescript\nexport class CoreCommand extends Command {\n public constructor(context: PieceContext) {\n super(context, {\n preconditions: [\n 'GuildOnly',\n new UserPermissionsPrecondition('ADD_REACTIONS')\n ]\n });\n }\n\n public messageRun(message: Message, args: Args) {\n // ...\n }\n}\n```" + ], + "abstract": false, + "deprecated": false, + "construct": { + "name": "constructor", + "description": "Constructs a precondition container entry.", + "params": [ + { + "name": "permissions", + "description": "The permissions that will be required by this command.", + "optional": false, + "type": [ + [ + [ + "PermissionResolvable" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "UserPermissionsPrecondition" + ] + ] + ], + "meta": { + "line": 33, + "file": "UserPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + }, + "props": [ + { + "name": "context", + "description": "The context to be set at {@link PreconditionContainerSingle.context}.", + "type": [ + [ + [ + "{" + ], + [ + "\npermissions", + ": " + ], + [ + "Permissions\n", + "}" + ] + ] + ], + "meta": { + "line": 27, + "file": "UserPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + }, + { + "name": "name", + "description": "The name of the precondition to retrieve from {@link SapphireClient.preconditions}.", + "type": [ + [ + [ + "'UserPermissions'" + ] + ] + ], + "meta": { + "line": 26, + "file": "UserPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + } + ], + "meta": { + "line": 25, + "file": "UserPermissionsPrecondition.ts", + "path": "src/lib/utils/preconditions/containers" + } + } + ], + "typedefs": [ + { + "name": "BucketScope", + "description": "The scope the cooldown applies to.", + "meta": { + "line": 18, + "file": "Enums.ts", + "path": "src/lib/types" + }, + "variant": "enum", + "props": [ + { + "name": "Channel", + "description": "Per channel cooldowns.", + "type": [ + [ + [ + "0" + ] + ] + ] + }, + { + "name": "Global", + "description": "Global cooldowns.", + "type": [ + [ + [ + "1" + ] + ] + ] + }, + { + "name": "Guild", + "description": "Per guild cooldowns.", + "type": [ + [ + [ + "2" + ] + ] + ] + }, + { + "name": "User", + "description": "Per user cooldowns.", + "type": [ + [ + [ + "3" + ] + ] + ] + } + ] + }, + { + "name": "CommandOptionsRunTypeEnum", + "description": "The allowed values for {@link Command.Options.runIn} as an enum.", + "see": [], + "deprecated": false, + "meta": { + "line": 557, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "enum", + "props": [ + { + "name": "Dm", + "type": [ + [ + [ + "\"DM\"" + ] + ] + ] + }, + { + "name": "GuildAny", + "type": [ + [ + [ + "\"GUILD_ANY\"" + ] + ] + ] + }, + { + "name": "GuildNews", + "type": [ + [ + [ + "\"GUILD_NEWS\"" + ] + ] + ] + }, + { + "name": "GuildNewsThread", + "type": [ + [ + [ + "\"GUILD_NEWS_THREAD\"" + ] + ] + ] + }, + { + "name": "GuildPrivateThread", + "type": [ + [ + [ + "\"GUILD_PRIVATE_THREAD\"" + ] + ] + ] + }, + { + "name": "GuildPublicThread", + "type": [ + [ + [ + "\"GUILD_PUBLIC_THREAD\"" + ] + ] + ] + }, + { + "name": "GuildText", + "type": [ + [ + [ + "\"GUILD_TEXT\"" + ] + ] + ] + } + ] + }, + { + "name": "CommandPreConditions", + "description": "The available command pre-conditions.", + "see": [], + "deprecated": false, + "meta": { + "line": 571, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "enum", + "props": [ + { + "name": "ClientPermissions", + "type": [ + [ + [ + "\"ClientPermissions\"" + ] + ] + ] + }, + { + "name": "Cooldown", + "type": [ + [ + [ + "\"Cooldown\"" + ] + ] + ] + }, + { + "name": "DirectMessageOnly", + "type": [ + [ + [ + "\"DMOnly\"" + ] + ] + ] + }, + { + "name": "GuildNewsOnly", + "type": [ + [ + [ + "\"GuildNewsOnly\"" + ] + ] + ] + }, + { + "name": "GuildNewsThreadOnly", + "type": [ + [ + [ + "\"GuildNewsThreadOnly\"" + ] + ] + ] + }, + { + "name": "GuildOnly", + "type": [ + [ + [ + "\"GuildOnly\"" + ] + ] + ] + }, + { + "name": "GuildPrivateThreadOnly", + "type": [ + [ + [ + "\"GuildPrivateThreadOnly\"" + ] + ] + ] + }, + { + "name": "GuildPublicThreadOnly", + "type": [ + [ + [ + "\"GuildPublicThreadOnly\"" + ] + ] + ] + }, + { + "name": "GuildTextOnly", + "type": [ + [ + [ + "\"GuildTextOnly\"" + ] + ] + ] + }, + { + "name": "GuildThreadOnly", + "type": [ + [ + [ + "\"GuildThreadOnly\"" + ] + ] + ] + }, + { + "name": "NotSafeForWork", + "type": [ + [ + [ + "\"NSFW\"" + ] + ] + ] + }, + { + "name": "UserPermissions", + "type": [ + [ + [ + "\"UserPermissions\"" + ] + ] + ] + } + ] + }, + { + "name": "CooldownLevel", + "meta": { + "line": 1, + "file": "Enums.ts", + "path": "src/lib/types" + }, + "variant": "enum", + "props": [ + { + "name": "Author", + "type": [ + [ + [ + "\"author\"" + ] + ] + ] + }, + { + "name": "Channel", + "type": [ + [ + [ + "\"channel\"" + ] + ] + ] + }, + { + "name": "Guild", + "type": [ + [ + [ + "\"guild\"" + ] + ] + ] + } + ] + }, + { + "name": "Identifiers", + "meta": { + "line": 1, + "file": "Identifiers.ts", + "path": "src/lib/errors" + }, + "variant": "enum", + "props": [ + { + "name": "ArgsMissing", + "type": [ + [ + [ + "\"argsMissing\"" + ] + ] + ] + }, + { + "name": "ArgsUnavailable", + "type": [ + [ + [ + "\"argsUnavailable\"" + ] + ] + ] + }, + { + "name": "ArgumentBooleanError", + "type": [ + [ + [ + "\"booleanError\"" + ] + ] + ] + }, + { + "name": "ArgumentChannelError", + "type": [ + [ + [ + "\"channelError\"" + ] + ] + ] + }, + { + "name": "ArgumentDMChannelError", + "type": [ + [ + [ + "\"dmChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentDateError", + "type": [ + [ + [ + "\"dateError\"" + ] + ] + ] + }, + { + "name": "ArgumentDateTooEarly", + "type": [ + [ + [ + "\"dateTooEarly\"" + ] + ] + ] + }, + { + "name": "ArgumentDateTooFar", + "type": [ + [ + [ + "\"dateTooFar\"" + ] + ] + ] + }, + { + "name": "ArgumentEmojiError", + "type": [ + [ + [ + "\"emojiError\"" + ] + ] + ] + }, + { + "name": "ArgumentEnumEmptyError", + "type": [ + [ + [ + "\"enumEmptyError\"" + ] + ] + ] + }, + { + "name": "ArgumentEnumError", + "type": [ + [ + [ + "\"enumError\"" + ] + ] + ] + }, + { + "name": "ArgumentFloatError", + "type": [ + [ + [ + "\"floatError\"" + ] + ] + ] + }, + { + "name": "ArgumentFloatTooLarge", + "type": [ + [ + [ + "\"floatTooLarge\"" + ] + ] + ] + }, + { + "name": "ArgumentFloatTooSmall", + "type": [ + [ + [ + "\"floatTooSmall\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildCategoryChannelError", + "type": [ + [ + [ + "\"categoryChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildChannelError", + "type": [ + [ + [ + "\"guildChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildChannelMissingGuildError", + "type": [ + [ + [ + "\"guildChannelMissingGuildError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildNewsChannelError", + "type": [ + [ + [ + "\"guildNewsChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildNewsThreadChannelError", + "type": [ + [ + [ + "\"guildNewsChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildPrivateThreadChannelError", + "type": [ + [ + [ + "\"guildPrivateThreadChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildPublicThreadChannelError", + "type": [ + [ + [ + "\"guildPublicThreadChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildStageVoiceChannelError", + "type": [ + [ + [ + "\"guildStageVoiceChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildTextChannelError", + "type": [ + [ + [ + "\"guildTextChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildThreadChannelError", + "type": [ + [ + [ + "\"guildThreadChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentGuildVoiceChannelError", + "type": [ + [ + [ + "\"guildVoiceChannelError\"" + ] + ] + ] + }, + { + "name": "ArgumentHyperlinkError", + "type": [ + [ + [ + "\"hyperlinkError\"" + ] + ] + ] + }, + { + "name": "ArgumentIntegerError", + "type": [ + [ + [ + "\"integerError\"" + ] + ] + ] + }, + { + "name": "ArgumentIntegerTooLarge", + "type": [ + [ + [ + "\"integerTooLarge\"" + ] + ] + ] + }, + { + "name": "ArgumentIntegerTooSmall", + "type": [ + [ + [ + "\"integerTooSmall\"" + ] + ] + ] + }, + { + "name": "ArgumentMemberError", + "type": [ + [ + [ + "\"memberError\"" + ] + ] + ] + }, + { + "name": "ArgumentMemberMissingGuild", + "type": [ + [ + [ + "\"memberMissingGuild\"" + ] + ] + ] + }, + { + "name": "ArgumentMessageError", + "type": [ + [ + [ + "\"messageError\"" + ] + ] + ] + }, + { + "name": "ArgumentNumberError", + "type": [ + [ + [ + "\"numberError\"" + ] + ] + ] + }, + { + "name": "ArgumentNumberTooLarge", + "type": [ + [ + [ + "\"numberTooLarge\"" + ] + ] + ] + }, + { + "name": "ArgumentNumberTooSmall", + "type": [ + [ + [ + "\"numberTooSmall\"" + ] + ] + ] + }, + { + "name": "ArgumentRoleError", + "type": [ + [ + [ + "\"roleError\"" + ] + ] + ] + }, + { + "name": "ArgumentRoleMissingGuild", + "type": [ + [ + [ + "\"roleMissingGuild\"" + ] + ] + ] + }, + { + "name": "ArgumentStringTooLong", + "type": [ + [ + [ + "\"stringTooLong\"" + ] + ] + ] + }, + { + "name": "ArgumentStringTooShort", + "type": [ + [ + [ + "\"stringTooShort\"" + ] + ] + ] + }, + { + "name": "ArgumentUserError", + "type": [ + [ + [ + "\"userError\"" + ] + ] + ] + }, + { + "name": "CommandDisabled", + "type": [ + [ + [ + "\"commandDisabled\"" + ] + ] + ] + }, + { + "name": "PreconditionClientPermissions", + "type": [ + [ + [ + "\"preconditionClientPermissions\"" + ] + ] + ] + }, + { + "name": "PreconditionClientPermissionsNoClient", + "type": [ + [ + [ + "\"preconditionClientPermissionsNoClient\"" + ] + ] + ] + }, + { + "name": "PreconditionClientPermissionsNoPermissions", + "type": [ + [ + [ + "\"preconditionClientPermissionsNoPermissions\"" + ] + ] + ] + }, + { + "name": "PreconditionCooldown", + "type": [ + [ + [ + "\"preconditionCooldown\"" + ] + ] + ] + }, + { + "name": "PreconditionDMOnly", + "type": [ + [ + [ + "\"preconditionDmOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionGuildNewsOnly", + "type": [ + [ + [ + "\"preconditionGuildNewsOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionGuildNewsThreadOnly", + "type": [ + [ + [ + "\"preconditionGuildNewsThreadOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionGuildOnly", + "type": [ + [ + [ + "\"preconditionGuildOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionGuildPrivateThreadOnly", + "type": [ + [ + [ + "\"preconditionGuildPrivateThreadOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionGuildPublicThreadOnly", + "type": [ + [ + [ + "\"preconditionGuildPublicThreadOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionGuildTextOnly", + "type": [ + [ + [ + "\"preconditionGuildTextOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionMissingChatInputHandler", + "type": [ + [ + [ + "\"preconditionMissingChatInputHandler\"" + ] + ] + ] + }, + { + "name": "PreconditionMissingContextMenuHandler", + "type": [ + [ + [ + "\"preconditionMissingContextMenuHandler\"" + ] + ] + ] + }, + { + "name": "PreconditionMissingMessageHandler", + "type": [ + [ + [ + "\"preconditionMissingMessageHandler\"" + ] + ] + ] + }, + { + "name": "PreconditionNSFW", + "type": [ + [ + [ + "\"preconditionNsfw\"" + ] + ] + ] + }, + { + "name": "PreconditionThreadOnly", + "type": [ + [ + [ + "\"preconditionThreadOnly\"" + ] + ] + ] + }, + { + "name": "PreconditionUserPermissions", + "type": [ + [ + [ + "\"preconditionUserPermissions\"" + ] + ] + ] + }, + { + "name": "PreconditionUserPermissionsNoPermissions", + "type": [ + [ + [ + "\"preconditionUserPermissionsNoPermissions\"" + ] + ] + ] + } + ] + }, + { + "name": "InteractionHandlerTypes", + "meta": { + "line": 105, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "enum", + "props": [ + { + "name": "Autocomplete", + "type": [ + [ + [ + "\"AUTOCOMPLETE\"" + ] + ] + ] + }, + { + "name": "Button", + "type": [ + [ + [ + "\"BUTTON\"" + ] + ] + ] + }, + { + "name": "MessageComponent", + "type": [ + [ + [ + "\"MESSAGE_COMPONENT\"" + ] + ] + ] + }, + { + "name": "SelectMenu", + "type": [ + [ + [ + "\"SELECT_MENU\"" + ] + ] + ] + } + ] + }, + { + "name": "InternalRegistryAPIType", + "meta": { + "line": 42, + "file": "Enums.ts", + "path": "src/lib/types" + }, + "variant": "enum", + "props": [ + { + "name": "ChatInput", + "type": [ + [ + [ + "0" + ] + ] + ] + }, + { + "name": "ContextMenu", + "type": [ + [ + [ + "1" + ] + ] + ] + } + ] + }, + { + "name": "LogLevel", + "description": "The logger levels for the {@link ILogger}.", + "meta": { + "line": 4, + "file": "ILogger.ts", + "path": "src/lib/utils/logger" + }, + "variant": "enum", + "props": [ + { + "name": "Debug", + "description": "The debug level, used when calling {@link ILogger.debug}.", + "type": [ + [ + [ + "20" + ] + ] + ] + }, + { + "name": "Error", + "description": "The error level, used when calling {@link ILogger.error}.", + "type": [ + [ + [ + "50" + ] + ] + ] + }, + { + "name": "Fatal", + "description": "The critical level, used when calling {@link ILogger.fatal}.", + "type": [ + [ + [ + "60" + ] + ] + ] + }, + { + "name": "Info", + "description": "The info level, used when calling {@link ILogger.info}.", + "type": [ + [ + [ + "30" + ] + ] + ] + }, + { + "name": "None", + "description": "An unknown or uncategorized level.", + "type": [ + [ + [ + "100" + ] + ] + ] + }, + { + "name": "Trace", + "description": "The lowest log level, used when calling {@link ILogger.trace}.", + "type": [ + [ + [ + "10" + ] + ] + ] + }, + { + "name": "Warn", + "description": "The warning level, used when calling {@link ILogger.warn}.", + "type": [ + [ + [ + "40" + ] + ] + ] + } + ] + }, + { + "name": "PluginHook", + "meta": { + "line": 7, + "file": "Enums.ts", + "path": "src/lib/types" + }, + "variant": "enum", + "props": [ + { + "name": "PostInitialization", + "type": [ + [ + [ + "\"postInitialization\"" + ] + ] + ] + }, + { + "name": "PostLogin", + "type": [ + [ + [ + "\"postLogin\"" + ] + ] + ] + }, + { + "name": "PreGenericsInitialization", + "type": [ + [ + [ + "\"preGenericsInitialization\"" + ] + ] + ] + }, + { + "name": "PreInitialization", + "type": [ + [ + [ + "\"preInitialization\"" + ] + ] + ] + }, + { + "name": "PreLogin", + "type": [ + [ + [ + "\"preLogin\"" + ] + ] + ] + } + ] + }, + { + "name": "PreconditionRunCondition", + "description": "The condition for a {@link PreconditionContainerArray}.", + "meta": { + "line": 38, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "enum", + "props": [ + { + "name": "And", + "description": "Defines a condition where all the entries must pass. This uses {@link PreconditionConditionAnd}.", + "type": [ + [ + [ + "0" + ] + ] + ] + }, + { + "name": "Or", + "description": "Defines a condition where at least one entry must pass. This uses {@link PreconditionConditionOr}.", + "type": [ + [ + [ + "1" + ] + ] + ] + } + ] + }, + { + "name": "PreconditionRunMode", + "description": "The run mode for a {@link PreconditionContainerArray}.", + "see": [], + "deprecated": false, + "meta": { + "line": 19, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "enum", + "props": [ + { + "name": "Parallel", + "description": "All entries are run in parallel using `Promise.all`, then the results are processed after all of them have\ncompleted.", + "type": [ + [ + [ + "1" + ] + ] + ] + }, + { + "name": "Sequential", + "description": "The entries are run sequentially, this is the default behaviour and can be slow when doing long asynchronous\ntasks, but is performance savvy.", + "type": [ + [ + [ + "0" + ] + ] + ] + } + ] + }, + { + "name": "RegisterBehavior", + "meta": { + "line": 37, + "file": "Enums.ts", + "path": "src/lib/types" + }, + "variant": "enum", + "props": [ + { + "name": "LogToConsole", + "type": [ + [ + [ + "\"LOG_TO_CONSOLE\"" + ] + ] + ] + }, + { + "name": "Overwrite", + "type": [ + [ + [ + "\"OVERWRITE\"" + ] + ] + ] + } + ] + }, + { + "name": "AliasPieceOptions", + "meta": { + "line": 669, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "ArgOptions", + "meta": { + "line": 722, + "file": "Args.ts", + "path": "src/lib/parsers" + }, + "variant": "interface" + }, + { + "name": "ArgType", + "meta": { + "line": 693, + "file": "Args.ts", + "path": "src/lib/parsers" + }, + "variant": "interface", + "props": [ + { + "name": "boolean", + "optional": false, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "channel", + "optional": false, + "type": [ + [ + [ + "ChannelTypes" + ] + ] + ] + }, + { + "name": "date", + "optional": false, + "type": [ + [ + [ + "Date" + ] + ] + ] + }, + { + "name": "dmChannel", + "optional": false, + "type": [ + [ + [ + "DMChannel" + ] + ] + ] + }, + { + "name": "emoji", + "optional": false, + "type": [ + [ + [ + "EmojiObject" + ] + ] + ] + }, + { + "name": "enum", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "float", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "guildCategoryChannel", + "optional": false, + "type": [ + [ + [ + "CategoryChannel" + ] + ] + ] + }, + { + "name": "guildChannel", + "optional": false, + "type": [ + [ + [ + "GuildBasedChannelTypes" + ] + ] + ] + }, + { + "name": "guildNewsChannel", + "optional": false, + "type": [ + [ + [ + "NewsChannel" + ] + ] + ] + }, + { + "name": "guildNewsThreadChannel", + "optional": false, + "type": [ + [ + [ + "ThreadChannel", + " & {" + ], + [ + "\nparent", + ": " + ], + [ + "null", + " | " + ], + [ + "NewsChannel", + "," + ], + [ + "\ntype", + ": " + ], + [ + "'GUILD", + "_" + ], + [ + "NEWS", + "_" + ], + [ + "THREAD'\n", + "}" + ] + ] + ] + }, + { + "name": "guildPrivateThreadChannel", + "optional": false, + "type": [ + [ + [ + "ThreadChannel", + " & {" + ], + [ + "\nparent", + ": " + ], + [ + "null", + " | " + ], + [ + "TextChannel", + "," + ], + [ + "\ntype", + ": " + ], + [ + "'GUILD", + "_" + ], + [ + "PRIVATE", + "_" + ], + [ + "THREAD'\n", + "}" + ] + ] + ] + }, + { + "name": "guildPublicThreadChannel", + "optional": false, + "type": [ + [ + [ + "ThreadChannel", + " & {" + ], + [ + "\nparent", + ": " + ], + [ + "null", + " | " + ], + [ + "TextChannel", + "," + ], + [ + "\ntype", + ": " + ], + [ + "'GUILD", + "_" + ], + [ + "PUBLIC", + "_" + ], + [ + "THREAD'\n", + "}" + ] + ] + ] + }, + { + "name": "guildStageVoiceChannel", + "optional": false, + "type": [ + [ + [ + "StageChannel" + ] + ] + ] + }, + { + "name": "guildTextChannel", + "optional": false, + "type": [ + [ + [ + "TextChannel" + ] + ] + ] + }, + { + "name": "guildThreadChannel", + "optional": false, + "type": [ + [ + [ + "ThreadChannel" + ] + ] + ] + }, + { + "name": "guildVoiceChannel", + "optional": false, + "type": [ + [ + [ + "VoiceChannel" + ] + ] + ] + }, + { + "name": "hyperlink", + "optional": false, + "type": [ + [ + [ + "URL" + ] + ] + ] + }, + { + "name": "integer", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "member", + "optional": false, + "type": [ + [ + [ + "GuildMember" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "number", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "role", + "optional": false, + "type": [ + [ + [ + "Role" + ] + ] + ] + }, + { + "name": "string", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "url", + "optional": false, + "type": [ + [ + [ + "URL" + ] + ] + ] + }, + { + "name": "user", + "optional": false, + "type": [ + [ + [ + "User" + ] + ] + ] + } + ] + }, + { + "name": "ArgsNextCallback", + "description": "The value to be mapped.", + "meta": { + "line": 735, + "file": "Args.ts", + "path": "src/lib/parsers" + }, + "variant": "interface", + "params": [ + { + "name": "value", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Maybe", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "ArgumentContext", + "meta": { + "line": 90, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "Args" + ] + ] + ] + }, + { + "name": "argument", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "commandContext", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "inclusive", + "optional": true, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "maximum", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "minimum", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + } + ] + }, + { + "name": "ArgumentOptions", + "meta": { + "line": 88, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "AutocompleteCommandContext", + "meta": { + "line": 813, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "commandId", + "description": "The id of the command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "commandName", + "description": "The name of the command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "AutocompleteInteractionPayload", + "meta": { + "line": 520, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "AutocompleteCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "AutocompleteCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "AutocompleteInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandAcceptedPayload", + "meta": { + "line": 453, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandContext", + "meta": { + "line": 791, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "commandId", + "description": "The id of the command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "commandName", + "description": "The name of the command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandDeniedPayload", + "meta": { + "line": 449, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandErrorPayload", + "meta": { + "line": 466, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandFinishPayload", + "meta": { + "line": 457, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandRunPayload", + "meta": { + "line": 455, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ChatInputCommandSuccessPayload", + "meta": { + "line": 461, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "result", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + } + ] + }, + { + "name": "ClientLoggerOptions", + "meta": { + "line": 353, + "file": "SapphireClient.ts", + "path": "src/lib" + }, + "variant": "interface", + "props": [ + { + "name": "instance", + "optional": true, + "type": [ + [ + [ + "ILogger" + ] + ] + ] + }, + { + "name": "level", + "optional": true, + "type": [ + [ + [ + "LogLevel" + ] + ] + ] + } + ] + }, + { + "name": "CommandChatInputRegisterShortcut", + "meta": { + "line": 733, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "behaviorWhenNotIdentical", + "description": "Specifies what we should do when the command is present, but not identical with the data you provided", + "optional": true, + "default": "RegisterBehavior.LogToConsole", + "type": [ + [ + [ + "RegisterBehavior" + ] + ] + ] + }, + { + "name": "defaultPermission", + "description": "Sets the `defaultPermission` field for the chat input command", + "optional": true, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "guildIds", + "description": "If this is specified, the application commands will only be registered for these guild ids.", + "optional": true, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "idHints", + "description": "Specifies a list of command ids that we should check in the event of a name mismatch", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "register", + "description": "If we should register the command, be it missing or present already", + "optional": false, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ] + }, + { + "name": "CommandDoesNotHaveChatInputCommandHandlerPayload", + "meta": { + "line": 434, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "CommandDoesNotHaveContextMenuCommandHandlerPayload", + "meta": { + "line": 475, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "CommandDoesNotHaveMessageCommandHandler", + "meta": { + "line": 382, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">" + ] + ] + ] + }, + { + "name": "commandPrefix", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "prefix", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "RegExp" + ] + ] + ] + } + ] + }, + { + "name": "CommandJSON", + "meta": { + "line": 824, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "aliases", + "optional": false, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "category", + "optional": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ] + }, + { + "name": "description", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "detailedDescription", + "optional": false, + "type": [ + [ + [ + "DetailedDescriptionCommand" + ] + ] + ] + }, + { + "name": "enabled", + "optional": false, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "location", + "optional": false, + "type": [ + [ + [ + "PieceLocationJSON" + ] + ] + ] + }, + { + "name": "name", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "AliasPieceOptions" + ] + ] + ] + } + ] + }, + { + "name": "CommandOptions", + "description": "The {@link Command} options.", + "see": [], + "deprecated": false, + "meta": { + "line": 590, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "chatInputCommand", + "description": "Shortcuts for registering simple chat input commands", + "optional": true, + "type": [ + [ + [ + "CommandChatInputRegisterShortcut" + ] + ] + ] + }, + { + "name": "cooldownDelay", + "description": "The time in milliseconds for the cooldown entries to reset, if set to a non-zero value alongside {@link Command.Options.cooldownLimit}, the `Cooldown` precondition will be added to the list.", + "optional": true, + "default": "0", + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "cooldownFilteredUsers", + "description": "The users that are exempt from the Cooldown precondition.\nUse this to filter out someone like a bot owner", + "optional": true, + "default": "undefined", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "cooldownLimit", + "description": "The amount of entries the cooldown can have before filling up, if set to a non-zero value alongside {@link Command.Options.cooldownDelay}, the `Cooldown` precondition will be added to the list.", + "optional": true, + "default": "1", + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "cooldownScope", + "description": "The scope of the cooldown entries.", + "optional": true, + "default": "BucketScope.User", + "type": [ + [ + [ + "BucketScope" + ] + ] + ] + }, + { + "name": "description", + "description": "The description for the command.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "detailedDescription", + "description": "The detailed description for the command.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "DetailedDescriptionCommand" + ] + ] + ] + }, + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "flags", + "description": "The accepted flags. Flags are key-only identifiers that can be placed anywhere in the command. Two different types are accepted:\n* An array of strings, e.g. [`silent`].\n* A boolean defining whether the strategy should accept all keys (`true`) or none at all (`false`).", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "boolean", + " | " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "fullCategory", + "description": "The full category path for the command", + "optional": true, + "default": "'An array of folder names that lead back to the folder that is registered for in the commands store'", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "generateDashLessAliases", + "description": "Whether to add aliases for commands with dashes in them", + "optional": true, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "generateUnderscoreLessAliases", + "description": "Whether to add aliases for commands with underscores in them", + "optional": true, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "nsfw", + "description": "Sets whether or not the command should be treated as NSFW. If set to true, the `NSFW` precondition will be added to the list.", + "optional": true, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "options", + "description": "The accepted options. Options are key-value identifiers that can be placed anywhere in the command. Two different types are accepted:\n* An array of strings, e.g. [`silent`].\n* A boolean defining whether the strategy should accept all keys (`true`) or none at all (`false`).", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "boolean", + " | " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "preconditions", + "description": "The {@link Precondition}s to be run, accepts an array of their names.", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "PreconditionEntryResolvable", + ">" + ] + ] + ] + }, + { + "name": "prefixes", + "description": "The prefixes for both flags and options.", + "optional": true, + "default": "['--', '-', 'β€”']", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "quotes", + "description": "The quotes accepted by this command, pass `[]` to disable them.", + "optional": true, + "default": "[\n ['\"', '\"'], // Double quotes\n ['β€œ', '”'], // Fancy quotes (on iOS)\n ['γ€Œ', '」'] // Corner brackets (CJK)\n ['Β«', 'Β»'] // French quotes (guillemets)\n]", + "type": [ + [ + [ + "Array", + "<[" + ], + [ + "string", + ", " + ], + [ + "string", + "]>" + ] + ] + ] + }, + { + "name": "requiredClientPermissions", + "description": "The required permissions for the client.", + "optional": true, + "default": "0", + "type": [ + [ + [ + "PermissionResolvable" + ] + ] + ] + }, + { + "name": "requiredUserPermissions", + "description": "The required permissions for the user.", + "optional": true, + "default": "0", + "type": [ + [ + [ + "PermissionResolvable" + ] + ] + ] + }, + { + "name": "runIn", + "description": "The channels the command should run in. If set to `null`, no precondition entry will be added. Some optimizations are applied when given an array to reduce the amount of preconditions run (e.g. `'GUILD_TEXT'` and `'GUILD_NEWS'` becomes `'GUILD_ANY'`, and if both `'DM'` and `'GUILD_ANY'` are defined, then no precondition entry is added as it runs in all channels).", + "optional": true, + "default": "null", + "type": [ + [ + [ + "null", + " | " + ], + [ + "CommandOptionsRunType", + " | " + ], + [ + "CommandOptionsRunTypeEnum", + " | " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "CommandOptionsRunType", + " | " + ], + [ + "CommandOptionsRunTypeEnum", + ">" + ] + ] + ] + }, + { + "name": "separators", + "description": "The flag separators.", + "optional": true, + "default": "['=', ':']", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "typing", + "description": "If {@link SapphireClient.typing} is true, this option will override it.\nOtherwise, this option has no effect - you may call {@link Channel#sendTyping}` in the run method if you want specific commands to display the typing status.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandAcceptedPayload", + "meta": { + "line": 494, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandContext", + "meta": { + "line": 802, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "commandId", + "description": "The id of the command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "commandName", + "description": "The name of the command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandDeniedPayload", + "meta": { + "line": 490, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandErrorPayload", + "meta": { + "line": 507, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandFinishPayload", + "meta": { + "line": 498, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandRunPayload", + "meta": { + "line": 496, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ContextMenuCommandSuccessPayload", + "meta": { + "line": 502, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + }, + { + "name": "result", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + } + ] + }, + { + "name": "CooldownOptions", + "meta": { + "line": 358, + "file": "SapphireClient.ts", + "path": "src/lib" + }, + "variant": "interface", + "props": [ + { + "name": "delay", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "filteredCommands", + "optional": true, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "filteredUsers", + "optional": true, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "limit", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "scope", + "optional": true, + "type": [ + [ + [ + "BucketScope" + ] + ] + ] + } + ] + }, + { + "name": "DetailedDescriptionCommandObject", + "meta": { + "line": 846, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface" + }, + { + "name": "Err", + "see": [], + "deprecated": false, + "meta": { + "line": 26, + "file": "Lexure.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "error", + "description": "The resulting error, which only exists on an Err.", + "optional": false, + "type": [ + [ + [ + "E" + ] + ] + ] + }, + { + "name": "success", + "description": "If this an Err, this is false.", + "optional": false, + "type": [ + [ + [ + "false" + ] + ] + ] + }, + { + "name": "value", + "optional": true, + "type": [ + [ + [ + "undefined" + ] + ] + ] + } + ] + }, + { + "name": "ExtendedArgumentContext", + "see": [], + "deprecated": true, + "meta": { + "line": 86, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "Args" + ] + ] + ] + }, + { + "name": "argument", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "unknown", + ">" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "commandContext", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "inclusive", + "optional": true, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "maximum", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "minimum", + "optional": true, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "parameter", + "description": "The canonical parameter specified by the user in the command, as\na string, equivalent to the first parameter of {@link Argument#run}.\nThis allows {@link ExtendedArgument#handle} to access the original\nargument, which is useful for returning {@link Argument#error} so\nthat you don't have to convert the parsed argument back into a\nstring.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "ExtendedArgumentOptions", + "see": [], + "deprecated": true, + "meta": { + "line": 75, + "file": "ExtendedArgument.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "aliases", + "description": "The aliases for the piece.", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "baseArgument", + "description": "The name of the underlying argument whose value is used to compute\nthe extended argument value; see {@link ArgType} for valid keys.", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + }, + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "IArgument", + "meta": { + "line": 20, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "name", + "description": "The name of the argument, this is used to make the identification of an argument easier.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "run", + "description": "The method which is called when invoking the argument.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "parameter", + ": " + ], + [ + "string", + ", " + ], + [ + "context", + ": " + ], + [ + "Context", + "<" + ], + [ + "T", + ">) => " + ], + [ + "Result", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ] + }, + { + "name": "IChatInputCommandPayload", + "meta": { + "line": 440, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "IContextMenuCommandPayload", + "meta": { + "line": 481, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "IInteractionHandlerPayload", + "meta": { + "line": 511, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "handler", + "optional": false, + "type": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "Interaction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ILogger", + "meta": { + "line": 41, + "file": "ILogger.ts", + "path": "src/lib/utils/logger" + }, + "variant": "interface", + "props": [ + { + "name": "debug", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Debug} as level.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "error", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Error} as level.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "fatal", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Fatal} as level.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "has", + "description": "Checks whether a level is supported.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "level", + ": " + ], + [ + "LogLevel", + ") => " + ], + [ + "boolean" + ] + ] + ] + }, + { + "name": "info", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Info} as level.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "trace", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Trace} as level.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "warn", + "description": "Alias of {@link ILogger.write} with {@link LogLevel.Warn} as level.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + }, + { + "name": "write", + "description": "Writes the log message given a level and the value(s).", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "level", + ": " + ], + [ + "LogLevel", + ", " + ], + [ + "values", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "unknown", + ">) => " + ], + [ + "void" + ] + ] + ] + } + ] + }, + { + "name": "IMessageCommandPayload", + "meta": { + "line": 393, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + } + ] + }, + { + "name": "IPieceError", + "meta": { + "line": 368, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "piece", + "optional": false, + "type": [ + [ + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">" + ] + ] + ] + } + ] + }, + { + "name": "IPreconditionCondition", + "description": "Defines the condition for {@link PreconditionContainerArray}s to run.", + "see": [], + "deprecated": false, + "meta": { + "line": 10, + "file": "IPreconditionCondition.ts", + "path": "src/lib/utils/preconditions/conditions" + }, + "variant": "interface", + "props": [ + { + "name": "chatInputParallel", + "description": "Runs all the containers using `Promise.all`, then checks the results once all tasks finished running.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "interaction", + ": " + ], + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">, " + ], + [ + "command", + ": " + ], + [ + "ChatInputCommand", + ", " + ], + [ + "entries", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "chatInputSequential", + "description": "Runs the containers one by one.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "interaction", + ": " + ], + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">, " + ], + [ + "command", + ": " + ], + [ + "ChatInputCommand", + ", " + ], + [ + "entries", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "contextMenuParallel", + "description": "Runs all the containers using `Promise.all`, then checks the results once all tasks finished running.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "interaction", + ": " + ], + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">, " + ], + [ + "command", + ": " + ], + [ + "ContextMenuCommand", + ", " + ], + [ + "entries", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "contextMenuSequential", + "description": "Runs the containers one by one.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "interaction", + ": " + ], + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">, " + ], + [ + "command", + ": " + ], + [ + "ContextMenuCommand", + ", " + ], + [ + "entries", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "messageParallel", + "description": "Runs all the containers using `Promise.all`, then checks the results once all tasks finished running.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "message", + ": " + ], + [ + "Message", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "command", + ": " + ], + [ + "MessageCommand", + ", " + ], + [ + "entries", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "messageSequential", + "description": "Runs the containers one by one.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "message", + ": " + ], + [ + "Message", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "command", + ": " + ], + [ + "MessageCommand", + ", " + ], + [ + "entries", + ": " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "IPreconditionContainer", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + } + ] + }, + { + "name": "IPreconditionContainer", + "description": "An abstracted precondition container to be implemented by classes.", + "see": [], + "deprecated": false, + "meta": { + "line": 30, + "file": "IPreconditionContainer.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "interface", + "props": [ + { + "name": "chatInputRun", + "description": "Runs a precondition container.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "interaction", + ": " + ], + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">, " + ], + [ + "command", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "contextMenuRun", + "description": "Runs a precondition container.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "interaction", + ": " + ], + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">, " + ], + [ + "command", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + }, + { + "name": "messageRun", + "description": "Runs a precondition container.", + "optional": false, + "type": [ + [ + [ + "(" + ], + [ + "message", + ": " + ], + [ + "Message", + "<" + ], + [ + "boolean", + ">, " + ], + [ + "command", + ": " + ], + [ + "Command", + "<" + ], + [ + "Args", + ", " + ], + [ + "CommandOptions", + ">, " + ], + [ + "context", + ": " + ], + [ + "PreconditionContext", + ") => " + ], + [ + "PreconditionContainerReturn" + ] + ] + ] + } + ] + }, + { + "name": "InteractionHandlerError", + "meta": { + "line": 518, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "handler", + "optional": false, + "type": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "Interaction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "InteractionHandlerJSON", + "meta": { + "line": 93, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "enabled", + "optional": false, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "interactionHandlerType", + "optional": false, + "type": [ + [ + [ + "InteractionHandlerTypes" + ] + ] + ] + }, + { + "name": "location", + "optional": false, + "type": [ + [ + [ + "PieceLocationJSON" + ] + ] + ] + }, + { + "name": "name", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "PieceOptions" + ] + ] + ] + } + ] + }, + { + "name": "InteractionHandlerOptions", + "meta": { + "line": 86, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "interactionHandlerType", + "description": "The type of interaction this handler is for. Must be one of {@link InteractionHandlerTypes}.", + "optional": false, + "type": [ + [ + [ + "InteractionHandlerTypes" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "InteractionHandlerParseError", + "meta": { + "line": 516, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "handler", + "optional": false, + "type": [ + [ + [ + "InteractionHandler", + "<" + ], + [ + "InteractionHandlerOptions", + ">" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "Interaction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ListenerErrorPayload", + "meta": { + "line": 372, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "piece", + "optional": false, + "type": [ + [ + [ + "Listener", + "<" + ], + [ + "''", + ", " + ], + [ + "ListenerOptions", + ">" + ] + ] + ] + } + ] + }, + { + "name": "ListenerJSON", + "meta": { + "line": 122, + "file": "Listener.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "enabled", + "optional": false, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "event", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "location", + "optional": false, + "type": [ + [ + [ + "PieceLocationJSON" + ] + ] + ] + }, + { + "name": "name", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "once", + "optional": false, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "PieceOptions" + ] + ] + ] + } + ] + }, + { + "name": "ListenerOptions", + "meta": { + "line": 116, + "file": "Listener.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "emitter", + "optional": true, + "type": [ + [ + [ + "EventEmitter", + " | " + ], + [ + "keyof", + " " + ], + [ + "Client", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "event", + "optional": true, + "type": [ + [ + [ + "string", + " | " + ], + [ + "symbol" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "once", + "optional": true, + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandAcceptedPayload", + "meta": { + "line": 405, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandContext", + "meta": { + "line": 773, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "commandName", + "description": "The alias used to run this command.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "commandPrefix", + "description": "The matched prefix, this will always be the same as {@link MessageCommand.RunContext.prefix} if it was a string, otherwise it is\nthe result of doing `prefix.exec(content)[0]`.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "prefix", + "description": "The prefix used to run this command.", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "RegExp" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandDeniedPayload", + "meta": { + "line": 400, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandErrorPayload", + "meta": { + "line": 418, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandFinishPayload", + "meta": { + "line": 414, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandRunPayload", + "meta": { + "line": 410, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandSuccessPayload", + "meta": { + "line": 422, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "duration", + "optional": false, + "type": [ + [ + [ + "number" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "result", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + } + ] + }, + { + "name": "MessageCommandTypingErrorPayload", + "meta": { + "line": 427, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "args", + "optional": false, + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "None", + "see": [], + "deprecated": false, + "meta": { + "line": 69, + "file": "Lexure.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "exists", + "description": "If this is a None, this is false.", + "optional": false, + "type": [ + [ + [ + "false" + ] + ] + ] + }, + { + "name": "value", + "optional": true, + "type": [ + [ + [ + "undefined" + ] + ] + ] + } + ] + }, + { + "name": "Ok", + "see": [], + "deprecated": false, + "meta": { + "line": 8, + "file": "Lexure.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "error", + "optional": true, + "type": [ + [ + [ + "undefined" + ] + ] + ] + }, + { + "name": "success", + "description": "If this is an Ok, this is true.", + "optional": false, + "type": [ + [ + [ + "true" + ] + ] + ] + }, + { + "name": "value", + "description": "The resulting value, which only exists on an Ok.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ] + }, + { + "name": "PieceContext", + "description": "The context for the piece, contains extra information from the store,\nthe piece's path, and the store that loaded it.", + "meta": { + "line": 386, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "name", + "description": "The module's name extracted from the path.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "path", + "description": "The path the module was loaded from, relative to {@link PieceContext.root}.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "root", + "description": "The root directory the piece was loaded from.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "store", + "description": "The store that loaded the piece.", + "optional": false, + "type": [ + [ + [ + "Store", + "<" + ], + [ + "Piece", + "<" + ], + [ + "PieceOptions", + ">>" + ] + ] + ] + } + ] + }, + { + "name": "PieceOptions", + "description": "The options for the {@link Piece}.", + "meta": { + "line": 407, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "PreChatInputCommandRunPayload", + "meta": { + "line": 445, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ChatInputCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "PreContextMenuCommandRunPayload", + "meta": { + "line": 486, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "PreMessageCommandRunPayload", + "meta": { + "line": 398, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "command", + "optional": false, + "type": [ + [ + [ + "MessageCommand" + ] + ] + ] + }, + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "parameters", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "PreconditionArrayResolvableDetails", + "description": "Defines the detailed options for the {@link PreconditionContainerArray}, where both the {@link PreconditionRunMode} and the\nentries can be defined.", + "see": [], + "deprecated": false, + "meta": { + "line": 57, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "interface", + "props": [ + { + "name": "entries", + "description": "The data that will be used to resolve {@link IPreconditionContainer} dependent of this one.", + "optional": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "PreconditionEntryResolvable", + ">" + ] + ] + ] + }, + { + "name": "mode", + "description": "The mode the {@link PreconditionContainerArray} will run.", + "optional": false, + "type": [ + [ + [ + "PreconditionRunMode" + ] + ] + ] + } + ] + }, + { + "name": "PreconditionContext", + "meta": { + "line": 142, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "external", + "optional": true, + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ] + }, + { + "name": "PreconditionOptions", + "meta": { + "line": 133, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "enabled", + "description": "Whether or not the piece should be enabled. If set to false, the piece will be unloaded.", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "name", + "description": "The name for the piece.", + "optional": true, + "default": "''", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "position", + "description": "The position for the precondition to be set at in the global precondition list. If set to `null`, this\nprecondition will not be set as a global one.", + "optional": true, + "default": "null", + "type": [ + [ + [ + "null", + " | " + ], + [ + "number" + ] + ] + ] + } + ] + }, + { + "name": "PreconditionSingleResolvableDetails", + "description": "Defines the detailed options for the {@link PreconditionContainerSingle}, where both the {@link PreconditionContext} and the\nname of the precondition can be defined.", + "see": [], + "deprecated": false, + "meta": { + "line": 25, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "interface", + "props": [ + { + "name": "context", + "description": "The context to be set at {@link PreconditionContainerSingle.context}.", + "optional": false, + "type": [ + [ + [ + "Preconditions", + "[" + ], + [ + "K", + "]" + ] + ] + ] + }, + { + "name": "name", + "description": "The name of the precondition to retrieve from {@link SapphireClient.preconditions}.", + "optional": false, + "type": [ + [ + [ + "K" + ] + ] + ] + } + ] + }, + { + "name": "Preconditions", + "description": "The registered preconditions and their contexts, if any. When registering new ones, it is recommended to use\n[module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) so\ncustom ones are registered.", + "extendedDescription": "When a key's value is `never`, it means that it does not take any context, which allows you to pass its identifier as\na bare string (e.g. `preconditions: ['NSFW']`), however, if context is required, a non-`never` type should be passed,\nwhich will type {@link PreconditionContainerArray#append} and require an object with the name and a `context` with\nthe defined type.", + "see": [], + "deprecated": false, + "meta": { + "line": 108, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "interface", + "props": [ + { + "name": "ClientPermissions", + "optional": false, + "type": [ + [ + [ + "{" + ], + [ + "\npermissions", + ": " + ], + [ + "Permissions\n", + "}" + ] + ] + ] + }, + { + "name": "Cooldown", + "optional": false, + "type": [ + [ + [ + "CooldownPreconditionContext" + ] + ] + ] + }, + { + "name": "DMOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "Enabled", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildNewsOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildNewsThreadOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildPrivateThreadOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildPublicThreadOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildTextOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "GuildThreadOnly", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "NSFW", + "optional": false, + "type": [ + [ + [ + "never" + ] + ] + ] + }, + { + "name": "UserPermissions", + "optional": false, + "type": [ + [ + [ + "{" + ], + [ + "\npermissions", + ": " + ], + [ + "Permissions\n", + "}" + ] + ] + ] + } + ] + }, + { + "name": "RepeatArgOptions", + "meta": { + "line": 724, + "file": "Args.ts", + "path": "src/lib/parsers" + }, + "variant": "interface", + "props": [ + { + "name": "times", + "description": "The maximum amount of times the argument can be repeated.", + "optional": true, + "default": "Infinity", + "type": [ + [ + [ + "number" + ] + ] + ] + } + ] + }, + { + "name": "SapphireClientOptions", + "meta": { + "line": 32, + "file": "SapphireClient.ts", + "path": "src/lib" + }, + "variant": "interface", + "props": [ + { + "name": "baseUserDirectory", + "description": "The base user directory, if set to `null`, Sapphire will not call {@link StoreRegistry.registerPath},\nmeaning that you will need to manually set each folder for each store. Please read the aforementioned method's\ndocumentation for more information.", + "optional": true, + "default": "undefined", + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ] + }, + { + "name": "caseInsensitiveCommands", + "description": "Whether commands can be case insensitive", + "optional": true, + "default": "false", + "type": [ + [ + [ + "null", + " | " + ], + [ + "boolean" + ] + ] + ] + }, + { + "name": "caseInsensitivePrefixes", + "description": "Whether prefixes can be case insensitive", + "optional": true, + "default": "false", + "type": [ + [ + [ + "null", + " | " + ], + [ + "boolean" + ] + ] + ] + }, + { + "name": "defaultCooldown", + "description": "Sets the default cooldown time for all commands.", + "optional": true, + "default": "\"No cooldown options\"", + "type": [ + [ + [ + "CooldownOptions" + ] + ] + ] + }, + { + "name": "defaultPrefix", + "description": "The default prefix, in case of `null`, only mention prefix will trigger the bot's commands.", + "optional": true, + "default": "null", + "type": [ + [ + [ + "SapphirePrefix" + ] + ] + ] + }, + { + "name": "disableMentionPrefix", + "description": "Controls whether the bot has mention as a prefix disabled", + "optional": true, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "enableLoaderTraceLoggings", + "description": "Whether or not trace logging should be enabled.", + "optional": true, + "default": "container.logger.has(LogLevel.Trace)", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "fetchPrefix", + "description": "The prefix hook, by default it is a callback function that returns {@link SapphireClientOptions.defaultPrefix}.", + "optional": true, + "default": "() => client.options.defaultPrefix", + "type": [ + [ + [ + "SapphirePrefixHook" + ] + ] + ] + }, + { + "name": "id", + "description": "The client's ID, this is automatically set by the CoreReady event.", + "optional": true, + "default": "this.client.user?.id ?? null", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "loadDefaultErrorListeners", + "description": "If Sapphire should load the pre-included error event listeners that log any encountered errors to the {@link SapphireClient.logger} instance", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "loadMessageCommandListeners", + "description": "If Sapphire should load the pre-included message command listeners that are used to process incoming messages for commands.", + "optional": true, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "logger", + "description": "The logger options, defaults to an instance of {@link Logger} when {@link ClientLoggerOptions.instance} is not specified.", + "optional": true, + "default": "{ instance: new Logger(LogLevel.Info) }", + "type": [ + [ + [ + "ClientLoggerOptions" + ] + ] + ] + }, + { + "name": "preventFailedToFetchLogForGuildIds", + "description": "Whenever starting the bot process Sapphire may report errors when failing to fetch guild commands.\nOne of the causes for this can be when a bot was invited to a server without the `application.commands` scope.", + "optional": true, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "regexPrefix", + "description": "The regex prefix, an alternative to a mention or regular prefix to allow creating natural language command messages", + "optional": true, + "type": [ + [ + [ + "RegExp" + ] + ] + ] + }, + { + "name": "typing", + "description": "Controls whether the bot will automatically appear to be typing when a command is accepted.", + "optional": true, + "default": "false", + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ] + }, + { + "name": "SapphirePluginAsyncHook", + "meta": { + "line": 9, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + }, + "variant": "interface", + "params": [ + { + "name": "this", + "optional": false, + "type": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "ClientOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "SapphirePluginHook", + "meta": { + "line": 14, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + }, + "variant": "interface", + "params": [ + { + "name": "this", + "optional": false, + "type": [ + [ + [ + "SapphireClient", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "options", + "optional": false, + "type": [ + [ + [ + "ClientOptions" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "SapphirePluginHookEntry", + "meta": { + "line": 18, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + }, + "variant": "interface", + "props": [ + { + "name": "hook", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + }, + { + "name": "name", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "type", + "optional": false, + "type": [ + [ + [ + "PluginHook" + ] + ] + ] + } + ] + }, + { + "name": "SapphirePrefixHook", + "meta": { + "line": 28, + "file": "SapphireClient.ts", + "path": "src/lib" + }, + "variant": "interface", + "params": [ + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + } + ], + "returns": [ + [ + [ + "Awaitable", + "<" + ], + [ + "SapphirePrefix", + ">" + ] + ] + ] + }, + { + "name": "SimplePreconditionSingleResolvableDetails", + "description": "Defines the simple options for the {@link PreconditionContainerSingle}, where only the name of the precondition can\nbe defined.", + "see": [], + "deprecated": false, + "meta": { + "line": 12, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "interface", + "props": [ + { + "name": "name", + "description": "The name of the precondition to retrieve from {@link SapphireClient.preconditions}.", + "optional": false, + "type": [ + [ + [ + "SimplePreconditionKeys" + ] + ] + ] + } + ] + }, + { + "name": "Some", + "see": [], + "deprecated": false, + "meta": { + "line": 53, + "file": "Lexure.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "exists", + "description": "If this is a Some, this is true.", + "optional": false, + "type": [ + [ + [ + "true" + ] + ] + ] + }, + { + "name": "value", + "description": "The value, which only exists on a Some.", + "optional": false, + "type": [ + [ + [ + "T" + ] + ] + ] + } + ] + }, + { + "name": "StoreOptions", + "description": "The options for the store, this features both hooks (changes the behaviour) and handlers (similar to event listeners).", + "meta": { + "line": 247, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "name", + "description": "The name for this store.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "paths", + "description": "The paths to load pieces from, should be absolute.", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "strategy", + "description": "The strategy to be used for the loader.", + "optional": true, + "default": "Store.defaultStrategy", + "type": [ + [ + [ + "ILoaderStrategy", + "<" + ], + [ + "T", + ">" + ] + ] + ] + } + ] + }, + { + "name": "StoreRegistryEntries", + "description": "The {@link StoreRegistry}'s registry, use module augmentation against this interface when adding new stores.", + "see": [], + "deprecated": false, + "meta": { + "line": 565, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "interface", + "isExternal": true, + "props": [ + { + "name": "arguments", + "optional": false, + "type": [ + [ + [ + "ArgumentStore" + ] + ] + ] + }, + { + "name": "commands", + "optional": false, + "type": [ + [ + [ + "CommandStore" + ] + ] + ] + }, + { + "name": "interaction-handlers", + "optional": false, + "type": [ + [ + [ + "InteractionHandlerStore" + ] + ] + ] + }, + { + "name": "listeners", + "optional": false, + "type": [ + [ + [ + "ListenerStore" + ] + ] + ] + }, + { + "name": "preconditions", + "optional": false, + "type": [ + [ + [ + "PreconditionStore" + ] + ] + ] + } + ] + }, + { + "name": "UnknownChatInputCommandPayload", + "meta": { + "line": 429, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "UnknownContextMenuCommandPayload", + "meta": { + "line": 470, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "context", + "optional": false, + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ] + }, + { + "name": "interaction", + "optional": false, + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "CacheType", + ">" + ] + ] + ] + } + ] + }, + { + "name": "UnknownMessageCommandNamePayload", + "meta": { + "line": 376, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "commandPrefix", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "prefix", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "RegExp" + ] + ] + ] + } + ] + }, + { + "name": "UnknownMessageCommandPayload", + "meta": { + "line": 389, + "file": "Events.ts", + "path": "src/lib/types" + }, + "variant": "interface", + "props": [ + { + "name": "commandName", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "commandPrefix", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + }, + { + "name": "prefix", + "optional": false, + "type": [ + [ + [ + "string", + " | " + ], + [ + "RegExp" + ] + ] + ] + } + ] + }, + { + "name": "ApplicationCommandRegistryRegisterOptions", + "type": [ + [ + [ + "ApplicationCommandRegistry", + "." + ], + [ + "RegisterOptions" + ] + ] + ], + "meta": { + "line": 481, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + }, + "variant": "type" + }, + { + "name": "ArgumentResult", + "description": "Defines a synchronous result of an {@link Argument}, check {@link Argument.AsyncResult} for the asynchronous version.", + "type": [ + [ + [ + "Awaitable", + "<" + ], + [ + "Result", + "<" + ], + [ + "T", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 13, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "AsyncArgumentResult", + "description": "Defines an asynchronous result of an {@link Argument}, check {@link Argument.Result} for the synchronous version.", + "type": [ + [ + [ + "Promise", + "<" + ], + [ + "Result", + "<" + ], + [ + "T", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 18, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "AsyncPluginHooks", + "type": [ + [ + [ + "PluginHook", + "." + ], + [ + "PreLogin", + " | " + ], + [ + "PluginHook", + "." + ], + [ + "PostLogin" + ] + ] + ], + "meta": { + "line": 8, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + }, + "variant": "type" + }, + { + "name": "AsyncPreconditionContainerReturn", + "description": "Async-only version of {@link PreconditionContainerReturn}, to be used when the run method is async.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "Promise", + "<" + ], + [ + "PreconditionContainerResult", + ">" + ] + ] + ], + "meta": { + "line": 24, + "file": "IPreconditionContainer.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "type" + }, + { + "name": "AsyncPreconditionResult", + "type": [ + [ + [ + "Promise", + "<" + ], + [ + "Result", + "<" + ], + [ + "unknown", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 11, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "AutocompleteCommand", + "type": [ + [ + [ + "Command", + " & " + ], + [ + "Required", + "<" + ], + [ + "Pick", + "<" + ], + [ + "Command", + ", " + ], + [ + "'autocompleteRun'", + ">>" + ] + ] + ], + "meta": { + "line": 527, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Awaitable", + "description": "ReturnType for a function that can return either a value or a `Promise` with that value", + "type": [ + [ + [ + "PromiseLike", + "<" + ], + [ + "T", + "> | " + ], + [ + "T" + ] + ] + ], + "meta": { + "line": 44, + "file": "utilityTypes.d.ts", + "path": "node_modules/@sapphire/utilities/dist/lib" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "ChatInputCommand", + "type": [ + [ + [ + "Command", + " & " + ], + [ + "Required", + "<" + ], + [ + "Pick", + "<" + ], + [ + "Command", + ", " + ], + [ + "'chatInputRun'", + ">>" + ] + ] + ], + "meta": { + "line": 503, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "CommandOptionsRunType", + "description": "The allowed values for {@link Command.Options.runIn}.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "'DM'", + " | " + ], + [ + "'GUILD", + "_" + ], + [ + "TEXT'", + " | " + ], + [ + "'GUILD", + "_" + ], + [ + "NEWS'", + " | " + ], + [ + "'GUILD", + "_" + ], + [ + "NEWS", + "_" + ], + [ + "THREAD'", + " | " + ], + [ + "'GUILD", + "_" + ], + [ + "PUBLIC", + "_" + ], + [ + "THREAD'", + " | " + ], + [ + "'GUILD", + "_" + ], + [ + "PRIVATE", + "_" + ], + [ + "THREAD'", + " | " + ], + [ + "'GUILD", + "_" + ], + [ + "ANY'" + ] + ] + ], + "meta": { + "line": 544, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "ContextMenuCommand", + "type": [ + [ + [ + "Command", + " & " + ], + [ + "Required", + "<" + ], + [ + "Pick", + "<" + ], + [ + "Command", + ", " + ], + [ + "'contextMenuRun'", + ">>" + ] + ] + ], + "meta": { + "line": 515, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "DetailedDescriptionCommand", + "type": [ + [ + [ + "string", + " | " + ], + [ + "DetailedDescriptionCommandObject" + ] + ] + ], + "meta": { + "line": 844, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "InteractionHandlerParseResult", + "type": [ + [ + [ + "UnwrapMaybeValue", + "<" + ], + [ + "Awaited", + "<" + ], + [ + "ReturnType", + "<" + ], + [ + "Instance", + "[" + ], + [ + "'parse'", + "]>>>" + ] + ] + ], + "meta": { + "line": 97, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "LogMethods", + "type": [ + [ + [ + "'trace'", + " | " + ], + [ + "'debug'", + " | " + ], + [ + "'info'", + " | " + ], + [ + "'warn'", + " | " + ], + [ + "'error'" + ] + ] + ], + "meta": { + "line": 54, + "file": "Logger.ts", + "path": "src/lib/utils/logger" + }, + "variant": "type" + }, + { + "name": "Maybe", + "description": "A type used to express a value that may or may not exist.", + "type": [ + [ + [ + "Some", + "<" + ], + [ + "T", + "> | " + ], + [ + "None" + ] + ] + ], + "meta": { + "line": 6, + "file": "Maybe.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "MessageCommand", + "type": [ + [ + [ + "Command", + " & " + ], + [ + "Required", + "<" + ], + [ + "Pick", + "<" + ], + [ + "Command", + ", " + ], + [ + "'messageRun'", + ">>" + ] + ] + ], + "meta": { + "line": 493, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Option", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "Some", + "<" + ], + [ + "T", + "> | " + ], + [ + "None" + ] + ] + ], + "meta": { + "line": 45, + "file": "Lexure.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "PreconditionArrayResolvable", + "description": "Defines the data accepted by {@link PreconditionContainerArray}'s constructor.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "PreconditionEntryResolvable", + "> | " + ], + [ + "PreconditionArrayResolvableDetails" + ] + ] + ], + "meta": { + "line": 75, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "type" + }, + { + "name": "PreconditionContainerResult", + "description": "Defines the result's value for a PreconditionContainer.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "Result", + "<" + ], + [ + "unknown", + ", " + ], + [ + "UserError", + ">" + ] + ] + ], + "meta": { + "line": 12, + "file": "IPreconditionContainer.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "type" + }, + { + "name": "PreconditionContainerReturn", + "description": "Defines the return type of the generic {@link IPreconditionContainer.messageRun}.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "Awaitable", + "<" + ], + [ + "PreconditionContainerResult", + ">" + ] + ] + ], + "meta": { + "line": 18, + "file": "IPreconditionContainer.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "type" + }, + { + "name": "PreconditionEntryResolvable", + "description": "Defines the data accepted for each entry of the array.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "PreconditionSingleResolvable", + " | " + ], + [ + "PreconditionArrayResolvable" + ] + ] + ], + "meta": { + "line": 83, + "file": "PreconditionContainerArray.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "type" + }, + { + "name": "PreconditionKeys", + "type": [ + [ + [ + "keyof", + " " + ], + [ + "Preconditions" + ] + ] + ], + "meta": { + "line": 128, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "PreconditionResult", + "type": [ + [ + [ + "Awaitable", + "<" + ], + [ + "Result", + "<" + ], + [ + "unknown", + ", " + ], + [ + "UserError", + ">>" + ] + ] + ], + "meta": { + "line": 10, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "PreconditionSingleResolvable", + "description": "Defines the data accepted by {@link PreconditionContainerSingle}'s constructor.", + "see": [], + "deprecated": false, + "type": [ + [ + [ + "SimplePreconditionKeys", + " | " + ], + [ + "SimplePreconditionSingleResolvableDetails", + " | " + ], + [ + "PreconditionSingleResolvableDetails" + ] + ] + ], + "meta": { + "line": 43, + "file": "PreconditionContainerSingle.ts", + "path": "src/lib/utils/preconditions" + }, + "variant": "type" + }, + { + "name": "Result", + "description": "A type used to express computations that can fail.", + "type": [ + [ + [ + "Ok", + "<" + ], + [ + "T", + "> | " + ], + [ + "Err", + "<" + ], + [ + "E", + ">" + ] + ] + ], + "meta": { + "line": 7, + "file": "Result.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "SapphirePrefix", + "description": "A valid prefix in Sapphire.\n* `string`: a single prefix, e.g. `'!'`.\n* `string[]`: an array of prefixes, e.g. `['!', '.']`.\n* `null`: disabled prefix, locks the bot's command usage to mentions only.", + "type": [ + [ + [ + "string", + " | " + ], + [ + "readonly", + " " + ], + [ + "Array", + "<" + ], + [ + "string", + "> | " + ], + [ + "null" + ] + ] + ], + "meta": { + "line": 26, + "file": "SapphireClient.ts", + "path": "src/lib" + }, + "variant": "type" + }, + { + "name": "SimplePreconditionKeys", + "type": [ + [ + [ + "unknown", + "[" + ], + [ + "PreconditionKeys", + "]" + ] + ] + ], + "meta": { + "line": 129, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "SyncPluginHooks", + "type": [ + [ + [ + "Exclude", + "<" + ], + [ + "PluginHook", + ", " + ], + [ + "AsyncPluginHooks", + ">" + ] + ] + ], + "meta": { + "line": 13, + "file": "PluginManager.ts", + "path": "src/lib/plugins" + }, + "variant": "type" + }, + { + "name": "UnwrapMaybeValue", + "type": [ + [ + [ + "T", + " " + ], + [ + "extends", + " " + ], + [ + "Some", + "<" + ], + [ + "V", + "> ? " + ], + [ + "V", + " : " + ], + [ + "never" + ] + ] + ], + "meta": { + "line": 64, + "file": "Maybe.d.ts", + "path": "node_modules/@sapphire/result/dist/lib" + }, + "variant": "type", + "isExternal": true + } + ], + "namespaces": [ + { + "name": "AliasPiece", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "Piece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 700, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "JSON", + "type": [ + [ + [ + "AliasPieceJSON" + ] + ] + ], + "meta": { + "line": 701, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "LocationJSON", + "type": [ + [ + [ + "Piece", + "." + ], + [ + "LocationJSON" + ] + ] + ], + "meta": { + "line": 702, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "Options", + "type": [ + [ + [ + "AliasPieceOptions" + ] + ] + ], + "meta": { + "line": 699, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + } + ], + "meta": { + "line": 697, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "AllFlowsPrecondition", + "typeAliases": [ + { + "name": "AsyncResult", + "type": [ + [ + [ + "AsyncPreconditionResult" + ] + ] + ], + "meta": { + "line": 157, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Context", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ], + "meta": { + "line": 155, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "PreconditionOptions" + ] + ] + ], + "meta": { + "line": 154, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Result", + "type": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 156, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 153, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ApplicationCommandRegistry", + "interfaces": [ + { + "name": "RegisterOptions", + "meta": { + "line": 458, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + }, + "variant": "interface", + "props": [ + { + "name": "behaviorWhenNotIdentical", + "description": "Specifies what we should do when the command is present, but not identical with the data you provided", + "optional": true, + "default": "`ApplicationCommandRegistries.getDefaultBehaviorWhenNotIdentical`", + "type": [ + [ + [ + "RegisterBehavior" + ] + ] + ] + }, + { + "name": "guildIds", + "description": "If this is specified, the application commands will only be registered for these guild ids.", + "optional": true, + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "idHints", + "description": "Specifies a list of command ids that we should check in the event of a name mismatch", + "optional": true, + "default": "[]", + "type": [ + [ + [ + "Array", + "<" + ], + [ + "string", + ">" + ] + ] + ] + }, + { + "name": "registerCommandIfMissing", + "description": "If we should register the command when it is missing", + "optional": true, + "default": "true", + "type": [ + [ + [ + "boolean" + ] + ] + ] + } + ] + } + ], + "meta": { + "line": 457, + "file": "ApplicationCommandRegistry.ts", + "path": "src/lib/utils/application-commands" + } + }, + { + "name": "Argument", + "typeAliases": [ + { + "name": "AsyncResult", + "type": [ + [ + [ + "AsyncArgumentResult", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 105, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Context", + "type": [ + [ + [ + "ArgumentContext", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 103, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "ArgumentOptions" + ] + ] + ], + "meta": { + "line": 102, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Result", + "type": [ + [ + [ + "ArgumentResult", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 104, + "file": "Argument.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 101, + "file": "Argument.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ArgumentError", + "interfaces": [ + { + "name": "Options", + "description": "The options for {@link ArgumentError}.", + "see": [], + "deprecated": false, + "meta": { + "line": 30, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + }, + "variant": "interface", + "props": [ + { + "name": "argument", + "description": "The argument that caused the error.", + "optional": false, + "type": [ + [ + [ + "IArgument", + "<" + ], + [ + "T", + ">" + ] + ] + ] + }, + { + "name": "context", + "description": "The extra context to provide more information about this error.", + "optional": true, + "default": "null", + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "identifier", + "description": "The identifier.", + "optional": true, + "default": "argument.name", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "message", + "description": "The message to be passed to the Error constructor.", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "parameter", + "description": "The parameter that failed to be parsed.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + } + ], + "meta": { + "line": 25, + "file": "ArgumentError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "AutocompleteCommand", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "AliasPiece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 532, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Interaction", + "type": [ + [ + [ + "AutocompleteInteraction", + "<" + ], + [ + "Cached", + ">" + ] + ] + ], + "meta": { + "line": 535, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "JSON", + "type": [ + [ + [ + "CommandJSON" + ] + ] + ], + "meta": { + "line": 531, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "CommandOptions" + ] + ] + ], + "meta": { + "line": 530, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Registry", + "type": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 536, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunContext", + "type": [ + [ + [ + "AutocompleteCommandContext" + ] + ] + ], + "meta": { + "line": 534, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunInTypes", + "type": [ + [ + [ + "CommandOptionsRunType" + ] + ] + ], + "meta": { + "line": 533, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 529, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ChatInputCommand", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "AliasPiece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 508, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Interaction", + "type": [ + [ + [ + "CommandInteraction", + "<" + ], + [ + "Cached", + ">" + ] + ] + ], + "meta": { + "line": 511, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "JSON", + "type": [ + [ + [ + "CommandJSON" + ] + ] + ], + "meta": { + "line": 507, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "CommandOptions" + ] + ] + ], + "meta": { + "line": 506, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Registry", + "type": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 512, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunContext", + "type": [ + [ + [ + "ChatInputCommandContext" + ] + ] + ], + "meta": { + "line": 510, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunInTypes", + "type": [ + [ + [ + "CommandOptionsRunType" + ] + ] + ], + "meta": { + "line": 509, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 505, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "Command", + "typeAliases": [ + { + "name": "AutocompleteInteraction", + "type": [ + [ + [ + "AutocompleteInteraction" + ] + ] + ], + "meta": { + "line": 839, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "ChatInputInteraction", + "type": [ + [ + [ + "CommandInteraction" + ] + ] + ], + "meta": { + "line": 835, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Context", + "type": [ + [ + [ + "AliasPiece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 833, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "ContextMenuInteraction", + "type": [ + [ + [ + "ContextMenuInteraction" + ] + ] + ], + "meta": { + "line": 837, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "JSON", + "type": [ + [ + [ + "CommandJSON" + ] + ] + ], + "meta": { + "line": 832, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "CommandOptions" + ] + ] + ], + "meta": { + "line": 831, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Registry", + "type": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 841, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunInTypes", + "type": [ + [ + [ + "CommandOptionsRunType" + ] + ] + ], + "meta": { + "line": 834, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 830, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "ContextMenuCommand", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "AliasPiece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 520, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Interaction", + "type": [ + [ + [ + "ContextMenuInteraction", + "<" + ], + [ + "Cached", + ">" + ] + ] + ], + "meta": { + "line": 523, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "JSON", + "type": [ + [ + [ + "CommandJSON" + ] + ] + ], + "meta": { + "line": 519, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "CommandOptions" + ] + ] + ], + "meta": { + "line": 518, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Registry", + "type": [ + [ + [ + "ApplicationCommandRegistry" + ] + ] + ], + "meta": { + "line": 524, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunContext", + "type": [ + [ + [ + "ContextMenuCommandContext" + ] + ] + ], + "meta": { + "line": 522, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunInTypes", + "type": [ + [ + [ + "CommandOptionsRunType" + ] + ] + ], + "meta": { + "line": 521, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 517, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "CorePreconditions", + "typeAliases": [ + { + "name": "CooldownContext", + "type": [ + [ + [ + "CooldownPreconditionContext" + ] + ] + ], + "meta": { + "line": 102, + "file": "index.ts", + "path": "src" + }, + "variant": "type" + }, + { + "name": "UserPermissionsPreconditionContext", + "type": [ + [ + [ + "PermissionPreconditionContext" + ] + ] + ], + "meta": { + "line": 101, + "file": "index.ts", + "path": "src" + }, + "variant": "type" + } + ], + "meta": { + "line": 100, + "file": "index.ts", + "path": "src" + } + }, + { + "name": "InteractionHandler", + "typeAliases": [ + { + "name": "JSON", + "type": [ + [ + [ + "InteractionHandlerJSON" + ] + ] + ], + "meta": { + "line": 101, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "InteractionHandlerOptions" + ] + ] + ], + "meta": { + "line": 100, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "ParseResult", + "type": [ + [ + [ + "InteractionHandlerParseResult", + "<" + ], + [ + "Instance", + ">" + ] + ] + ], + "meta": { + "line": 102, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 99, + "file": "InteractionHandler.ts", + "path": "src/lib/structures" + } + }, + { + "name": "Listener", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "Piece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 130, + "file": "Listener.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "JSON", + "type": [ + [ + [ + "ListenerJSON" + ] + ] + ], + "meta": { + "line": 129, + "file": "Listener.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "ListenerOptions" + ] + ] + ], + "meta": { + "line": 128, + "file": "Listener.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 127, + "file": "Listener.ts", + "path": "src/lib/structures" + } + }, + { + "name": "MessageCommand", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "AliasPiece", + "." + ], + [ + "Context" + ] + ] + ], + "meta": { + "line": 498, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "JSON", + "type": [ + [ + [ + "CommandJSON" + ] + ] + ], + "meta": { + "line": 497, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "CommandOptions" + ] + ] + ], + "meta": { + "line": 496, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunContext", + "type": [ + [ + [ + "MessageCommandContext" + ] + ] + ], + "meta": { + "line": 500, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "RunInTypes", + "type": [ + [ + [ + "CommandOptionsRunType" + ] + ] + ], + "meta": { + "line": 499, + "file": "Command.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 495, + "file": "Command.ts", + "path": "src/lib/structures" + } + }, + { + "name": "Piece", + "typeAliases": [ + { + "name": "Context", + "type": [ + [ + [ + "PieceContext" + ] + ] + ], + "meta": { + "line": 484, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "JSON", + "type": [ + [ + [ + "PieceJSON" + ] + ] + ], + "meta": { + "line": 485, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "LocationJSON", + "type": [ + [ + [ + "PieceLocationJSON" + ] + ] + ], + "meta": { + "line": 486, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "Options", + "type": [ + [ + [ + "PieceOptions" + ] + ] + ], + "meta": { + "line": 483, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + } + ], + "meta": { + "line": 481, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "Precondition", + "typeAliases": [ + { + "name": "AsyncResult", + "type": [ + [ + [ + "AsyncPreconditionResult" + ] + ] + ], + "meta": { + "line": 150, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Context", + "type": [ + [ + [ + "PreconditionContext" + ] + ] + ], + "meta": { + "line": 148, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Options", + "type": [ + [ + [ + "PreconditionOptions" + ] + ] + ], + "meta": { + "line": 147, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + }, + { + "name": "Result", + "type": [ + [ + [ + "PreconditionResult" + ] + ] + ], + "meta": { + "line": 149, + "file": "Precondition.ts", + "path": "src/lib/structures" + }, + "variant": "type" + } + ], + "meta": { + "line": 146, + "file": "Precondition.ts", + "path": "src/lib/structures" + } + }, + { + "name": "PreconditionError", + "interfaces": [ + { + "name": "Options", + "description": "The options for {@link PreconditionError}.", + "see": [], + "deprecated": false, + "meta": { + "line": 27, + "file": "PreconditionError.ts", + "path": "src/lib/errors" + }, + "variant": "interface", + "props": [ + { + "name": "context", + "description": "The extra context to provide more information about this error.", + "optional": true, + "default": "null", + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "identifier", + "description": "The identifier.", + "optional": true, + "default": "precondition.name", + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "message", + "description": "The message to be passed to the Error constructor.", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "precondition", + "description": "The precondition that caused the error.", + "optional": false, + "type": [ + [ + [ + "Precondition", + "<" + ], + [ + "PreconditionOptions", + ">" + ] + ] + ] + } + ] + } + ], + "meta": { + "line": 22, + "file": "PreconditionError.ts", + "path": "src/lib/errors" + } + }, + { + "name": "Resolvers", + "interfaces": [ + { + "name": "EmojiObject", + "meta": { + "line": 29, + "file": "emoji.ts", + "path": "src/lib/resolvers" + }, + "variant": "interface", + "props": [ + { + "name": "animated", + "optional": true, + "type": [ + [ + [ + "boolean" + ] + ] + ] + }, + { + "name": "id", + "optional": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ] + }, + { + "name": "name", + "optional": false, + "type": [ + [ + [ + "null", + " | " + ], + [ + "string" + ] + ] + ] + } + ] + }, + { + "name": "MessageResolverOptions", + "meta": { + "line": 9, + "file": "message.ts", + "path": "src/lib/resolvers" + }, + "variant": "interface", + "props": [ + { + "name": "channel", + "optional": true, + "type": [ + [ + [ + "DMChannel", + " | " + ], + [ + "PartialDMChannel", + " | " + ], + [ + "NewsChannel", + " | " + ], + [ + "TextChannel", + " | " + ], + [ + "ThreadChannel" + ] + ] + ] + }, + { + "name": "message", + "optional": false, + "type": [ + [ + [ + "Message", + "<" + ], + [ + "boolean", + ">" + ] + ] + ] + } + ] + } + ], + "meta": { + "line": 1, + "file": "index.ts", + "path": "src/lib/resolvers" + } + }, + { + "name": "Store", + "typeAliases": [ + { + "name": "Logger", + "type": [ + [ + [ + "StoreLogger" + ] + ] + ], + "meta": { + "line": 378, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "Options", + "type": [ + [ + [ + "StoreOptions", + "<" + ], + [ + "T", + ">" + ] + ] + ], + "meta": { + "line": 377, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + }, + { + "name": "RegistryEntries", + "type": [ + [ + [ + "StoreRegistryEntries" + ] + ] + ], + "meta": { + "line": 379, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "variant": "type", + "isExternal": true + } + ], + "meta": { + "line": 375, + "file": "index.d.ts", + "path": "node_modules/@sapphire/pieces/dist" + }, + "isExternal": true + }, + { + "name": "UserError", + "interfaces": [ + { + "name": "Options", + "description": "The options for {@link UserError}.", + "see": [], + "deprecated": false, + "meta": { + "line": 38, + "file": "UserError.ts", + "path": "src/lib/errors" + }, + "variant": "interface", + "props": [ + { + "name": "context", + "description": "The extra context to provide more information about this error.", + "optional": true, + "default": "null", + "type": [ + [ + [ + "unknown" + ] + ] + ] + }, + { + "name": "identifier", + "description": "The identifier for this error.", + "optional": false, + "type": [ + [ + [ + "string" + ] + ] + ] + }, + { + "name": "message", + "description": "The message to be passed to the Error constructor.", + "optional": true, + "type": [ + [ + [ + "string" + ] + ] + ] + } + ] + } + ], + "meta": { + "line": 33, + "file": "UserError.ts", + "path": "src/lib/errors" + } + } + ] +} \ No newline at end of file diff --git a/docs/General/Welcome.mdx b/docs/General/Welcome.mdx index 97002acb..4d42d0bc 100644 --- a/docs/General/Welcome.mdx +++ b/docs/General/Welcome.mdx @@ -294,7 +294,7 @@ If you don't understand something in the documentation, you are experiencing pro in the right direction, please don't hesitate to join our official [Sapphire Community Server](https://sapphirejs.dev/discord). -[frameworksdocs]: ../Documentation/api-framework/ +[frameworksdocs]: ../Documentation/sapphire-framework/General/welcome [djs]: https://discord.js.org/ [saphfw]: https://github.com/sapphiredev/framework [updating-guide]: ../Guide/getting-started/updating-from-v2-to-v3 diff --git a/docs/Guide/arguments/built-in-arguments.mdx b/docs/Guide/arguments/built-in-arguments.mdx index b9f8223e..a2ec1a5a 100644 --- a/docs/Guide/arguments/built-in-arguments.mdx +++ b/docs/Guide/arguments/built-in-arguments.mdx @@ -60,7 +60,7 @@ To facilitate creating commands and getting your bot running, Sapphire bundles a [date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date [dmchannel]: https://discord.js.org/#/docs/main/v13/class/DMChannel [guildchannel]: https://discord.js.org/#/docs/main/v13/class/GuildChannel -[emojiobject]: ../../Documentation/api-framework/interfaces/EmojiObject +[emojiobject]: ../../Documentation/sapphire-framework/interfaces/EmojiObject [guildmember]: https://discord.js.org/#/docs/main/v13/class/GuildMember [mdn-date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#several_ways_to_create_a_date_object diff --git a/docs/Guide/arguments/using-arguments.mdx b/docs/Guide/arguments/using-arguments.mdx index dcf81f6d..bd6c03f9 100644 --- a/docs/Guide/arguments/using-arguments.mdx +++ b/docs/Guide/arguments/using-arguments.mdx @@ -262,8 +262,8 @@ export class MathsCommand extends Command { The code above matches any number of members up to 5, so it will never return an array of 6 or more. -[pick]: ../../Documentation/api-framework/classes/Args#pick -[rest]: ../../Documentation/api-framework/classes/Args#rest -[repeat]: ../../Documentation/api-framework/classes/Args#repeat +[pick]: ../../Documentation/sapphire-framework/class/Args#pick +[rest]: ../../Documentation/sapphire-framework/class/Args#rest +[repeat]: ../../Documentation/sapphire-framework/class/Args#repeat [iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#iterators [djs-slash-guide-options]: https://discordjs.guide/interactions/slash-commands.html#options diff --git a/docs/Guide/arguments/using-flags.mdx b/docs/Guide/arguments/using-flags.mdx index 5bd3154e..4be899b8 100644 --- a/docs/Guide/arguments/using-flags.mdx +++ b/docs/Guide/arguments/using-flags.mdx @@ -122,5 +122,5 @@ export class FlagsCommand extends Command { } ``` -[getflags]: ../../Documentation/api-framework/classes/Args#getflags -[rest]: ../../Documentation/api-framework/classes/Args#rest +[getflags]: ../../Documentation/sapphire-framework/class/Args#getflags +[rest]: ../../Documentation/sapphire-framework/class/Args#rest diff --git a/docs/Guide/arguments/using-options.mdx b/docs/Guide/arguments/using-options.mdx index a0d83717..cb08cc8f 100644 --- a/docs/Guide/arguments/using-options.mdx +++ b/docs/Guide/arguments/using-options.mdx @@ -125,7 +125,7 @@ export class OptionsCommand extends Command { } ``` -[getoption]: ../../Documentation/api-framework/classes/Args#getOption -[getoptions]: ../../Documentation/api-framework/classes/Args#getOptions -[pick]: ../../Documentation/api-framework/classes/Args#pick -[rest]: ../../Documentation/api-framework/classes/Args#rest +[getoption]: ../../Documentation/sapphire-framework/class/Args#getOption +[getoptions]: ../../Documentation/sapphire-framework/class/Args#getOptions +[pick]: ../../Documentation/sapphire-framework/class/Args#pick +[rest]: ../../Documentation/sapphire-framework/class/Args#rest diff --git a/docs/Guide/getting-started/creating-a-basic-command.mdx b/docs/Guide/getting-started/creating-a-basic-command.mdx index 2cf09686..a817d8cb 100644 --- a/docs/Guide/getting-started/creating-a-basic-command.mdx +++ b/docs/Guide/getting-started/creating-a-basic-command.mdx @@ -144,8 +144,8 @@ For handling subcommands, please refer to the [Sapphire Plugin Subcommands][saph ::: -[command]: ../../Documentation/api-framework/classes/Command -[commandoptions]: ../../Documentation/api-framework/interfaces/CommandOptions +[command]: ../../Documentation/sapphire-framework/class/Command +[commandoptions]: ../../Documentation/sapphire-framework/interfaces/CommandOptions [getting-started]: ./getting-started-with-sapphire [load-message-commands-option]: ../../Documentation/api-framework/interfaces/SapphireClientOptions#loadmessagecommandlisteners diff --git a/docs/Guide/getting-started/getting-started-with-sapphire.mdx b/docs/Guide/getting-started/getting-started-with-sapphire.mdx index 2d0c6b20..31ca294f 100644 --- a/docs/Guide/getting-started/getting-started-with-sapphire.mdx +++ b/docs/Guide/getting-started/getting-started-with-sapphire.mdx @@ -86,7 +86,7 @@ And that's it for your `index.js` file! In the end, your directory should look l └── index.js ``` -[sapphire]: ../../Documentation/api-framework/classes/SapphireClient +[sapphire]: ../../Documentation/sapphire-framework/class/SapphireClient [djs-client]: https://discord.js.org/#/docs/main/v13/class/Client -[baseuserdirectory]: ../../Documentation/api-framework/interfaces/SapphireClientOptions#baseuserdirectory +[baseuserdirectory]: ../../Documentation/sapphire-framework/interfaces/SapphireClientOptions#baseuserdirectory [securing-your-token]: https://discordjs.guide/preparations/setting-up-a-bot-application.html#your-token diff --git a/docs/Guide/plugins/API/rate-limiting.mdx b/docs/Guide/plugins/API/rate-limiting.mdx index d9031a30..7e8c0316 100644 --- a/docs/Guide/plugins/API/rate-limiting.mdx +++ b/docs/Guide/plugins/API/rate-limiting.mdx @@ -143,4 +143,4 @@ export class UserRoute extends Route { Now when a user gets rate limited they will receive a 429 error with a Retry-After header. -[rlm]: ../../../Documentation/api-utilities/classes/ratelimits_src.RateLimitManager +[rlm]: ../../../Documentation/sapphire-ratelimits/class/RateLimitManager diff --git a/docs/Guide/plugins/Logger/configuring-loglevel.mdx b/docs/Guide/plugins/Logger/configuring-loglevel.mdx index 2a3d4239..f984e9d8 100644 --- a/docs/Guide/plugins/Logger/configuring-loglevel.mdx +++ b/docs/Guide/plugins/Logger/configuring-loglevel.mdx @@ -47,4 +47,4 @@ to `Warn` then logger will not log `Info` log messages. ::: -[sapphire]: ../../../Documentation/api-framework/classes/SapphireClient +[sapphire]: ../../../Documentation/sapphire-framework/class/SapphireClient diff --git a/docs/Guide/plugins/i18next/getting-started.mdx b/docs/Guide/plugins/i18next/getting-started.mdx index b795caed..8c26bab9 100644 --- a/docs/Guide/plugins/i18next/getting-started.mdx +++ b/docs/Guide/plugins/i18next/getting-started.mdx @@ -3,36 +3,21 @@ title: Getting Started sidebar_position: 0 --- -This plugin implements [i18next], a powerful internationalization library. It provides a simple way to internationalize -your bot's responses. It leverages a [filesystem backend][fs-backend] to load JSON files from a directory, and provides -a simple way to get translated keys and have your languages also match your Discord data. By simply implementing -[`fetchLanguage`][fetchlanguage] on the [`SapphireClient`][sapphireclient] you can return a language key for a user, -guild, interaction, or message and then the plugin will automatically get the proper internationalization data for you. +An implementation of i18next's [filesystem backend] for Sapphire. It allows you to use a JSON-based `languages` +directory to add internationalization for your bot using `SapphireClient`'s `fetchLanguage` hook and a custom message +extension, adding features such as `sendTranslated` and `resolveKey`. -:::tip - -All [i18next] methods and capabilities are available when using this plugin. This plugin is simply a tiny wrapper around -the [i18next] API. Need to access the `t` function without using this plugin? You can just access it through -`i18next.t`. Wondering how we you can handle formatting, interpolation, plurals and other [i18next] features? Yes, to -everything. - -In short: **Everything that is possible with [i18next] is also possible with [`@sapphire/plugin-i18next`][plugin]** - -::: +[filesystem backend]: https://github.com/i18next/i18next-fs-backend ## Installation ```bash npm2yarn2pnpm -npm install @sapphire/plugin-i18next @sapphire/framework discord.js@13.x +npm install @sapphire/plugin-i18next @sapphire/framework discord.js ``` ## Usage -First of all you will need to register the plugin. This will: - -- Register the TypeScript types for configuring the plugin -- Load your language files when starting your bot -- Add the `i18n` property to the [`container`][using-container] +This registers the methods and options necessary for message translations in the Sapphire client. @@ -66,38 +51,29 @@ import '@sapphire/plugin-i18next/register'; ## Get the language set per server -Once you start to use [i18next] to offer your bot in different languages you are likely to also want each server to be +Once you start to use i18next to offer your bot in different languages you are likely to also want each server to be able to configure their own language through some kind of configuration command while you store this data in a database. -While this page will not cover those aspects, what we will cover here is how you can inform the [i18next] plugin about -the language that should be used in the current context. - -In order to achieve this, you will need to provide the options to the plugin. This is done through the -[`i18n`][i18n-options] option on the [`ClientOptions`][`saphclientoptions`], specifically the -[`fetchLanguage`][fetchlanguage] property on that object. This method receives 1 parameter, which is an object that has -[`guild`][internationalizationcontext.guild], [`channel`][internationalizationcontext.channel], -[`user`][internationalizationcontext.user], -[`interactionGuildLocale`][internationalizationcontext.interactionguildlocale], and -[`interactionLocale`][internationalizationcontext.interactionlocale]. Using these properties you can make a call to your -database, and return the proper language key. Alternatively if you want some kind of fallback to a default language you -can also specify that here. +While this page will not cover those aspects, what we will cover here is how you can inform the i18next plugin about the +language that should be used in the current context. + +In order to achieve this, you will need to provide the options to the plugin. This is done through the `i18next` option +on the [`ClientOptions`][`saphclientoptions`], specifically the [`fetchLanguage`] property on that object. This method +receives 1 parameter, which is an object that has `message`, `guild`, and `user`, we call it the +[`InternationalizationContext`]. Using these properties you can make a call to your database, and return the proper +language key. Alternatively if you want some kind of fallback to a default language you can also specify that here. ```typescript ts2esm2cjs|{3}|{3} import { SapphireClient } from '@sapphire/framework'; -import type { InternationalizationContext } from '@sapphire/plugin-i18next'; +import { InternationalizationContext } from '@sapphire/plugin-i18next'; const client = new SapphireClient({ intents: ['GUILDS', 'GUILD_MESSAGES'], i18n: { fetchLanguage: async (context: InternationalizationContext) => { - if (context.interactionGuildLocale || context.interactionLocale) { - return context.interactionGuildLocale || context.interactionLocale; - } - - if (!context.guild) { - return 'en-US'; - } + // Or whatever your default language is + if (!context.guild) return 'en-US'; - // Example of querying your database. The exact syntax will depend on your ORM + // example of querying your database. The exact syntax will depend on your ORM const guildSettings = await db.find({ guild_id: context.guildId }); return guildSettings.language; } @@ -109,24 +85,17 @@ client.login('your-token-goes-here'); :::note -In this example we first check if [`fetchLanguage`][fetchlanguage] was called with an interaction. If so we return the -language key that Discord gives us on the API about that interaction. This is either the server's configured primary -language or a users own client language. If this is not an interaction we then check if the command was ran in a guild. -If not we return the default language. If it was ran in a guild we then query our database for the guild's language and -return that. +In this example we check if the command comes from a guild, if not, we return the default language of `en-US`. If the +command does come from within a server we query the database and get the language configured for that guild. The +language from the database will be used to get the proper language content for the language key. ::: -:::caution - Something important to keep in mind is that you have to make sure that the language exists in your language directory, otherwise an error will be thrown saying that the language obtained from the server is not valid. -::: - -## Configuring languages - -Every language has a name which is linked to the name of the folder that holds the language files. For example: +The name of the languages configured in the i18n plugin will depend on the names of the language folders in your +language directory, for example: ``` β”œβ”€β”€ commands @@ -141,23 +110,14 @@ Every language has a name which is linked to the name of the folder that holds t ``` In this case, we have the languages `en-US` and `es-ES`. Remember that the languages must be in the directory called -`languages` (this can be customized but we do not advise doing so). Each of these folders should hold JSON files with -key-value maps of language keys and their translated string values. Each folder can also have ONE (1) nested folder -which is called a `namespace` in [i18next]. This namespace is used to separate the language keys into different -categories. - -:::danger - -_**[i18next] does not support nesting namespaces in namespaces. You can have only 1 nested folder, not multiple.**_ +`languages` in the root folder of your project. Inside the language's folder, we will put our files and namespaces to +use in the translation of messages. -::: - -### Adding key-value pairs to a translation file +The basic structure of a translation file is as follows: -Now that we have created the folder structure and some basic language files lets populate one with key-value pairs. For -example lets consider the file: `languages/en-US/ping.json` +`languages/en-US/ping.json` -We can fill this file with the key-value pairs: +The same with the other languages but with their corresponding translations. ```json { @@ -166,34 +126,10 @@ We can fill this file with the key-value pairs: } ``` -And lets say we also have the language `nl-NL`. This means we should also have the file `languages/nl-NL/ping.json`, -which will have the key-value pairs: +The `resolveKey` function can be used anywhere to get translated text by its key. In this example, it is used in a +method to send a message. -```json -{ - "success": "Pong!", - "success_with_args": "Pong! Het heeft {{latency}}ms geduurd om te reageren" -} -``` - -## Using languages - -### [`resolveKey`][resolve-key] - -The [`resolveKey`][resolve-key] function can be used anywhere to get translated text by its key. `resolveKey` takes 2-3 -parameters. - -- The first parameter should always be a `message` or an `interaction` which provides the context to - [`fetchLanguage`][fetchlanguage] to get the appropriate language key for [i18next]. -- The second parameter is the key for the translated string you want to get, including the namespace if applicable. -- The third parameter is any additional context to pass to [i18next] such as when leveraging interpolation, - pluralization, etc. - -Following is an example of a command that implements [`messageRun`][messagerun] (for message based commands), -[`chatInputRun`][chatinputrun] (for chat input commands) and [`contextMenuRun`][contextmenurun] (for context menu -commands) to send the same translated message. - -```typescript ts2esm2cjs|{13,17,21}|{13,17,21} +```typescript ts2esm2cjs|{13}|{13} import { resolveKey } from '@sapphire/plugin-i18next'; import { Command } from '@sapphire/framework'; @@ -205,37 +141,36 @@ export class PingCommand extends Command { }); } - public override async messageRun(message: Message) { + public async messageRun(message: Message) { await message.channel.send(await resolveKey(message, 'ping:success')); } - - public override async chatInputRun(interaction: Command.ChatInputInteraction) { - await interaction.reply(await resolveKey(interaction, 'ping:success')); - } - - public override async contextMenuRun(interaction: Command.ContextMenuInteraction) { - await interaction.reply(await resolveKey(interaction, 'ping:success')); - } } ``` -:::note - -In this example we used `ping:success` as the key for the translation. This means that [i18next] will look for a file -called `ping.json` in the languages folder, and if it finds that file look for a key called `success`. If you have -followed this guide up to this point you should have this configured. +`sendLocalized` will send translated text resolved from a key to a specified channel. -If you have instead opted for categorizing your JSON files in namespaces and you have for example followed a structure -of `languages/en-US/commands/ping.json` then the key will be `commands/ping:success`. +```typescript ts2esm2cjs|{13}|{13} +import { sendLocalized } from '@sapphire/plugin-i18next'; +import { Command } from '@sapphire/framework'; -::: +export class PingCommand extends Command { + public constructor(context: Command.Context, options: Command.Options) { + super(context, { + ...options, + description: 'ping pong' + }); + } -### [`fetchLanguage`][fetchlanguage] + public async messageRun(message: Message) { + await sendLocalized(message, 'ping:success'); + } +} +``` -[`fetchLanguage`][fetchlanguage] returns the language specific for the provided context. +`editLocalized` edits a message, replacing its content with translated text resolved from its key. -```typescript ts2esm2cjs|{13,18,23}|{13,18,23} -import { fetchLanguage } from '@sapphire/plugin-i18next'; +```typescript ts2esm2cjs|{13}|{13} +import { editLocalized } from '@sapphire/plugin-i18next'; import { Command } from '@sapphire/framework'; export class PingCommand extends Command { @@ -246,29 +181,35 @@ export class PingCommand extends Command { }); } - public override async messageRun(message: Message) { - const languageCodeForCurrentGuild = await fetchLanguage(message); - // ===> en-US + public async messageRun(message: Message) { + await editLocalized(message, { keys: 'ping:success_with_args', formatOptions: { latency: ws.ping } }); } +} +``` - public override async chatInputRun(interaction: Command.ChatInputInteraction) { - const languageCodeForCurrentGuild = await fetchLanguage(interaction); - // ===> en-US +`replyLocalized` replies to a message, sending the text resolved from its key. + +```typescript ts2esm2cjs|{13}|{13} +import { replyLocalized } from '@sapphire/plugin-i18next'; +import { Command } from '@sapphire/framework'; + +export class PingCommand extends Command { + public constructor(context: Command.Context, options: Command.Options) { + super(context, { + ...options, + description: 'ping pong' + }); } - public override async contextMenuRun(interaction: Command.ContextMenuInteraction) { - const languageCodeForCurrentGuild = await fetchLanguage(interaction); - // ===> en-US + public async messageRun(message: Message) { + await replyLocalized(message, { keys: 'ping:success_with_args', formatOptions: { latency: ws.ping } }); } } ``` -### [`fetchT`][fetcht] +`fetchLanguage` returns the guild-specific language that the client is using. -[`fetchT`][fetcht] returns an [i18next][i18next] [`TFunction`][tfunction] with the language specific for the provided -context. - -```typescript ts2esm2cjs|{13,18,23}|{13,18,23} +```typescript ts2esm2cjs|{13}|{13} import { fetchLanguage } from '@sapphire/plugin-i18next'; import { Command } from '@sapphire/framework'; @@ -280,45 +221,13 @@ export class PingCommand extends Command { }); } - public override async messageRun(message: Message) { - const tFunction = await fetchT(message); - const translatedPingSuccess = tFunction('ping:success'); - } - - public override async chatInputRun(interaction: Command.ChatInputInteraction) { - const tFunction = await fetchT(interaction); - const translatedPingSuccess = tFunction('ping:success'); - } - - public override async contextMenuRun(interaction: Command.ContextMenuInteraction) { - const tFunction = await fetchT(interaction); - const translatedPingSuccess = tFunction('ping:success'); + public async messageRun(message: Message) { + return message.channel.send(await fetchLanguage(message)); + // ===> en-US } } ``` -[`saphclientoptions`]: ../../../Documentation/api-framework/interfaces/SapphireClientOptions -[`internationalizationcontext`]: ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationContext -[resolve-key]: ../../../Documentation/api-plugins/modules/i18next_src.md#resolvekey -[fs-backend]: https://github.com/skyra-project/archid-components/tree/main/packages/i18next-backend -[fetchlanguage]: ../../../Documentation/api-plugins/modules/i18next_src.md#fetchlanguage -[i18n-options]: ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationOptions -[sapphireclient]: ../../../Documentation/api-framework/classes/SapphireClient.md -[i18next]: https://i18next.com -[plugin]: https://github.com/sapphiredev/plugins/tree/main/packages/i18next -[using-container]: ../../additional-information/using-and-extending-container.mdx -[internationalizationcontext.guild]: - ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationContext#guild -[internationalizationcontext.channel]: - ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationContext#channel -[internationalizationcontext.user]: - ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationContext#user -[internationalizationcontext.interactionguildlocale]: - ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationContext#interactionguildlocale -[internationalizationcontext.interactionlocale]: - ../../../Documentation/api-plugins/interfaces/i18next_src.InternationalizationContext#interactionlocale -[messagerun]: ../../../Documentation/api-framework/classes/Command.md#messagerun -[chatinputrun]: ../../../Documentation/api-framework/classes/Command.md#chatinputrun -[contextmenurun]: ../../../Documentation/api-framework/classes/Command.md#contextmenurun -[fetcht]: ../../../Documentation/api-plugins/modules/i18next_src.md#fetcht -[tfunction]: ../../../Documentation/api-plugins/interfaces/i18next_src.TFunction +[`saphclientoptions`]: ../../../Documentation/sapphire-framework/interfaces/SapphireClientOptions +[`fetchlanguage`]: ../../../Documentation/sapphire-plugin-i18next/class/InternationalizationHandler#fetchlanguage +[`internationalizationcontext`]: ../../../Documentation/sapphire-plugin-i18next/interfaces/InternationalizationContext diff --git a/docs/Guide/preconditions/channel-types.mdx b/docs/Guide/preconditions/channel-types.mdx index d1e405f9..f00553cf 100644 --- a/docs/Guide/preconditions/channel-types.mdx +++ b/docs/Guide/preconditions/channel-types.mdx @@ -35,6 +35,6 @@ Failure][reporting-precondition-failure]. ::: -[runin]: ../../Documentation/api-framework/interfaces/CommandOptions#runin -[runintypes]: ../../Documentation/api-framework/enums/CommandOptionsRunTypeEnum +[runin]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#runin +[runintypes]: ../../Documentation/sapphire-framework/enums/CommandOptionsRunTypeEnum [reporting-precondition-failure]: ./reporting-precondition-failure diff --git a/docs/Guide/preconditions/command-cooldown.mdx b/docs/Guide/preconditions/command-cooldown.mdx index 4008f31a..396374af 100644 --- a/docs/Guide/preconditions/command-cooldown.mdx +++ b/docs/Guide/preconditions/command-cooldown.mdx @@ -109,13 +109,13 @@ Failure][reporting-precondition-failure]. ::: -[cooldowndelay]: ../../Documentation/api-framework/interfaces/CommandOptions#cooldowndelay -[cooldownfilteredusers]: ../../Documentation/api-framework/interfaces/CommandOptions#cooldownfilteredusers -[cooldownlimit]: ../../Documentation/api-framework/interfaces/CommandOptions#cooldownlimit -[cooldownscope]: ../../Documentation/api-framework/interfaces/CommandOptions#cooldownscope -[defaultcooldown]: ../../Documentation/api-framework/interfaces/SapphireClientOptions#defaultcooldown -[sapphire]: ../../Documentation/api-framework/classes/SapphireClient -[scopes]: ../../Documentation/api-framework/enums/BucketScope +[cooldowndelay]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldowndelay +[cooldownfilteredusers]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldownfilteredusers +[cooldownlimit]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldownlimit +[cooldownscope]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldownscope +[defaultcooldown]: ../../Documentation/sapphire-framework/interfaces/SapphireClientOptions#defaultcooldown +[sapphire]: ../../Documentation/sapphire-framework/class/SapphireClient +[scopes]: ../../Documentation/sapphire-framework/enums/BucketScope [reporting-precondition-failure]: ./reporting-precondition-failure -[timeutils]: ../../Documentation/api-utilities/modules/time_utilities_src -[timeenum]: ../../Documentation/api-utilities/enums/time_utilities_src.Time +[timeutils]: ../../Documentation/sapphire-time-utilities +[timeenum]: ../../Documentation/sapphire-time-utilities/typedefs/Time diff --git a/docs/Guide/preconditions/creating-your-own-preconditions.mdx b/docs/Guide/preconditions/creating-your-own-preconditions.mdx index 15fb64c0..b57fdae1 100644 --- a/docs/Guide/preconditions/creating-your-own-preconditions.mdx +++ b/docs/Guide/preconditions/creating-your-own-preconditions.mdx @@ -35,84 +35,32 @@ import { Precondition } from '@sapphire/framework'; export class OwnerOnlyPrecondition extends Precondition {} ``` -Next, we can create a [`messageRun`][preconditionmessagerun], [`chatInputRun`][preconditionchatinputrun], and/or -[`contextMenuRun`][preconditioncontextmenurun] function to execute our logic. These functions should either return +Next, we can create a [`run`][preconditionrun] function to execute our logic. This function should either return [`this.ok()`][preconditionok] to signify the condition has passed, or [`this.error(...)`][preconditionerror] to signify the command should be denied. -:::tip +:::danger -If your precondition is set to implement all three of [`messageRun`][preconditionmessagerun], -[`chatInputRun`][preconditionchatinputrun], and [`contextMenuRun`][preconditioncontextmenurun] then we recommend -extending [`AllFlowsPrecondition`][all-flows-precondition] which will add TypeScript checks to ensure that you have -implemented all 3 methods. +Clicking on [`run`][preconditionrun] above will take you to a method instead called `messageRun`. This is because this +documentation reflects the latest commit to the `main` branch of `@sapphire/framework` which is has a breaking change +included that changed the name of the method. For the purposes of this guide however, you can use `run` as long as you +are using the latest NPM published version of `@sapphire/framework`. ::: -```typescript ts2esm2cjs|{4-17}|{5-17} +```typescript ts2esm2cjs|{4-8}|{4-8} import { Precondition } from '@sapphire/framework'; -import type { CommandInteraction, ContextMenuInteraction, Message } from 'discord.js'; +import type { Message } from 'discord.js'; export class OwnerOnlyPrecondition extends Precondition { - public override async messageRun(message: Message) { - // for message command - return this.checkOwner(message.author.id); - } - - public override async chatInputRun(interaction: CommandInteraction) { - // for slash command - return this.checkOwner(interaction.user.id); - } - - public override async contextMenuRun(interaction: ContextMenuInteraction) { - // for Context Menu Command - return this.checkOwner(interaction.user.id); - } - - private async checkOwner(userId: string) { - return Config.bot.owners!.includes(userId) + public run(message: Message) { + return message.author.id === 'YOUR_ID' ? this.ok() : this.error({ message: 'Only the bot owner can use this command!' }); } } ``` -:::info - -Adding a check method i.e. `messageRun` or `chatInputRun` or `contextMenuRun` is optional, you can add add any of them -that's needed for your bot. For example, if your bot has no `Slash` or `Context menu` command then `chatInputRun` and -`contextMenuRun` can be omitted from the example above. - -::: - -:::caution - - - -Typescript users must augment Sapphire's [`Preconditions`][preconditions-interface] interface, which is needed to -increase the security of Sapphire's types. Otherwise, you will run into type errors in the next section. - -```typescript {7-11} -import { Precondition } from '@sapphire/framework'; - -export class OwnerOnlyPrecondition extends Precondition { - // ... -} - -declare module '@sapphire/framework' { - interface Preconditions { - OwnerOnly: never; - } -} -``` - -Please see an official example [here][preconditions-augment]. - -::: - ## Using Preconditions in Commands To attach a precondition to a command, you simply have to input its name in an array in the command's @@ -133,6 +81,19 @@ export class PingCommand extends Command { Now, if someone who is not the bot owner executes the `ping` command, nothing will happen! +:::caution + +For TypeScript users, there's an extra step to make this work. To increase the security of Sapphire's types, you'll need +to augment Sapphire's [`Preconditions`][preconditions-interface] interface. Please see an official example +[here][preconditions-augment]. + + + +::: + By default, no error message will be sent or logged when a command is denied because of a precondition. To learn how to configure this, please read [Reporting Precondition Failures][reporting-precondition-failure]. @@ -160,16 +121,13 @@ None of the following preconditions are bundled with Sapphire; as such you'd hav For a command with these preconditions to pass the denial checks, the `InVoiceChannel` precondition must pass, as well as `AdminOnly` _or_ both `OwnerOnly` and `ModOnly`. -[all-flows-precondition]: ../../Documentation/api-framework/classes/AllFlowsPrecondition [creating-commands]: ../getting-started/creating-a-basic-command -[precondition]: ../../Documentation/api-framework/classes/Precondition -[preconditionmessagerun]: ../../Documentation/api-framework/classes/Precondition#messagerun -[preconditionchatinputrun]: ../../Documentation/api-framework/classes/Precondition#chatinputrun -[preconditioncontextmenurun]: ../../Documentation/api-framework/classes/Precondition#contextmenurun -[preconditionok]: ../../Documentation/api-framework/classes/Precondition#ok -[preconditionerror]: ../../Documentation/api-framework/classes/Precondition#error -[preconditions-option]: ../../Documentation/api-framework/interfaces/CommandOptions#preconditions -[preconditions-interface]: ../../Documentation/api-framework/interfaces/Preconditions +[precondition]: ../../Documentation/sapphire-framework/class/Precondition +[preconditionrun]: ../../Documentation/sapphire-framework/class/Precondition#messagerun +[preconditionok]: ../../Documentation/sapphire-framework/class/Precondition#ok +[preconditionerror]: ../../Documentation/sapphire-framework/class/Precondition#error +[preconditions-option]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#preconditions +[preconditions-interface]: ../../Documentation/sapphire-framework/interfaces/Preconditions [preconditions-augment]: - https://github.com/sapphiredev/examples/blob/main/examples/with-typescript-recommended/src/preconditions/OwnerOnly.ts#L27-L31 + https://github.com/sapphiredev/examples/blob/main/examples/with-typescript-recommended/src/preconditions/OwnerOnly.ts#L13-L17 [reporting-precondition-failure]: ./reporting-precondition-failure diff --git a/docs/Guide/preconditions/handling-permissions.mdx b/docs/Guide/preconditions/handling-permissions.mdx index f714b9eb..1da19125 100644 --- a/docs/Guide/preconditions/handling-permissions.mdx +++ b/docs/Guide/preconditions/handling-permissions.mdx @@ -56,6 +56,6 @@ Failure][reporting-precondition-failure]. ::: -[requireduserpermissions]: ../../Documentation/api-framework/interfaces/CommandOptions#requireduserpermissions -[requiredclientpermissions]: ../../Documentation/api-framework/interfaces/CommandOptions#requiredclientpermissions +[requireduserpermissions]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#requireduserpermissions +[requiredclientpermissions]: ../../Documentation/sapphire-framework/interfaces/CommandOptions#requiredclientpermissions [reporting-precondition-failure]: ./reporting-precondition-failure diff --git a/docs/Guide/preconditions/reporting-precondition-failure.mdx b/docs/Guide/preconditions/reporting-precondition-failure.mdx index 208ac572..218465cc 100644 --- a/docs/Guide/preconditions/reporting-precondition-failure.mdx +++ b/docs/Guide/preconditions/reporting-precondition-failure.mdx @@ -106,8 +106,8 @@ throw a TypeScript error for trying to read property `silent` of type `unknown`. ::: [listeners]: ../listeners/creating-your-own-listeners -[error]: ../../Documentation/api-framework/classes/UserError -[payload]: ../../Documentation/api-framework/interfaces/MessageCommandDeniedPayload -[context]: ../../Documentation/api-framework/classes/UserError#context -[preconditionerror]: ../../Documentation/api-framework/classes/Precondition#error +[error]: ../../Documentation/sapphire-framework/class/UserError +[payload]: ../../Documentation/sapphire-framework/interfaces/MessageCommandDeniedPayload +[context]: ../../Documentation/sapphire-framework/class/UserError#context +[preconditionerror]: ../../Documentation/sapphire-framework/class/Precondition#error [creating-preconditions]: ./creating-your-own-preconditions diff --git a/docusaurus-discordjs-docgen/package.json b/docusaurus-discordjs-docgen/package.json new file mode 100644 index 00000000..15c5696a --- /dev/null +++ b/docusaurus-discordjs-docgen/package.json @@ -0,0 +1,25 @@ +{ + "name": "docusaurus-discordjs-docgen", + "version": "0.0.1", + "description": "A Docusaurus v2 plugin to build API documentation based on @discordjs/ts-docgen output.", + "main": "dist/index.js", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc", + "watch": "tsc -w", + "debug": "node --inspect scripts/debug.mjs" + }, + "dependencies": { + "@sapphire/docusaurus-plugin-ts2esm2cjs": "^1.1.3", + "@sapphire/result": "^2.6.0", + "@sapphire/utilities": "^3.11.0", + "common-tags": "^1.8.2", + "css": "^3.0.0" + }, + "devDependencies": { + "@docusaurus/types": "2.1.0", + "@types/common-tags": "^1.8.1" + } +} diff --git a/docusaurus-discordjs-docgen/scripts/debug.mjs b/docusaurus-discordjs-docgen/scripts/debug.mjs new file mode 100644 index 00000000..e8c26943 --- /dev/null +++ b/docusaurus-discordjs-docgen/scripts/debug.mjs @@ -0,0 +1,70 @@ +import { fileURLToPath } from 'node:url'; +import parser from '../dist/index.js'; + +const docusaurusDiscordjsDocgen = parser.default; + +const siteDir = new URL('../../', import.meta.url); +const generatedFilesDir = new URL('.docusaurus/', siteDir); +const outDir = new URL('build/', siteDir); +const siteConfigPath = new URL('docusaurus.config.js', siteDir); + +const docgenJsonFile = new URL('data/framework.json', siteDir); +const outDocs = new URL('docs/Documentation/sapphire-framework', siteDir); + +docusaurusDiscordjsDocgen( + { + siteDir: fileURLToPath(siteDir), + generatedFilesDir: fileURLToPath(generatedFilesDir), + siteConfig: { + title: 'Sapphire', + url: 'https://sapphirejs.dev', + baseUrl: '/', + onBrokenLinks: 'warn', + onBrokenMarkdownLinks: 'warn', + onDuplicateRoutes: 'throw', + favicon: 'img/favicon.ico', + tagline: + 'Sapphire is a next-gen Discord bot framework for developers of all skill levels to make the best JavaScript/TypeScript based bots possible.', + organizationName: 'sapphiredev', + projectName: 'framework', + baseUrlIssueBanner: true, + i18n: { + defaultLocale: 'en', + locales: ['en'], + localeConfigs: {} + }, + staticDirectories: ['static'], + customFields: {}, + scripts: [], + stylesheets: [], + clientModules: [], + titleDelimiter: '|', + noIndex: false + }, + siteConfigPath: fileURLToPath(siteConfigPath), + outDir: fileURLToPath(outDir), + baseUrl: '/', + i18n: { + defaultLocale: 'en', + locales: ['en'], + currentLocale: 'en', + localeConfigs: { + en: { + label: 'English', + direction: 'ltr', + htmlLang: 'en' + } + } + }, + codeTranslations: {} + }, + { + id: 'framework', + docgenJsonFile: fileURLToPath(docgenJsonFile), + out: fileURLToPath(outDocs), + sidebar: { + categoryLabel: '@sapphire/framework', + position: 0 + } + } +).loadContent(); diff --git a/docusaurus-discordjs-docgen/src/index.ts b/docusaurus-discordjs-docgen/src/index.ts new file mode 100644 index 00000000..3ebe4e4d --- /dev/null +++ b/docusaurus-discordjs-docgen/src/index.ts @@ -0,0 +1,50 @@ +import type { LoadContext } from '@docusaurus/types'; +import { from, isErr } from '@sapphire/result'; +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import { renderOutputFiles } from './lib/renderer/render'; +import { removeDir } from './lib/renderer/utils'; +import { writeCategoryYaml } from './lib/renderer/writeCategoryYaml'; +import type { Documentation } from './lib/types/docgen-output'; +import type { PluginOptions } from './lib/types/types'; +import { generateLogString } from './lib/utils/logger'; +import { getPluginOptions } from './lib/utils/options'; +import { pluginContainer } from './lib/utils/pluginContainer'; + +// store list of plugin ids when running multiple instances +const apps: string[] = []; + +export default function docusaurusDiscordjsDocgen(context: LoadContext, opts: Partial) { + return { + name: 'docusaurus-discordjs-docgen', + loadContent() { + if (opts.id && !apps.includes(opts.id)) { + apps.push(opts.id); + + const { siteDir } = context; + + const options = getPluginOptions(opts); + + pluginContainer.pluginOptions = options; + + const outputDir = resolve(siteDir, options.docsRoot, options.out); + + removeDir(outputDir); + + writeCategoryYaml(outputDir, '', options.sidebar.categoryLabel, options.sidebar.position ?? 0); + + const docgenJsonFile = from(() => { + return JSON.parse(readFileSync(resolve(options.docgenJsonFile), 'utf8')); + }); + + if (isErr(docgenJsonFile)) { + throw new Error(generateLogString(`Failed to parse JSON file at path ${resolve(options.docgenJsonFile)}`, options.id)); + } + + const jsonFileContent = docgenJsonFile.value; + + renderOutputFiles(jsonFileContent, outputDir, options); + } + } + }; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/discordjs/resolveClasses.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/discordjs/resolveClasses.ts new file mode 100644 index 00000000..17c2d7c2 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/discordjs/resolveClasses.ts @@ -0,0 +1,149 @@ +const baseLink = 'https://discord.js.org/#/docs/main/stable/class'; + +const knownClasses = new Set([ + 'Activity', + 'ActivityFlags', + 'AnonymousGuild', + 'Application', + 'ApplicationCommand', + 'ApplicationCommandManager', + 'ApplicationCommandPermissionsManager', + 'ApplicationFlags', + 'AutocompleteInteraction', + 'Base', + 'BaseClient', + 'BaseCommandInteraction', + 'BaseGuild', + 'BaseGuildEmoji', + 'BaseGuildEmojiManager', + 'BaseGuildTextChannel', + 'BaseGuildVoiceChannel', + 'BaseManager', + 'BaseMessageComponent', + 'BitField', + 'ButtonInteraction', + 'CachedManager', + 'CategoryChannel', + 'Channel', + 'ChannelManager', + 'Client', + 'ClientApplication', + 'ClientPresence', + 'ClientUser', + 'ClientVoiceManager', + 'Collector', + 'CommandInteraction', + 'CommandInteractionOptionResolver', + 'ContextMenuInteraction', + 'DataManager', + 'DiscordAPIError', + 'DMChannel', + 'Emoji', + 'Formatters', + 'Guild', + 'GuildApplicationCommandManager', + 'GuildAuditLogs', + 'GuildAuditLogsEntry', + 'GuildBan', + 'GuildBanManager', + 'GuildChannel', + 'GuildChannelManager', + 'GuildEmoji', + 'GuildEmojiManager', + 'GuildEmojiRoleManager', + 'GuildInviteManager', + 'GuildManager', + 'GuildMember', + 'GuildMemberManager', + 'GuildMemberRoleManager', + 'GuildPreview', + 'GuildPreviewEmoji', + 'GuildStickerManager', + 'GuildTemplate', + 'HTTPError', + 'Integration', + 'IntegrationApplication', + 'Intents', + 'Interaction', + 'InteractionCollector', + 'InteractionWebhook', + 'Invite', + 'InviteGuild', + 'InviteStageInstance', + 'LimitedCollection', + 'Message', + 'MessageActionRow', + 'MessageAttachment', + 'MessageButton', + 'MessageCollector', + 'MessageComponentInteraction', + 'MessageEmbed', + 'MessageFlags', + 'MessageManager', + 'MessageMentions', + 'MessagePayload', + 'MessageReaction', + 'MessageSelectMenu', + 'NewsChannel', + 'OAuth2Guild', + 'Options', + 'PartialGroupDMChannel', + 'PermissionOverwriteManager', + 'PermissionOverwrites', + 'Permissions', + 'Presence', + 'PresenceManager', + 'RateLimitError', + 'ReactionCollector', + 'ReactionEmoji', + 'ReactionManager', + 'ReactionUserManager', + 'RichPresenceAssets', + 'Role', + 'RoleManager', + 'SelectMenuInteraction', + 'Shard', + 'ShardClientUtil', + 'ShardingManager', + 'SnowflakeUtil', + 'StageChannel', + 'StageInstance', + 'StageInstanceManager', + 'Sticker', + 'StickerPack', + 'StoreChannel', + 'SystemChannelFlags', + 'Team', + 'TeamMember', + 'TextChannel', + 'ThreadChannel', + 'ThreadManager', + 'ThreadMember', + 'ThreadMemberFlags', + 'ThreadMemberManager', + 'Typing', + 'User', + 'UserFlags', + 'UserManager', + 'Util', + 'VoiceChannel', + 'VoiceRegion', + 'VoiceState', + 'VoiceStateManager', + 'Webhook', + 'WebhookClient', + 'WebSocketManager', + 'WebSocketShard', + 'WelcomeChannel', + 'WelcomeScreen', + 'Widget', + 'WidgetMember' +]); + +export function resolveClasses(name: string): string | undefined { + if (knownClasses.has(name)) { + return `${baseLink}/${name}`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/discordjs/resolveTypedefs.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/discordjs/resolveTypedefs.ts new file mode 100644 index 00000000..cfd83d84 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/discordjs/resolveTypedefs.ts @@ -0,0 +1,270 @@ +const baseLink = 'https://discord.js.org/#/docs/main/stable/typedef'; + +const knownTypeDefs = new Set([ + 'ActivitiesOptions', + 'ActivityOptions', + 'ActivityParty', + 'ActivityPlatform', + 'ActivityTimestamps', + 'ActivityType', + 'AddApplicationCommandPermissionsOptions', + 'AddGuildMemberOptions', + 'AgentOptions', + 'APIError', + 'APIMessageActionRowComponent', + 'APIRequest', + 'ApplicationAsset', + 'ApplicationCommandData', + 'ApplicationCommandOption', + 'ApplicationCommandOptionChoice', + 'ApplicationCommandOptionData', + 'ApplicationCommandOptionType', + 'ApplicationCommandPermissionData', + 'ApplicationCommandPermissions', + 'ApplicationCommandPermissionType', + 'ApplicationCommandResolvable', + 'ApplicationCommandType', + 'ApplicationResolvable', + 'AuditLogAction', + 'AuditLogActionType', + 'AuditLogChange', + 'AuditLogEntryTarget', + 'AuditLogTargetType', + 'AwaitMessageComponentOptions', + 'AwaitMessagesOptions', + 'AwaitReactionsOptions', + 'BanOptions', + 'Base64Resolvable', + 'BaseApplicationCommandPermissionsOptions', + 'BaseFetchOptions', + 'BaseMessageComponentOptions', + 'BaseMessageOptions', + 'BitFieldResolvable', + 'BroadcastEvalOptions', + 'BufferResolvable', + 'CacheFactory', + 'CategoryChannelResolvable', + 'CategoryCreateChannelOptions', + 'ChannelData', + 'ChannelLogsQueryOptions', + 'ChannelPosition', + 'ChannelResolvable', + 'ChannelType', + 'ChannelWebhookCreateOptions', + 'ClientOptions', + 'ClientPresenceStatus', + 'ClientUserEditData', + 'CollectorFilter', + 'CollectorOptions', + 'CollectorResetTimerOptions', + 'ColorResolvable', + 'CommandInteractionOption', + 'CommandInteractionResolvedData', + 'Constants', + 'CreateInviteOptions', + 'CreateRoleOptions', + 'CrosspostedChannel', + 'DateResolvable', + 'DeconstructedSnowflake', + 'DefaultMessageNotificationLevel', + 'EditGuildTemplateOptions', + 'EmbedField', + 'EmbedFieldData', + 'EmojiIdentifierResolvable', + 'EmojiResolvable', + 'EscapeMarkdownOptions', + 'ExplicitContentFilterLevel', + 'Features', + 'FetchApplicationCommandOptions', + 'FetchArchivedThreadOptions', + 'FetchBanOptions', + 'FetchBansOptions', + 'FetchChannelOptions', + 'FetchedThreads', + 'FetchGuildOptions', + 'FetchGuildsOptions', + 'FetchInviteOptions', + 'FetchInvitesOptions', + 'FetchMemberOptions', + 'FetchMembersOptions', + 'FetchReactionUsersOptions', + 'FetchRecommendedShardsOptions', + 'FetchThreadsOptions', + 'FileOptions', + 'GuildApplicationCommandPermissionData', + 'GuildAuditLogsFetchOptions', + 'GuildBanResolvable', + 'GuildChannelCloneOptions', + 'GuildChannelCreateOptions', + 'GuildChannelOverwriteOptions', + 'GuildChannelResolvable', + 'GuildCreateOptions', + 'GuildEditData', + 'GuildEmojiCreateOptions', + 'GuildEmojiEditData', + 'GuildInvitableChannelResolvable', + 'GuildListMembersOptions', + 'GuildMemberEditData', + 'GuildMemberResolvable', + 'GuildMembersChunk', + 'GuildPruneMembersOptions', + 'GuildResolvable', + 'GuildRolePosition', + 'GuildSearchMembersOptions', + 'GuildStickerCreateOptions', + 'GuildStickerEditData', + 'GuildTemplateResolvable', + 'GuildTextChannelResolvable', + 'GuildVoiceChannelResolvable', + 'GuildWidgetSettings', + 'GuildWidgetSettingsData', + 'HasApplicationCommandPermissionsOptions', + 'HTTPAttachmentData', + 'HTTPErrorData', + 'HTTPOptions', + 'ImageURLOptions', + 'IntegrationAccount', + 'IntegrationExpireBehavior', + 'IntegrationType', + 'IntentsResolvable', + 'InteractionCollectorOptions', + 'InteractionDeferReplyOptions', + 'InteractionDeferUpdateOptions', + 'InteractionReplyOptions', + 'InteractionResponseType', + 'InteractionType', + 'InteractionUpdateOptions', + 'InvalidRequestWarningData', + 'InviteGenerationOptions', + 'InviteResolvable', + 'InviteScope', + 'LifetimeFilterOptions', + 'LimitedCollectionOptions', + 'MakeErrorOptions', + 'MembershipState', + 'MessageActionRowComponent', + 'MessageActionRowComponentOptions', + 'MessageActionRowComponentResolvable', + 'MessageActionRowOptions', + 'MessageActivity', + 'MessageButtonOptions', + 'MessageButtonStyle', + 'MessageButtonStyleResolvable', + 'MessageCollectorOptions', + 'MessageComponent', + 'MessageComponentCollectorOptions', + 'MessageComponentOptions', + 'MessageComponentType', + 'MessageComponentTypeResolvable', + 'MessageEditOptions', + 'MessageEmbedAuthor', + 'MessageEmbedFooter', + 'MessageEmbedImage', + 'MessageEmbedOptions', + 'MessageEmbedProvider', + 'MessageEmbedThumbnail', + 'MessageEmbedVideo', + 'MessageFile', + 'MessageInteraction', + 'MessageMentionOptions', + 'MessageMentionsHasOptions', + 'MessageMentionTypes', + 'MessageOptions', + 'MessageReactionResolvable', + 'MessageReference', + 'MessageResolvable', + 'MessageSelectMenuOptions', + 'MessageSelectOption', + 'MessageSelectOptionData', + 'MessageTarget', + 'MessageType', + 'MFALevel', + 'MultipleShardRespawnOptions', + 'MultipleShardSpawnOptions', + 'NSFWLevel', + 'OverwriteData', + 'OverwriteResolvable', + 'OverwriteType', + 'Partial', + 'PartialChannelData', + 'PartialOverwriteData', + 'PartialRecipient', + 'PartialRoleData', + 'PartialType', + 'PermissionOverwriteOptions', + 'PermissionResolvable', + 'PremiumTier', + 'PresenceData', + 'PresenceResolvable', + 'PresenceStatus', + 'PresenceStatusData', + 'PrivacyLevel', + 'RateLimitData', + 'RateLimitQueueFilter', + 'RawEmoji', + 'RawOverwriteData', + 'ReactionCollectorOptions', + 'RemoveApplicationCommandPermissionsOptions', + 'ReplyMessageOptions', + 'ReplyOptions', + 'ResolvedOverwriteOptions', + 'RoleData', + 'RoleResolvable', + 'SetApplicationCommandPermissionsOptions', + 'SetChannelPositionOptions', + 'SetParentOptions', + 'SetRolePositionOptions', + 'ShardingManagerMode', + 'ShardingManagerOptions', + 'ShardRespawnOptions', + 'Snowflake', + 'SplitOptions', + 'StageChannelResolvable', + 'StageInstanceCreateOptions', + 'StageInstanceEditOptions', + 'StartThreadOptions', + 'StaticImageURLOptions', + 'Status', + 'StickerFormatType', + 'StickerResolvable', + 'StickerType', + 'SweepFilter', + 'SystemChannelFlagsResolvable', + 'SystemMessageType', + 'TargetType', + 'TextBasedChannels', + 'TextBasedChannelTypes', + 'TextChannelResolvable', + 'ThreadAutoArchiveDuration', + 'ThreadChannelResolvable', + 'ThreadChannelTypes', + 'ThreadCreateOptions', + 'ThreadEditData', + 'ThreadMemberResolvable', + 'TimestampStylesString', + 'UserResolvable', + 'Vanity', + 'VerificationLevel', + 'VoiceBasedChannelTypes', + 'VoiceChannelResolvable', + 'WebhookClientData', + 'WebhookEditData', + 'WebhookEditMessageOptions', + 'WebhookFetchMessageOptions', + 'WebhookMessageOptions', + 'WebhookType', + 'WebsocketOptions', + 'WelcomeChannelData', + 'WelcomeScreenEditData', + 'WidgetActivity', + 'WidgetChannel', + 'WSEventType' +]); + +export function resolveTypeDefs(name: string): string | undefined { + if (knownTypeDefs.has(name)) { + return `${baseLink}/${name}`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/THIRD_PARTY_LICENSE b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/THIRD_PARTY_LICENSE new file mode 100644 index 00000000..81173e61 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/THIRD_PARTY_LICENSE @@ -0,0 +1,19 @@ +Copyright 2021 Gerrit Birkeland + +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/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveCss.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveCss.ts new file mode 100644 index 00000000..69117e6f --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveCss.ts @@ -0,0 +1,70 @@ +const cssPages = new Set([ + // Reference + 'AnimationEvent', + 'CaretPosition', + 'CSS', + 'CSSConditionRule', + 'CSSCounterStyleRule', + 'CSSFontFaceRule', + 'CSSGroupingRule', + 'CSSImportRule', + 'CSSKeyframeRule', + 'CSSKeyframesRule', + 'CSSMediaRule', + 'CSSNamespaceRule', + 'CSSPageRule', + 'CSSRule', + 'CSSRuleList', + 'CSSStyleDeclaration', + 'CSSStyleSheet', + 'CSSStyleRule', + 'CSSSupportsRule', + 'FontFace', + 'FontFaceSet', + 'FontFaceSetLoadEvent', + 'MediaList', + 'MediaQueryList', + 'MediaQueryListEvent', + 'Screen', + 'StyleSheet', + 'StyleSheetList', + 'TransitionEvent', + + // CSS Typed Object Model + 'CSSImageValue', + 'CSSKeywordValue', + 'CSSMathInvert', + 'CSSMathMax', + 'CSSMathMin', + 'CSSMathNegate', + 'CSSMathProduct', + 'CSSMathSum', + 'CSSMathValue', + 'CSSMatrixComponent', + 'CSSNumericArray', + 'CSSNumericValue', + 'CSSPerspective', + 'CSSPositionValue', + 'CSSRotate', + 'CSSScale', + 'CSSSkew', + 'CSSSkewX', + 'CSSSkewY', + 'CSSStyleValue', + 'CSSTransformComponent', + 'CSSTransformValue', + 'CSSTranslate', + 'CSSUnitValue', + 'CSSUnparsedValue', + 'CSSVariableReferenceValue', + 'StylePropertyMap', + 'StylePropertyMapReadOnly ' +]); + +export function resolveCss(name: string) { + if (cssPages.has(name)) { + return `https://developer.mozilla.org/en-US/docs/Web/API/${name}`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveDom.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveDom.ts new file mode 100644 index 00000000..42126c8c --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveDom.ts @@ -0,0 +1,255 @@ +const webPages = new Set([ + // Sidebar from HTMLElement page + 'HTMLElement', + 'BeforeUnloadEvent', + 'DOMStringMap', + 'ErrorEvent', + 'GlobalEventHandlers', + 'HTMLAnchorElement', + 'HTMLAreaElement', + 'HTMLAudioElement', + 'HTMLBRElement', + 'HTMLBaseElement', + 'HTMLBaseFontElement', + 'HTMLBodyElement', + 'HTMLButtonElement', + 'HTMLCanvasElement', + 'HTMLContentElement', + 'HTMLDListElement', + 'HTMLDataElement', + 'HTMLDataListElement', + 'HTMLDialogElement', + 'HTMLDivElement', + 'HTMLDocument', + 'HTMLEmbedElement', + 'HTMLFieldSetElement', + 'HTMLFormControlsCollection', + 'HTMLFormElement', + 'HTMLFrameSetElement', + 'HTMLHRElement', + 'HTMLHeadElement', + 'HTMLHeadingElement', + 'HTMLHtmlElement', + 'HTMLIFrameElement', + 'HTMLImageElement', + 'HTMLInputElement', + 'HTMLIsIndexElement', + 'HTMLKeygenElement', + 'HTMLLIElement', + 'HTMLLabelElement', + 'HTMLLegendElement', + 'HTMLLinkElement', + 'HTMLMapElement', + 'HTMLMediaElement', + 'HTMLMetaElement', + 'HTMLMeterElement', + 'HTMLModElement', + 'HTMLOListElement', + 'HTMLObjectElement', + 'HTMLOptGroupElement', + 'HTMLOptionElement', + 'HTMLOptionsCollection', + 'HTMLOutputElement', + 'HTMLParagraphElement', + 'HTMLParamElement', + 'HTMLPictureElement', + 'HTMLPreElement', + 'HTMLProgressElement', + 'HTMLQuoteElement', + 'HTMLScriptElement', + 'HTMLSelectElement', + 'HTMLShadowElement', + 'HTMLSourceElement', + 'HTMLSpanElement', + 'HTMLStyleElement', + 'HTMLTableCaptionElement', + 'HTMLTableCellElement', + 'HTMLTableColElement', + 'HTMLTableDataCellElement', + 'HTMLTableElement', + 'HTMLTableHeaderCellElement', + 'HTMLTableRowElement', + 'HTMLTableSectionElement', + 'HTMLTemplateElement', + 'HTMLTextAreaElement', + 'HTMLTimeElement', + 'HTMLTitleElement', + 'HTMLTrackElement', + 'HTMLUListElement', + 'HTMLUnknownElement', + 'HTMLVideoElement', + 'HashChangeEvent', + 'History', + 'ImageData', + 'Location', + 'MessageChannel', + 'MessageEvent', + 'MessagePort', + 'Navigator', + 'PageTransitionEvent', + 'Plugin', + 'PluginArray', + 'PopStateEvent', + 'PortCollection', + 'PromiseRejectionEvent', + 'RadioNodeList', + 'Transferable', + 'ValidityState', + 'Window', + 'WindowBase64', + 'WindowEventHandlers', + 'WindowTimers', + + // DOM interfaces + 'Attr', + 'CDATASection', + 'CharacterData', + 'Comment', + 'CustomEvent', + 'Document', + 'DocumentFragment', + 'DocumentType', + 'DOMException', + 'DOMImplementation', + 'DOMString', + 'DOMTimeStamp', + 'DOMStringList', + 'DOMTokenList', + 'Element', + 'Event', + 'EventTarget', + 'HTMLCollection', + 'MutationObserver', + 'MutationRecord', + 'NamedNodeMap', + 'Node', + 'NodeFilter', + 'NodeIterator', + 'NodeList', + 'ProcessingInstruction', + 'Selection', + 'Range', + 'Text', + 'TextDecoder', + 'TextEncoder', + 'TimeRanges', + 'TreeWalker', + 'URL', + 'Window', + 'Worker', + 'XMLDocument', + + // SVG interfaces + 'SVGAElement', + 'SVGAnimationElement', + 'SVGAnimateElement', + 'SVGAnimateMotionElement', + 'SVGAnimateTransformElement', + 'SVGCircleElement', + 'SVGClipPathElement', + 'SVGComponentTransferFunctionElement', + 'SVGCursorElement', + 'SVGDefsElement', + 'SVGDescElement', + 'SVGElement', + 'SVGEllipseElement', + 'SVGFEBlendElement', + 'SVGFEColorMatrixElement', + 'SVGFEComponentTransferElement', + 'SVGFECompositeElement', + 'SVGFEConvolveMatrixElement', + 'SVGFEDiffuseLightingElement', + 'SVGFEDisplacementMapElement', + 'SVGFEDistantLightElement', + 'SVGFEDropShadowElement', + 'SVGFEFloodElement', + 'SVGFEFuncAElement', + 'SVGFEFuncBElement', + 'SVGFEFuncGElement', + 'SVGFEFuncRElement', + 'SVGFEGaussianBlurElement', + 'SVGFEImageElement', + 'SVGFEMergeElement', + 'SVGFEMergeNodeElement', + 'SVGFEMorphologyElement', + 'SVGFEOffsetElement', + 'SVGFEPointLightElement', + 'SVGFESpecularLightingElement', + 'SVGFESpotLightElement', + 'SVGFETileElement', + 'SVGFETurbulenceElement', + 'SVGFilterElement', + 'SVGForeignObjectElement', + 'SVGGElement', + 'SVGGeometryElement', + 'SVGGradientElement', + 'SVGGraphicsElement', + 'SVGImageElement', + 'SVGLinearGradientElement', + 'SVGLineElement', + 'SVGMarkerElement', + 'SVGMaskElement', + 'SVGMetadataElement', + 'SVGMPathElement', + 'SVGPathElement', + 'SVGPatternElement', + 'SVGPolylineElement', + 'SVGPolygonElement', + 'SVGRadialGradientElement', + 'SVGRectElement', + 'SVGScriptElement', + 'SVGSetElement', + 'SVGStopElement', + 'SVGStyleElement', + 'SVGSVGElement', + 'SVGSwitchElement', + 'SVGSymbolElement', + 'SVGTextContentElement', + 'SVGTextElement', + 'SVGTextPathElement', + 'SVGTextPositioningElement', + 'SVGTitleElement', + 'SVGTSpanElement', + 'SVGUseElement', + 'SVGViewElement', + + // SVG data type interfaces + 'SVGAngle', + 'SVGLength', + 'SVGLengthList', + 'SVGNumber', + 'SVGNumberList', + 'SVGPreserveAspectRatio', + 'SVGStringList', + 'SVGTransform', + 'SVGTransformList', + + // Animated type + 'SVGAnimatedAngle', + 'SVGAnimatedBoolean', + 'SVGAnimatedEnumeration', + 'SVGAnimatedInteger', + 'SVGAnimatedLength', + 'SVGAnimatedLengthList', + 'SVGAnimatedNumber', + 'SVGAnimatedNumberList', + 'SVGAnimatedPoints', + 'SVGAnimatedPreserveAspectRatio', + 'SVGAnimatedRect', + 'SVGAnimatedString', + 'SVGAnimatedTransformList', + + // SMIL-related interfaces + 'TimeEvent', + + // Other SVG interfaces + 'SVGUnitTypes' +]); + +export function resolveDom(name: string) { + if (webPages.has(name)) { + return `https://developer.mozilla.org/en-US/docs/Web/API/${name}`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveGlobals.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveGlobals.ts new file mode 100644 index 00000000..a7aa1060 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/mdn/resolveGlobals.ts @@ -0,0 +1,121 @@ +const baseLink = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects'; + +const knownGlobalObjects = new Set([ + // Value properties + 'Infinity', + 'NaN', + 'undefined', + 'globalThis', + + // Function properties + 'eval', + 'isFinite', + 'isNaN', + 'parseFloat', + 'parseInt', + 'encodeURI', + 'encodeURIComponent', + 'decodeURI', + 'decodeURIComponent', + + // Fundamental objects + 'Object', + 'Function', + 'Boolean', + 'Symbol', + + // Error objects + 'Error', + 'AggregateError', + 'EvalError', + 'InternalError', + 'RangeError', + 'ReferenceError', + 'SyntaxError', + 'TypeError', + 'URIError', + + // Numbers and dates + 'Number', + 'BigInt', + 'Math', + 'Date', + + // Text processing + 'String', + 'RegExp', + + // Indexed collections + 'Array', + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array', + + // Keyed collections + 'Map', + 'Set', + 'WeakMap', + 'WeakSet', + + // Structured data + 'ArrayBuffer', + 'SharedArrayBuffer', + 'Atomics', + 'DataView', + 'JSON', + + // Control abstraction objects + 'Promise', + 'Generator', + 'GeneratorFunction', + 'AsyncFunction', + // "AsyncGenerator", // No file on MDN yet + // "AsyncGeneratorFunction", // No file on MDN yet + + // Reflection + 'Reflect', + 'Proxy', + + 'Intl', + 'WebAssembly' +]); + +const knownScopedGlobalObjects = { + // Internationalization + Collator: 'Intl/Collator', + DateTimeFormat: 'Intl/DateTimeFormat', + ListFormat: 'Intl/ListFormat', + NumberFormat: 'Intl/NumberFormat', + PluralRules: 'Intl/PluralRules', + RelativeTimeFormat: 'Intl/RelativeTimeFormat', + Locale: 'Intl/Locale', + + // WebAssembly + Module: 'WebAssembly/Module', + Instance: 'WebAssembly/Instance', + Memory: 'WebAssembly/Memory', + Table: 'WebAssembly/Table', + CompileError: 'WebAssembly/CompileError', + LinkError: 'WebAssembly/LinkError', + RuntimeError: 'WebAssembly/RuntimeError' +}; + +export function resolveGlobals(name: string) { + if (knownGlobalObjects.has(name)) { + return `${baseLink}/${name}`; + } + + if (knownScopedGlobalObjects.hasOwnProperty(name)) { + return `${baseLink}/${knownScopedGlobalObjects[name as never]}`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/parsers.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/parsers.ts new file mode 100644 index 00000000..6f8b42a4 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/parsers.ts @@ -0,0 +1,177 @@ +import { isNullishOrEmpty } from '@sapphire/utilities'; +import type { Documentation } from '../../types/docgen-output'; +import { resolveClasses as resolveDiscordjsClasses } from './discordjs/resolveClasses'; +import { resolveTypeDefs as resolveDiscordjsTypedefs } from './discordjs/resolveTypedefs'; +import { resolveCss } from './mdn/resolveCss'; +import { resolveDom } from './mdn/resolveDom'; +import { resolveGlobals } from './mdn/resolveGlobals'; +import { resolveClasses as resolveSapphireClasses } from './sapphire/resolveClasses'; +import { resolveNamespaces as resolveSapphireNamespaces } from './sapphire/resolveNamespaces'; +import { resolveTypeDefs as resolveSapphireTypedefs } from './sapphire/resolveTypeDefs'; + +const linkExtractorRegex = /{@link (?[A-Za-z.]+)}/g; +const genericTypeInfillRegex = /(?:(?:\[`)?[A-Za-z]+(?:`\]?)(?:\([\.A-Za-z\/]+\)))?<(?[A-Za-z]+)>/g; +const genericTypeRegex = /(?[A-Za-z]+)(?:<\[?[A-Za-z]+\]?(?:\([\.A-Za-z\/]+\))?\\?>)?/g; + +type ReplaceArgs = [string, ...unknown[]]; +let hasReplacedWithLinkRegex = false; + +export function parseDocsLinks(jsonFileContent: Documentation, content: string) { + // Early exit if there is nothing to parse + if (isNullishOrEmpty(content)) return content; + + content = content.replace(linkExtractorRegex, (match, ...args: ReplaceArgs) => + parseSapphireExternals({ + args, + isLinkReplacement: true, + jsonFileContent, + match + }) + ); + + if (!hasReplacedWithLinkRegex) { + content = content.replace(genericTypeRegex, (match, ...args: ReplaceArgs) => + parseSapphireExternals({ + args, + isLinkReplacement: false, + jsonFileContent, + match + }) + ); + + content = content.replace(genericTypeInfillRegex, (match, ...args: ReplaceArgs) => + parseSapphireExternals({ + args, + isLinkReplacement: false, + jsonFileContent, + match + }) + ); + } + + hasReplacedWithLinkRegex = false; + content = content.replace(linkExtractorRegex, (match, ...args: ReplaceArgs) => + parseDiscordjsExternals({ + args, + isLinkReplacement: true, + match + }) + ); + + if (!hasReplacedWithLinkRegex) { + content = content.replace(genericTypeRegex, (match, ...args: ReplaceArgs) => + parseDiscordjsExternals({ + args, + isLinkReplacement: false, + match + }) + ); + + content = content.replace(genericTypeInfillRegex, (match, ...args: ReplaceArgs) => + parseDiscordjsExternals({ + args, + isLinkReplacement: false, + match + }) + ); + } + + hasReplacedWithLinkRegex = false; + content = content.replace(linkExtractorRegex, (match, ...args: ReplaceArgs) => + parseMdnExternals({ + args, + isLinkReplacement: true, + match + }) + ); + + if (!hasReplacedWithLinkRegex) { + content = content.replace(genericTypeRegex, (match, ...args: ReplaceArgs) => + parseMdnExternals({ + args, + isLinkReplacement: false, + match + }) + ); + + content = content.replace(genericTypeInfillRegex, (match, ...args: ReplaceArgs) => + parseMdnExternals({ + args, + isLinkReplacement: false, + match + }) + ); + } + + return content; +} + +function parseMdnExternals({ match, args: [matchContent], isLinkReplacement }: ParseExternalsParameters) { + const mdnLink = + resolveGlobals(matchContent) ?? // + resolveDom(matchContent) ?? + resolveCss(matchContent); + + if (mdnLink) { + const markdownText = `[\`${matchContent}\`](${mdnLink})`; + + if (isLinkReplacement) { + hasReplacedWithLinkRegex = true; + + return markdownText; + } + + return match.replace(matchContent, markdownText); + } + + return match; +} + +function parseDiscordjsExternals({ match, args: [matchContent], isLinkReplacement }: ParseExternalsParameters) { + const discordjsLink = resolveDiscordjsClasses(matchContent) ?? resolveDiscordjsTypedefs(matchContent); + + if (discordjsLink) { + const markdownText = `[\`${matchContent}\`](${discordjsLink})`; + + if (isLinkReplacement) { + hasReplacedWithLinkRegex = true; + + return markdownText; + } + + return match.replace(matchContent, markdownText); + } + + return match; +} + +function parseSapphireExternals({ match, jsonFileContent, args: [matchContent], isLinkReplacement }: ParseSapphireExternalsParameters) { + const sapphireDocsLink = + resolveSapphireClasses(matchContent, jsonFileContent.classes) ?? + resolveSapphireTypedefs(matchContent, jsonFileContent.typedefs) ?? + resolveSapphireNamespaces(matchContent, jsonFileContent.namespaces); + + if (sapphireDocsLink) { + const markdownText = `[\`${matchContent}\`](${sapphireDocsLink})`; + + if (isLinkReplacement) { + hasReplacedWithLinkRegex = true; + + return markdownText; + } + + return match.replace(matchContent, markdownText); + } + + return match; +} + +interface ParseExternalsParameters { + match: string; + args: ReplaceArgs; + isLinkReplacement: boolean; +} + +interface ParseSapphireExternalsParameters extends ParseExternalsParameters { + jsonFileContent: Documentation; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveClasses.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveClasses.ts new file mode 100644 index 00000000..02308e0c --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveClasses.ts @@ -0,0 +1,19 @@ +import type { DocumentationClass } from '../../../types/docgen-output'; +import { resolveExternalPackage } from './resolveExternalPackage'; + +export function resolveClasses(name: string, allClasses: DocumentationClass[]): string | undefined { + const allClassNames = allClasses.map((c) => c.name); + const docMeta = allClasses.find((c) => c.name === name)?.meta; + + if (allClassNames.includes(name)) { + const externalPackage = resolveExternalPackage(docMeta); + + if (externalPackage) { + return `../../${externalPackage}/class/${name.toLowerCase().replace(/\s/g, '-')}.mdx`; + } + + return `../class/${name.toLowerCase().replace(/\s/g, '-')}.mdx`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveExternalPackage.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveExternalPackage.ts new file mode 100644 index 00000000..26cbcad3 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveExternalPackage.ts @@ -0,0 +1,9 @@ +import type { DocumentationClassMeta } from '../../../types/docgen-output'; + +export function resolveExternalPackage(meta?: DocumentationClassMeta) { + if (!meta?.path) return null; + + if (!meta.path.includes('@sapphire')) return null; + + return meta.path.replace(/.+@(sapphire)\/([0-9a-zA-Z\-\.]+).+/, '$1-$2'); +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveNamespaces.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveNamespaces.ts new file mode 100644 index 00000000..390dab1e --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveNamespaces.ts @@ -0,0 +1,19 @@ +import type { DocumentationNamespace } from '../../../types/docgen-output'; +import { resolveExternalPackage } from './resolveExternalPackage'; + +export function resolveNamespaces(name: string, allNamespaces: DocumentationNamespace[]): string | undefined { + const allNamespaceNames = allNamespaces.map((c) => c.name); + const docMeta = allNamespaces.find((c) => c.name === name)?.meta; + + if (allNamespaceNames.includes(name)) { + const externalPackage = resolveExternalPackage(docMeta); + + if (externalPackage) { + return `../../${externalPackage}/namespace/${name.toLowerCase().replace(/\s/g, '-')}.mdx`; + } + + return `../namespace/${name.toLowerCase().replace(/\s/g, '-')}.mdx`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveTypeDefs.ts b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveTypeDefs.ts new file mode 100644 index 00000000..9a40c725 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/externals/sapphire/resolveTypeDefs.ts @@ -0,0 +1,19 @@ +import type { DocumentationTypeDefinition } from '../../../types/docgen-output'; +import { resolveExternalPackage } from './resolveExternalPackage'; + +export function resolveTypeDefs(name: string, allTypedefs: DocumentationTypeDefinition[]): string | undefined { + const allTypedefNames = allTypedefs.map((c) => c.name); + const docMeta = allTypedefs.find((c) => c.name === name)?.meta; + + if (allTypedefNames.includes(name)) { + const externalPackage = resolveExternalPackage(docMeta); + + if (externalPackage) { + return `../../${externalPackage}/typedef/${name.toLowerCase().replace(/\s/g, '-')}.mdx`; + } + + return `../typedef/${name.toLowerCase().replace(/\s/g, '-')}.mdx`; + } + + return undefined; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/render.ts b/docusaurus-discordjs-docgen/src/lib/renderer/render.ts new file mode 100644 index 00000000..57fd76f9 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/render.ts @@ -0,0 +1,19 @@ +import type { Documentation } from '../types/docgen-output'; +import type { PluginOptions } from '../types/types'; +import { renderClasses } from './renderClass'; +import { renderCustom } from './renderCustomFile'; +import { renderTypedefs } from './renderTypedef'; + +export function renderOutputFiles(jsonFileContent: Documentation, outputDir: string, _pluginOptions: PluginOptions) { + if (Reflect.has(jsonFileContent, 'custom')) { + renderCustom(jsonFileContent.custom, outputDir); + } + + if (Reflect.has(jsonFileContent, 'classes')) { + renderClasses(jsonFileContent, jsonFileContent.classes, outputDir); + } + + if (Reflect.has(jsonFileContent, 'typedefs')) { + renderTypedefs(jsonFileContent, jsonFileContent.typedefs, outputDir); + } +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/renderClass.ts b/docusaurus-discordjs-docgen/src/lib/renderer/renderClass.ts new file mode 100644 index 00000000..c34707a7 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/renderClass.ts @@ -0,0 +1,127 @@ +import { isNullishOrEmpty } from '@sapphire/utilities'; +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { Documentation, DocumentationClass } from '../types/docgen-output'; +import { pluginContainer } from '../utils/pluginContainer'; +import { parseContent, parseSee } from './utils'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderClass(jsonFileContent: Documentation, docClass: DocumentationClass, outputDir: string, sidebarPosition: number) { + const slug = docClass.name.toLowerCase().replace(/\s/g, '-'); + + const classHeader = [ + '---', + `id: "${slug}"`, + `title: "${docClass.name}"`, + `sidebar_label: "${docClass.name}"`, + `sidebar_position: ${sidebarPosition}`, + `custom_edit_url: null`, + '---' + ].join('\n'); + + const classExtends = parseClassExtendsAndImplements(docClass.extends); + const classImplements = parseClassExtendsAndImplements(docClass.implements); + + const classDescription = docClass.description ?? ''; + const classExtendedDescription = docClass.extendedDescription ?? ''; + + const classResult = `${classHeader} +${isNullishOrEmpty(classExtends) ? '' : `**extends ${parseContent(jsonFileContent, classExtends)}**`} +${isNullishOrEmpty(classImplements) ? '' : `**implements ${parseContent(jsonFileContent, classImplements)}**`} + +${parseContent(jsonFileContent, classDescription)} + +${parseContent(jsonFileContent, classExtendedDescription)} +${parseSee(jsonFileContent, docClass.see)} + +${parseExamples(docClass.examples)} + +${parseConstructor(jsonFileContent, docClass)} +${parseProperties(jsonFileContent, docClass)} +`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), classResult); +} + +export function renderClasses(jsonFileContent: Documentation, documentationClasses: DocumentationClass[], outputDir: string) { + const categoryDir = writeCategoryYaml(outputDir, 'class', 'Classes', 1); + + let fileSidebarPosition = 0; + for (const documentationClass of documentationClasses) { + if (documentationClass.isExternal) continue; + + renderClass(jsonFileContent, documentationClass, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} + +function parseClassExtendsAndImplements(classExtends?: string[] | string[][]) { + if (!classExtends) return ''; + + const zeroEntry = classExtends?.[0]; + + if (Array.isArray(zeroEntry)) { + return zeroEntry.join(', '); + } + + return zeroEntry; +} + +function parseExamples(examples?: string[]) { + if (isNullishOrEmpty(examples)) return ''; + + let examplesString = '## Examples\n\n'; + + for (const example of examples) { + const exampleWithPlugin = example.replace(/(```typescript)\n/g, '$1 ts2esm2cjs\n'); + + examplesString += `${exampleWithPlugin}\n\n`; + } + + return examplesString; +} + +function parseConstructor(jsonFileContent: Documentation, dClass: DocumentationClass) { + const classConstructorParameters = dClass.construct?.params?.map((param) => param.name).join(', '); + + return `## Constructor + +\`\`\`typescript ts2esm2cjs +import { ${dClass.name} } from '${pluginContainer.pluginOptions.packageName}'; + +new ${dClass.name}(${classConstructorParameters}); +\`\`\` + +| Parameter | Type | Optional | Default | Description | +| :---: | :---: | :---: | :---: | :---: | +${dClass.construct?.params + ?.map( + (param) => + `| ${param.name} | ${parseContent(jsonFileContent, param.type.flat(2).join(''))} | ${param.optional ? 'Yes' : 'No'} | ${ + param.default ?? '' + } | ${parseContent(jsonFileContent, param.description ?? 'N/A')} |` + ) + .join('\n')}`; +} + +function parseProperties(jsonFileContent: Documentation, dClass: DocumentationClass) { + const props = dClass.props ?? []; + + if (props.length === 0) return ''; + + // TODO: Add support for modifiers like, optional, readonly, etc. + + return `## Properties + +${props + .map( + (prop) => `### .${prop.name}** + +${parseContent(jsonFileContent, prop.description ?? '')} + +**Type**: ${parseContent(jsonFileContent, prop.type.flat(2).join(''))} +` + ) + .join('')}`; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/renderCustomFile.ts b/docusaurus-discordjs-docgen/src/lib/renderer/renderCustomFile.ts new file mode 100644 index 00000000..975ca53f --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/renderCustomFile.ts @@ -0,0 +1,51 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { DocumentationCustom, DocumentationCustomFile } from '../types/docgen-output'; +import { transformPlainCssToReactCss } from './transformPlainCssToReactCss'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +const replaceCssRegex = /style=\"(?.*?)\"/g; + +function customFileStylesParser(content: string): string { + return content.replace(replaceCssRegex, (match, _p1, _offset, _string, groups) => { + if (groups.css) { + const transformed = transformPlainCssToReactCss(groups.css); + return `style={${JSON.stringify(transformed)}}`; + } + + return match; + }); +} + +function renderCustomFile(slug: string, customFile: DocumentationCustomFile, outputDir: string, sidebarPosition: number) { + const lowercaseCustomFileType = customFile.type.toLowerCase(); + + if (lowercaseCustomFileType === 'md' || lowercaseCustomFileType === 'mdx' || lowercaseCustomFileType === 'markdown') { + const customFileHeader = [ + '---', + `id: "${slug}"`, + `title: "${customFile.name}"`, + `sidebar_label: "${customFile.name}"`, + `sidebar_position: ${sidebarPosition}`, + `custom_edit_url: null`, + '---' + ].join('\n'); + + const customFileResult = `${customFileHeader}\n${customFileStylesParser(customFile.content)}`; + writeFileSync(resolve(outputDir, `${slug}.mdx`), customFileResult); + } +} +export function renderCustom(documentationCustom: DocumentationCustom, outputDir: string) { + let categorySidebarPosition = 0; + for (const customCategory of Object.values(documentationCustom)) { + const categoryDir = writeCategoryYaml(outputDir, customCategory.name, customCategory.name, categorySidebarPosition); + + let fileSidebarPosition = 0; + for (const [slug, file] of Object.entries(customCategory.files)) { + renderCustomFile(slug, file, categoryDir, fileSidebarPosition); + fileSidebarPosition++; + } + + categorySidebarPosition++; + } +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/renderTypedef.ts b/docusaurus-discordjs-docgen/src/lib/renderer/renderTypedef.ts new file mode 100644 index 00000000..6a1b20a1 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/renderTypedef.ts @@ -0,0 +1,114 @@ +import { writeFileSync } from 'fs'; +import { resolve } from 'path'; +import type { Documentation, DocumentationTypeDefinition } from '../types/docgen-output'; +import { parseContent, parseSee } from './utils'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderTypedef(jsonFileContent: Documentation, docTypedef: DocumentationTypeDefinition, outputDir: string, sidebarPosition: number) { + const slug = docTypedef.name.toLowerCase().replace(/\s/g, '-'); + + const typedefHeader = [ + '---', + `id: "${slug}"`, + `title: "${docTypedef.name}"`, + `sidebar_label: "${docTypedef.name}"`, + `sidebar_position: ${sidebarPosition}`, + `custom_edit_url: null`, + '---' + ].join('\n'); + + const typedefDescription = docTypedef.description ?? ''; + const typedefExtendedDescription = docTypedef.extendedDescription ?? ''; + + let typedefResult = `${typedefHeader} + +${parseContent(jsonFileContent, typedefDescription)} + +${parseContent(jsonFileContent, typedefExtendedDescription)} +${parseSee(jsonFileContent, docTypedef.see)} +`; + + switch (docTypedef.variant) { + case 'enum': + typedefResult += parseEnum(jsonFileContent, docTypedef); + + break; + + case 'interface': + typedefResult += parseInterface(jsonFileContent, docTypedef); + + break; + + case 'type': + break; + } + + writeFileSync(resolve(outputDir, `${slug}.mdx`), typedefResult); +} + +export function renderTypedefs(jsonFileContent: Documentation, documentationTypedefs: DocumentationTypeDefinition[], outputDir: string) { + const categoryDir = writeCategoryYaml(outputDir, 'typedef', 'Type Definitions', 1); + + let fileSidebarPosition = 0; + for (const documentationTypedef of documentationTypedefs) { + if (documentationTypedef.isExternal) continue; + + renderTypedef(jsonFileContent, documentationTypedef, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} + +function parseEnum(jsonFileContent: Documentation, dEnum: DocumentationTypeDefinition) { + const props = dEnum.props ?? []; + + if (props.length === 0) return '## Empty Enum'; + + let enumResult = props.some((prop) => prop.description) + ? `| Property | Value | Description | +| :---: | :---: | :---: | +` + : `| Property | Value | +| :---: | :---: | +`; + + for (const prop of dEnum.props ?? []) { + enumResult += props.some((prop) => prop.description) + ? `| ${prop.name} | ${parseContent(jsonFileContent, prop.type.flat(2).join(''))} | ${parseContent( + jsonFileContent, + prop.description ?? 'N/A' + )} | +` + : `| ${prop.name} | ${parseContent(jsonFileContent, prop.type.flat(2).join(''))} | +`; + } + + return enumResult; +} + +function parseInterface(jsonFileContent: Documentation, dInterface: DocumentationTypeDefinition) { + const props = dInterface.props ?? []; + + if (props.length === 0) return '## Empty Interface'; + + let enumResult = props.some((prop) => prop.description) + ? `| Property | Type | Optional | Description | +| :---: | :---: | :---: | :---: | +` + : `| Property | Type | Optional | +| :---: | :---: | :---: | +`; + + for (const prop of dInterface.props ?? []) { + enumResult += props.some((prop) => prop.description) + ? `| ${prop.name} | ${parseContent(jsonFileContent, prop.type.flat(2).join(''))} | ${prop.optional ? 'Yes' : 'No'} | ${parseContent( + jsonFileContent, + prop.description ?? 'N/A' + )} | +` + : `| ${prop.name} | ${parseContent(jsonFileContent, prop.type.flat(2).join(''))} | ${prop.optional ? 'Yes' : 'No'} | +`; + } + + return enumResult; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/transformPlainCssToReactCss.ts b/docusaurus-discordjs-docgen/src/lib/renderer/transformPlainCssToReactCss.ts new file mode 100644 index 00000000..1733571b --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/transformPlainCssToReactCss.ts @@ -0,0 +1,82 @@ +import { parse, type Rule } from 'css'; + +type CssProperty = string | { __expression__: string }; +type CSSProperties = Record; + +function transformRules(rules: Rule[], result: Record) { + if (rules) { + rules.forEach((rule) => { + const obj = {}; + if (rule.type === 'media') { + const name = mediaNameGenerator(rule.media); + + result[name] ||= { + __expression__: rule.media + }; + + const media = result[name]; + + transformRules(rule.rules, media as any); + } else if (rule.type === 'rule') { + rule.declarations.forEach((declaration) => { + if (declaration.type === 'declaration') { + const cleanProperty = cleanPropertyName(declaration.property); + + Reflect.set(obj, cleanProperty, declaration.value); + } + }); + + rule.selectors.forEach((selector) => { + const name = nameGenerator(selector.trim()); + + Reflect.set(result, name, obj); + }); + } + }); + } +} + +const cleanPropertyName = (name: string) => { + // turn things like 'align-items' into 'alignItems' + name = name.replace(/(-.)/g, (v) => v[1].toUpperCase()); + + return name; +}; + +const mediaNameGenerator = (name: string) => `@media ${name}`; + +const nameGenerator = (name: string) => { + name = name.replace(/\s\s+/g, ' '); + name = name.replace(/[^a-zA-Z0-9]/g, '_'); + name = name.replace(/^_+/g, ''); + name = name.replace(/_+$/g, ''); + + return name; +}; + +export function transformPlainCssToReactCss(inputCssText: string): CSSProperties | CssProperty { + if (!inputCssText) { + throw new Error('missing css text to transform'); + } + + // If the input "css" doesn't wrap it with a css class (raw styles) + // we need to wrap it with a style so the css parser doesn't choke. + let bootstrapWithCssClass = false; + if (!inputCssText.includes('{')) { + bootstrapWithCssClass = true; + inputCssText = `.bootstrapWithCssClass { ${inputCssText} }`; + } + + const css = parse(inputCssText); + + const result: CSSProperties = {}; + + transformRules(css.stylesheet?.rules, result); + + // Don't expose the implementation detail of our wrapped css class. + if (bootstrapWithCssClass) { + return result.bootstrapWithCssClass; + } + + return result; +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/utils.ts b/docusaurus-discordjs-docgen/src/lib/renderer/utils.ts new file mode 100644 index 00000000..c00d915a --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/utils.ts @@ -0,0 +1,43 @@ +import { existsSync, mkdirSync, readdirSync, rmdirSync, statSync, unlinkSync } from 'node:fs'; +import type { Documentation } from '../types/docgen-output'; +import { parseDocsLinks } from './externals/parsers'; + +export function parseContent(jsonFileContent: Documentation, content: string) { + content = parseDocsLinks(jsonFileContent, content); + + content = escapeGreaterThanSymbols(content); + + return content; +} + +export function parseSee(jsonFileContent: Documentation, see?: string[]) { + return see?.map((seeItem) => `\n**\`See also:\`** ${parseContent(jsonFileContent, seeItem)}`).join('\n') ?? ''; +} + +function escapeGreaterThanSymbols(markdown: string) { + return markdown.replace(/<([A-Za-z]+)>(?!`)/gm, '<$1\\>'); +} + +export function removeDir(outputDir: string) { + if (existsSync(outputDir)) { + const files = readdirSync(outputDir); + if (files.length > 0) { + files.forEach((filename) => { + if (statSync(`${outputDir}/${filename}`).isDirectory()) { + removeDir(`${outputDir}/${filename}`); + } else { + unlinkSync(`${outputDir}/${filename}`); + } + }); + rmdirSync(outputDir); + } else { + rmdirSync(outputDir); + } + } +} + +export function createDirIfNotExists(dir: string) { + if (!existsSync(dir)) { + mkdirSync(dir, { recursive: true }); + } +} diff --git a/docusaurus-discordjs-docgen/src/lib/renderer/writeCategoryYaml.ts b/docusaurus-discordjs-docgen/src/lib/renderer/writeCategoryYaml.ts new file mode 100644 index 00000000..b9d4801b --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/renderer/writeCategoryYaml.ts @@ -0,0 +1,19 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import { createDirIfNotExists } from './utils'; + +export function writeCategoryYaml(outputDir: string, categoryPath: string, categoryName: string, sidebarPosition: number) { + const categoryDir = resolve(outputDir, categoryPath); + + createDirIfNotExists(categoryDir); + + const categoryData = [ + // + `label: "${categoryName}"`, + `position: ${sidebarPosition}` + ].join('\n'); + + writeFileSync(resolve(categoryDir, '_category_.yml'), categoryData); + + return categoryDir; +} diff --git a/docusaurus-discordjs-docgen/src/lib/types/css.d.ts b/docusaurus-discordjs-docgen/src/lib/types/css.d.ts new file mode 100644 index 00000000..ca88f585 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/types/css.d.ts @@ -0,0 +1,75 @@ +declare module 'css' { + export interface Start { + column: number; + + line: number; + } + + export interface End { + column: number; + + line: number; + } + + export interface Position { + end: End; + + start: Start; + } + + export interface Declaration { + position: Position; + + property: string; + + type: string; + + value: string; + } + + export interface Start2 { + column: number; + + line: number; + } + + export interface End2 { + column: number; + + line: number; + } + + export interface Position2 { + end: End2; + + start: Start2; + } + + export interface Rule { + declarations: Declaration[]; + + media: string; + + position: Position2; + + rules: Rule[]; + + selectors: string[]; + + type: string; + } + + export interface Stylesheet { + parsingErrors: any[]; + + rules: Rule[]; + } + + export interface CssParserResult { + stylesheet: Stylesheet; + + type: string; + } + + export function parse(cssText: string): CssParserResult; +} diff --git a/docusaurus-discordjs-docgen/src/lib/types/docgen-output.ts b/docusaurus-discordjs-docgen/src/lib/types/docgen-output.ts new file mode 100644 index 00000000..64bcf3f5 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/types/docgen-output.ts @@ -0,0 +1,247 @@ +/** + * Copyright (c) 2021 iCrawl + * Copyright (c) 2020 Federico Grandi + * + * 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. + */ + +interface DocumentationMeta { + date: number; + format: number; + generator: string; +} + +export interface DocumentationClassMeta { + file: string; + line: number; + path: string; +} +type DocumentationClassMethodMeta = DocumentationClassMeta; + +type DocumentationClassMethodParameterMeta = DocumentationClassMeta; + +type DocumentationClassMethodPropertyMeta = DocumentationClassMeta; + +type DocumentationClassEventMeta = DocumentationClassMeta; + +type DocumentationExternalMeta = DocumentationClassMeta; + +type DocumentationTypeDefinitionMeta = DocumentationClassMeta; + +type DocumentationTypeDefinitionParameterMeta = DocumentationClassMeta; + +export interface DocumentationTypeAlias { + meta: DocumentationClassMeta; + name: string; + type?: string[][][]; +} + +export interface DocumentationInterface { + meta: DocumentationClassMethodPropertyMeta; + name: string; + props: DocumentationClassPropertyProperty[]; +} + +export interface DocumentationParameter { + abstract?: boolean; + access?: string; + default: string; + deprecated?: boolean | string; + description?: string; + name: string; + nullable?: boolean; + optional?: boolean; + readonly?: boolean; + scope?: string; + see?: string[]; + type: string[][][]; + variable?: boolean; +} + +type DocumentationClassConstructorParameter = DocumentationParameter; + +type DocumentationClassEventParameter = DocumentationParameter; + +interface DocumentationClassMethodParameter extends DocumentationParameter { + meta: DocumentationClassMethodParameterMeta; +} + +interface DocumentationTypeDefinitionParameter extends DocumentationParameter { + meta: DocumentationTypeDefinitionParameterMeta; +} + +type DocumentationProperty = DocumentationParameter; + +type DocumentationTypeDefinitionProperty = DocumentationProperty; + +type DocumentationClassPropertyProperty = DocumentationProperty; + +export interface DocumentationClassProperty extends DocumentationProperty { + meta: DocumentationClassMethodPropertyMeta; + props: DocumentationClassPropertyProperty[]; +} + +export interface DocumentationClassConstructor { + name: string; + params?: DocumentationClassConstructorParameter[]; +} + +export interface DocumentationReturns { + description: string; + nullable: boolean; + types: string[][][]; + variable: boolean; +} + +export interface DocumentationClassMethod { + abstract?: boolean; + access?: string; + async?: boolean; + deprecated?: boolean | string; + description?: string; + examples?: string[]; + inherited?: boolean; + meta: DocumentationClassMethodMeta; + name: string; + params?: DocumentationClassMethodParameter[]; + returns?: DocumentationReturns; + returnsDescription?: string; + scope?: string; + see?: string[]; + throws?: string[]; +} + +export interface DocumentationClassEvent { + access?: string; + deprecated?: boolean | string; + description: string; + meta: DocumentationClassEventMeta; + name: string; + params: DocumentationClassEventParameter[]; + see?: string[]; +} + +export interface DocumentationClass { + abstract?: boolean | undefined; + access?: 'private' | undefined; + construct?: DocumentationClassConstructor | undefined; + deprecated?: boolean | undefined; + description?: string | undefined; + events?: DocumentationClassEvent[] | undefined; + examples?: string[] | undefined; + extendedDescription?: string | undefined; + extends?: [string] | undefined; + implements?: [string] | undefined; + isExternal?: boolean | undefined; + meta?: DocumentationClassMeta | undefined; + methods?: DocumentationClassMethod[] | undefined; + name: string; + props?: DocumentationClassProperty[] | undefined; + see?: string[] | undefined; +} + +export interface DocumentationCustomFile { + content: string; + name: string; + path: string; + type: string; +} + +export interface DocumentationCustom { + [key: string]: { + name: string; + files: { + [key: string]: DocumentationCustomFile; + }; + }; +} + +export interface DocumentationExternal { + meta: DocumentationExternalMeta; + name: string; + see: string[]; +} + +enum DocumentationLinkParams { + class = 'class', + typedef = 'typedef' +} + +export interface DocumentationLink { + [key: string]: + | { + name: string; + params: { + [key in DocumentationLinkParams]: string; + }; + } + | string; +} + +export interface DocumentationTypeDefinition { + access?: 'private' | undefined; + deprecated?: boolean | undefined; + description?: string | undefined; + extendedDescription?: string | undefined; + isExternal?: boolean | undefined; + meta?: DocumentationTypeDefinitionMeta | undefined; + name: string; + params?: DocumentationTypeDefinitionParameter[] | undefined; + props?: DocumentationTypeDefinitionProperty[] | undefined; + returns?: DocumentationReturns | undefined; + returnsDescription?: string | undefined; + see?: string[] | undefined; + type?: string[][] | string[][][] | undefined; + variant: 'type' | 'interface' | 'enum'; +} + +export interface DocumentationNamespace { + deprecated?: boolean | undefined; + description?: string | undefined; + enumerations?: DocumentationTypeDefinition[] | undefined; + extendedDescription?: string | undefined; + interfaces?: DocumentationTypeDefinition[] | undefined; + isExternal?: boolean | undefined; + meta?: DocumentationTypeDefinitionMeta | undefined; + name: string; + see?: string[] | undefined; + typeAliases?: DocumentationTypeDefinition[] | undefined; +} + +export type DocIterateeUnion = + | DocumentationClass + // | DocumentationCustom + | DocumentationExternal + | DocumentationInterface + // | DocumentationLink + | DocumentationTypeDefinition + | DocumentationClassEventParameter + | DocumentationClassProperty + | DocumentationClassMethod + | DocumentationClassMethodParameter + | DocumentationClassEvent; + +export interface Documentation { + classes: DocumentationClass[]; + custom: DocumentationCustom; + // externals: DocumentationExternal[]; + // global?: string; + // interfaces: DocumentationInterface[]; + // links: DocumentationLink[]; + meta: DocumentationMeta; + namespaces: DocumentationNamespace[]; + // id?: string; + // source?: string; + // tag?: string; + typedefs: DocumentationTypeDefinition[]; +} diff --git a/docusaurus-discordjs-docgen/src/lib/types/types.ts b/docusaurus-discordjs-docgen/src/lib/types/types.ts new file mode 100644 index 00000000..01d66675 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/types/types.ts @@ -0,0 +1,13 @@ +export interface PluginOptions { + id: string; + docsRoot: string; + out: string; + docgenJsonFile: string; + packageName: string; + sidebar: SidebarOptions; +} + +interface SidebarOptions { + categoryLabel: string; + position: number | null; +} diff --git a/docusaurus-discordjs-docgen/src/lib/utils/logger.ts b/docusaurus-discordjs-docgen/src/lib/utils/logger.ts new file mode 100644 index 00000000..b84073a7 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/utils/logger.ts @@ -0,0 +1,3 @@ +export function generateLogString(logString: string, id: string) { + return `[DOCUSAURUS-DISCORDJS-DOCGEN] ${logString} (found at: ${id})`; +} diff --git a/docusaurus-discordjs-docgen/src/lib/utils/options.ts b/docusaurus-discordjs-docgen/src/lib/utils/options.ts new file mode 100644 index 00000000..ec183800 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/utils/options.ts @@ -0,0 +1,27 @@ +import type { PluginOptions } from '../types/types'; + +const DEFAULT_PLUGIN_OPTIONS: PluginOptions = { + id: 'default', + docsRoot: 'docs', + out: 'api', + docgenJsonFile: 'docs.json', + packageName: 'API', + sidebar: { + categoryLabel: 'API', + position: null + } +}; + +export function getPluginOptions(opts: Partial): PluginOptions { + const options = { + ...DEFAULT_PLUGIN_OPTIONS, + ...opts, + packageName: opts.packageName ?? opts.sidebar?.categoryLabel ?? DEFAULT_PLUGIN_OPTIONS.packageName, + sidebar: { + ...DEFAULT_PLUGIN_OPTIONS.sidebar, + ...opts.sidebar + } + }; + + return options; +} diff --git a/docusaurus-discordjs-docgen/src/lib/utils/pluginContainer.ts b/docusaurus-discordjs-docgen/src/lib/utils/pluginContainer.ts new file mode 100644 index 00000000..fd79bf35 --- /dev/null +++ b/docusaurus-discordjs-docgen/src/lib/utils/pluginContainer.ts @@ -0,0 +1,8 @@ +import type { PluginOptions } from '../types/types'; + +// @ts-expect-error initialise empty container +export const pluginContainer: Container = {}; + +interface Container { + pluginOptions: PluginOptions; +} diff --git a/docusaurus-discordjs-docgen/tsconfig.json b/docusaurus-discordjs-docgen/tsconfig.json new file mode 100644 index 00000000..ccc201e4 --- /dev/null +++ b/docusaurus-discordjs-docgen/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@sapphire/ts-config", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "lib": ["ESNext", "DOM"], + "tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo" + }, + "include": ["src"] +} diff --git a/docusaurus-typedoc-json-parser/package.json b/docusaurus-typedoc-json-parser/package.json new file mode 100644 index 00000000..1a651900 --- /dev/null +++ b/docusaurus-typedoc-json-parser/package.json @@ -0,0 +1,30 @@ +{ + "name": "docusaurus-typedoc-json-parser", + "version": "0.0.1", + "description": "A Docusaurus v2 plugin to build API Documentation based on typedoc-json-parser output.", + "main": "dist/index.js", + "files": [ + "dist/" + ], + "scripts": { + "build": "tsc", + "watch": "tsc -w", + "debug": "node --inspect scripts/debug.mjs", + "start": "node scripts/debug.mjs" + }, + "dependencies": { + "@sapphire/docusaurus-plugin-ts2esm2cjs": "^1.1.3", + "@sapphire/fetch": "^2.4.1", + "@sapphire/result": "^2.6.0", + "@sapphire/utilities": "^3.11.0", + "common-tags": "^1.8.2", + "css": "^3.0.0", + "typedoc-json-parser": "^6.0.1" + }, + "devDependencies": { + "@docusaurus/types": "^2.1.0", + "@types/common-tags": "^1.8.1", + "dotenv": "^16.0.3", + "typescript": "^4.8.4" + } +} diff --git a/docusaurus-typedoc-json-parser/scripts/debug.mjs b/docusaurus-typedoc-json-parser/scripts/debug.mjs new file mode 100644 index 00000000..e1deb962 --- /dev/null +++ b/docusaurus-typedoc-json-parser/scripts/debug.mjs @@ -0,0 +1,65 @@ +import { fileURLToPath } from 'node:url'; +import parser from '../dist/index.js'; +import { config } from 'dotenv'; + +config(); + +const docusaurusTypeDocJsonParser = parser.default; + +const siteDir = new URL('../../', import.meta.url); +const generatedFilesDir = new URL('.docusaurus/', siteDir); +const outDir = new URL('build/', siteDir); +const siteConfigPath = new URL('docusaurus.config.js', siteDir); + +docusaurusTypeDocJsonParser( + { + siteDir: fileURLToPath(siteDir), + generatedFilesDir: fileURLToPath(generatedFilesDir), + siteConfig: { + title: 'Sapphire', + url: 'https://sapphirejs.dev', + baseUrl: '/', + onBrokenLinks: 'warn', + onBrokenMarkdownLinks: 'warn', + onDuplicateRoutes: 'throw', + favicon: 'img/favicon.ico', + tagline: + 'Sapphire is a next-gen Discord bot framework for developers of all skill levels to make the best JavaScript/TypeScript based bots possible.', + organizationName: 'sapphiredev', + projectName: 'framework', + baseUrlIssueBanner: true, + i18n: { + defaultLocale: 'en', + locales: ['en'], + localeConfigs: {} + }, + staticDirectories: ['static'], + customFields: {}, + scripts: [], + stylesheets: [], + clientModules: [], + titleDelimiter: '|', + noIndex: false + }, + siteConfigPath: fileURLToPath(siteConfigPath), + outDir: fileURLToPath(outDir), + baseUrl: '/', + i18n: { + defaultLocale: 'en', + locales: ['en'], + currentLocale: 'en', + localeConfigs: { + en: { + label: 'English', + direction: 'ltr', + htmlLang: 'en' + } + } + }, + codeTranslations: {} + }, + { + githubContentUrl: 'https://api.github.com/repos/sapphiredev/docs/contents/docs', + githubToken: process.env.GITHUB_TOKEN + } +).loadContent(); diff --git a/docusaurus-typedoc-json-parser/src/index.ts b/docusaurus-typedoc-json-parser/src/index.ts new file mode 100644 index 00000000..b0e17c87 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/index.ts @@ -0,0 +1,91 @@ +import type { LoadContext, Plugin } from '@docusaurus/types'; +import { fetch } from '@sapphire/fetch'; +import type { PluginOptions } from './types/PluginOptions'; +import { RepositoryContent, RepositoryContentFileType } from './types/RepositoryContent'; +import { ProjectParser } from 'typedoc-json-parser'; +import { resolve } from 'node:path'; +import { removeDirectory } from './renderer/utilities/removeDirectory'; +import { writeCategoryYaml } from './renderer/writeCategoryYaml'; +import { renderOutputFiles } from './renderer/render'; + +export default function docusaurusTypeDocJsonParser(context: LoadContext, options: PluginOptions): Plugin { + return { + name: 'docusaurus-typedoc-json-parser', + async loadContent() { + const { siteDir } = context; + const { githubContentUrl, githubToken } = options; + + const contents = ( + await (githubToken + ? fetch(githubContentUrl, { + headers: { + Authorization: `Bearer ${githubToken}` + } + }) + : fetch(githubContentUrl)) + ).filter((content) => content.type === RepositoryContentFileType.Directory); + + for (const content of contents) { + const projectContents = await fetch(content.url, { + headers: { + Authorization: `Bearer ${githubToken}` + } + }); + + for (const projectContent of projectContents) { + if (projectContent.type === RepositoryContentFileType.Directory) { + const projectSubContents = await fetch(projectContent.url, { + headers: { + Authorization: `Bearer ${githubToken}` + } + }); + + writeCategoryYaml(resolve(siteDir, 'docs', 'Documentation', content.name), '', content.name, 0); + + for (const projectSubContent of projectSubContents) { + if (projectSubContent.download_url === null) + throw new Error( + `The 'download_url' field is null for '${content.name}/${projectContent.name}/${projectSubContent.name}'` + ); + + const outputDir = resolve(siteDir, 'docs', 'Documentation', content.name, projectContent.name); + + removeDirectory(outputDir); + + writeCategoryYaml(outputDir, '', projectContent.name, 1); + + const data = await fetch(projectSubContent.download_url); + const incomingTypeDocJsonParserVersion = data.typeDocJsonParserVersion.split('.').map(Number) as [number, number, number]; + const currentTypeDocJsonParserVersion = ProjectParser.version.split('.').map(Number) as [number, number, number]; + + if (incomingTypeDocJsonParserVersion[0] !== currentTypeDocJsonParserVersion[0]) continue; + + const projectParser = new ProjectParser({ data, version: projectSubContent.name.replace('.json', '') }); + + renderOutputFiles(projectParser, outputDir, true); + } + } else { + if (projectContent.download_url === null) + throw new Error(`The 'download_url' field is null for '${content.name}/${projectContent.name}'`); + + const outputDir = resolve(siteDir, 'docs', 'Documentation', content.name); + + removeDirectory(outputDir); + + writeCategoryYaml(outputDir, '', content.name, 0); + + const data = await fetch(projectContent.download_url); + const incomingTypeDocJsonParserVersion = data.typeDocJsonParserVersion.split('.').map(Number) as [number, number, number]; + const currentTypeDocJsonParserVersion = ProjectParser.version.split('.').map(Number) as [number, number, number]; + + if (incomingTypeDocJsonParserVersion[0] !== currentTypeDocJsonParserVersion[0]) continue; + + const projectParser = new ProjectParser({ data, version: projectContent.name.replace('.json', '') }); + + renderOutputFiles(projectParser, outputDir, false); + } + } + } + } + }; +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/render.ts b/docusaurus-typedoc-json-parser/src/renderer/render.ts new file mode 100644 index 00000000..d932081d --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/render.ts @@ -0,0 +1,78 @@ +import { + ClassParser, + ConstantParser, + EnumParser, + FunctionParser, + InterfaceParser, + NamespaceParser, + ProjectParser, + ReferenceTypeParser, + TypeAliasParser +} from 'typedoc-json-parser'; +import { renderClasses } from './renderClass'; +import { renderConstants } from './renderConstant'; +import { renderEnums } from './renderEnum'; +import { renderFunctions } from './renderFunction'; +import { renderInterfaces } from './renderInterface'; +import { renderNamespaces } from './renderNamespace'; +import { renderTypeAliases } from './renderTypeAlias'; + +export function renderOutputFiles(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + if (projectParser.classes.length) { + renderClasses(projectParser, outputDir, isGroup); + } + + if (projectParser.constants.length) { + renderConstants(projectParser, outputDir, isGroup); + } + + if (projectParser.enums.length) { + renderEnums(projectParser, outputDir, isGroup); + } + + if (projectParser.functions.length) { + renderFunctions(projectParser, outputDir, isGroup); + } + + if (projectParser.interfaces.length) { + renderInterfaces(projectParser, outputDir, isGroup); + } + + if (projectParser.namespaces.length) { + renderNamespaces(projectParser, outputDir, isGroup); + } + + if (projectParser.typeAliases.length) { + renderTypeAliases(projectParser, outputDir, isGroup); + } +} + +ReferenceTypeParser.formatToString = (parser) => { + const typeArguments = parser.typeArguments.length > 0 ? `<${parser.typeArguments.map((type) => type.toString()).join(', ')}>` : ''; + + if (parser.id !== null && parser.packageName === null) { + const foundParser = parser.project.find(parser.id); + + if (foundParser !== null) { + if (foundParser instanceof ClassParser) { + return `[${parser.name}](../class/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } else if (foundParser instanceof ConstantParser) { + return `[${parser.name}](../constant/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } else if (foundParser instanceof EnumParser) { + return `[${parser.name}](../enum/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } else if (foundParser instanceof FunctionParser) { + return `[${parser.name}](../function/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } else if (foundParser instanceof InterfaceParser) { + return `[${parser.name}](../interface/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } else if (foundParser instanceof NamespaceParser) { + return `[${parser.name}](../namespace/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } else if (foundParser instanceof TypeAliasParser) { + return `[${parser.name}](../type-alias/${foundParser.name.toLowerCase().replace(/\s/g, '-')}.mdx)${typeArguments}`; + } + } + } + + // TODO: Parse `parser.packageName` + + return `${parser.packageName ? `${parser.packageName}.` : ''}${parser.name}${typeArguments}`; +}; diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderClass.ts b/docusaurus-typedoc-json-parser/src/renderer/renderClass.ts new file mode 100644 index 00000000..ea5a2610 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderClass.ts @@ -0,0 +1,56 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { ClassParser, ProjectParser, TypeParser } from 'typedoc-json-parser'; +import { parseExamples } from './utilities/parseExamples'; +import { parseSee } from './utilities/parseSee'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderClass(classParser: ClassParser, outputDir: string, fileSidebarPosition: number) { + const slug = classParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${classParser.name}" +sidebar_label: "${classParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const classExtendsType = parseExtendsType(classParser.extendsType); + const classImplementsTypes = parseImplementsType(classParser.implementsType); + + const result = `${header} +${classExtendsType === null ? '' : `**extends ${classExtendsType}**`} +${classImplementsTypes.length === 0 ? '' : `**implements ${classImplementsTypes.join(', ')}**`} + +${classParser.comment.description ?? ''} + +${parseSee(classParser.comment.see)} + +${parseExamples(classParser.comment.example)} +`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderClasses(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'class', 'Classes', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const classParser of projectParser.classes) { + if (classParser.external) continue; + + renderClass(classParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} + +function parseExtendsType(typeParser: TypeParser | null): string | null { + return typeParser?.toString() ?? null; +} + +function parseImplementsType(typeParsers: TypeParser[]): string[] { + return typeParsers.map((typeParser) => typeParser.toString()); +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderConstant.ts b/docusaurus-typedoc-json-parser/src/renderer/renderConstant.ts new file mode 100644 index 00000000..3e1abe7b --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderConstant.ts @@ -0,0 +1,34 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { ConstantParser, ProjectParser } from 'typedoc-json-parser'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderConstant(constantParser: ConstantParser, outputDir: string, fileSidebarPosition: number) { + const slug = constantParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${constantParser.name}" +sidebar_label: "${constantParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const result = `${header}`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderConstants(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'constant', 'Constants', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const constantParser of projectParser.constants) { + if (constantParser.external) continue; + + renderConstant(constantParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderEnum.ts b/docusaurus-typedoc-json-parser/src/renderer/renderEnum.ts new file mode 100644 index 00000000..c7573734 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderEnum.ts @@ -0,0 +1,34 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { EnumParser, ProjectParser } from 'typedoc-json-parser'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderEnum(enumParser: EnumParser, outputDir: string, fileSidebarPosition: number) { + const slug = enumParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${enumParser.name}" +sidebar_label: "${enumParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const result = `${header}`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderEnums(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'enum', 'Enums', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const enumParser of projectParser.enums) { + if (enumParser.external) continue; + + renderEnum(enumParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderFunction.ts b/docusaurus-typedoc-json-parser/src/renderer/renderFunction.ts new file mode 100644 index 00000000..dd46e8d4 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderFunction.ts @@ -0,0 +1,34 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { FunctionParser, ProjectParser } from 'typedoc-json-parser'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderFunction(functionParser: FunctionParser, outputDir: string, fileSidebarPosition: number) { + const slug = functionParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${functionParser.name}" +sidebar_label: "${functionParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const result = `${header}`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderFunctions(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'function', 'Functions', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const functionParser of projectParser.functions) { + if (functionParser.external) continue; + + renderFunction(functionParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderInterface.ts b/docusaurus-typedoc-json-parser/src/renderer/renderInterface.ts new file mode 100644 index 00000000..bcee4027 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderInterface.ts @@ -0,0 +1,34 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { InterfaceParser, ProjectParser } from 'typedoc-json-parser'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderInterface(interfaceParser: InterfaceParser, outputDir: string, fileSidebarPosition: number) { + const slug = interfaceParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${interfaceParser.name}" +sidebar_label: "${interfaceParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const result = `${header}`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderInterfaces(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'interface', 'Interfaces', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const interfaceParser of projectParser.interfaces) { + if (interfaceParser.external) continue; + + renderInterface(interfaceParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderNamespace.ts b/docusaurus-typedoc-json-parser/src/renderer/renderNamespace.ts new file mode 100644 index 00000000..fde120c4 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderNamespace.ts @@ -0,0 +1,34 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { NamespaceParser, ProjectParser } from 'typedoc-json-parser'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderNamespace(namespaceParser: NamespaceParser, outputDir: string, fileSidebarPosition: number) { + const slug = namespaceParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${namespaceParser.name}" +sidebar_label: "${namespaceParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const result = `${header}`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderNamespaces(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'namespace', 'Namespaces', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const namespaceParser of projectParser.namespaces) { + if (namespaceParser.external) continue; + + renderNamespace(namespaceParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/renderTypeAlias.ts b/docusaurus-typedoc-json-parser/src/renderer/renderTypeAlias.ts new file mode 100644 index 00000000..92d8eb8f --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/renderTypeAlias.ts @@ -0,0 +1,34 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import type { ProjectParser, TypeAliasParser } from 'typedoc-json-parser'; +import { writeCategoryYaml } from './writeCategoryYaml'; + +function renderTypeAlias(typeAliasParser: TypeAliasParser, outputDir: string, fileSidebarPosition: number) { + const slug = typeAliasParser.name.toLowerCase().replace(/\s/g, '-'); + + const header = `--- +id: "${slug}" +title: "${typeAliasParser.name}" +sidebar_label: "${typeAliasParser.name}" +sidebar_position: ${fileSidebarPosition} +custom_edit_url: null +---`; + + const result = `${header}`; + + writeFileSync(resolve(outputDir, `${slug}.mdx`), result); +} + +export function renderTypeAliases(projectParser: ProjectParser, outputDir: string, isGroup: boolean) { + const categoryDir = writeCategoryYaml(outputDir, 'typeAlias', 'Type Aliases', isGroup ? 2 : 1); + + let fileSidebarPosition = 0; + + for (const typeAliasParser of projectParser.typeAliases) { + if (typeAliasParser.external) continue; + + renderTypeAlias(typeAliasParser, categoryDir, fileSidebarPosition); + + fileSidebarPosition++; + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/utilities/ensureDirectory.ts b/docusaurus-typedoc-json-parser/src/renderer/utilities/ensureDirectory.ts new file mode 100644 index 00000000..6f5f6089 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/utilities/ensureDirectory.ts @@ -0,0 +1,5 @@ +import { existsSync, mkdirSync } from 'node:fs'; + +export function ensureDirectory(dir: string) { + if (!existsSync(dir)) mkdirSync(dir, { recursive: true }); +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/utilities/parseExamples.ts b/docusaurus-typedoc-json-parser/src/renderer/utilities/parseExamples.ts new file mode 100644 index 00000000..4d238612 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/utilities/parseExamples.ts @@ -0,0 +1,7 @@ +import type { CommentParser } from 'typedoc-json-parser'; + +export function parseExamples(blockTags: CommentParser.BlockTag[]): string { + if (blockTags.length === 0) return ''; + + return `## Examples\n\n${blockTags.map((blockTag) => blockTag.text.replace(/(```typescript)\n/g, '$1 ts2esm2cjs\n'))}`; +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/utilities/parseSee.ts b/docusaurus-typedoc-json-parser/src/renderer/utilities/parseSee.ts new file mode 100644 index 00000000..dc8e70a3 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/utilities/parseSee.ts @@ -0,0 +1,5 @@ +import type { CommentParser } from 'typedoc-json-parser'; + +export function parseSee(blockTags: CommentParser.BlockTag[]): string { + return blockTags.map((blockTag) => `\n**\`See Also:\`** ${blockTag.text}`).join('\n'); +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/utilities/removeDirectory.ts b/docusaurus-typedoc-json-parser/src/renderer/utilities/removeDirectory.ts new file mode 100644 index 00000000..b693e6c8 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/utilities/removeDirectory.ts @@ -0,0 +1,21 @@ +import { existsSync, readdirSync, rmdirSync, statSync, unlinkSync } from 'node:fs'; + +export function removeDirectory(directory: string) { + if (existsSync(directory)) { + const files = readdirSync(directory); + + if (files.length > 0) { + files.forEach((filename) => { + if (statSync(`${directory}/${filename}`).isDirectory()) { + removeDirectory(`${directory}/${filename}`); + } else { + unlinkSync(`${directory}/${filename}`); + } + }); + + rmdirSync(directory); + } else { + rmdirSync(directory); + } + } +} diff --git a/docusaurus-typedoc-json-parser/src/renderer/writeCategoryYaml.ts b/docusaurus-typedoc-json-parser/src/renderer/writeCategoryYaml.ts new file mode 100644 index 00000000..99499e22 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/renderer/writeCategoryYaml.ts @@ -0,0 +1,15 @@ +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import { ensureDirectory } from './utilities/ensureDirectory'; + +export function writeCategoryYaml(directory: string, categoryPath: string, categoryName: string, sidebarPosition: number) { + const categoryDirectory = resolve(directory, categoryPath); + + ensureDirectory(categoryDirectory); + + const categoryData = [`label: "${categoryName}"`, `position: ${sidebarPosition}`].join(`\n`); + + writeFileSync(resolve(categoryDirectory, '_category.yml'), categoryData); + + return categoryDirectory; +} diff --git a/docusaurus-typedoc-json-parser/src/types/PluginOptions.ts b/docusaurus-typedoc-json-parser/src/types/PluginOptions.ts new file mode 100644 index 00000000..c1ee22c6 --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/types/PluginOptions.ts @@ -0,0 +1,5 @@ +export interface PluginOptions { + githubContentUrl: string; + + githubToken?: string; +} diff --git a/docusaurus-typedoc-json-parser/src/types/RepositoryContent.ts b/docusaurus-typedoc-json-parser/src/types/RepositoryContent.ts new file mode 100644 index 00000000..f20e78aa --- /dev/null +++ b/docusaurus-typedoc-json-parser/src/types/RepositoryContent.ts @@ -0,0 +1,15 @@ +export interface RepositoryContent { + type: RepositoryContentFileType; + + name: string; + + url: string; + + download_url: string | null; +} + +export enum RepositoryContentFileType { + File = 'file', + + Directory = 'dir' +} diff --git a/docusaurus-typedoc-json-parser/tsconfig.json b/docusaurus-typedoc-json-parser/tsconfig.json new file mode 100644 index 00000000..ccc201e4 --- /dev/null +++ b/docusaurus-typedoc-json-parser/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@sapphire/ts-config", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "lib": ["ESNext", "DOM"], + "tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo" + }, + "include": ["src"] +} diff --git a/docusaurus.config.js b/docusaurus.config.js index a41838f7..f63110da 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -9,13 +9,15 @@ const BaseUrl = 'https://sapphirejs.dev'; const Email = 'contact@sapphirejs.dev'; const Title = 'Sapphire Framework'; -/** @type {import('@docusaurus/types').Config} */ +/** @type {import('@docusaurus/types').DocusaurusConfig} */ const config = { title: 'Sapphire', url: BaseUrl, baseUrl: '/', - onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'throw', + // TODO: Re-enable after adding all JSON files. See temporary-errors-log-of-broken-links.md + onBrokenLinks: 'warn', + // TODO: Re-enable after adding all JSON files. See temporary-errors-log-of-broken-links.md + onBrokenMarkdownLinks: 'warn', onDuplicateRoutes: 'throw', favicon: 'img/favicon.ico', tagline: Description, @@ -49,132 +51,16 @@ const config = { } ], [ - 'docusaurus-plugin-typedoc', - { + 'docusaurus-discordjs-docgen', + /** @type {import('docusaurus-discordjs-docgen/dist/types').PluginOptions} */ ({ id: 'framework', - entryPoints: ['./projects/framework/src/index.ts'], - tsconfig: './projects/framework/src/tsconfig.json', - readme: 'none', - out: 'Documentation/api-framework', - plugin: ['typedoc-plugin-mdn-links', 'typedoc-plugin-djs-links'], + docgenJsonFile: './data/framework.json', + out: 'Documentation/sapphire-framework', sidebar: { categoryLabel: '@sapphire/framework', - position: 0, - fullNames: true - } - } - ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'Pieces', - entryPoints: ['./projects/pieces/src/index.ts'], - tsconfig: './projects/pieces/src/tsconfig.json', - readme: 'none', - out: 'Documentation/api-pieces', - plugin: ['typedoc-plugin-mdn-links'], - sidebar: { - categoryLabel: '@sapphire/pieces', - position: 1, - fullNames: true - } - } - ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'Utilities', - entryPointStrategy: 'resolve', - entryPoints: [ - './projects/utilities/packages/async-queue/src/index.ts', - './projects/utilities/packages/bitfield/src/index.ts', - './projects/utilities/packages/cron/src/index.ts', - './projects/utilities/packages/decorators/src/index.ts', - './projects/utilities/packages/discord-utilities/src/index.ts', - './projects/utilities/packages/discord.js-utilities/src/index.ts', - './projects/utilities/packages/duration/src/index.ts', - './projects/utilities/packages/event-iterator/src/index.ts', - './projects/utilities/packages/fetch/src/index.ts', - './projects/utilities/packages/lexure/src/index.ts', - './projects/utilities/packages/node-utilities/src/index.ts', - './projects/utilities/packages/phisherman/src/index.ts', - './projects/utilities/packages/ratelimits/src/index.ts', - './projects/utilities/packages/result/src/index.ts', - './projects/utilities/packages/snowflake/src/index.ts', - './projects/utilities/packages/stopwatch/src/index.ts', - './projects/utilities/packages/time-utilities/src/index.ts', - './projects/utilities/packages/timer-manager/src/index.ts', - './projects/utilities/packages/timestamp/src/index.ts', - './projects/utilities/packages/utilities/src/index.ts' - ], - tsconfig: './tsconfig.typedoc.json', - readme: 'none', - out: 'Documentation/api-utilities', - plugin: ['typedoc-plugin-mdn-links', 'typedoc-plugin-djs-links'], - sidebar: { - categoryLabel: 'Sapphire Utilities', - position: 2 + position: 0 } - } - ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'Plugins', - entryPointStrategy: 'resolve', - entryPoints: [ - './projects/plugins/packages/api/src/index.ts', - './projects/plugins/packages/editable-commands/src/index.ts', - './projects/plugins/packages/hmr/src/index.ts', - './projects/plugins/packages/i18next/src/index.ts', - './projects/plugins/packages/logger/src/index.ts', - './projects/plugins/packages/pattern-commands/src/index.ts', - './projects/plugins/packages/scheduled-tasks/src/index.ts', - './projects/plugins/packages/subcommands/src/index.ts' - ], - tsconfig: './tsconfig.typedoc.json', - readme: 'none', - out: 'Documentation/api-plugins', - excludeExternals: true, - externalPattern: ['node_modules/@types/**'], - plugin: ['typedoc-plugin-mdn-links', 'typedoc-plugin-djs-links'], - sidebar: { - categoryLabel: 'Sapphire Plugins', - position: 3 - } - } - ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'Type', - entryPoints: ['./projects/type/src/index.ts'], - tsconfig: './projects/type/src/tsconfig.json', - readme: './projects/type/README.md', - out: 'Documentation/api-type', - plugin: ['typedoc-plugin-mdn-links'], - sidebar: { - categoryLabel: '@sapphire/type', - position: 4, - fullNames: true - } - } - ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'Shapeshift', - entryPoints: ['./projects/shapeshift/src/index.ts'], - tsconfig: './projects/shapeshift/src/tsconfig.json', - readme: './projects/shapeshift/README.md', - out: 'Documentation/api-shapeshift', - plugin: ['typedoc-plugin-mdn-links'], - sidebar: { - categoryLabel: '@sapphire/shapeshift', - position: 5, - fullNames: true - } - } + }) ] ], diff --git a/package.json b/package.json index c6d0ccd9..95b02860 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,18 @@ "name": "root-website", "version": "1.0.0", "workspaces": [ - "projects/*" + "docusaurus-discordjs-docgen", + "docusaurus-typedoc-json-parser" ], "description": "Website with the Sapphire guide, hosted on https://sapphirejs.dev", "author": "@sapphire", "license": "MIT", "private": true, "scripts": { + "build-plugin": "tsc -p docusaurus-discordjs-docgen", "docusaurus": "docusaurus", - "start": "docusaurus start", - "build": "docusaurus build", + "start": "yarn build-plugin && docusaurus start", + "build": "yarn build-plugin && docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", @@ -27,10 +29,8 @@ "format:check": "prettier --check \"{src,static,scripts,docs}/**/*.{js,jsx,ts,tsx,css,json,md,mdx,yml}\"", "update": "yarn upgrade-interactive", "postinstall": "husky install .github/husky", - "clean-projects": "rimraf \"./projects/**/node_modules\" \"./projects/**/dist\" \"./projects/**/build\" \"./projects/**/prebuild\"", - "vercel-build": "yarn make-djs-node-14-compatible && yarn build", - "update-submodules": "git pull --recurse-submodules && git submodule update --remote --recursive", - "make-djs-node-14-compatible": "node scripts/make-djs-node-14-compatible.mjs" + "vercel-build": "yarn build", + "update-submodules": "git pull --recurse-submodules && git submodule update --remote --recursive" }, "dependencies": { "@docusaurus/core": "2.1.0", @@ -53,15 +53,9 @@ "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.1.0", "@docusaurus/module-type-aliases": "2.1.0", - "@sapphire/cron": "^1.0.0", - "@sapphire/decorators": "^5.0.0", - "@sapphire/duration": "^1.0.0", "@sapphire/eslint-config": "^4.3.8", "@sapphire/fetch": "^2.4.1", "@sapphire/prettier-config": "^1.4.4", - "@sapphire/result": "^2.6.0", - "@sapphire/timer-manager": "^1.0.0", - "@sapphire/timestamp": "^1.0.0", "@sapphire/ts-config": "^3.3.4", "@types/node": "^18.11.3", "@types/react": "^18.0.21", @@ -69,7 +63,6 @@ "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", "cz-conventional-changelog": "^3.3.0", - "docusaurus-plugin-typedoc": "^0.17.5", "eslint": "^8.26.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", @@ -83,21 +76,12 @@ "markdownlint-cli2": "^0.5.1", "prettier": "^2.7.1", "pretty-quick": "^3.1.3", - "replace-in-file": "^6.3.5", - "rimraf": "^3.0.2", - "ts-node": "^10.9.1", - "typedoc": "0.22.18", - "typedoc-plugin-djs-links": "^1.2.0", - "typedoc-plugin-markdown": "^3.13.6", - "typedoc-plugin-mdn-links": "^2.0.0", "typescript": "^4.8.4" }, "resolutions": { "ansi-regex": "^5.0.1", "minimist": "^1.2.7", - "async": "^2.6.4", - "typedoc": "0.22.17", - "discord-api-types": "^0.36.3" + "async": "^2.6.4" }, "browserslist": { "production": [ diff --git a/projects/framework b/projects/framework deleted file mode 160000 index 5d29c0a1..00000000 --- a/projects/framework +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5d29c0a17531df32021f6fe36b25a5621587301f diff --git a/projects/pieces b/projects/pieces deleted file mode 160000 index c26e3144..00000000 --- a/projects/pieces +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c26e314482895e3925987d21ab7906a90dece6c8 diff --git a/projects/plugins b/projects/plugins deleted file mode 160000 index 11510012..00000000 --- a/projects/plugins +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 115100125adf517707aa2f2368ce520c5b4ed3d4 diff --git a/projects/shapeshift b/projects/shapeshift deleted file mode 160000 index 676b2855..00000000 --- a/projects/shapeshift +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 676b28553f669ba2665272e15bd1f2ad9c3acf0c diff --git a/projects/type b/projects/type deleted file mode 160000 index 36f6db4f..00000000 --- a/projects/type +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 36f6db4f10af4db8889b3490fff8defcda036292 diff --git a/projects/utilities b/projects/utilities deleted file mode 160000 index a90f2875..00000000 --- a/projects/utilities +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a90f28758e7b5e18c3654cffc9bd241e76253fee diff --git a/scripts/make-djs-node-14-compatible.mjs b/scripts/make-djs-node-14-compatible.mjs deleted file mode 100644 index 9bd0f994..00000000 --- a/scripts/make-djs-node-14-compatible.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { sep } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import replace from 'replace-in-file'; - -const discordJsSrcFolder = new URL('../node_modules/discord.js/src/', import.meta.url); -const files = `${fileURLToPath(discordJsSrcFolder)}**${sep}*.js`; - -const optionsLogicalNullish = { - files, - from: /([\w_\.]+) \?\?= (.+);/g, - to: '$1 !== null && $1 !== void 0 ? $1 : ($1 = $2);' -}; - -const optionsLogicalAnd = { - files, - from: /([a-zA-Z].+) \&\&= (.+);/g, - to: '$1 && ($1 = $2);' -}; - -const optionsLogicalOr = { - files, - from: /([a-zA-Z].+) \|\|= (.+);/g, - to: '$1 || ($1 = $2);' -}; - -await replace.replaceInFile(optionsLogicalNullish); -await replace.replaceInFile(optionsLogicalAnd); -await replace.replaceInFile(optionsLogicalOr); diff --git a/temporary-errors-log-of-broken-links.md b/temporary-errors-log-of-broken-links.md new file mode 100644 index 00000000..7dcc7cd9 --- /dev/null +++ b/temporary-errors-log-of-broken-links.md @@ -0,0 +1,77 @@ +- On source page path = /docs/Documentation/sapphire-framework/class/argument: + -> linking to ../../sapphire-pieces/class/aliaspiece.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/aliaspiece.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/argumentstore: + -> linking to ../../sapphire-pieces/class/aliasstore.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/aliasstore.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/command: + -> linking to ../../sapphire-pieces/class/aliaspiece.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/aliaspiece.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/commandstore: + -> linking to ../../sapphire-pieces/class/aliasstore.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/aliasstore.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/interactionhandler: + -> linking to ../../sapphire-pieces/class/piece.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/piece.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/interactionhandlerstore: + -> linking to ../../sapphire-pieces/class/store.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/store.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/listener: + -> linking to ../../sapphire-pieces/class/piece.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/piece.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/listenerstore: + -> linking to ../../sapphire-pieces/class/store.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/store.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/precondition: + -> linking to ../../sapphire-pieces/class/piece.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/piece.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/preconditionstore: + -> linking to ../../sapphire-pieces/class/store.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/store.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/class/sapphireclient: + -> linking to ../../sapphire-pieces/class/storeregistry.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/storeregistry.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/typedef/pieceoptions: + -> linking to ../../sapphire-pieces/class/piece.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/piece.mdx) + +- On source page path = /docs/Documentation/sapphire-framework/typedef/storeregistryentries: + -> linking to ../../sapphire-pieces/class/storeregistry.mdx (resolved as: /docs/Documentation/sapphire-pieces/class/storeregistry.mdx) + +- On source page path = /docs/Guide/arguments/built-in-arguments: + -> linking to ../../Documentation/sapphire-framework/interfaces/Resolvers.EmojiObject (resolved as: /docs/Documentation/sapphire-framework/interfaces/Resolvers.EmojiObject) + +- On source page path = /docs/Guide/getting-started/getting-started-with-sapphire: + -> linking to ../../Documentation/sapphire-framework/interfaces/SapphireClientOptions#baseuserdirectory (resolved as: /docs/Documentation/sapphire-framework/interfaces/SapphireClientOptions) + +- On source page path = /docs/Guide/plugins/API/rate-limiting: + -> linking to ../../../Documentation/sapphire-ratelimits/class/RateLimitManager (resolved as: /docs/Documentation/sapphire-ratelimits/class/RateLimitManager) + +- On source page path = /docs/Guide/plugins/i18next/getting-started: + -> linking to ../../../Documentation/sapphire-framework/interfaces/SapphireClientOptions (resolved as: /docs/Documentation/sapphire-framework/interfaces/SapphireClientOptions) + -> linking to ../../../Documentation/sapphire-plugin-i18next/class/InternationalizationHandler#fetchlanguage (resolved as: /docs/Documentation/sapphire-plugin-i18next/class/InternationalizationHandler) + -> linking to ../../../Documentation/sapphire-plugin-i18next/interfaces/InternationalizationContext (resolved as: /docs/Documentation/sapphire-plugin-i18next/interfaces/InternationalizationContext) + +- On source page path = /docs/Guide/preconditions/channel-types: + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#runin (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-framework/enums/CommandOptionsRunTypeEnum (resolved as: /docs/Documentation/sapphire-framework/enums/CommandOptionsRunTypeEnum) + +- On source page path = /docs/Guide/preconditions/command-cooldown: + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldowndelay (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-time-utilities (resolved as: /docs/Documentation/sapphire-time-utilities) + -> linking to ../../Documentation/sapphire-time-utilities/typedefs/Time (resolved as: /docs/Documentation/sapphire-time-utilities/typedefs/Time) + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldownfilteredusers (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldownlimit (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#cooldownscope (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-framework/enums/BucketScope (resolved as: /docs/Documentation/sapphire-framework/enums/BucketScope) + -> linking to ../../Documentation/sapphire-framework/interfaces/SapphireClientOptions#defaultcooldown (resolved as: /docs/Documentation/sapphire-framework/interfaces/SapphireClientOptions) + +- On source page path = /docs/Guide/preconditions/creating-your-own-preconditions: + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#preconditions (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-framework/interfaces/Preconditions (resolved as: /docs/Documentation/sapphire-framework/interfaces/Preconditions) + +- On source page path = /docs/Guide/preconditions/handling-permissions: + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#requireduserpermissions (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + -> linking to ../../Documentation/sapphire-framework/interfaces/CommandOptions#requiredclientpermissions (resolved as: /docs/Documentation/sapphire-framework/interfaces/CommandOptions) + +- On source page path = /docs/Guide/preconditions/reporting-precondition-failure: + -> linking to ../../Documentation/sapphire-framework/interfaces/MessageCommandDeniedPayload (resolved as: /docs/Documentation/sapphire-framework/interfaces/MessageCommandDeniedPayload) diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index cd608919..75f65a9e 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,4 +1,16 @@ { "extends": "./tsconfig.json", - "include": ["babel.config.js", "docs/General", "docs/Guide", "docusaurus.config.js", "projects", "scripts", "sidebars.js", "src", "static"] + "include": [ + "babel.config.js", + "docs/General", + "docs/Guide", + "docusaurus.config.js", + "projects", + "scripts", + "sidebars.js", + "src", + "static", + "docusaurus-discordjs-docgen", + "docusaurus-typedoc-json-parser" + ] }