├── .gitignore ├── Config.example.json ├── LICENSE ├── README.md ├── Zoopo.js ├── package-lock.json ├── package.json └── src ├── BaseCommand.js ├── BaseEvent.js ├── Commands ├── Attachments │ ├── Dog.js │ └── Monkey.js ├── Canvas │ ├── 80s.js │ ├── Brightness.js │ ├── PetPet.js │ ├── circle.js │ ├── contrast.js │ ├── dither565.js │ ├── gay.js │ ├── greyscale.js │ ├── invert.js │ ├── pixelate.js │ ├── resize.js │ └── sepia.js ├── Config │ ├── ChatChannel.js │ └── prefix.js ├── Facts │ ├── CatFact.js │ ├── DogFact.js │ └── MonkeyFact.js ├── Fun │ ├── 8ball.js │ ├── Reverse.js │ └── Shuffle.js ├── Other │ ├── Help.js │ ├── Invite.js │ ├── Ping.js │ ├── RateLimit.js │ ├── Uptime.js │ └── Vote.js └── Owner │ └── Eval.js ├── Database └── GuildManager.js ├── Events ├── guildCreate.js ├── guildDelete.js ├── messageCreate.js └── ready.js ├── ExtendedMap.js ├── MessageCollector.js └── ZoopoClient.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | Config.json 106 | .DS_Store 107 | -------------------------------------------------------------------------------- /Config.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "", 3 | "mongoURI": "", 4 | "apiKey": "", 5 | "defaultPrefix": "z!", 6 | "mongooseOptions": { 7 | "useUnifiedTopology": true, 8 | "useNewUrlParser": true 9 | }, 10 | "logs": { 11 | "guildID": "767569427935133736", 12 | "channelID": "808833177493438465" 13 | }, 14 | "ZoopoOptions": { 15 | "allowedMentions": { 16 | "everyone": false, 17 | "roles": false, 18 | "users": true, 19 | "repliedUser": true 20 | }, 21 | "defaultImageFormat": "png", 22 | "defaultImageSize": 512, 23 | "disableEvents": [ 24 | "CHANNEL_CREATE", 25 | "CHANNEL_DELETE", 26 | "GUILD_BAN_ADD", 27 | "GUILD_BAN_REMOVE", 28 | "GUILD_CREATE", 29 | "GUILD_DELETE", 30 | "GUILD_MEMBER_UPDATE", 31 | "GUILD_ROLE_CREATE", 32 | "GUILD_ROLE_DELETE", 33 | "GUILD_ROLE_UPDATE", 34 | "MESSAGE_DELETE", 35 | "MESSAGE_DELETE_BULK", 36 | "MESSAGE_UPDATE", 37 | "PRESENCE_UPDATE", 38 | "TYPING_START", 39 | "USER_UPDATE", 40 | "VOICE_STATE_UPDATE" 41 | ], 42 | "intents": [ 43 | "guilds", 44 | "guildMembers", 45 | "guildInvites", 46 | "guildMessages" 47 | ], 48 | "messageLimit": 10, 49 | "ratelimiterOffset": 200, 50 | "reconnectDelay": 3000, 51 | "restMode": true 52 | }, 53 | "onceEvents": ["ready"] 54 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zoopo 2 | Zoopo - A discord bot that uses MonkeDev's API. (https://api.monkedev.com) 3 | 4 | 5 | ## Invite link 6 | https://discord.com/api/oauth2/authorize?client_id=807048838362955798&permissions=52224&redirect_uri=https%3A%2F%2Fmonkedev.com&scope=bot -------------------------------------------------------------------------------- /Zoopo.js: -------------------------------------------------------------------------------- 1 | const ZoopoClient = require('./src/ZoopoClient'), 2 | Config = require('./Config.json'), 3 | Zoopo = new ZoopoClient(Config.token, Config.ZoopoOptions, Config); 4 | 5 | const Init = async () => { 6 | Zoopo.loadCommands(__dirname + '/src/Commands'); 7 | Zoopo.loadEvents(__dirname + '/src/Events'); 8 | await Zoopo.connectDatabase(); 9 | 10 | Zoopo.connect(); 11 | }; 12 | 13 | Init(); 14 | 15 | // Up time thingeeee 16 | /* 17 | const http = require('http'); 18 | http.createServer(function (req, res) { 19 | res.writeHead(200, {'Content-Type': 'text/plain'}); 20 | res.end('ok'); 21 | }).listen(25569); 22 | */ 23 | 24 | function getRandomColor() { 25 | var letters = '0123456789ABCDEF'; 26 | var color = '0x'; 27 | for (var i = 0; i < 6; i++) { 28 | color += letters[Math.floor(Math.random() * 16)]; 29 | } 30 | return color; 31 | } 32 | 33 | const app = require('express')(); 34 | const bodyParser = require('body-parser'); 35 | const fetch = require('node-fetch').default; 36 | 37 | // Uptime 38 | app.get('/', (req, res) => { 39 | res.status(200).send('ok'); 40 | }); 41 | 42 | // Votes 43 | app.post('/vote', bodyParser.json(), (req, res) => { 44 | // console.log(req.headers, req.body); 45 | const { authorization } = req.headers; 46 | const { bot, user } = req.body; 47 | if(authorization != Config['top.gg_auth']) { 48 | console.log(`No auth from ${req.headers['user-agent']}, auth: ${authorization}`); 49 | return res.status(400).send('Wrong auth :sob:'); 50 | }; 51 | const howMany = Math.floor(Math.random() * 3000); 52 | // Wassup <@!${user}>, Thank you for voting for Zoopo, You earned ${howMany} points! 53 | Zoopo.createMessage('779441136719757323', { 54 | content: `<@!${user}>`, 55 | embed: { 56 | description: `Thank you for voting for me!`, 57 | fields: [ 58 | { 59 | name: 'Points gained', 60 | value: `${howMany}`, 61 | inline: true 62 | }, 63 | { 64 | name: 'Vote link', 65 | value: '[Click ME](https://top.gg/bot/807048838362955798/vote)', 66 | inline: true 67 | } 68 | ], 69 | color: Number(getRandomColor()) 70 | } 71 | }) 72 | // console.log(user) 73 | // 74 | 75 | fetch('https://afk.monkedev.com/points/add', { method: 'POST', headers: { userid: user, howmany: howMany, auth: Config.adminKey }}); 76 | res.status(200).send('ok'); 77 | }); 78 | 79 | const port = process.env.PORT || 25569; 80 | app.listen(port, () => console.log('On port: ' + port)); 81 | 82 | // Server count 83 | setInterval(() => { 84 | fetch('https://top.gg/api/bots/807048838362955798/stats', { 85 | method: 'POST', 86 | body: JSON.stringify({ 87 | server_count: Zoopo.guilds.size, 88 | shard_count: Zoopo.shards.size 89 | }), 90 | headers: { 91 | Authorization: Config['top.gg_token'], 92 | 'Content-Type': 'application/json' 93 | } 94 | }); 95 | }, 1000 * 60); // 1 min -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zoopo", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/bson": { 8 | "version": "4.0.3", 9 | "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.3.tgz", 10 | "integrity": "sha512-mVRvYnTOZJz3ccpxhr3wgxVmSeiYinW+zlzQz3SXWaJmD1DuL05Jeq7nKw3SnbKmbleW5qrLG5vdyWe/A9sXhw==", 11 | "requires": { 12 | "@types/node": "*" 13 | } 14 | }, 15 | "@types/mongodb": { 16 | "version": "3.6.5", 17 | "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.6.5.tgz", 18 | "integrity": "sha512-XbG9+2wNaEwUn5DlhgN4ogjUYYzvjIsH6gwPvXXoTgfiQqUNq41RNxOqO+lrdpCjlRKtt/Pv7ZgSl7paQ/GUjw==", 19 | "requires": { 20 | "@types/bson": "*", 21 | "@types/node": "*" 22 | } 23 | }, 24 | "@types/node": { 25 | "version": "14.14.25", 26 | "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", 27 | "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" 28 | }, 29 | "accepts": { 30 | "version": "1.3.7", 31 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 32 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 33 | "requires": { 34 | "mime-types": "~2.1.24", 35 | "negotiator": "0.6.2" 36 | } 37 | }, 38 | "array-flatten": { 39 | "version": "1.1.1", 40 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 41 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 42 | }, 43 | "bl": { 44 | "version": "2.2.1", 45 | "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", 46 | "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", 47 | "requires": { 48 | "readable-stream": "^2.3.5", 49 | "safe-buffer": "^5.1.1" 50 | } 51 | }, 52 | "bluebird": { 53 | "version": "3.5.1", 54 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", 55 | "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" 56 | }, 57 | "body-parser": { 58 | "version": "1.19.0", 59 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 60 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 61 | "requires": { 62 | "bytes": "3.1.0", 63 | "content-type": "~1.0.4", 64 | "debug": "2.6.9", 65 | "depd": "~1.1.2", 66 | "http-errors": "1.7.2", 67 | "iconv-lite": "0.4.24", 68 | "on-finished": "~2.3.0", 69 | "qs": "6.7.0", 70 | "raw-body": "2.4.0", 71 | "type-is": "~1.6.17" 72 | }, 73 | "dependencies": { 74 | "debug": { 75 | "version": "2.6.9", 76 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 77 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 78 | "requires": { 79 | "ms": "2.0.0" 80 | } 81 | }, 82 | "ms": { 83 | "version": "2.0.0", 84 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 85 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 86 | } 87 | } 88 | }, 89 | "bson": { 90 | "version": "1.1.5", 91 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", 92 | "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" 93 | }, 94 | "bytes": { 95 | "version": "3.1.0", 96 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 97 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 98 | }, 99 | "call-bind": { 100 | "version": "1.0.2", 101 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 102 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 103 | "requires": { 104 | "function-bind": "^1.1.1", 105 | "get-intrinsic": "^1.0.2" 106 | } 107 | }, 108 | "content-disposition": { 109 | "version": "0.5.3", 110 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 111 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 112 | "requires": { 113 | "safe-buffer": "5.1.2" 114 | }, 115 | "dependencies": { 116 | "safe-buffer": { 117 | "version": "5.1.2", 118 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 119 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 120 | } 121 | } 122 | }, 123 | "content-type": { 124 | "version": "1.0.4", 125 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 126 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 127 | }, 128 | "cookie": { 129 | "version": "0.4.0", 130 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 131 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 132 | }, 133 | "cookie-signature": { 134 | "version": "1.0.6", 135 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 136 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 137 | }, 138 | "core-util-is": { 139 | "version": "1.0.2", 140 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 141 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 142 | }, 143 | "cron-parser": { 144 | "version": "3.1.0", 145 | "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-3.1.0.tgz", 146 | "integrity": "sha512-4Spe1gRbiQza3BqklhB/8dMi8PZAWalhLK1p+k3iYJjcxIK6t4YYGL0lKdHT0e743jDTJEDBz1NEAzY88kyNWQ==", 147 | "requires": { 148 | "is-nan": "^1.3.0", 149 | "luxon": "^1.25.0" 150 | } 151 | }, 152 | "debug": { 153 | "version": "3.1.0", 154 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 155 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 156 | "requires": { 157 | "ms": "2.0.0" 158 | }, 159 | "dependencies": { 160 | "ms": { 161 | "version": "2.0.0", 162 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 163 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 164 | } 165 | } 166 | }, 167 | "define-properties": { 168 | "version": "1.1.3", 169 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 170 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 171 | "requires": { 172 | "object-keys": "^1.0.12" 173 | } 174 | }, 175 | "denque": { 176 | "version": "1.5.0", 177 | "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", 178 | "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" 179 | }, 180 | "depd": { 181 | "version": "1.1.2", 182 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 183 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 184 | }, 185 | "destroy": { 186 | "version": "1.0.4", 187 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 188 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 189 | }, 190 | "ee-first": { 191 | "version": "1.1.1", 192 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 193 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 194 | }, 195 | "encodeurl": { 196 | "version": "1.0.2", 197 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 198 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 199 | }, 200 | "eris": { 201 | "version": "github:MonkeDev/erisInlines#b74ca0aee3da0fd08446bc63625cda15d719bf9f", 202 | "from": "github:MonkeDev/erisInlines", 203 | "requires": { 204 | "opusscript": "^0.0.7", 205 | "tweetnacl": "^1.0.1", 206 | "ws": "^7.2.1" 207 | } 208 | }, 209 | "escape-html": { 210 | "version": "1.0.3", 211 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 212 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 213 | }, 214 | "etag": { 215 | "version": "1.8.1", 216 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 217 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 218 | }, 219 | "express": { 220 | "version": "4.17.1", 221 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 222 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 223 | "requires": { 224 | "accepts": "~1.3.7", 225 | "array-flatten": "1.1.1", 226 | "body-parser": "1.19.0", 227 | "content-disposition": "0.5.3", 228 | "content-type": "~1.0.4", 229 | "cookie": "0.4.0", 230 | "cookie-signature": "1.0.6", 231 | "debug": "2.6.9", 232 | "depd": "~1.1.2", 233 | "encodeurl": "~1.0.2", 234 | "escape-html": "~1.0.3", 235 | "etag": "~1.8.1", 236 | "finalhandler": "~1.1.2", 237 | "fresh": "0.5.2", 238 | "merge-descriptors": "1.0.1", 239 | "methods": "~1.1.2", 240 | "on-finished": "~2.3.0", 241 | "parseurl": "~1.3.3", 242 | "path-to-regexp": "0.1.7", 243 | "proxy-addr": "~2.0.5", 244 | "qs": "6.7.0", 245 | "range-parser": "~1.2.1", 246 | "safe-buffer": "5.1.2", 247 | "send": "0.17.1", 248 | "serve-static": "1.14.1", 249 | "setprototypeof": "1.1.1", 250 | "statuses": "~1.5.0", 251 | "type-is": "~1.6.18", 252 | "utils-merge": "1.0.1", 253 | "vary": "~1.1.2" 254 | }, 255 | "dependencies": { 256 | "debug": { 257 | "version": "2.6.9", 258 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 259 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 260 | "requires": { 261 | "ms": "2.0.0" 262 | } 263 | }, 264 | "ms": { 265 | "version": "2.0.0", 266 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 267 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 268 | }, 269 | "safe-buffer": { 270 | "version": "5.1.2", 271 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 272 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 273 | } 274 | } 275 | }, 276 | "extendedmap": { 277 | "version": "1.0.4", 278 | "resolved": "https://registry.npmjs.org/extendedmap/-/extendedmap-1.0.4.tgz", 279 | "integrity": "sha512-o2MY1FNwTAyEc7keKMSy3LVk2Bu0edqBRnGPQwhDXT0se098seCKJ817goXsH6i+mlC6A/A19efg0MLGTIc0bw==" 280 | }, 281 | "finalhandler": { 282 | "version": "1.1.2", 283 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 284 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 285 | "requires": { 286 | "debug": "2.6.9", 287 | "encodeurl": "~1.0.2", 288 | "escape-html": "~1.0.3", 289 | "on-finished": "~2.3.0", 290 | "parseurl": "~1.3.3", 291 | "statuses": "~1.5.0", 292 | "unpipe": "~1.0.0" 293 | }, 294 | "dependencies": { 295 | "debug": { 296 | "version": "2.6.9", 297 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 298 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 299 | "requires": { 300 | "ms": "2.0.0" 301 | } 302 | }, 303 | "ms": { 304 | "version": "2.0.0", 305 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 306 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 307 | } 308 | } 309 | }, 310 | "forwarded": { 311 | "version": "0.1.2", 312 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 313 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 314 | }, 315 | "fresh": { 316 | "version": "0.5.2", 317 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 318 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 319 | }, 320 | "function-bind": { 321 | "version": "1.1.1", 322 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 323 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 324 | }, 325 | "get-intrinsic": { 326 | "version": "1.1.1", 327 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 328 | "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 329 | "requires": { 330 | "function-bind": "^1.1.1", 331 | "has": "^1.0.3", 332 | "has-symbols": "^1.0.1" 333 | } 334 | }, 335 | "has": { 336 | "version": "1.0.3", 337 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 338 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 339 | "requires": { 340 | "function-bind": "^1.1.1" 341 | } 342 | }, 343 | "has-symbols": { 344 | "version": "1.0.1", 345 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", 346 | "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" 347 | }, 348 | "haste-pls": { 349 | "version": "1.0.3", 350 | "resolved": "https://registry.npmjs.org/haste-pls/-/haste-pls-1.0.3.tgz", 351 | "integrity": "sha512-Gk2AR4JJGaMJE+YtcTQiVe0j/WC3bxncVStzH6JWRwhodtdysuYC6/vCDXHpE8LV2d7S5Yt5QdTJOEkJAA/Kyg==" 352 | }, 353 | "http-errors": { 354 | "version": "1.7.2", 355 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 356 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 357 | "requires": { 358 | "depd": "~1.1.2", 359 | "inherits": "2.0.3", 360 | "setprototypeof": "1.1.1", 361 | "statuses": ">= 1.5.0 < 2", 362 | "toidentifier": "1.0.0" 363 | }, 364 | "dependencies": { 365 | "inherits": { 366 | "version": "2.0.3", 367 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 368 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 369 | } 370 | } 371 | }, 372 | "iconv-lite": { 373 | "version": "0.4.24", 374 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 375 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 376 | "requires": { 377 | "safer-buffer": ">= 2.1.2 < 3" 378 | } 379 | }, 380 | "inherits": { 381 | "version": "2.0.4", 382 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 383 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 384 | }, 385 | "ipaddr.js": { 386 | "version": "1.9.1", 387 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 388 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 389 | }, 390 | "is-nan": { 391 | "version": "1.3.2", 392 | "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", 393 | "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", 394 | "requires": { 395 | "call-bind": "^1.0.0", 396 | "define-properties": "^1.1.3" 397 | } 398 | }, 399 | "isarray": { 400 | "version": "1.0.0", 401 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 402 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 403 | }, 404 | "kareem": { 405 | "version": "2.3.2", 406 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", 407 | "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" 408 | }, 409 | "long-timeout": { 410 | "version": "0.1.1", 411 | "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz", 412 | "integrity": "sha1-lyHXiLR+C8taJMLivuGg2lXatRQ=" 413 | }, 414 | "luxon": { 415 | "version": "1.25.0", 416 | "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.25.0.tgz", 417 | "integrity": "sha512-hEgLurSH8kQRjY6i4YLey+mcKVAWXbDNlZRmM6AgWDJ1cY3atl8Ztf5wEY7VBReFbmGnwQPz7KYJblL8B2k0jQ==" 418 | }, 419 | "media-typer": { 420 | "version": "0.3.0", 421 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 422 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 423 | }, 424 | "memory-pager": { 425 | "version": "1.5.0", 426 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 427 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", 428 | "optional": true 429 | }, 430 | "merge-descriptors": { 431 | "version": "1.0.1", 432 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 433 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 434 | }, 435 | "methods": { 436 | "version": "1.1.2", 437 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 438 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 439 | }, 440 | "mime": { 441 | "version": "1.6.0", 442 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 443 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 444 | }, 445 | "mime-db": { 446 | "version": "1.46.0", 447 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", 448 | "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==" 449 | }, 450 | "mime-types": { 451 | "version": "2.1.29", 452 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", 453 | "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", 454 | "requires": { 455 | "mime-db": "1.46.0" 456 | } 457 | }, 458 | "mongodb": { 459 | "version": "3.6.3", 460 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.3.tgz", 461 | "integrity": "sha512-rOZuR0QkodZiM+UbQE5kDsJykBqWi0CL4Ec2i1nrGrUI3KO11r6Fbxskqmq3JK2NH7aW4dcccBuUujAP0ERl5w==", 462 | "requires": { 463 | "bl": "^2.2.1", 464 | "bson": "^1.1.4", 465 | "denque": "^1.4.1", 466 | "require_optional": "^1.0.1", 467 | "safe-buffer": "^5.1.2", 468 | "saslprep": "^1.0.0" 469 | } 470 | }, 471 | "mongoose": { 472 | "version": "5.11.15", 473 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.11.15.tgz", 474 | "integrity": "sha512-8T4bT6eCGB7MqCm40oVhnhT/1AyAdwe+y1rYUhdl3ljsks3BpYz8whZgcMkIoh6VoCCjipOXRqZqdk1UByvlYA==", 475 | "requires": { 476 | "@types/mongodb": "^3.5.27", 477 | "bson": "^1.1.4", 478 | "kareem": "2.3.2", 479 | "mongodb": "3.6.3", 480 | "mongoose-legacy-pluralize": "1.0.2", 481 | "mpath": "0.8.3", 482 | "mquery": "3.2.3", 483 | "ms": "2.1.2", 484 | "regexp-clone": "1.0.0", 485 | "safe-buffer": "5.2.1", 486 | "sift": "7.0.1", 487 | "sliced": "1.0.1" 488 | } 489 | }, 490 | "mongoose-legacy-pluralize": { 491 | "version": "1.0.2", 492 | "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", 493 | "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" 494 | }, 495 | "mpath": { 496 | "version": "0.8.3", 497 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.8.3.tgz", 498 | "integrity": "sha512-eb9rRvhDltXVNL6Fxd2zM9D4vKBxjVVQNLNijlj7uoXUy19zNDsIif5zR+pWmPCWNKwAtqyo4JveQm4nfD5+eA==" 499 | }, 500 | "mquery": { 501 | "version": "3.2.3", 502 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.3.tgz", 503 | "integrity": "sha512-cIfbP4TyMYX+SkaQ2MntD+F2XbqaBHUYWk3j+kqdDztPWok3tgyssOZxMHMtzbV1w9DaSlvEea0Iocuro41A4g==", 504 | "requires": { 505 | "bluebird": "3.5.1", 506 | "debug": "3.1.0", 507 | "regexp-clone": "^1.0.0", 508 | "safe-buffer": "5.1.2", 509 | "sliced": "1.0.1" 510 | }, 511 | "dependencies": { 512 | "safe-buffer": { 513 | "version": "5.1.2", 514 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 515 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 516 | } 517 | } 518 | }, 519 | "ms": { 520 | "version": "2.1.2", 521 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 522 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 523 | }, 524 | "negotiator": { 525 | "version": "0.6.2", 526 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 527 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 528 | }, 529 | "node-fetch": { 530 | "version": "2.6.1", 531 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 532 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" 533 | }, 534 | "node-schedule": { 535 | "version": "2.0.0", 536 | "resolved": "https://registry.npmjs.org/node-schedule/-/node-schedule-2.0.0.tgz", 537 | "integrity": "sha512-cHc9KEcfiuXxYDU+HjsBVo2FkWL1jRAUoczFoMIzRBpOA4p/NRHuuLs85AWOLgKsHtSPjN8csvwIxc2SqMv+CQ==", 538 | "requires": { 539 | "cron-parser": "^3.1.0", 540 | "long-timeout": "0.1.1", 541 | "sorted-array-functions": "^1.3.0" 542 | } 543 | }, 544 | "object-keys": { 545 | "version": "1.1.1", 546 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", 547 | "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" 548 | }, 549 | "on-finished": { 550 | "version": "2.3.0", 551 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 552 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 553 | "requires": { 554 | "ee-first": "1.1.1" 555 | } 556 | }, 557 | "opusscript": { 558 | "version": "0.0.7", 559 | "resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.7.tgz", 560 | "integrity": "sha512-DcBadTdYTUuH9zQtepsLjQn4Ll6rs3dmeFvN+SD0ThPnxRBRm/WC1zXWPg+wgAJimB784gdZvUMA57gDP7FdVg==", 561 | "optional": true 562 | }, 563 | "parse-ms": { 564 | "version": "2.1.0", 565 | "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", 566 | "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==" 567 | }, 568 | "parseurl": { 569 | "version": "1.3.3", 570 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 571 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 572 | }, 573 | "path-to-regexp": { 574 | "version": "0.1.7", 575 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 576 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 577 | }, 578 | "pretty-ms": { 579 | "version": "7.0.1", 580 | "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", 581 | "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", 582 | "requires": { 583 | "parse-ms": "^2.1.0" 584 | } 585 | }, 586 | "process-nextick-args": { 587 | "version": "2.0.1", 588 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 589 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 590 | }, 591 | "proxy-addr": { 592 | "version": "2.0.6", 593 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", 594 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", 595 | "requires": { 596 | "forwarded": "~0.1.2", 597 | "ipaddr.js": "1.9.1" 598 | } 599 | }, 600 | "qs": { 601 | "version": "6.7.0", 602 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 603 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 604 | }, 605 | "range-parser": { 606 | "version": "1.2.1", 607 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 608 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 609 | }, 610 | "raw-body": { 611 | "version": "2.4.0", 612 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 613 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 614 | "requires": { 615 | "bytes": "3.1.0", 616 | "http-errors": "1.7.2", 617 | "iconv-lite": "0.4.24", 618 | "unpipe": "1.0.0" 619 | } 620 | }, 621 | "readable-stream": { 622 | "version": "2.3.7", 623 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 624 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 625 | "requires": { 626 | "core-util-is": "~1.0.0", 627 | "inherits": "~2.0.3", 628 | "isarray": "~1.0.0", 629 | "process-nextick-args": "~2.0.0", 630 | "safe-buffer": "~5.1.1", 631 | "string_decoder": "~1.1.1", 632 | "util-deprecate": "~1.0.1" 633 | }, 634 | "dependencies": { 635 | "safe-buffer": { 636 | "version": "5.1.2", 637 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 638 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 639 | } 640 | } 641 | }, 642 | "regexp-clone": { 643 | "version": "1.0.0", 644 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", 645 | "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" 646 | }, 647 | "require_optional": { 648 | "version": "1.0.1", 649 | "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", 650 | "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", 651 | "requires": { 652 | "resolve-from": "^2.0.0", 653 | "semver": "^5.1.0" 654 | } 655 | }, 656 | "resolve-from": { 657 | "version": "2.0.0", 658 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", 659 | "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" 660 | }, 661 | "safe-buffer": { 662 | "version": "5.2.1", 663 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 664 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 665 | }, 666 | "safer-buffer": { 667 | "version": "2.1.2", 668 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 669 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 670 | }, 671 | "saslprep": { 672 | "version": "1.0.3", 673 | "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", 674 | "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", 675 | "optional": true, 676 | "requires": { 677 | "sparse-bitfield": "^3.0.3" 678 | } 679 | }, 680 | "semver": { 681 | "version": "5.7.1", 682 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 683 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 684 | }, 685 | "send": { 686 | "version": "0.17.1", 687 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 688 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 689 | "requires": { 690 | "debug": "2.6.9", 691 | "depd": "~1.1.2", 692 | "destroy": "~1.0.4", 693 | "encodeurl": "~1.0.2", 694 | "escape-html": "~1.0.3", 695 | "etag": "~1.8.1", 696 | "fresh": "0.5.2", 697 | "http-errors": "~1.7.2", 698 | "mime": "1.6.0", 699 | "ms": "2.1.1", 700 | "on-finished": "~2.3.0", 701 | "range-parser": "~1.2.1", 702 | "statuses": "~1.5.0" 703 | }, 704 | "dependencies": { 705 | "debug": { 706 | "version": "2.6.9", 707 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 708 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 709 | "requires": { 710 | "ms": "2.0.0" 711 | }, 712 | "dependencies": { 713 | "ms": { 714 | "version": "2.0.0", 715 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 716 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 717 | } 718 | } 719 | }, 720 | "ms": { 721 | "version": "2.1.1", 722 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 723 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 724 | } 725 | } 726 | }, 727 | "serve-static": { 728 | "version": "1.14.1", 729 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 730 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 731 | "requires": { 732 | "encodeurl": "~1.0.2", 733 | "escape-html": "~1.0.3", 734 | "parseurl": "~1.3.3", 735 | "send": "0.17.1" 736 | } 737 | }, 738 | "setprototypeof": { 739 | "version": "1.1.1", 740 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 741 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 742 | }, 743 | "sift": { 744 | "version": "7.0.1", 745 | "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", 746 | "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" 747 | }, 748 | "sliced": { 749 | "version": "1.0.1", 750 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 751 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 752 | }, 753 | "sorted-array-functions": { 754 | "version": "1.3.0", 755 | "resolved": "https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.3.0.tgz", 756 | "integrity": "sha512-2sqgzeFlid6N4Z2fUQ1cvFmTOLRi/sEDzSQ0OKYchqgoPmQBVyM3959qYx3fpS6Esef80KjmpgPeEr028dP3OA==" 757 | }, 758 | "sparse-bitfield": { 759 | "version": "3.0.3", 760 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 761 | "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", 762 | "optional": true, 763 | "requires": { 764 | "memory-pager": "^1.0.2" 765 | } 766 | }, 767 | "statuses": { 768 | "version": "1.5.0", 769 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 770 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 771 | }, 772 | "string_decoder": { 773 | "version": "1.1.1", 774 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 775 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 776 | "requires": { 777 | "safe-buffer": "~5.1.0" 778 | }, 779 | "dependencies": { 780 | "safe-buffer": { 781 | "version": "5.1.2", 782 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 783 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 784 | } 785 | } 786 | }, 787 | "toidentifier": { 788 | "version": "1.0.0", 789 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 790 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 791 | }, 792 | "tweetnacl": { 793 | "version": "1.0.3", 794 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", 795 | "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", 796 | "optional": true 797 | }, 798 | "type-is": { 799 | "version": "1.6.18", 800 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 801 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 802 | "requires": { 803 | "media-typer": "0.3.0", 804 | "mime-types": "~2.1.24" 805 | } 806 | }, 807 | "unpipe": { 808 | "version": "1.0.0", 809 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 810 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 811 | }, 812 | "util-deprecate": { 813 | "version": "1.0.2", 814 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 815 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 816 | }, 817 | "utils-merge": { 818 | "version": "1.0.1", 819 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 820 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 821 | }, 822 | "vary": { 823 | "version": "1.1.2", 824 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 825 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 826 | }, 827 | "ws": { 828 | "version": "7.4.4", 829 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", 830 | "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==" 831 | } 832 | } 833 | } 834 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zoopo", 3 | "version": "1.0.0", 4 | "description": "Zoopo - An invite manager", 5 | "main": "Zoopo.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/Mafia-7777/Zoopo.git" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/Mafia-7777/Zoopo/issues" 17 | }, 18 | "homepage": "https://github.com/Mafia-7777/Zoopo#readme", 19 | "dependencies": { 20 | "body-parser": "^1.19.0", 21 | "eris": "github:MonkeDev/erisInlines", 22 | "express": "^4.17.1", 23 | "extendedmap": "^1.0.4", 24 | "haste-pls": "^1.0.3", 25 | "mongoose": "^5.11.15", 26 | "node-fetch": "^2.6.1", 27 | "node-schedule": "^2.0.0", 28 | "pretty-ms": "^7.0.1" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/BaseCommand.js: -------------------------------------------------------------------------------- 1 | class BaseCommand { 2 | constructor(bot, cmd) { 3 | this.bot = bot; 4 | 5 | if(!cmd.name) throw new Error('No command name.'); 6 | this.name = cmd.name; 7 | this.alli = cmd.alli || []; 8 | this.desc = cmd.desc || 'No description'; 9 | this.category = cmd.category || 'Other'; 10 | this.usage = cmd.usage || 'None'; 11 | 12 | this.bPerms = cmd.bPerms || ['embedLinks', 'sendMessages']; 13 | this.mPerms = cmd.mPerms || []; 14 | 15 | }; 16 | }; 17 | 18 | module.exports = BaseCommand; -------------------------------------------------------------------------------- /src/BaseEvent.js: -------------------------------------------------------------------------------- 1 | class BaseCommand { 2 | constructor(bot, event) { 3 | this.bot = bot; 4 | 5 | if(!event.name) throw new Error('No command name.'); 6 | this.name = event.name; 7 | 8 | }; 9 | }; 10 | 11 | module.exports = BaseCommand; -------------------------------------------------------------------------------- /src/Commands/Attachments/Dog.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | fetch = require('node-fetch'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'bird', 7 | desc: 'Get a random bird image/gif.', 8 | usage: 'bird', 9 | category: 'Attachments', 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | 15 | const res = await (await (fetch(`${this.bot.baseApiUrl}/attachments/bird?key=${this.bot.config.apiKey}`))).json(); 16 | 17 | msg.channel.createMessage({embed: {color: this.bot.colors.main, image: { url: res.url}}}); 18 | 19 | }; 20 | }; -------------------------------------------------------------------------------- /src/Commands/Attachments/Monkey.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | fetch = require('node-fetch'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'monkey', 7 | desc: 'Get a random monkey image/gif.', 8 | usage: 'monkey', 9 | category: 'Attachments', 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | 15 | const res = await (await (fetch(`${this.bot.baseApiUrl}/attachments/monkey?key=${this.bot.config.apiKey}`))).json(); 16 | 17 | msg.channel.createMessage({embed: {color: this.bot.colors.main, image: { url: res.url}}}); 18 | 19 | }; 20 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/80s.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: '80s', 7 | usage: '80s [imgUrl | user]', 8 | category: 'Canvas', 9 | bPerms: ['attachFiles'], 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | 15 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 16 | 17 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 18 | 19 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 20 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 21 | 22 | let buffer; 23 | try{ 24 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/80s?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer() 25 | } catch (err) { 26 | console.log(`${__filename} - ${err}`) 27 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 28 | } 29 | 30 | msg.channel.createMessage('', {file: buffer, name: `80s.png`}); 31 | }; 32 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/Brightness.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'brightness', 7 | usage: 'brightness [imgUrl | user] [val]', 8 | category: 'Canvas', 9 | bPerms: ['attachFiles'], 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | 15 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 16 | 17 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 18 | 19 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 20 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 21 | 22 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/brightness?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}&val=${Number(args[1]) && Number(args[1]) <= 1 && Number(args[1]) >= .1 ? args[1] : null || '.7'}`))).buffer(); 23 | let buffer; 24 | try{ 25 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/brightness?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}&val=${Number(args[1]) && Number(args[1]) <= 1 && Number(args[1]) >= .1 ? args[1] : null || '.7'}`))).buffer() 26 | } catch (err) { 27 | console.log(`${__filename} - ${err}`) 28 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 29 | } 30 | 31 | msg.channel.createMessage('', {file: buffer, name: `brightness.png`}); 32 | }; 33 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/PetPet.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'petpet', 7 | desc: 'petpet :yum:', 8 | usage: 'petpet [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/petpet?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/petpet?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer() 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`); 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `petpet.gif`}); 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/circle.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'circle', 7 | desc: 'Circle a image', 8 | usage: 'circle [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/circle?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/circle?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer() 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`) 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `circle.png`}); 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/contrast.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'contrast', 7 | desc: 'Place a contrast filter on a image', 8 | usage: 'contrast [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/contrast?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}&val=.5`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/contrast?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}&val=.5`))).buffer() 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`) 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `contrast.png`}); 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/dither565.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'dither565', 7 | desc: 'Place a dither565 filter on a image', 8 | usage: 'dither565 [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/dither565?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 24 | 25 | msg.channel.createMessage('', {file: buffer, name: `dither565.png`}); 26 | }; 27 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/gay.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'gay', 7 | desc: 'Huh', 8 | usage: 'gay [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | 17 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 18 | 19 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 20 | 21 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 22 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 23 | let buffer; 24 | try{ 25 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/gay?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer() 26 | } catch (err) { 27 | console.log(`${__filename} - ${err}`) 28 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 29 | } 30 | 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `gay.png`}); 33 | 34 | 35 | 36 | } 37 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/greyscale.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'greyscale', 7 | desc: 'greyscale a image', 8 | usage: 'greyscale [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/greyscale?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/greyscale?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`); 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `greyscale.png`}); 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/invert.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'invert', 7 | desc: 'invert a image', 8 | usage: 'invert [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/invert?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/invert?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer() 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`) 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `invert.png`}); 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/pixelate.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'pixelate', 7 | desc: 'pixelate a image', 8 | usage: 'pixelate [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/pixelate?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}&val=7`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/pixelate?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}&val=7`))).buffer(); 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`) 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | 32 | msg.channel.createMessage('', {file: buffer, name: `pixelate.png`}); 33 | }; 34 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/resize.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'resize', 7 | desc: 'pixelate a image', 8 | usage: 'pixelate [imgUrl | user] ', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | const x = parseInt(args[1]) || null; 24 | const y = parseInt(args[2]) || null; 25 | 26 | if(x && x > 2000) { 27 | return msg.channel.createMessage('**X** can not be larger then 2000.'); 28 | }; 29 | if(y && y > 2000) { 30 | return msg.channel.createMessage('**Y** can not be larger then 2000.'); 31 | }; 32 | 33 | if(!x && !y) return msg.channel.createMessage('Missing both **X** and **Y** you have to give at-least one.') 34 | // const res = await ( await fetch(encodeURI(`${this.bot.baseApiUrl}/canvas/resize?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}${x ? `&x=${x}` : ''}${y ? `&y=${y}` : ''}`))).buffer(); 35 | let buffer; 36 | try{ 37 | buffer = await (await (fetch(encodeURI(`${this.bot.baseApiUrl}/canvas/resize?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}${x ? `&x=${x}` : ''}${y ? `&y=${y}` : ''}`)))).buffer(); 38 | } catch (err) { 39 | console.log(`${__filename} - ${err}`); 40 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 41 | } 42 | 43 | msg.channel.createMessage('', {file: buffer, name: 'resized.png'}); 44 | 45 | }; 46 | }; -------------------------------------------------------------------------------- /src/Commands/Canvas/sepia.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'sepia', 7 | desc: 'Add a sepia filter on a image', 8 | usage: 'sepia [imgUrl | user]', 9 | category: 'Canvas', 10 | bPerms: ['attachFiles'], 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const user = msg.mentions[0] || this.bot.users.get(args[0]); 17 | 18 | const imgUrl = user ? user.staticAvatarURL : null || this.bot.isUrl(args[0]) ? args[0] : null || msg.channel.lastAttachment ? msg.channel.lastAttachment.proxy_url : null; 19 | 20 | if(!imgUrl) return msg.channel.createMessage('I could not find a image in this channel, Please provide me with a user or a image URL.'); 21 | if(!this.bot.isUrl(imgUrl)) return msg.channel.createMessage('Please give me a **valid** URL.'); 22 | 23 | // const buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/sepia?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer(); 24 | let buffer; 25 | try{ 26 | buffer = await (await (fetch(`${this.bot.baseApiUrl}/canvas/sepia?key=${this.bot.config.apiKey}&imgUrl=${imgUrl}`))).buffer() 27 | } catch (err) { 28 | console.log(`${__filename} - ${err}`) 29 | return msg.channel.createMessage('An error happened, Joined my support server for help! ||||'); 30 | } 31 | msg.channel.createMessage('', {file: buffer, name: `sepia.png`}); 32 | }; 33 | }; -------------------------------------------------------------------------------- /src/Commands/Config/ChatChannel.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | mc = require('../../MessageCollector'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'chat-channel', 7 | desc: 'Set up my chat feature', 8 | mPerms: ['manageGuild'], 9 | usage: 'chat-channel <#channel | none>', 10 | category: 'Config', 11 | alli: ['cc', 'chatchannel'] 12 | }); 13 | }; 14 | 15 | async run(msg, args, data){ 16 | 17 | if(!args[0]) return msg.channel.send(`Invalid args, \`${data.guild.prefix}${this.usage}.\``); 18 | 19 | if(args[0].toLowerCase() == 'none') { 20 | if(data.guild.chatChannel) { 21 | data.guild.chatChannel = null; 22 | data.guild.save(); 23 | return msg.channel.send('Chat channel has been removed!'); 24 | } else { 25 | return msg.channel.send('You do not have a chat channel set.'); 26 | }; 27 | }; 28 | 29 | const channel = msg.channelMentions[0] ? msg.channel.guild.channels.get(msg.channelMentions[0]) : null || msg.channel.guild.channels.find(x => x.name.toLowerCase() == args[0].toLowerCase()); 30 | 31 | if(!channel) return msg.channel.send(`Invalid args, \`${data.guild.prefix}${this.usage}.\``); 32 | data.guild.chatChannel = channel.id; 33 | data.guild.save(); 34 | 35 | msg.channel.send(`<#${data.guild.chatChannel}> is now your chat channel!`); 36 | 37 | 38 | }; 39 | }; -------------------------------------------------------------------------------- /src/Commands/Config/prefix.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | mc = require('../../MessageCollector'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'prefix', 7 | desc: 'Change my prefix!', 8 | mPerms: ['manageGuild'], 9 | usage: 'prefix', 10 | category: 'Config' 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const message = await msg.channel.createMessage('Please respond with a new prefix, If you want to cancel this respond with `cancel`. You have 10 seconds!') 17 | const collector = new mc(msg.channel, { 18 | filter: x => x.author.id == msg.author.id, 19 | }); 20 | collector.startCollecting(); 21 | 22 | collector.on('collect', m => { 23 | if(m.content == 'cancel') { 24 | message.edit('Action canceled.'); 25 | } else { 26 | const newPrefix = m.content.toLowerCase(); 27 | if(newPrefix == data.guild.prefix) return message.edit(`The prefix on this server is already \`${newPrefix}\`.`); 28 | if(newPrefix.length >= 10) return message.edit(`Your new prefix has to be under 10 characters.`); 29 | 30 | data.guild.prefix = newPrefix; 31 | data.guild.save().then(d => { 32 | message.edit(`My prefix on this server is now \`${d.prefix}\`!`); 33 | }); 34 | 35 | }; 36 | }); 37 | 38 | }; 39 | }; -------------------------------------------------------------------------------- /src/Commands/Facts/CatFact.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | fetch = require('node-fetch'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'cat-fact', 7 | desc: 'Get a random cat fact.', 8 | usage: 'cat-fact', 9 | category: 'Facts', 10 | alli: ['catfact', 'cf'] 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const res = await (await (fetch(`${this.bot.baseApiUrl}/facts/cat?key=${this.bot.config.apiKey}`))).json(); 17 | 18 | msg.channel.createMessage(res.fact); 19 | 20 | }; 21 | }; -------------------------------------------------------------------------------- /src/Commands/Facts/DogFact.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | fetch = require('node-fetch'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'dog-fact', 7 | desc: 'Get a random cat fact.', 8 | usage: 'dog-fact', 9 | category: 'Facts', 10 | alli: ['dogfact', 'df'] 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const res = await (await (fetch(`${this.bot.baseApiUrl}/facts/dog?key=${this.bot.config.apiKey}`))).json(); 17 | 18 | msg.channel.createMessage(res.fact); 19 | 20 | }; 21 | }; -------------------------------------------------------------------------------- /src/Commands/Facts/MonkeyFact.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'), 2 | fetch = require('node-fetch'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'monkey-fact', 7 | desc: 'Get a random cat fact.', 8 | usage: 'monkey-fact', 9 | category: 'Facts', 10 | alli: ['monkeyfact', 'mf'] 11 | }); 12 | }; 13 | 14 | async run(msg, args, data){ 15 | 16 | const res = await (await (fetch(`${this.bot.baseApiUrl}/facts/monkey?key=${this.bot.config.apiKey}`))).json(); 17 | 18 | msg.channel.createMessage(res.fact); 19 | 20 | }; 21 | }; -------------------------------------------------------------------------------- /src/Commands/Fun/8ball.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: '8ball', 7 | desc: 'The magik 8ball will answer a question', 8 | usage: '8ball ', 9 | category: 'Fun' 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | if(!args[0]) return msg.channel.createMessage(`What is your question? | \`${data.guild.prefix}8ball \``); 15 | const res = await (await (fetch(`${this.bot.baseApiUrl}/fun/8ball?key=${this.bot.config.apiKey}`))).json(); 16 | msg.channel.createMessage({ embed: { 17 | color: this.bot.colors.main, 18 | title: `:question: | __Question__: \`${args.join(' ').slice(0, 210)}\``, 19 | description: `:mag_right: | **__Answer__**: \`${res.answer}\`` 20 | }}); 21 | } 22 | }; -------------------------------------------------------------------------------- /src/Commands/Fun/Reverse.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'reverse', 7 | desc: 'reverse some text', 8 | usage: 'reverse ', 9 | category: 'Fun' 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | if(!args[0]) return msg.channel.createMessage(`Add an argument please, \`${data.guild.prefix}reverse \``); 15 | const res = await (await (fetch(`${this.bot.baseApiUrl}/fun/reverse?key=${this.bot.config.apiKey}&content=${encodeURI(args.join(' ').slice(0, 1000) || 'What would you like to shuffle?')}`))).json(); 16 | msg.channel.createMessage({ embed: { 17 | color: this.bot.colors.main, 18 | fields: [ 19 | { 20 | name: "__Original__:", 21 | value: `\`${args.join(' ').slice(0, 1000)}\``, 22 | inline: true 23 | }, 24 | { 25 | name: "__Reversed__:", 26 | value: `\`${res.result}\``, 27 | inline: true 28 | } 29 | ] 30 | }}); 31 | } 32 | }; -------------------------------------------------------------------------------- /src/Commands/Fun/Shuffle.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'shuffle', 7 | desc: 'shuffle some text', 8 | usage: 'shuffle ', 9 | category: 'Fun' 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | if(!args[0]) return msg.channel.createMessage(`Add an argument please, \`${data.guild.prefix}shuffle \``); 15 | const res = await (await (fetch(`${this.bot.baseApiUrl}/fun/shuffle?key=${this.bot.config.apiKey}&content=${encodeURI(args.join(' ').slice(0, 1000) || 'What would you like to shuffle?')}`))).json(); 16 | msg.channel.createMessage({ embed: { 17 | color: this.bot.colors.main, 18 | fields: [ 19 | { 20 | name: "__Original__:", 21 | value: `\`${args.join(' ').slice(0, 1000)}\``, 22 | inline: true 23 | }, 24 | { 25 | name: "__Shuffled__:", 26 | value: `\`${res.result}\``, 27 | inline: true 28 | } 29 | ] 30 | }}); 31 | } 32 | }; -------------------------------------------------------------------------------- /src/Commands/Other/Help.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | module.exports = class Help extends Base { 3 | constructor(bot) { 4 | super(bot, { 5 | name: 'help', 6 | desc: 'If you don\'t know how to use me use this!', 7 | usage: 'help [command]' 8 | }); 9 | }; 10 | 11 | async run(msg, args, data){ 12 | 13 | const toSend = { 14 | content: 'Support server: https://discord.gg/5q8rQeA3m2', 15 | embed: { 16 | color: this.bot.colors.main, 17 | fields: [], 18 | description: `Use \`${data.guild.prefix}help \`, For more help on a command!` 19 | } 20 | } 21 | 22 | const allCategorys = [ ...new Set( this.bot.commands.filter(x => x.value.category, true).map(x => x.category) ) ]; 23 | 24 | if(!args[0]) { 25 | allCategorys.forEach(c => { 26 | if(c == 'Owner') return; 27 | const allCommands = [ ...new Set( this.bot.commands.filter(x => x.value.category == c, true).map(x => x.name) ) ]; 28 | toSend.embed.fields.push({name: c, value: `\`${allCommands.join('`, `')}\``}); 29 | }); 30 | } else { 31 | const cmd = await this.bot.commands.get(args[0].toLowerCase()) || this.bot.commands.get(this.bot.alli.get(args[0].toLowerCase())); 32 | if(!cmd) return msg.channel.createMessage({ 33 | embed: { 34 | color: this.bot.colors.red, 35 | description: `**${args[0].slice(0, 100)}** is not a command.` 36 | } 37 | }); 38 | toSend.embed.description = cmd.desc; 39 | toSend.embed.title = `Command ${cmd.name}`; 40 | 41 | toSend.embed.fields.push({name: '__Usage__:', value: cmd.usage == 'None' ? cmd.usage : `\`${data.guild.prefix}${cmd.usage}\``}); 42 | toSend.embed.fields.push({name: '__Alias(es)__:', value: cmd.alli[0] ? `\`${cmd.alli.join('`, `')}\`` : 'None'}); 43 | }; 44 | 45 | 46 | msg.channel.createMessage(toSend); 47 | } 48 | }; -------------------------------------------------------------------------------- /src/Commands/Other/Invite.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | module.exports = class Help extends Base { 3 | constructor(bot) { 4 | super(bot, { 5 | name: 'invite', 6 | desc: 'Get a link to invite me to your server!', 7 | usage: 'invite' 8 | }); 9 | }; 10 | 11 | async run(msg, args, data){ 12 | 13 | msg.channel.createMessage({ 14 | content: `` 15 | }); 16 | 17 | }; 18 | }; -------------------------------------------------------------------------------- /src/Commands/Other/Ping.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const pm = require('pretty-ms'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'ping', 7 | desc: 'Pong', 8 | usage: 'ping', 9 | alli: ['latency'] 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | 15 | const toSend = { 16 | embed: { 17 | color: this.bot.colors.main, 18 | fields: [ 19 | { 20 | name: '__Database__:', 21 | value: this.bot.emojis.loading 22 | }, 23 | { 24 | name: `__Shard | ${msg.channel.guild.shard.id}__:`, 25 | value: this.bot.emojis.loading 26 | }, 27 | { 28 | name: '__Message Response__:', 29 | value: this.bot.emojis.loading 30 | } 31 | ] 32 | } 33 | } 34 | 35 | 36 | const message = await msg.channel.createMessage(toSend); 37 | const End = Date.now() - message.createdAt 38 | 39 | toSend.embed.fields[0].value = pm(data.ping); 40 | toSend.embed.fields[1].value = pm(msg.channel.guild.shard.latency); 41 | toSend.embed.fields[2].value = pm(End); 42 | 43 | message.edit(toSend); 44 | 45 | 46 | 47 | 48 | } 49 | }; -------------------------------------------------------------------------------- /src/Commands/Other/RateLimit.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const fetch = require('node-fetch'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'rate-limit', 7 | desc: 'See the rate-limit of the API that the bot uses.', 8 | usage: 'rate-limit', 9 | alli: ['rl'] 10 | }); 11 | }; 12 | 13 | async run(msg, args, data){ 14 | 15 | const res = await (await (fetch(`${this.bot.baseApiUrl}/info/ratelimit?key=${this.bot.config.apiKey}`))).json(); 16 | 17 | const green = res.max / 2.8; 18 | const yellow = res.max / 1.22; 19 | 20 | 21 | msg.channel.createMessage( 22 | { 23 | embed: { 24 | title: `Rate-limit: ${res.used < green ? 'Good' : null || res.used < yellow ? 'Decent' : null || 'Bad'}`, 25 | color: res.used < green ? this.bot.colors.green : null || res.used < yellow ? this.bot.colors.yellow : null || this.bot.colors.red, 26 | fields: [ 27 | { 28 | name: '__Used__:', 29 | value: res.used, 30 | inline: true 31 | }, 32 | { 33 | name: '__Max__:', 34 | value: res.max, 35 | inline: true 36 | } 37 | ] 38 | } 39 | } 40 | ); 41 | 42 | } 43 | }; -------------------------------------------------------------------------------- /src/Commands/Other/Uptime.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const pm = require('pretty-ms'); 3 | module.exports = class Help extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'uptime', 7 | desc: 'Shows you the bots uptime.', 8 | usage: 'uptime' 9 | }); 10 | }; 11 | 12 | async run(msg, args, data){ 13 | const toSend = { 14 | embed: { 15 | fields: [], 16 | color: this.bot.colors.main 17 | } 18 | } 19 | 20 | const pUp = pm(process.uptime() * 1000); 21 | const bUp = pm(this.bot.uptime); 22 | 23 | toSend.embed.fields.push({name: '__Bot-Uptime__:', value: bUp, inline: true}); 24 | toSend.embed.fields.push({name: '__Process-Uptime__:', value: pUp, inline: true}); 25 | 26 | msg.channel.createMessage(toSend); 27 | } 28 | }; -------------------------------------------------------------------------------- /src/Commands/Other/Vote.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | module.exports = class Help extends Base { 3 | constructor(bot) { 4 | super(bot, { 5 | name: 'vote', 6 | desc: 'Please vote!', 7 | usage: 'vote' 8 | }); 9 | }; 10 | 11 | async run(msg, args, data){ 12 | 13 | msg.channel.createMessage(''); 14 | } 15 | }; -------------------------------------------------------------------------------- /src/Commands/Owner/Eval.js: -------------------------------------------------------------------------------- 1 | const Base = require('../../BaseCommand'); 2 | const { inspect } = require("util"); 3 | const hastePls = require('haste-pls'); 4 | 5 | module.exports = class Help extends Base { 6 | constructor(bot) { 7 | super(bot, { 8 | name: 'eval', 9 | desc: 'EVAL', 10 | usage: 'EVAL', 11 | category: 'Owner' 12 | }); 13 | }; 14 | 15 | async run(msg, args, data){ 16 | 17 | if(msg.author.id != '695520751842885672') return; 18 | 19 | let input = args.join(" "), 20 | hasAwait = input.includes("await"), 21 | hasReturn = input.includes("return"), 22 | evaled, 23 | startTime = Date.now() 24 | if(!input) return msg.channel.send({ 25 | content: "Give me input bruh", 26 | }) 27 | 28 | try{ 29 | evaled = hasAwait ? await eval(`(async () => { ${hasReturn ? " " : "return"} ${input} })()`) : eval(input); 30 | if(typeof evaled != "string"){ 31 | evaled = inspect(evaled, { 32 | depth: Number(msg.content.slice(-1)) || +!(inspect(evaled, { depth: 2 })) 33 | //depth: 1 34 | }); 35 | } 36 | }catch(err){ 37 | evaled = err; 38 | } 39 | 40 | evaled = evaled.toString(); 41 | 42 | evaled = evaled.split(this.bot.config.token).join("botToken"); 43 | 44 | if(evaled.length > 1900) { 45 | const bin = await new hastePls(evaled).post() 46 | msg.channel.send(bin.link); 47 | // evaled = evaled.slice(0, 1900); 48 | } else msg.channel.send(`${Date.now() - startTime} \`\`\`js\n${evaled}\`\`\``); 49 | 50 | 51 | 52 | 53 | } 54 | }; -------------------------------------------------------------------------------- /src/Database/GuildManager.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'), 2 | config = require('../../Config.json'); 3 | 4 | const Schema = mongoose.model('facts', new mongoose.Schema({ 5 | id: { type: String }, 6 | users: { type: Array, default: [] }, 7 | prefix: { type: String, default: config.defaultPrefix }, 8 | chatChannel: { type: String, require: false } 9 | })); 10 | 11 | module.exports = class GuildManager { 12 | constructor() { 13 | this.cache = new Map(); 14 | this.schema = Schema; 15 | 16 | Schema.find().then(data => { 17 | data.forEach(guildData => { 18 | this.cache.set(guildData.id, guildData); 19 | }) 20 | }); 21 | }; 22 | 23 | async get(id) { 24 | let data = await this.cache.get(id); 25 | if(data === undefined) { 26 | data = await Schema.findOne({id: id}); 27 | if(!data) data = await new Schema({id: id}).save(); 28 | this.cache.set(id, data); 29 | }; 30 | return data; 31 | }; 32 | 33 | }; -------------------------------------------------------------------------------- /src/Events/guildCreate.js: -------------------------------------------------------------------------------- 1 | const Base = require('../BaseEvent'); 2 | module.exports = class messageCreate extends Base { 3 | constructor(bot) { 4 | super(bot, { 5 | name: 'guildCreate' 6 | }); 7 | }; 8 | 9 | async run(guild) { 10 | 11 | const logGuild = await this.bot.guilds.get(this.bot.config.logs.guildID); 12 | const logChannel = logGuild.channels.get(this.bot.config.logs.channelID); 13 | 14 | logChannel.createMessage({ 15 | content: `__**New Guild**__\nName: ${guild.name}\nMemberCount: ${guild.memberCount}`, 16 | }); 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /src/Events/guildDelete.js: -------------------------------------------------------------------------------- 1 | const Base = require('../BaseEvent'); 2 | module.exports = class messageCreate extends Base { 3 | constructor(bot) { 4 | super(bot, { 5 | name: 'guildDelete' 6 | }); 7 | }; 8 | 9 | async run(guild) { 10 | 11 | const logGuild = await this.bot.guilds.get(this.bot.config.logs.guildID); 12 | const logChannel = logGuild.channels.get(this.bot.config.logs.channelID); 13 | 14 | logChannel.createMessage({ 15 | content: `__**Left a Guild**__\nName: ${guild.name}\nMemberCount: ${guild.memberCount}`, 16 | }); 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /src/Events/messageCreate.js: -------------------------------------------------------------------------------- 1 | const Base = require('../BaseEvent'); 2 | const fetch = require('node-fetch').default; 3 | module.exports = class messageCreate extends Base { 4 | constructor(bot) { 5 | super(bot, { 6 | name: 'messageCreate' 7 | }); 8 | 9 | this.chatCooldown = new Map(); 10 | }; 11 | 12 | async run(msg) { 13 | 14 | msg.channel.send = msg.channel.createMessage; 15 | // if(msg.channel.guild.id != this.bot.config.logs.guildID) return; 16 | 17 | const { content, guildID, member, channel } = msg; 18 | 19 | const data = {}; 20 | 21 | const start = Date.now(); 22 | data.guild = await this.bot.db.guilds.get(guildID); 23 | data.ping = Date.now() - start; 24 | 25 | if(data.guild.chatChannel === msg.channel.id) { 26 | if(msg.author.bot) return; 27 | 28 | if(this.chatCooldown.has(msg.author.id)) return 29 | else { 30 | this.chatCooldown.set(msg.author.id, Date.now()); 31 | setTimeout(() => { 32 | this.chatCooldown.delete(msg.author.id); 33 | }, 1500); 34 | 35 | const res = await (await fetch(`${this.bot.baseApiUrl}/fun/chat?key=${this.bot.config.apiKey}&msg=${encodeURIComponent(msg.content)}&uid=${msg.author.id}`)).json(); 36 | return msg.channel.send({ 37 | content: res.response, 38 | messageReference: { messageID: msg.id } 39 | }); 40 | }; 41 | }; 42 | 43 | if(msg.content == `<@${this.bot.user.id}>` || msg.content == `<@!${this.bot.user.id}>`) { 44 | msg.channel.createMessage({ 45 | embed: { 46 | color: this.bot.colors.main, 47 | title: `Hello, ${msg.author.username} :wave:`, 48 | description: `My prefix in **${msg.channel.guild.name}** is **${data.guild.prefix}**.\nI'm a bot created by [MonkeDev](https://monkedev.com) with the purpose of using their [API](https://api.monkedev.com), if you need help join my [support server](https://discord.gg/5q8rQeA3m2)!` 49 | } 50 | }) 51 | } 52 | if(msg.attachments[0]) { 53 | if (msg.attachments[0].url.endsWith('.png') || msg.attachments[0].url.endsWith('.jpeg') || msg.attachments[0].url.endsWith('.jpg')) { 54 | msg.channel.lastAttachment = msg.attachments[0]; 55 | }; 56 | }; 57 | 58 | if(msg.author.bot || !msg.guildID) return; 59 | 60 | 61 | if(!content.toLowerCase().startsWith(data.guild.prefix.toLowerCase())) return; 62 | 63 | 64 | const args = content.split(/ +/); 65 | 66 | const cmd = this.bot.commands.get(args[0].slice(data.guild.prefix.length).toLowerCase()) || this.bot.commands.get(this.bot.alli.get(args[0].slice(data.guild.prefix.length).toLowerCase())); 67 | 68 | if(!cmd) return; 69 | 70 | const ME = await msg.channel.guild.members.get(this.bot.user.id); 71 | if(!msg.channel.permissionsOf(this.bot.user.id).has('sendMessages') || !msg.channel.permissionsOf(this.bot.user.id).has('embedLinks')) return; 72 | 73 | const neededMperms = []; 74 | cmd.mPerms.forEach(perm => { 75 | if(!member.permissions.json[perm]) neededMperms.push(perm); 76 | }); 77 | 78 | const neededBperms = []; 79 | cmd.bPerms.forEach(perm => { 80 | if(!ME.permissions.json[perm]) neededBperms.push(perm); 81 | }); 82 | 83 | if(neededMperms[0]) return channel.createMessage({ 84 | embed: { 85 | color: this.bot.colors.red, 86 | title: 'Missing permission(s)', 87 | description: `You're missing \`${neededMperms.join('` & `')}\` permission(s), Therefore you can't execute this command.` 88 | } 89 | }); 90 | if(neededBperms[0]) return channel.createMessage({ 91 | embed: { 92 | color: this.bot.colors.red, 93 | title: 'Missing permission(s)', 94 | description: `I'm missing \`${neededBperms.join('` & `')}\` permission(s), Therefore I can't execute this command.` 95 | } 96 | }); 97 | 98 | 99 | cmd.run(msg, args.slice(1), data).catch(err => { 100 | msg.channel.send('An error has happened, Join my support server for help! || https://discord.gg/5q8rQeA3m2 ||'); 101 | throw err; 102 | }); 103 | } 104 | } -------------------------------------------------------------------------------- /src/Events/ready.js: -------------------------------------------------------------------------------- 1 | const Base = require('../BaseEvent'); 2 | module.exports = class messageCreate extends Base { 3 | constructor(bot) { 4 | super(bot, { 5 | name: 'ready' 6 | }); 7 | }; 8 | 9 | async run() { 10 | console.log(this.bot.user.username + '#' + this.bot.user.discriminator + ' is ready!'); 11 | this.bot.editStatus('idle', { 12 | name: 'Ping for prefix!', 13 | }); 14 | }; 15 | }; -------------------------------------------------------------------------------- /src/ExtendedMap.js: -------------------------------------------------------------------------------- 1 | module.exports = class ExtendedMap extends Map { 2 | constructor(){ 3 | super(); 4 | } 5 | 6 | /** 7 | * 8 | * @param {Function} filter 9 | * @param {Boolean} returnArray 10 | */ 11 | filter(filter, returnArray){ 12 | if(!filter) new Error("A filter is required"); 13 | if(returnArray) { 14 | let array = []; 15 | for(const keys of this){ 16 | if(filter({value: keys[1], key: keys[0]})) array.push(keys[1]); 17 | }; 18 | return array; 19 | } else { 20 | let newMap = new ExtendedMap(); 21 | for(const keys of this){ 22 | if(filter({value: keys[1], key: keys[0]})) newMap.set(keys[0], keys[1]); 23 | }; 24 | return newMap; 25 | }; 26 | }; 27 | 28 | }; -------------------------------------------------------------------------------- /src/MessageCollector.js: -------------------------------------------------------------------------------- 1 | const { EventEmitter } = require('events'); 2 | const { Collection, Message } = require('eris'); 3 | const { scheduleJob, rescheduleJob } = require('node-schedule'); 4 | const defaults = { 5 | idle: 10000, 6 | maxCount: 1, 7 | filter: (msg) => msg.content.length > 0 8 | } 9 | 10 | class MessageCollector extends EventEmitter { 11 | constructor(channel, options = {}) { 12 | super(); 13 | const cOptions = Object.assign(defaults, options); 14 | this.channel = channel; 15 | this.timeout = cOptions.timeout; 16 | this.maxCount = cOptions.maxCount; 17 | this.filter = cOptions.filter; 18 | this.collecting = false; 19 | this.idle = cOptions.idle; 20 | this.messages = new Collection(Message); 21 | 22 | this._onMessage = this._onMessage.bind(this); 23 | this._onMessageUpdate = this._onMessageUpdate.bind(this); 24 | this._onMessageDelete = this._onMessageDelete.bind(this); 25 | this._onGuildDelete = this._onGuildDelete.bind(this); 26 | this._onChannelDelete = this._onChannelDelete.bind(this); 27 | 28 | this.onCollect = this.onCollect.bind(this); 29 | this.onUpdate = this.onUpdate.bind(this); 30 | this.onDelete = this.onDelete.bind(this); 31 | } 32 | 33 | /** 34 | * 35 | * @private 36 | */ 37 | _onMessage(msg) { 38 | if (!this.collecting) return; 39 | if (this.channel.id != msg.channel.id) return; 40 | if (this.idle && typeof this.idle == "number") rescheduleJob(`${this.channel.id}`, Date.now() + this.idle); 41 | if (!this.filter(msg)) return; 42 | this.emit('collect', msg); 43 | } 44 | 45 | /** 46 | * 47 | * @private 48 | */ 49 | _onGuildDelete(guild) { 50 | if (this.channel.guild.id == guild.id) this.stop(); 51 | } 52 | 53 | /** 54 | * 55 | * @private 56 | */ 57 | _onChannelDelete(channel) { 58 | if (this.channel.id == channel.id) this.stop(); 59 | } 60 | 61 | /** 62 | * @private 63 | */ 64 | _onMessageUpdate(msg, oldMsg) { 65 | if (!this.collecting) return; 66 | if (this.channel.id != msg.channel.id) return; 67 | if (!this.filter(msg)) return this.messages.remove(msg); 68 | if (!this.messages.has(oldMsg.id)) return this.emit('collect', msg); 69 | this.emit('update', msg); 70 | } 71 | 72 | /** 73 | * @private 74 | */ 75 | _onMessageDelete(msg) { 76 | if (!this.collecting) return; 77 | if (!this.messages.has(msg.id)) return; 78 | this.emit('delete', msg); 79 | } 80 | 81 | /** 82 | * 83 | * @private 84 | */ 85 | onCollect(msg) { 86 | this.messages.add(msg); 87 | if (this.maxCount && this.messages.size == this.maxCount) { 88 | this.stop(); 89 | } 90 | } 91 | 92 | /** 93 | * 94 | * @private 95 | */ 96 | onUpdate(msg) { 97 | this.messages.update(msg); 98 | } 99 | 100 | /** 101 | * 102 | * @private 103 | */ 104 | onDelete(msg) { 105 | this.messages.delete(msg); 106 | } 107 | 108 | startCollecting() { 109 | this.collecting = true; 110 | if (this.idle && typeof this.idle == "number") scheduleJob(`${this.channel.id}`, Date.now() + this.idle, () => this.stop()); 111 | return new Promise((res) => { 112 | this.channel.client.setMaxListeners(this.getMaxListeners() + 1); 113 | this.channel.client.on('messageCreate', this._onMessage); 114 | 115 | this.channel.client.on('guildDelete', this._onGuildDelete); 116 | this.channel.client.on('channelDelete', this._onChannelDelete); 117 | 118 | this.setMaxListeners(this.getMaxListeners() + 1); 119 | this.on('collect', this.onCollect); 120 | this.on('update', this.onUpdate); 121 | this.on('delete', this.onDelete); 122 | 123 | if (this.timeout) setTimeout(() => this.stop(), this.timeout); 124 | this.once('stop', () => res(this)); 125 | }); 126 | } 127 | 128 | stop() { 129 | this.messages.clear(); 130 | this.collecting = false; 131 | this.channel.client.setMaxListeners(this.getMaxListeners() - 1); 132 | this.channel.client.off('messageCreate', this._onMessage); 133 | this.channel.client.off('guildDelete', this._onGuildDelete); 134 | this.channel.client.off('channelDelete', this._onChannelDelete); 135 | 136 | this.setMaxListeners(this.getMaxListeners() - 1); 137 | this.channel.client.off('collect', this.onCollect); 138 | this.channel.client.off('update', this.onUpdate); 139 | this.channel.client.off('delete', this.onDelete); 140 | this.emit("stop"); 141 | return this; 142 | } 143 | 144 | setIdle(time) { 145 | if (isNaN(time)) return; 146 | this.idle = time; 147 | rescheduleJob(`${this.channel.id}`, Date.now() + this.idle); 148 | return this; 149 | } 150 | } 151 | module.exports = MessageCollector; -------------------------------------------------------------------------------- /src/ZoopoClient.js: -------------------------------------------------------------------------------- 1 | const { Client } = require('eris'), 2 | fs = require('fs'), 3 | mongoose = require('mongoose'), 4 | ExtendedMap = require('./ExtendedMap'); 5 | 6 | class ZoopoClient extends Client { 7 | constructor(token, options, config) { 8 | super(token, options); 9 | 10 | this.config = config; 11 | 12 | this.commands = new ExtendedMap(); 13 | this.alli = new ExtendedMap(); 14 | 15 | this.db = { 16 | guilds: new (require('./Database/GuildManager'))() 17 | }; 18 | 19 | this.colors = { 20 | main: 0xf7c38e, 21 | red: 0xff1800, 22 | yellow: 0xFFFF00, 23 | green: 0x008000 24 | }; 25 | 26 | this.emojis = { 27 | loading: '' 28 | }; 29 | 30 | this.baseApiUrl = 'https://api.monkedev.com' 31 | }; 32 | 33 | loadCommands(dir) { 34 | const Commands = fs.readdirSync(dir); 35 | Commands.forEach(cmd => { 36 | if(!cmd.endsWith('.js')) return this.loadCommands(dir + `/${cmd}`); 37 | 38 | const file = new (require(dir + `/${cmd}`))(this); 39 | this.commands.set(file.name, file); 40 | file.alli.forEach(alli => { 41 | this.alli.set(alli, file.name); 42 | }); 43 | 44 | console.log(`Command ${file.name} loaded!`); 45 | }); 46 | }; 47 | 48 | loadEvents(dir) { 49 | const Events = fs.readdirSync(dir); 50 | Events.forEach(event => { 51 | if(!event.endsWith('.js')) return this.loadEvents(dir + `/${event}`); 52 | 53 | const file = new (require(dir + `/${event}`))(this); 54 | if(this.config.onceEvents.includes(file.name)) { 55 | this.once(file.name, (...args) => file.run(...args)); 56 | console.log(`Event ${file.name} loaded as once event!`); 57 | } else { 58 | this.on(file.name, (...args) => file.run(...args)); 59 | console.log(`Event ${file.name} loaded!`); 60 | } 61 | }); 62 | }; 63 | 64 | async connectDatabase() { 65 | await mongoose.connect(this.config.mongoURI, this.config.mongooseOptions); 66 | console.log('MongoDB connected!'); 67 | }; 68 | 69 | isUrl(url) { 70 | const pattern = new RegExp('^((ft|htt)ps?:\\/\\/)?'+ 71 | '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ 72 | '((\\d{1,3}\\.){3}\\d{1,3}))'+ 73 | '(\\:\\d+)?'+ 74 | '(\\/[-a-z\\d%@_.~+&:]*)*'+ 75 | '(\\?[;&a-z\\d%@_.,~+&:=-]*)?'+ 76 | '(\\#[-a-z\\d_]*)?$','i'); 77 | if(!pattern.test(url)) return false; 78 | else return url; 79 | }; 80 | 81 | }; 82 | 83 | module.exports = ZoopoClient; --------------------------------------------------------------------------------