├── .eslintrc.json ├── .gitignore ├── .vscode └── settings.json ├── LICENSE.md ├── README.md ├── package-lock.json ├── package.json └── src ├── Argument.js ├── Command.js ├── Handler.js ├── commands ├── eval.js ├── help.js └── usage.js └── index.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "node": true, 5 | "es6": true 6 | }, 7 | "parserOptions": { 8 | "ecmaVersion": 2017, 9 | "sourceType": "module" 10 | 11 | }, 12 | 13 | "plugins": [ 14 | "jsdoc" 15 | ] 16 | , 17 | 18 | "rules": { 19 | "jsdoc/check-examples": 2, 20 | "jsdoc/check-param-names": 2, 21 | "jsdoc/check-tag-names": 2, 22 | "jsdoc/check-types": 2, 23 | "jsdoc/newline-after-description": 2, 24 | "jsdoc/no-undefined-types": 2, 25 | "jsdoc/require-description": 0, 26 | "jsdoc/require-description-complete-sentence": 1, 27 | "jsdoc/require-example": 0, 28 | "jsdoc/require-hyphen-before-param-description": 2, 29 | "jsdoc/require-param": 2, 30 | "jsdoc/require-param-description": 2, 31 | "jsdoc/require-param-name": 2, 32 | "jsdoc/require-param-type": 2, 33 | "jsdoc/require-returns": 0, 34 | "jsdoc/require-returns-description": 0, 35 | "jsdoc/require-returns-type": 0, 36 | "jsdoc/valid-types": 2, 37 | "brace-style": ["error", "stroustrup", { "allowSingleLine": true }], 38 | "comma-dangle": ["error", "always-multiline"], 39 | "comma-spacing": "error", 40 | "comma-style": "error", 41 | "curly": ["error", "multi-line", "consistent"], 42 | "dot-location": ["error", "property"], 43 | "handle-callback-err": "off", 44 | "indent": ["error", "tab"], 45 | "max-nested-callbacks": ["error", { "max": 5 }], 46 | "max-statements-per-line": ["error", { "max": 2 }], 47 | "no-console": "off", 48 | "no-empty-function": "error", 49 | "no-floating-decimal": "error", 50 | "no-inline-comments": "off", 51 | "no-lonely-if": "error", 52 | "no-multi-spaces": "error", 53 | "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], 54 | "no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }], 55 | "no-trailing-spaces": ["error"], 56 | "no-var": "error", 57 | "object-curly-spacing": ["error", "always"], 58 | "prefer-const": "error", 59 | "quotes": ["error", "single"], 60 | "semi": ["error", "always"], 61 | "space-before-blocks": "error", 62 | "space-before-function-paren": ["error", { 63 | "anonymous": "never", 64 | "named": "never", 65 | "asyncArrow": "always" 66 | }], 67 | "space-in-parens": "error", 68 | "space-infix-ops": "error", 69 | "space-unary-ops": "error", 70 | "spaced-comment": "error", 71 | "yoda": "error" 72 | } 73 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | 63 | #Temp Folder 64 | temp/ 65 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | "workbench.colorCustomizations": {} 4 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # [ISC License](https://spdx.org/licenses/ISC) 2 | 3 | Copyright (c) 2019, plasmachicken 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Module to make an fast setup Discord Bot, simply do: 2 | 3 | ```js 4 | const Discord = require('discord.js'); 5 | const commandHandler = require('easy-djs-commandhandler'); 6 | 7 | const client = new Discord.Client(); 8 | const handle = new commandHandler.Handler(client, {owner: ['193406800614129664']}); 9 | 10 | client.on('message', message => { 11 | handle.handle(client, message); 12 | }) 13 | client.on('messageUpdate', (oldmessage, message) => { 14 | handle.handle(client, message); 15 | }) 16 | 17 | client.login() 18 | ``` 19 | 20 | # Then you can make your own Commands in the `commands` ( customizeable ) folder, by doing: 21 | ```js 22 | const { Client, Message } = require('discord.js'); 23 | /** 24 | * @param {Client} client - Discord.js Client. 25 | * @param {Message} message - Discord.js Message. 26 | * @param {Array} args - Array with parsed args. 27 | */ 28 | module.exports.run = async (client, message, args) => { 29 | message.channel.send('Hello World!'); 30 | }; 31 | 32 | module.exports.help = { 33 | name: 'cmdname', 34 | description: '', 35 | hideinhelp: false, 36 | requires: ['botowner', 'guild', 'dm'], 37 | usage: 'cmdname', // gets replaced with the prefix 38 | aliases: ['cmdalias'], 39 | requiresBotPermissions: ['EMBED_LINKS'], // Array containing Permissions that need to be checked, SEND_MESSAGES, is included automatically 40 | // cooldownGroup: 'example' || use this to cooldown all the commands in that group 41 | }; // to get a category just make a sub-folder 42 | ``` 43 | or by using the Command Class: 44 | ```js 45 | const { Command } = require('easy-djs-commandhandler'); 46 | module.exports = new Command({ 47 | name: 'cmdname', 48 | description: '', 49 | hideinhelp: false, 50 | requires: ['botowner', 'guild', 'dm'], 51 | usage: 'cmdname', // gets replaced with the prefix 52 | aliases: ['cmdalias'], 53 | requiresBotPermissions: ['EMBED_LINKS'], // Array containing Permissions that need to be checked, SEND_MESSAGES, is included automatically 54 | // cooldownGroup: 'example' || use this to cooldown all the commands in that group 55 | // to get a category just make a sub-folder 56 | }).execute((client, message, args) => { 57 | message.channel.send('Hello Discord!'); 58 | }); 59 | ``` 60 | 61 | # Using ArgumentsCollector 62 | ```js 63 | const { Command, ArgumentCollector } = require('easy-djs-commandhandler'); 64 | module.exports = new Command({ name: 'collect' }).execute(async (client, message, args) => { 65 | const collector = new ArgumentCollector([{ prompt: 'What did you eat today?', key: 'food_today' }, { prompt: 'What channel is this?', key: 'test_channel', attempts:3, errorMsg: 'Something went wrong!', type: 'channel', time: 5999 }]); 66 | const collected = await collector.obtain(message); 67 | console.log(collected);// retruns { values: { food_today: message_object, test_channel: channel_object }, canceled: false }; 68 | console.log(collected.values.food_today.content); // if no type specified, returns collected message object, example: get content of collected message 69 | console.log(collected.values.test_channel.name); // type: 'channel', returns channel object, example: get name of the channel 70 | }); 71 | ``` 72 | 73 | # Using Custom Prefixes 74 | 75 | ```js 76 | const handle = new commandHandler.Handler(client, { 77 | owner: ['193406800614129664'], 78 | prefixFunc : (message, client) => { 79 | // have something wich gets the specific prefix for that guild/user and return it; 80 | // eg. return guildsettings.get(message.guild.id).prefix; 81 | if(message.guild && message.guild.id == '193406800614129664') return 'B'; // The Prefix for this Guild will be B 82 | else return 'C'; // The Prefix for all other Guilds will be C 83 | }, 84 | }); 85 | ``` 86 | 87 | 88 | # Using Custom/Presistant Cooldowns 89 | 90 | ```js 91 | 92 | const Enmap = require("enmap"); 93 | 94 | // Normal enmap with default options 95 | const cooldownsEnmap = new Enmap({name: "cooldowns"}); 96 | 97 | const handle = new commandHandler.Handler(client, {owner: ['193406800614129664'], cooldowns: cooldownsEnmap}); 98 | 99 | ``` 100 | 101 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "easy-djs-commandhandler", 3 | "version": "3.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.0.0", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", 10 | "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", 11 | "dev": true, 12 | "requires": { 13 | "@babel/highlight": "^7.0.0" 14 | } 15 | }, 16 | "@babel/highlight": { 17 | "version": "7.0.0", 18 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", 19 | "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", 20 | "dev": true, 21 | "requires": { 22 | "chalk": "^2.0.0", 23 | "esutils": "^2.0.2", 24 | "js-tokens": "^4.0.0" 25 | } 26 | }, 27 | "@discordjs/collection": { 28 | "version": "0.1.6", 29 | "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", 30 | "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" 31 | }, 32 | "@discordjs/form-data": { 33 | "version": "3.0.1", 34 | "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", 35 | "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", 36 | "requires": { 37 | "asynckit": "^0.4.0", 38 | "combined-stream": "^1.0.8", 39 | "mime-types": "^2.1.12" 40 | } 41 | }, 42 | "abort-controller": { 43 | "version": "3.0.0", 44 | "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", 45 | "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", 46 | "requires": { 47 | "event-target-shim": "^5.0.0" 48 | } 49 | }, 50 | "acorn": { 51 | "version": "6.4.1", 52 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", 53 | "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", 54 | "dev": true 55 | }, 56 | "acorn-jsx": { 57 | "version": "5.0.1", 58 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", 59 | "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", 60 | "dev": true 61 | }, 62 | "ajv": { 63 | "version": "6.10.0", 64 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", 65 | "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", 66 | "dev": true, 67 | "requires": { 68 | "fast-deep-equal": "^2.0.1", 69 | "fast-json-stable-stringify": "^2.0.0", 70 | "json-schema-traverse": "^0.4.1", 71 | "uri-js": "^4.2.2" 72 | } 73 | }, 74 | "ansi-escapes": { 75 | "version": "3.2.0", 76 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", 77 | "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", 78 | "dev": true 79 | }, 80 | "ansi-regex": { 81 | "version": "3.0.0", 82 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 83 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", 84 | "dev": true 85 | }, 86 | "ansi-styles": { 87 | "version": "3.2.1", 88 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 89 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 90 | "dev": true, 91 | "requires": { 92 | "color-convert": "^1.9.0" 93 | } 94 | }, 95 | "argparse": { 96 | "version": "1.0.10", 97 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 98 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 99 | "dev": true, 100 | "requires": { 101 | "sprintf-js": "~1.0.2" 102 | } 103 | }, 104 | "astral-regex": { 105 | "version": "1.0.0", 106 | "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", 107 | "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", 108 | "dev": true 109 | }, 110 | "asynckit": { 111 | "version": "0.4.0", 112 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 113 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 114 | }, 115 | "balanced-match": { 116 | "version": "1.0.0", 117 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 118 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 119 | "dev": true 120 | }, 121 | "brace-expansion": { 122 | "version": "1.1.11", 123 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 124 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 125 | "dev": true, 126 | "requires": { 127 | "balanced-match": "^1.0.0", 128 | "concat-map": "0.0.1" 129 | } 130 | }, 131 | "callsites": { 132 | "version": "3.1.0", 133 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 134 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 135 | "dev": true 136 | }, 137 | "chalk": { 138 | "version": "2.4.2", 139 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 140 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 141 | "dev": true, 142 | "requires": { 143 | "ansi-styles": "^3.2.1", 144 | "escape-string-regexp": "^1.0.5", 145 | "supports-color": "^5.3.0" 146 | } 147 | }, 148 | "chardet": { 149 | "version": "0.7.0", 150 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", 151 | "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", 152 | "dev": true 153 | }, 154 | "cli-cursor": { 155 | "version": "2.1.0", 156 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 157 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", 158 | "dev": true, 159 | "requires": { 160 | "restore-cursor": "^2.0.0" 161 | } 162 | }, 163 | "cli-width": { 164 | "version": "2.2.0", 165 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", 166 | "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", 167 | "dev": true 168 | }, 169 | "color-convert": { 170 | "version": "1.9.3", 171 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 172 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 173 | "dev": true, 174 | "requires": { 175 | "color-name": "1.1.3" 176 | } 177 | }, 178 | "color-name": { 179 | "version": "1.1.3", 180 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 181 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 182 | "dev": true 183 | }, 184 | "combined-stream": { 185 | "version": "1.0.8", 186 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 187 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 188 | "requires": { 189 | "delayed-stream": "~1.0.0" 190 | } 191 | }, 192 | "comment-parser": { 193 | "version": "0.5.4", 194 | "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.5.4.tgz", 195 | "integrity": "sha512-0h7W6Y1Kb6zKQMJqdX41C5qf9ITCVIsD2qP2RaqDF3GFkXFrmuAuv5zUOuo19YzyC9scjBNpqzuaRQ2Sy5pxMQ==", 196 | "dev": true 197 | }, 198 | "concat-map": { 199 | "version": "0.0.1", 200 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 201 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 202 | "dev": true 203 | }, 204 | "cross-spawn": { 205 | "version": "6.0.5", 206 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 207 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 208 | "dev": true, 209 | "requires": { 210 | "nice-try": "^1.0.4", 211 | "path-key": "^2.0.1", 212 | "semver": "^5.5.0", 213 | "shebang-command": "^1.2.0", 214 | "which": "^1.2.9" 215 | } 216 | }, 217 | "debug": { 218 | "version": "4.1.1", 219 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 220 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 221 | "dev": true, 222 | "requires": { 223 | "ms": "^2.1.1" 224 | } 225 | }, 226 | "deep-is": { 227 | "version": "0.1.3", 228 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 229 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 230 | "dev": true 231 | }, 232 | "delayed-stream": { 233 | "version": "1.0.0", 234 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 235 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 236 | }, 237 | "discord.js": { 238 | "version": "12.5.1", 239 | "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.1.tgz", 240 | "integrity": "sha512-VwZkVaUAIOB9mKdca0I5MefPMTQJTNg0qdgi1huF3iwsFwJ0L5s/Y69AQe+iPmjuV6j9rtKoG0Ta0n9vgEIL6w==", 241 | "requires": { 242 | "@discordjs/collection": "^0.1.6", 243 | "@discordjs/form-data": "^3.0.1", 244 | "abort-controller": "^3.0.0", 245 | "node-fetch": "^2.6.1", 246 | "prism-media": "^1.2.2", 247 | "setimmediate": "^1.0.5", 248 | "tweetnacl": "^1.0.3", 249 | "ws": "^7.3.1" 250 | } 251 | }, 252 | "doctrine": { 253 | "version": "3.0.0", 254 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", 255 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", 256 | "dev": true, 257 | "requires": { 258 | "esutils": "^2.0.2" 259 | } 260 | }, 261 | "emoji-regex": { 262 | "version": "7.0.3", 263 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 264 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", 265 | "dev": true 266 | }, 267 | "escape-string-regexp": { 268 | "version": "1.0.5", 269 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 270 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 271 | "dev": true 272 | }, 273 | "eslint": { 274 | "version": "5.16.0", 275 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", 276 | "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", 277 | "dev": true, 278 | "requires": { 279 | "@babel/code-frame": "^7.0.0", 280 | "ajv": "^6.9.1", 281 | "chalk": "^2.1.0", 282 | "cross-spawn": "^6.0.5", 283 | "debug": "^4.0.1", 284 | "doctrine": "^3.0.0", 285 | "eslint-scope": "^4.0.3", 286 | "eslint-utils": "^1.3.1", 287 | "eslint-visitor-keys": "^1.0.0", 288 | "espree": "^5.0.1", 289 | "esquery": "^1.0.1", 290 | "esutils": "^2.0.2", 291 | "file-entry-cache": "^5.0.1", 292 | "functional-red-black-tree": "^1.0.1", 293 | "glob": "^7.1.2", 294 | "globals": "^11.7.0", 295 | "ignore": "^4.0.6", 296 | "import-fresh": "^3.0.0", 297 | "imurmurhash": "^0.1.4", 298 | "inquirer": "^6.2.2", 299 | "js-yaml": "^3.13.0", 300 | "json-stable-stringify-without-jsonify": "^1.0.1", 301 | "levn": "^0.3.0", 302 | "lodash": "^4.17.11", 303 | "minimatch": "^3.0.4", 304 | "mkdirp": "^0.5.1", 305 | "natural-compare": "^1.4.0", 306 | "optionator": "^0.8.2", 307 | "path-is-inside": "^1.0.2", 308 | "progress": "^2.0.0", 309 | "regexpp": "^2.0.1", 310 | "semver": "^5.5.1", 311 | "strip-ansi": "^4.0.0", 312 | "strip-json-comments": "^2.0.1", 313 | "table": "^5.2.3", 314 | "text-table": "^0.2.0" 315 | } 316 | }, 317 | "eslint-plugin-jsdoc": { 318 | "version": "4.8.4", 319 | "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-4.8.4.tgz", 320 | "integrity": "sha512-VDP+BI2hWpKNNdsJDSPofSQ9q7jGLgWbDMI0LzOeEcfsTjSS7jQtHDUuVLQ5E+OV2MPyQPk/3lnVcHfStXk5yA==", 321 | "dev": true, 322 | "requires": { 323 | "comment-parser": "^0.5.4", 324 | "jsdoctypeparser": "3.1.0", 325 | "lodash": "^4.17.11" 326 | } 327 | }, 328 | "eslint-scope": { 329 | "version": "4.0.3", 330 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", 331 | "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", 332 | "dev": true, 333 | "requires": { 334 | "esrecurse": "^4.1.0", 335 | "estraverse": "^4.1.1" 336 | } 337 | }, 338 | "eslint-utils": { 339 | "version": "1.4.2", 340 | "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", 341 | "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", 342 | "dev": true, 343 | "requires": { 344 | "eslint-visitor-keys": "^1.0.0" 345 | } 346 | }, 347 | "eslint-visitor-keys": { 348 | "version": "1.0.0", 349 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", 350 | "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", 351 | "dev": true 352 | }, 353 | "espree": { 354 | "version": "5.0.1", 355 | "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", 356 | "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", 357 | "dev": true, 358 | "requires": { 359 | "acorn": "^6.0.7", 360 | "acorn-jsx": "^5.0.0", 361 | "eslint-visitor-keys": "^1.0.0" 362 | } 363 | }, 364 | "esprima": { 365 | "version": "4.0.1", 366 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 367 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 368 | "dev": true 369 | }, 370 | "esquery": { 371 | "version": "1.0.1", 372 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", 373 | "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", 374 | "dev": true, 375 | "requires": { 376 | "estraverse": "^4.0.0" 377 | } 378 | }, 379 | "esrecurse": { 380 | "version": "4.2.1", 381 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", 382 | "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", 383 | "dev": true, 384 | "requires": { 385 | "estraverse": "^4.1.0" 386 | } 387 | }, 388 | "estraverse": { 389 | "version": "4.2.0", 390 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", 391 | "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", 392 | "dev": true 393 | }, 394 | "esutils": { 395 | "version": "2.0.2", 396 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 397 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 398 | "dev": true 399 | }, 400 | "event-target-shim": { 401 | "version": "5.0.1", 402 | "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", 403 | "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" 404 | }, 405 | "external-editor": { 406 | "version": "3.0.3", 407 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", 408 | "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", 409 | "dev": true, 410 | "requires": { 411 | "chardet": "^0.7.0", 412 | "iconv-lite": "^0.4.24", 413 | "tmp": "^0.0.33" 414 | } 415 | }, 416 | "fast-deep-equal": { 417 | "version": "2.0.1", 418 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 419 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", 420 | "dev": true 421 | }, 422 | "fast-json-stable-stringify": { 423 | "version": "2.0.0", 424 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 425 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", 426 | "dev": true 427 | }, 428 | "fast-levenshtein": { 429 | "version": "2.0.6", 430 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 431 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 432 | "dev": true 433 | }, 434 | "figures": { 435 | "version": "2.0.0", 436 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", 437 | "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", 438 | "dev": true, 439 | "requires": { 440 | "escape-string-regexp": "^1.0.5" 441 | } 442 | }, 443 | "file-entry-cache": { 444 | "version": "5.0.1", 445 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", 446 | "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", 447 | "dev": true, 448 | "requires": { 449 | "flat-cache": "^2.0.1" 450 | } 451 | }, 452 | "flat-cache": { 453 | "version": "2.0.1", 454 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", 455 | "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", 456 | "dev": true, 457 | "requires": { 458 | "flatted": "^2.0.0", 459 | "rimraf": "2.6.3", 460 | "write": "1.0.3" 461 | } 462 | }, 463 | "flatted": { 464 | "version": "2.0.0", 465 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", 466 | "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", 467 | "dev": true 468 | }, 469 | "fs.realpath": { 470 | "version": "1.0.0", 471 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 472 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 473 | "dev": true 474 | }, 475 | "functional-red-black-tree": { 476 | "version": "1.0.1", 477 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", 478 | "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", 479 | "dev": true 480 | }, 481 | "glob": { 482 | "version": "7.1.4", 483 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 484 | "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 485 | "dev": true, 486 | "requires": { 487 | "fs.realpath": "^1.0.0", 488 | "inflight": "^1.0.4", 489 | "inherits": "2", 490 | "minimatch": "^3.0.4", 491 | "once": "^1.3.0", 492 | "path-is-absolute": "^1.0.0" 493 | } 494 | }, 495 | "globals": { 496 | "version": "11.12.0", 497 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 498 | "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 499 | "dev": true 500 | }, 501 | "has-flag": { 502 | "version": "3.0.0", 503 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 504 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 505 | "dev": true 506 | }, 507 | "iconv-lite": { 508 | "version": "0.4.24", 509 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 510 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 511 | "dev": true, 512 | "requires": { 513 | "safer-buffer": ">= 2.1.2 < 3" 514 | } 515 | }, 516 | "ignore": { 517 | "version": "4.0.6", 518 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", 519 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", 520 | "dev": true 521 | }, 522 | "import-fresh": { 523 | "version": "3.0.0", 524 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", 525 | "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", 526 | "dev": true, 527 | "requires": { 528 | "parent-module": "^1.0.0", 529 | "resolve-from": "^4.0.0" 530 | } 531 | }, 532 | "imurmurhash": { 533 | "version": "0.1.4", 534 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 535 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", 536 | "dev": true 537 | }, 538 | "inflight": { 539 | "version": "1.0.6", 540 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 541 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 542 | "dev": true, 543 | "requires": { 544 | "once": "^1.3.0", 545 | "wrappy": "1" 546 | } 547 | }, 548 | "inherits": { 549 | "version": "2.0.3", 550 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 551 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 552 | "dev": true 553 | }, 554 | "inquirer": { 555 | "version": "6.3.1", 556 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", 557 | "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", 558 | "dev": true, 559 | "requires": { 560 | "ansi-escapes": "^3.2.0", 561 | "chalk": "^2.4.2", 562 | "cli-cursor": "^2.1.0", 563 | "cli-width": "^2.0.0", 564 | "external-editor": "^3.0.3", 565 | "figures": "^2.0.0", 566 | "lodash": "^4.17.11", 567 | "mute-stream": "0.0.7", 568 | "run-async": "^2.2.0", 569 | "rxjs": "^6.4.0", 570 | "string-width": "^2.1.0", 571 | "strip-ansi": "^5.1.0", 572 | "through": "^2.3.6" 573 | }, 574 | "dependencies": { 575 | "ansi-regex": { 576 | "version": "4.1.0", 577 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 578 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", 579 | "dev": true 580 | }, 581 | "strip-ansi": { 582 | "version": "5.2.0", 583 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 584 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 585 | "dev": true, 586 | "requires": { 587 | "ansi-regex": "^4.1.0" 588 | } 589 | } 590 | } 591 | }, 592 | "is-fullwidth-code-point": { 593 | "version": "2.0.0", 594 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 595 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", 596 | "dev": true 597 | }, 598 | "is-promise": { 599 | "version": "2.1.0", 600 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 601 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", 602 | "dev": true 603 | }, 604 | "isexe": { 605 | "version": "2.0.0", 606 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 607 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 608 | "dev": true 609 | }, 610 | "js-tokens": { 611 | "version": "4.0.0", 612 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 613 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 614 | "dev": true 615 | }, 616 | "js-yaml": { 617 | "version": "3.13.1", 618 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", 619 | "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", 620 | "dev": true, 621 | "requires": { 622 | "argparse": "^1.0.7", 623 | "esprima": "^4.0.0" 624 | } 625 | }, 626 | "jsdoctypeparser": { 627 | "version": "3.1.0", 628 | "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-3.1.0.tgz", 629 | "integrity": "sha512-JNbkKpDFqbYjg+IU3FNo7qjX7Opy7CwjHywT32zgAcz/d4lX6Umn5jOHVETUdnNNgGrMk0nEx1gvP0F4M0hzlQ==", 630 | "dev": true 631 | }, 632 | "json-schema-traverse": { 633 | "version": "0.4.1", 634 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 635 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 636 | "dev": true 637 | }, 638 | "json-stable-stringify-without-jsonify": { 639 | "version": "1.0.1", 640 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 641 | "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", 642 | "dev": true 643 | }, 644 | "levn": { 645 | "version": "0.3.0", 646 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 647 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 648 | "dev": true, 649 | "requires": { 650 | "prelude-ls": "~1.1.2", 651 | "type-check": "~0.3.2" 652 | } 653 | }, 654 | "lodash": { 655 | "version": "4.17.21", 656 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 657 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", 658 | "dev": true 659 | }, 660 | "mime-db": { 661 | "version": "1.45.0", 662 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", 663 | "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" 664 | }, 665 | "mime-types": { 666 | "version": "2.1.28", 667 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", 668 | "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", 669 | "requires": { 670 | "mime-db": "1.45.0" 671 | } 672 | }, 673 | "mimic-fn": { 674 | "version": "1.2.0", 675 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 676 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", 677 | "dev": true 678 | }, 679 | "minimatch": { 680 | "version": "3.0.4", 681 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 682 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 683 | "dev": true, 684 | "requires": { 685 | "brace-expansion": "^1.1.7" 686 | } 687 | }, 688 | "minimist": { 689 | "version": "1.2.5", 690 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 691 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", 692 | "dev": true 693 | }, 694 | "mkdirp": { 695 | "version": "0.5.5", 696 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", 697 | "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", 698 | "dev": true, 699 | "requires": { 700 | "minimist": "^1.2.5" 701 | } 702 | }, 703 | "ms": { 704 | "version": "2.1.1", 705 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 706 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 707 | }, 708 | "mute-stream": { 709 | "version": "0.0.7", 710 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", 711 | "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", 712 | "dev": true 713 | }, 714 | "natural-compare": { 715 | "version": "1.4.0", 716 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 717 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", 718 | "dev": true 719 | }, 720 | "nice-try": { 721 | "version": "1.0.5", 722 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 723 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", 724 | "dev": true 725 | }, 726 | "node-fetch": { 727 | "version": "2.6.1", 728 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 729 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" 730 | }, 731 | "once": { 732 | "version": "1.4.0", 733 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 734 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 735 | "dev": true, 736 | "requires": { 737 | "wrappy": "1" 738 | } 739 | }, 740 | "onetime": { 741 | "version": "2.0.1", 742 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 743 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", 744 | "dev": true, 745 | "requires": { 746 | "mimic-fn": "^1.0.0" 747 | } 748 | }, 749 | "optionator": { 750 | "version": "0.8.2", 751 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 752 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 753 | "dev": true, 754 | "requires": { 755 | "deep-is": "~0.1.3", 756 | "fast-levenshtein": "~2.0.4", 757 | "levn": "~0.3.0", 758 | "prelude-ls": "~1.1.2", 759 | "type-check": "~0.3.2", 760 | "wordwrap": "~1.0.0" 761 | } 762 | }, 763 | "os-tmpdir": { 764 | "version": "1.0.2", 765 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 766 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", 767 | "dev": true 768 | }, 769 | "parent-module": { 770 | "version": "1.0.1", 771 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 772 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 773 | "dev": true, 774 | "requires": { 775 | "callsites": "^3.0.0" 776 | } 777 | }, 778 | "path-is-absolute": { 779 | "version": "1.0.1", 780 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 781 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 782 | "dev": true 783 | }, 784 | "path-is-inside": { 785 | "version": "1.0.2", 786 | "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", 787 | "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", 788 | "dev": true 789 | }, 790 | "path-key": { 791 | "version": "2.0.1", 792 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 793 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", 794 | "dev": true 795 | }, 796 | "prelude-ls": { 797 | "version": "1.1.2", 798 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 799 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 800 | "dev": true 801 | }, 802 | "prism-media": { 803 | "version": "1.2.5", 804 | "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.5.tgz", 805 | "integrity": "sha512-YqSnMCugv+KUNE9PQec48Dq22jSxB/B6UcfD9jTpPN1Mbuh+RqELdTJmRPj106z3aa8ZuXrWGQllXPeIGmKbvw==" 806 | }, 807 | "progress": { 808 | "version": "2.0.3", 809 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 810 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", 811 | "dev": true 812 | }, 813 | "punycode": { 814 | "version": "2.1.1", 815 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 816 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", 817 | "dev": true 818 | }, 819 | "regexpp": { 820 | "version": "2.0.1", 821 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", 822 | "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", 823 | "dev": true 824 | }, 825 | "resolve-from": { 826 | "version": "4.0.0", 827 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 828 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 829 | "dev": true 830 | }, 831 | "restore-cursor": { 832 | "version": "2.0.0", 833 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 834 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", 835 | "dev": true, 836 | "requires": { 837 | "onetime": "^2.0.0", 838 | "signal-exit": "^3.0.2" 839 | } 840 | }, 841 | "rimraf": { 842 | "version": "2.6.3", 843 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 844 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 845 | "dev": true, 846 | "requires": { 847 | "glob": "^7.1.3" 848 | } 849 | }, 850 | "run-async": { 851 | "version": "2.3.0", 852 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", 853 | "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", 854 | "dev": true, 855 | "requires": { 856 | "is-promise": "^2.1.0" 857 | } 858 | }, 859 | "rxjs": { 860 | "version": "6.5.2", 861 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", 862 | "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", 863 | "dev": true, 864 | "requires": { 865 | "tslib": "^1.9.0" 866 | } 867 | }, 868 | "safer-buffer": { 869 | "version": "2.1.2", 870 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 871 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 872 | "dev": true 873 | }, 874 | "semver": { 875 | "version": "5.7.0", 876 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", 877 | "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", 878 | "dev": true 879 | }, 880 | "setimmediate": { 881 | "version": "1.0.5", 882 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 883 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" 884 | }, 885 | "shebang-command": { 886 | "version": "1.2.0", 887 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 888 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 889 | "dev": true, 890 | "requires": { 891 | "shebang-regex": "^1.0.0" 892 | } 893 | }, 894 | "shebang-regex": { 895 | "version": "1.0.0", 896 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 897 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", 898 | "dev": true 899 | }, 900 | "signal-exit": { 901 | "version": "3.0.2", 902 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 903 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", 904 | "dev": true 905 | }, 906 | "slice-ansi": { 907 | "version": "2.1.0", 908 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", 909 | "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", 910 | "dev": true, 911 | "requires": { 912 | "ansi-styles": "^3.2.0", 913 | "astral-regex": "^1.0.0", 914 | "is-fullwidth-code-point": "^2.0.0" 915 | } 916 | }, 917 | "sprintf-js": { 918 | "version": "1.0.3", 919 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 920 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 921 | "dev": true 922 | }, 923 | "string-width": { 924 | "version": "2.1.1", 925 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 926 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 927 | "dev": true, 928 | "requires": { 929 | "is-fullwidth-code-point": "^2.0.0", 930 | "strip-ansi": "^4.0.0" 931 | } 932 | }, 933 | "strip-ansi": { 934 | "version": "4.0.0", 935 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 936 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 937 | "dev": true, 938 | "requires": { 939 | "ansi-regex": "^3.0.0" 940 | } 941 | }, 942 | "strip-json-comments": { 943 | "version": "2.0.1", 944 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 945 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", 946 | "dev": true 947 | }, 948 | "supports-color": { 949 | "version": "5.5.0", 950 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 951 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 952 | "dev": true, 953 | "requires": { 954 | "has-flag": "^3.0.0" 955 | } 956 | }, 957 | "table": { 958 | "version": "5.3.3", 959 | "resolved": "https://registry.npmjs.org/table/-/table-5.3.3.tgz", 960 | "integrity": "sha512-3wUNCgdWX6PNpOe3amTTPWPuF6VGvgzjKCaO1snFj0z7Y3mUPWf5+zDtxUVGispJkDECPmR29wbzh6bVMOHbcw==", 961 | "dev": true, 962 | "requires": { 963 | "ajv": "^6.9.1", 964 | "lodash": "^4.17.11", 965 | "slice-ansi": "^2.1.0", 966 | "string-width": "^3.0.0" 967 | }, 968 | "dependencies": { 969 | "ansi-regex": { 970 | "version": "4.1.0", 971 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 972 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", 973 | "dev": true 974 | }, 975 | "string-width": { 976 | "version": "3.1.0", 977 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 978 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 979 | "dev": true, 980 | "requires": { 981 | "emoji-regex": "^7.0.1", 982 | "is-fullwidth-code-point": "^2.0.0", 983 | "strip-ansi": "^5.1.0" 984 | } 985 | }, 986 | "strip-ansi": { 987 | "version": "5.2.0", 988 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 989 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 990 | "dev": true, 991 | "requires": { 992 | "ansi-regex": "^4.1.0" 993 | } 994 | } 995 | } 996 | }, 997 | "text-table": { 998 | "version": "0.2.0", 999 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1000 | "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", 1001 | "dev": true 1002 | }, 1003 | "through": { 1004 | "version": "2.3.8", 1005 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1006 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", 1007 | "dev": true 1008 | }, 1009 | "tmp": { 1010 | "version": "0.0.33", 1011 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 1012 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 1013 | "dev": true, 1014 | "requires": { 1015 | "os-tmpdir": "~1.0.2" 1016 | } 1017 | }, 1018 | "tslib": { 1019 | "version": "1.9.3", 1020 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", 1021 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", 1022 | "dev": true 1023 | }, 1024 | "tweetnacl": { 1025 | "version": "1.0.3", 1026 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", 1027 | "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" 1028 | }, 1029 | "type-check": { 1030 | "version": "0.3.2", 1031 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 1032 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 1033 | "dev": true, 1034 | "requires": { 1035 | "prelude-ls": "~1.1.2" 1036 | } 1037 | }, 1038 | "uri-js": { 1039 | "version": "4.2.2", 1040 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 1041 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 1042 | "dev": true, 1043 | "requires": { 1044 | "punycode": "^2.1.0" 1045 | } 1046 | }, 1047 | "which": { 1048 | "version": "1.3.1", 1049 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1050 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1051 | "dev": true, 1052 | "requires": { 1053 | "isexe": "^2.0.0" 1054 | } 1055 | }, 1056 | "wordwrap": { 1057 | "version": "1.0.0", 1058 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1059 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 1060 | "dev": true 1061 | }, 1062 | "wrappy": { 1063 | "version": "1.0.2", 1064 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1065 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1066 | "dev": true 1067 | }, 1068 | "write": { 1069 | "version": "1.0.3", 1070 | "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", 1071 | "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", 1072 | "dev": true, 1073 | "requires": { 1074 | "mkdirp": "^0.5.1" 1075 | } 1076 | }, 1077 | "ws": { 1078 | "version": "7.4.6", 1079 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", 1080 | "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" 1081 | } 1082 | } 1083 | } 1084 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "easy-djs-commandhandler", 3 | "version": "3.0.1", 4 | "description": "Package to create an easy discord bot", 5 | "main": "./src/index", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "lint": "eslint src" 9 | }, 10 | "author": "plasmachicken", 11 | "repository": { 12 | "type": "github", 13 | "url": "https://github.com/PLASMAchicken/easy-djs-commandhandler" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/PLASMAchicken/easy-djs-commandhandler/issues" 17 | }, 18 | "license": "ISC", 19 | "devDependencies": { 20 | "eslint": "^5.16.0", 21 | "eslint-plugin-jsdoc": "^4.8.4" 22 | }, 23 | "dependencies": { 24 | "discord.js": "^12.5.1", 25 | "ms": "^2.1.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Argument.js: -------------------------------------------------------------------------------- 1 | const discord = require('discord.js'); 2 | class Argument { 3 | /** 4 | * @typedef {{key:string,prompt:string,type:ArgumentTypes,default?:string,time?:number,attempts?:number,errorMsg?:string}} ArgumentInfo 5 | * 6 | */ 7 | /** 8 | * 9 | * @param {ArgumentInfo} info - Argument Info Options. 10 | */ 11 | constructor(info = {}) { 12 | this.usedAttempts = 0; 13 | this.key = info.key; 14 | this.prompt = info.prompt; 15 | this.type = info.type; 16 | this.default = info.default; 17 | this.time = info.time; 18 | this.attempts = info.attempts; 19 | this.errorMsg = info.errorMsg; 20 | } 21 | /** 22 | * @param {discord.Message} message - Discordjs message. 23 | * @returns {{canceled:boolean,value:discord.Channel|discord.User|discord.GuildMember|discord.Message|string|discord.Role}} 24 | */ 25 | async obtain(message) { 26 | if(!this.key) throw new Error('Argument is missing key!'); 27 | if(!this.prompt) throw new Error('Argument is missing prompt!'); 28 | let value; 29 | await message.channel.send(this.prompt); 30 | const collector = await message.channel.awaitMessages( 31 | (x) => x.author.id == message.author.id, 32 | { max: 1, time: this.time } 33 | ); 34 | if (collector && collector.size) { 35 | if (this.type == 'channel') { 36 | value = 37 | collector.first().mentions.channels.first() || collector 38 | .first().guild ? 39 | collector 40 | .first() 41 | .guild.channels.get(collector.first().content) : undefined; 42 | } 43 | else if (this.type == 'member') { 44 | value = 45 | collector.first().mentions.members.first() || collector 46 | .first().guild ? 47 | collector 48 | .first() 49 | .guild.members.get(collector.first().content) : undefined; 50 | } 51 | else if (this.type == 'role') { 52 | value = 53 | collector.first().mentions.roles.first() || collector 54 | .first().guild ? 55 | collector 56 | .first() 57 | .guild.roles.get(collector.first().content) : undefined; 58 | } 59 | else if (this.type == 'string') { 60 | value = collector.first().content; 61 | } 62 | else if (this.type == 'user') { 63 | value = collector.first().mentions.users.first(); 64 | } 65 | else { 66 | value = collector.first(); 67 | } 68 | if (collector.first().content == 'cancel') { 69 | return { canceled: true, value: null }; 70 | } 71 | if (!value) { 72 | await message.channel.send( 73 | this.errorMsg || 'It seems, that this is not the correct answer!' 74 | ); 75 | if (this.attempts && this.usedAttempts < this.attempts) { 76 | this.usedAttempts++; 77 | return this.obtain(message); 78 | } 79 | else if ( 80 | this.attempts && 81 | this.usedAttempts >= this.attempts 82 | ) { 83 | this.usedAttempts = 0; 84 | return { canceled: false, value: null }; 85 | } 86 | return this.obtain(message); 87 | } 88 | else { 89 | return { canceled: false, value }; 90 | } 91 | } 92 | else { 93 | return { canceled: false, value: undefined }; 94 | } 95 | } 96 | } 97 | class Collector { 98 | /** 99 | * @typedef {'channel'|'user'|'member'|'role'|'string'} ArgumentTypes 100 | * 101 | */ 102 | /** 103 | * 104 | * @param {ArgumentInfo[]} args - Arguments. 105 | */ 106 | constructor(args = [{}]) { 107 | /** 108 | * @type {Argument[]} 109 | */ 110 | this.args = []; 111 | this.waiting = new Set(); 112 | for (const i of args) { 113 | const arg = new Argument(i); 114 | this.args.push(arg); 115 | } 116 | } 117 | /** 118 | * 119 | * @param {discord.Message} message - Discord.js Message. 120 | * @returns 121 | */ 122 | async obtain(message) { 123 | this.waiting.add(message.author.id + message.channel.id); 124 | const values = {}; 125 | try { 126 | for (const i of this.args) { 127 | const result = await i.obtain(message); 128 | if (result.canceled) { 129 | this.waiting.delete(message.author.id + message.channel.id); 130 | return { values: null, canceled: result.canceled }; 131 | } 132 | values[i.key] = result.value; 133 | } 134 | } 135 | catch (err) { 136 | this.waiting.delete(message.author + message.channel.id); 137 | throw err; 138 | } 139 | return { values, canceled: false }; 140 | } 141 | } 142 | module.exports = Collector; 143 | -------------------------------------------------------------------------------- /src/Command.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-unused-vars 2 | const discord = require('discord.js'); 3 | class Command { 4 | /** 5 | * @typedef {Object} cmdConstructor 6 | * 7 | * @property {string} name - The Command name, used for . 8 | * @property {string} [description] - The Command Description, for the help command. 9 | * @property {Boolean} [hideinhelp=false] - Should the Command be hidden for normal users in help? 10 | * @property {('botowner'|'guild'|'dm'|'guildowner')[]} [requires=[]] - Does the Command require a guild/dm or botowner? 11 | * @property {string} [usage] - The Command Usage, for the help command. 12 | * @property {string} [cooldown] - The Cooldown Overwrite. 13 | * @property {Array} [aliases] - The Aliases, used for . 14 | * @property {discord.PermissionResolvable[]} [requiresBotPermissions] - Permissions that the bot needs. 15 | * @property {discord.PermissionResolvable[]} [requireUserPermissions] - permissions that the user needs to have to execute the command. 16 | */ 17 | /** 18 | * 19 | * @param {cmdConstructor} param0 - Constructor. 20 | */ 21 | constructor({ 22 | name, 23 | description, 24 | hideinhelp = false, 25 | requires = [], 26 | usage, 27 | cooldown, 28 | aliases = [], 29 | requiresBotPermissions = [], 30 | requireUserPermissions = [], 31 | }) { 32 | if (!name) { 33 | throw new Error('name required for Command Class'); 34 | } 35 | this.help = {}; 36 | this.help.name = name; 37 | this.help.description = description; 38 | this.help.hideinhelp = hideinhelp; 39 | this.help.requires = requires; 40 | this.help.usage = usage; 41 | this.help.cooldown = cooldown; 42 | this.help.aliases = aliases; 43 | this.help.requiresBotPermissions = requiresBotPermissions; 44 | this.help.requireUserPermissions = requireUserPermissions; 45 | this.run = (client, message) => { message.channel.send('This Command does not have a Function!'); }; 46 | return this; 47 | } 48 | 49 | /** 50 | * Callback for the Command 51 | * 52 | * @callback cmdCallback 53 | * @param {discord.Client} client 54 | * @param {discord.Message} message 55 | * @param {String[]} args 56 | * @returns {any} 57 | */ 58 | /** 59 | * Assigns the command executor function to the callback provided. 60 | * 61 | * @param {cmdCallback} callback - Callback for the Command. 62 | * @returns {Command} Command Class. 63 | */ 64 | execute(callback) { 65 | this.run = callback; 66 | return this; 67 | } 68 | } 69 | module.exports = Command; 70 | -------------------------------------------------------------------------------- /src/Handler.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const { Message, Client, Collection } = require('discord.js'); 3 | const ms = require('ms'); 4 | const sleep = require('util').promisify(setTimeout); 5 | class CommandHandler { 6 | 7 | /** 8 | * Callback for adding two numbers. 9 | * 10 | * @callback prefixFunc 11 | * @param {Message} message - The Message we need the prefix for. 12 | * @param {Client} client - The Client 13 | * @returns {Strings} - The prefix that will be used. 14 | */ 15 | /** 16 | * Options for the Coammnd Handler. 17 | * @typedef {Object} HandlerSettings 18 | * 19 | * @property {string} [prefix=!] Prefix. 20 | * @property {Array} [owner=[]] Array of ids with Bot Perms. 21 | * @property {string} [folder=commands] Folder where the Commands are in. 22 | * @property {*} [cooldowns=true] - If Cooldowns are Enabled, either true/false, or Collection 23 | * @property {boolean} [defaultcmds=true] - Load Default Commands. 24 | * @property {string} [maxWait='2s'] - Max Time to wait for Cooldown. 25 | * @property {string} [defaultCooldown='5s'] - Default Cooldown if Command does not overwrite it. 26 | * @property {prefixFunc} [prefixFunc] - Function wich returns a string and selects the prefix. 27 | * @property {boolean} [logArgs] - Log arguments passed to each command 28 | */ 29 | /** 30 | * Module to run and handle Commands. 31 | * 32 | * @param {Client} client - Discord.js Client. 33 | * @param {HandlerSettings} settings - Settings Object. 34 | * @example new commandhandler(client, { prefix: '?', owner: ['193406800614129664'], folder: 'cmds' }); 35 | */ 36 | constructor(client, settings) { 37 | if(!client) throw new TypeError('Need Discord#Client'); 38 | let errorc = 0; 39 | if(!settings) settings = {}; 40 | if(!settings.folder) settings.folder = 'commands'; 41 | if(!settings.prefix) settings.prefix = '!'; 42 | if(!settings.defaultCooldown) settings.defaultCooldown = '5s'; 43 | if(!settings.maxWait) settings.maxWait = 2000; 44 | else settings.maxWait = ms(settings.maxWait); 45 | if(settings.cooldowns === undefined) settings.cooldowns = true; 46 | if(settings.cooldowns === true) { 47 | settings.cooldowns = new Collection(); 48 | client.cooldowns = settings.cooldowns; 49 | } 50 | else {client.cooldowns = settings.cooldowns;} 51 | 52 | if(settings.logArgs==undefined)settings.logArgs=false; 53 | 54 | if(settings.defaultcmds !== false) settings.defaultcmds = true; 55 | if(settings.owners && !settings.owner) settings.owner = settings.owners; 56 | if(!settings.owner) client.owners = []; 57 | else if (typeof settings.owner == 'string') client.owners = [settings.owner]; 58 | else if (Array.isArray(settings.owner)) client.owners = settings.owner; 59 | else client.owners = []; 60 | if(!client.prefix) client.prefix = settings.prefix; 61 | else settings.prefix = client.prefix; 62 | this.settings = settings; 63 | if(!client.commands) client.commands = new Collection(); 64 | if(!client.format) { 65 | client.format = function(string) { 66 | string = string.replace(//g, client.prefix); 67 | string = string.replace(//g, client.user.toString()); 68 | return string; 69 | }; 70 | } 71 | 72 | fs.readdir(`./${settings.folder}/`, (err, files) => { // read dir 73 | if(err) { // err => 74 | if (err.errno == -4058) { // err code = -4058 => dir not present 75 | fs.mkdirSync(`./${settings.folder}/`); // => make dir 76 | console.log(`Command Folder was not found! Creating ./${settings.folder}/ \n Please restart Bot!`); // => log 77 | return process.exit(); // => return 78 | } 79 | else{ // Unknow Error => 80 | throw err; 81 | } 82 | } 83 | 84 | const jsfile = files.filter(f => f.split('.').pop() === 'js' && !fs.statSync(process.cwd() + `/${settings.folder}/` + f).isDirectory()); // get all .js files 85 | const categorys = files.filter(f => fs.statSync(process.cwd() + `/${settings.folder}/` + f).isDirectory()); 86 | if (jsfile.length <= 0 && categorys.length <= 0) { // if no commands present 87 | console.log(' Couldn\'t find commands.'); // log no commands => close commandhandler and start client 88 | } 89 | 90 | console.log('-------------------------------\nStarting to load Commands!'); 91 | jsfile.forEach((f, i) => { // if commands present 92 | try{ 93 | const props = require(`${process.cwd()}/${settings.folder}/${f}`); // => load each one 94 | 95 | console.log(`${i} ${f} loaded!`); // => log that command got loaded 96 | if(props.help.aliases && !Array.isArray(props.help.aliases)) props.help.aliases = [props.help.aliases]; 97 | client.commands.set(props.help.name, props); // => add command to command list 98 | } 99 | catch(err) { 100 | errorc++; 101 | console.error(`${i} ${f} failed to load!\n${err}\n${err.stack}\n`); 102 | } 103 | }); 104 | 105 | console.log('Commands loaded or none found!\n-------------------------------\nStarting to load Categorys!'); 106 | categorys.forEach(category =>{ 107 | const catfiles = fs.readdirSync(`./${settings.folder}/` + category).filter(f => f.split('.').pop() === 'js' && !fs.statSync(process.cwd() + `/${settings.folder}/` + category + '/' + f).isDirectory()); 108 | catfiles.forEach((f, i) => { 109 | try{ 110 | const props = require(`${process.cwd()}/${settings.folder}/${category}/${f}`); // => load each one 111 | 112 | console.log(`${i} ${f} in category ${category} loaded!`); // => log that command got loaded 113 | props.help.category = category; 114 | if(props.help.aliases && !Array.isArray(props.help.aliases)) props.help.aliases = [props.help.aliases]; 115 | client.commands.set(props.help.name, props); // => add command to command list 116 | } 117 | catch(err) { 118 | errorc++; 119 | console.error(`${i} ${f} failed to in ${category} load!\n${err}\n${err.stack}\n`); 120 | } 121 | }); 122 | console.log(`-------------------------------\nCategory ${category} loaded or none found!\n-------------------------------`); 123 | }); 124 | 125 | 126 | console.log('Categorys loaded or none found!\n-------------------------------'); 127 | loadBaseCMD(client, 'help', this.settings); 128 | loadBaseCMD(client, 'eval', this.settings); 129 | loadBaseCMD(client, 'usage', this.settings); 130 | 131 | console.log(`${client.commands.size} Commands loaded! ${errorc == 0 ? '' : `${errorc} Error occured!` }`); 132 | }); // => close commandhandler and start client 133 | } 134 | 135 | /** 136 | * Module to run and handle Commands. 137 | * 138 | * @param {Client} client - Discord Client. 139 | * @param {Message} message - Message Object to handle Command in. 140 | * @example commandhandler.run(client, message); 141 | */ 142 | async handle(client, message) { 143 | if(message.guild && !message.channel.permissionsFor(message.guild.me).has('SEND_MESSAGES')) return; 144 | if (message.system || message.author.bot) return; 145 | let prefixRegex; 146 | if(this.settings.prefixFunc) { 147 | prefixRegex = new RegExp(`^(<@!?${client.user.id}>|${(await this.settings.prefixFunc(message, client) || client.prefix).replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')})\\s*`); 148 | } 149 | else { 150 | prefixRegex = new RegExp(`^(<@!?${client.user.id}>|${client.prefix.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')})\\s*`); 151 | } 152 | 153 | if (!prefixRegex.test(message.content)) return; 154 | const [, matchedPrefix] = message.content.match(prefixRegex); 155 | const args = message.content.slice(matchedPrefix.length).trim().split(/ +/); 156 | const cmdname = args.shift().toLowerCase(); 157 | const cmd = client.commands.get(cmdname) || client.commands.find(com => com.help.aliases && com.help.aliases.includes(cmdname)); 158 | if (cmd) { 159 | message.channel.startTyping(); 160 | 161 | let logArgs=this.settings.logArgs?' [\''+args.join("','")+'\']':''; 162 | console.log(`[Ping:${Math.round(client.ws.ping)}ms] ${cmd.help.name}${logArgs} request by ${message.author.username} @ ${message.author.id} `); // if command can run => log action 163 | 164 | if (cmd.help.requires) { 165 | if (cmd.help.requires.includes('botowner')) if (!client.owners.includes(message.author.id)) return message.reply('This command cannot be used by you!'), console.log(`[Ping:${Math.round(client.ws.ping)}ms]${client.shard ? ` [Shard: #${client.shard.ids}]`: ''} ${cmd.help.name} failed!: Not Bot Owner! `), message.channel.stopTyping(true); 166 | if (cmd.help.requires.includes('guild') && message.channel.type !== 'text') return message.channel.send('This command needs to be run in a guild!'), console.log(`[Ping:${Math.round(client.ws.ping)}ms]${client.shard ? ` [Shard: #${client.shard.ids}]`: ''} ${cmd.help.name} failed!: Not Guild! `), message.channel.stopTyping(true); 167 | if (cmd.help.requires.includes('dm') && message.channel.type !== 'dm') return message.channel.send('This command needs to be run in DMs!'), console.log(`[Ping:${Math.round(client.ws.ping)}ms]${client.shard ? ` [Shard: #${client.shard.ids}]`: ''} ${cmd.help.name} failed!: Not DM! `), message.channel.stopTyping(true); 168 | if (cmd.help.requires.includes('guildowner') && message.author.id !== message.guild.owner.id) return message.channel.send('This command can only be run by the guild owner!'), console.log(`[Ping:${Math.round(client.ws.ping)}ms]${client.shard ? ` [Shard: #${client.shard.ids}]`: ''} ${cmd.help.name} failed!: Not Guild Owner! `), message.channel.stopTyping(true); 169 | } 170 | if(cmd.help.requiresBotPermissions && cmd.help.requiresBotPermissions.length) { 171 | let missing = ['ERROR']; 172 | if(message.guild) { 173 | missing = cmd.help.requiresBotPermissions.filter(permission => !message.channel.permissionsFor(message.guild.me).has(permission)); 174 | } 175 | else { 176 | missing = cmd.help.requiresBotPermissions.filter(permission => !['VIEW_CHANNEL', 'SEND_MESSAGES', 'EMBED_LINKS', 'ADD_REACTIONS ', 'ATTACH_FILES'].includes(permission)); 177 | } 178 | if(missing.length)return message.reply(`I am missing the following Permissions to execute this Command: ${missing.map(x => `\`${x}\``).join(', ')}`), message.channel.stopTyping(true); 179 | } 180 | if(cmd.help.requireUserPermissions && cmd.help.requireUserPermissions.length) { 181 | let missing = ['ERROR']; 182 | if(message.guild) { 183 | missing = cmd.help.requireUserPermissions.filter(permission => !message.channel.permissionsFor(message.member).has(permission)); 184 | } 185 | else { 186 | missing = cmd.help.requireUserPermissions.filter(permission => !['VIEW_CHANNEL', 'SEND_MESSAGES', 'EMBED_LINKS', 'ADD_REACTIONS ', 'ATTACH_FILES'].includes(permission)); 187 | } 188 | if(missing.length)return message.reply(`You are missing the following Permissions to execute this Command: ${missing.map(x => `\`${x}\``).join(', ')}`), message.channel.stopTyping(true); 189 | } 190 | if(client.cooldowns) { 191 | if(await checkForCooldown(client, cmd, message, this.settings)) return; 192 | } 193 | if(!cmd.help.used) cmd.help.used = 0; 194 | cmd.help.used += 1; 195 | cmd.run(client, message, args); 196 | if (cmd.help.category === 'indevelopment' && !client.owners.includes(message.author.id)) message.reply('Just a quick sidenote:\nThis Command is still indevelopment and might be unstable or even broken!'); 197 | message.channel.stopTyping(true); 198 | } 199 | } 200 | } 201 | /** 202 | * Function to load Base Commmands that come with the Package. 203 | * 204 | * @private 205 | * @param {Client} client - Discord.JS Client. 206 | * @param {string} cmd - Name of Commmand to load. 207 | * @param {HandlerSettings} settings - Settings Object. 208 | */ 209 | function loadBaseCMD(client, cmd, settings) { 210 | if(!client.commands.has(cmd) && settings.defaultcmds) { 211 | const props = require(`./commands/${cmd}.js`); // => load each one 212 | 213 | console.log(`Loaded Default Command: ${cmd}`); // => log that command got loaded 214 | client.commands.set(props.help.name, props); // => add command to command list 215 | } 216 | } 217 | /** 218 | * Function to check for Cooldowns. 219 | * 220 | * @private 221 | * @param {Client} client - Discord.JS Client. 222 | * @param {Object} cmd - Command. 223 | * @param {Message} message - Message. 224 | * @param {HandlerSettings} settings - Settings Object. 225 | */ 226 | async function checkForCooldown(client, cmd, message, settings) { 227 | const cooldowns = client.cooldowns.get(message.author.id) || {}; 228 | const now = Date.now(); 229 | const cooldownAmount = ms(cmd.help.cooldown || settings.defaultCooldown); 230 | const cooldownName = cmd.help.cooldownGroup || cmd.help.name; 231 | if (!cooldowns[cooldownName]) cooldowns[cooldownName] = now - cooldownAmount; 232 | const cooldown = cooldowns[cooldownName]; 233 | const expirationTime = cooldown + cooldownAmount; 234 | if (now < expirationTime) { 235 | const msLeft = expirationTime - now; 236 | const timeLeft = ms(msLeft, { 237 | long: true, 238 | }); 239 | if(msLeft > settings.maxWait) { 240 | message.reply(`Please wait \`${timeLeft}\` before reusing the \`${cmd.help.name}\` command.`); 241 | message.channel.stopTyping(true); 242 | return true; 243 | } 244 | else { 245 | await sleep(msLeft); 246 | return await checkForCooldown(client, cmd, message, settings); 247 | } 248 | } 249 | cooldowns[cooldownName] = now; 250 | client.cooldowns.set(message.author.id, cooldowns); 251 | return false; 252 | } 253 | module.exports = CommandHandler; 254 | -------------------------------------------------------------------------------- /src/commands/eval.js: -------------------------------------------------------------------------------- 1 | const Discord = require('discord.js'); 2 | // eslint-disable-next-line no-unused-vars 3 | const discord = Discord; 4 | 5 | const cblockre = /(^```js)|(```$)/g; 6 | const { Command } = require('../'); 7 | module.exports = new Command({ name: 'eval', aliases: ['ev'], requires: ['botowner'], cooldown: '1ms', hideinhelp: true, description: 'Evals Code', usage: 'eval code' }) 8 | .execute(async (client, message, args) => { 9 | try { 10 | let content = args.join(' '); 11 | if (cblockre.test(content)) { 12 | content = content.replace(cblockre, '').trim(); 13 | } 14 | 15 | let evaled = await eval(content); 16 | 17 | if (typeof evaled !== 'string') {evaled = require('util').inspect(evaled);} 18 | header(message); 19 | console.log(evaled); 20 | if(evaled.length < 5000) await message.channel.send(evaled, { split: { char: '\n' }, code: 'js' }); 21 | else message.channel.send('Evaled Result is too big, please see console!'); 22 | header(message); 23 | } 24 | catch (err) { 25 | return message.channel.send(`\`ERROR\` \`\`\`xl\n${err}\n\`\`\``); 26 | } 27 | }); 28 | 29 | 30 | const header = (m, x) => { 31 | const H = `========== ${m.id} ==========`; 32 | console.log(H); 33 | if (x) { 34 | console.log(x); 35 | console.log(H); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /src/commands/help.js: -------------------------------------------------------------------------------- 1 | const ms = require('ms'); 2 | const { Client, Message } = require('discord.js'); 3 | /** 4 | * @param {Client} client - Discord.js Client. 5 | * @param {Message} message - Discord.js Message. 6 | * @param {Array} args - Array with parsed args. 7 | */ 8 | module.exports.run = async (client, message, args) => { 9 | if(!args.length) { 10 | let commands = {}; 11 | if (client.owners.includes(message.author.id)) commands = client.commands; 12 | else commands = client.commands.filter(cmd => !cmd.help.hideinhelp); 13 | const commandList = commands.map(props => `${props.help.hideinhelp ? '__' : ''}**Command: ${props.help.name}**${props.help.hideinhelp ? '\t __--hidden-- ( only visible to you because you are owner ) ' : ''}\n${props.help.category ? `\tCategory: ${props.help.category}\n` : '' }${props.help.description ? `\tDescription: ${props.help.description}\n` : '' }${props.help.usage ? `\tUsage: ${client.format(props.help.usage)}\n` : '' }${props.help.aliases ? (props.help.aliases.length ? `\tAliases: [ ${props.help.aliases.join(', ')} ]\n` : '') : '' }`).filter(data => data !== ''); 14 | 15 | return message.author.send(commandList, { split: { char: '\n\n' } }) 16 | .then(() => { 17 | if (message.channel.type === 'dm') return; 18 | message.reply('I\'ve sent you a DM with all my commands!'); 19 | }) 20 | .catch(error => { 21 | message.reply('it seems like I can\'t DM you! Do you have DMs disabled?'); 22 | if(error.code != 50007) throw new Error(`Could not send help DM to ${message.author.tag}.\n` + error); 23 | }); 24 | } 25 | const cmd = args.join(' ').toLowerCase(); 26 | const command = client.commands.get(cmd) || client.commands.find(commanda => commanda.help.aliases && commanda.help.aliases.includes(cmd)); 27 | const category = client.commands.filter(commanda => commanda.help.category && commanda.help.category.toLowerCase() == cmd); 28 | if (!command && !category.size) return message.reply('That\'s not a valid command/category!'); 29 | if(command) { 30 | const helpcmd = []; 31 | helpcmd.push(`**Name:** ${command.help.name}`); 32 | if (command.help.category) helpcmd.push(`**Category:** ${command.help.category}`); 33 | if (command.help.aliases) helpcmd.push(`**Aliases:** [${command.help.aliases.join(', ')}]`); 34 | if (command.help.description) helpcmd.push(`**Description:** ${command.help.description}`); 35 | if (command.help.usage) helpcmd.push(`**Usage:** ${client.format(command.help.usage)}`); 36 | if (command.help.cooldown) helpcmd.push(`**Cooldown:** ${ms(ms(command.help.cooldown), { long : true })}`); 37 | message.channel.send(helpcmd, { split: true }); 38 | } 39 | if(category.size) { 40 | return message.author.send( 41 | category.map(props => props.help.hideinhelp ? '' : `**Command: ${props.help.name}**\n${props.help.category ? `\tCategory: ${props.help.category}\n` : '' }${props.help.description ? `\tDescription: ${props.help.description}\n` : '' }${props.help.usage ? `\tUsage: ${client.format(props.help.usage)}\n` : '' }${props.help.aliases ? `\tAliases: [ ${props.help.aliases.join(', ')} ]\n` : '' }`).filter(data => data !== '').join(' ') 42 | , { split: { char: '\n\n' } }) 43 | .then(() => { 44 | if (message.channel.type === 'dm') return; 45 | message.reply('I\'ve sent you a DM with all my commands!'); 46 | }) 47 | .catch(error => { 48 | message.reply('it seems like I can\'t DM you! Do you have DMs disabled?'); 49 | if(error.code != 50007) throw error; 50 | }); 51 | } 52 | }; 53 | 54 | module.exports.help = { 55 | name: 'help', 56 | description: 'Shows all the commands', 57 | usage: 'help or help ', 58 | aliases: '', 59 | category: 'default', 60 | }; -------------------------------------------------------------------------------- /src/commands/usage.js: -------------------------------------------------------------------------------- 1 | const { Client, Message } = require('discord.js'); 2 | /** 3 | * @param {Client} client - Discord.js Client. 4 | * @param {Message} message - Discord.js Message. 5 | */ 6 | module.exports.run = async (client, message) => { 7 | const usage = client.commands.filter(cmd => cmd.help.used).map(cmd => cmd.help.name + ' : ' + cmd.help.used); 8 | if(usage.length) return message.channel.send(usage); 9 | else message.channel.send('No usage!'); 10 | }; 11 | 12 | 13 | module.exports.help = { 14 | name: 'usage', 15 | description: 'shows your bot usage', 16 | hideinhelp: true, 17 | aliases: [], 18 | requires: ['botowner'], 19 | cooldown: '1ms', 20 | category: 'default', 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const Command = require('./Command'); 2 | const CommandHandler = require('./Handler'); 3 | const ArgumentCollector = require('./Argument'); 4 | module.exports.Command = Command; 5 | module.exports.Handler = CommandHandler; 6 | module.exports.ArgumentCollector = ArgumentCollector; 7 | --------------------------------------------------------------------------------