diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 7915aa9..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,11 +0,0 @@ -# -# ________ _____ ___ ___ __ -# /_ __/ / ___ / ___/__ ___/ (_)__ ___ _/ _ )___ / /_ -# / / / _ \/ -_) /__/ _ \/ _ / / _ \/ _ `/ _ / _ \/ __/ -# /_/ /_//_/\__/\___/\___/\_,_/_/_//_/\_, /____/\___/\__/ -# /___/ -# -# Support Netro Corporation and keep the hosting machines alive. Your contributions are greatly appreciated! ^^ -# We believe in transparency. A report of how much and what exactly was purchased with your contributions will be written up monthly. (This will be in a separate repository) - -custom: ["https://www.paypal.me/officialtcgmatt"] diff --git a/.gitignore b/.gitignore index ee4e193..8bd0e35 100644 --- a/.gitignore +++ b/.gitignore @@ -2,23 +2,12 @@ # Tell VSCode to frick off .vscode/ -# and GitHub -.git/ # Let's not forget about node_modules. node_modules/ ## -- THECODINGBOT RELATED IGNORES -- -src/app/cache/* -src/app/cfg/tokendata.json -src/app/cfg/app.sqlite +src/modules/cache/* +src/modules/cfg/tokendata.json +src/modules/cfg/app.sqlite -## -- OTHER -- -#my/life -#memes/ -# Let's commit those, actually. -# Or do we? -# -# -# It's quite crazy what funnies I could be hiding -# but all my funnies won't be just in this file. \ No newline at end of file diff --git a/LICENSE b/LICENSE index 0f2c9d0..504dad4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Netro Corporation +Copyright (c) 2022 TMC Software Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 074e35f..2709e04 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,33 @@ # TheCodingBot Welcome to TheCodingBot. The hobby Discord bot created by TheCodingGuy#6697. -Packed with moderation, fun, and craziness. The only bot you'll ever need. -~~..until Discord updates their API and breaks the bot. :^)~~ - - -## This is the last version of TheCodingBot. -Do not expect anything to work as intended. As if, anything ever worked anyways. :P -Expect some changes to explode :^) +## Version 1 +Yeah, this build is from like 2018. There's like so much spaget code in this. Please remember I was just learning at this time LOL. ## Get this version goin'! -:warning: **Everything you need to change is in the `src` folder. Please try not to bother anything you don't have to.** -This guide will assume you've left `app` in `src` (the way it should be). -- First, you'll need to ensure you have [NodeJS](https://nodejs.org/) installed. -- Then, download this branch. - - You can download easily by `git clone NetroCorp/TheCodingBot`. - - If you don't know how to obtain this......... there's tutorials. This guide assumes you know how. -- Afterwards, fire up a terminal/command prompt and run `npm install` in the newly created directory, wait for packages to install. Kill some time by completing the next few steps. - - :information_source: **Wherever `package-lock.json` is, just run that command there.** -- Make the following changes to the `app/cfg/tokendata.json` file. - - You'll need to obtain a Discord token from [here](https://discord.com/developers/applications/). - - If you wish to have support for osu! stats and stuff, you'll need to obtain a API key from [here](https://osu.ppy.sh/p/api/). - - Save the file with your tokens in their proper place. - - :warning: **You'll need to rename the file from `tokendata.json.example` to `tokendata.json`.** -- Modify the `app/cfg/system.json`. - - Place your ID where the placeholder `yourUserIDHere` is. - - :warning: **Do not worry about changing emotes at this time.** - - :warning: **Do not worry about changing the `logURL` or `imgAPI` until a release regarding those items are publicly available.** -- Run `npm start` after changing everything that is stated above. - - :information_source: **You can also use `npm start true` to enable debug logging, however this is a mess and really spammy.** -- Boom, you have a v5 clone. Kinda, I guess. - - -## Version 5 Releases - -| Version | Release Date | -| ------- | ------------ | -| 5.0.0 | 3/10/2022 | -| 5.0.1 | 3/15/2022 | -| 5.0.2 | 3/28/2022 | -| 5.1.0 | 4/2/2022 | -| 5.1.1 | 1/4/2023 | -| 5.2.0 | 10/13/2023 | -| 5.2.1 | 12/20/2023 | -| 5.2.2 | 12/21/2023 | +:warning: **IT IS NOT RECOMMENDED YOU DO THIS** +It serves as a public archive. ## Contributing -Pull requests for emergency patches are welcome. Otherwise, pull requests will not be merged. +Don't. + + +## Version 1 Release Dates +| Version | Release Date | +| ------------ | ------------ | +| 1.0.0.0 BETA | 04/27/2018 | +| 1.0.0.1 BETA | 04/27/2018 | +| 1.0.0.2 BETA | 04/28/2018 | +| 1.0.0.3 BETA | 04/30/2018 | +| 1.0.0.4 BETA | 05/01/2018 | +| 1.1 BETA | 05/03/2018 | +| 1.1-u1 BETA | 05/03/2018 | +| 1.2 | 06/19/2018 | +| 1.2-u1 | 06/20/2018 | +| 1.2-u2 | 06/29/2018 | +| 1.3 | 07/31/2018 | -## History -TheCodingBot started off as a small hobby project back in 2018. TheCodingBot got verified in 2022, and had 164 total servers it was in. -On October 13th, 2023, it was announced that TheCodingBot would enter emergency patch maintenance only. ## Disclaimer -This bot is licensed under MIT, meaning that this bot is provided "AS IS". For the best experience, always keep your fork up-to-date or utilize the [current bot](https://the.codingbot.gg). -For further support, join the [Discord Server](https://discord.gg/HdKeWtV)! +This bot is licensed under MIT, meaning that this bot is provided "AS IS". For the best experience, always keep your fork up-to-date or utilize the [current bot](https://discord.com/oauth2/authorize?client_id=438532019924893707&permissions=8&scope=applications.commands%20bot). diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 51f0a47..0000000 --- a/package-lock.json +++ /dev/null @@ -1,4724 +0,0 @@ -{ - "name": "tcbv5", - "version": "5.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "tcbv5", - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "@discordjs/voice": "^0.6.0", - "ascii-table": "^0.0.9", - "async-queue": "^0.1.0", - "canvas": "^2.8.0", - "discord.js": "^13.3.1", - "node-fetch": "^2.6.1", - "node-os-utils": "^1.3.6", - "node-vibrant": "^3.2.1-alpha.1", - "os": "^0.1.2", - "os-utils": "^0.0.14", - "sequelize": "^6.7.0", - "sqlite": "^4.0.23", - "sqlite3": "^5.0.2" - } - }, - "node_modules/@babel/runtime": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", - "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@discordjs/builders": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.8.2.tgz", - "integrity": "sha512-/YRd11SrcluqXkKppq/FAVzLIPRVlIVmc6X8ZklspzMIHDtJ+A4W37D43SHvLdH//+NnK+SHW/WeOF4Ts54PeQ==", - "dependencies": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.24.0", - "ow": "^0.27.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@discordjs/collection": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.3.2.tgz", - "integrity": "sha512-dMjLl60b2DMqObbH1MQZKePgWhsNe49XkKBZ0W5Acl5uVV43SN414i2QfZwRI7dXAqIn8pEWD2+XXQFn9KWxqg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@discordjs/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@discordjs/voice": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz", - "integrity": "sha512-DF2fZAnB8gX3Qz5BEWPOUl565ptpda1uVmXJije4iK5aQrECfkqc6XcI+wzbGaNvzsH1Wb76NPzxngsEw8bblw==", - "dependencies": { - "@types/ws": "^7.4.4", - "discord-api-types": "^0.22.0", - "prism-media": "^1.3.1", - "tiny-typed-emitter": "^2.0.3", - "ws": "^7.4.4" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@discordjs/voice/node_modules/@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@discordjs/voice/node_modules/discord-api-types": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz", - "integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@jimp/bmp": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.16.1.tgz", - "integrity": "sha512-iwyNYQeBawrdg/f24x3pQ5rEx+/GwjZcCXd3Kgc+ZUd+Ivia7sIqBsOnDaMZdKCBPlfW364ekexnlOqyVa0NWg==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "bmp-js": "^0.1.0" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/core": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.16.1.tgz", - "integrity": "sha512-la7kQia31V6kQ4q1kI/uLimu8FXx7imWVajDGtwUG8fzePLWDFJyZl0fdIXVCL1JW2nBcRHidUot6jvlRDi2+g==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "any-base": "^1.1.0", - "buffer": "^5.2.0", - "exif-parser": "^0.1.12", - "file-type": "^9.0.0", - "load-bmfont": "^1.3.1", - "mkdirp": "^0.5.1", - "phin": "^2.9.1", - "pixelmatch": "^4.0.2", - "tinycolor2": "^1.4.1" - } - }, - "node_modules/@jimp/core/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/@jimp/custom": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.16.1.tgz", - "integrity": "sha512-DNUAHNSiUI/j9hmbatD6WN/EBIyeq4AO0frl5ETtt51VN1SvE4t4v83ZA/V6ikxEf3hxLju4tQ5Pc3zmZkN/3A==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/core": "^0.16.1" - } - }, - "node_modules/@jimp/gif": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.16.1.tgz", - "integrity": "sha512-r/1+GzIW1D5zrP4tNrfW+3y4vqD935WBXSc8X/wm23QTY9aJO9Lw6PEdzpYCEY+SOklIFKaJYUAq/Nvgm/9ryw==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "gifwrap": "^0.9.2", - "omggif": "^1.0.9" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/jpeg": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.16.1.tgz", - "integrity": "sha512-8352zrdlCCLFdZ/J+JjBslDvml+fS3Z8gttdml0We759PnnZGqrnPRhkOEOJbNUlE+dD4ckLeIe6NPxlS/7U+w==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "jpeg-js": "0.4.2" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/plugin-resize": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.16.1.tgz", - "integrity": "sha512-u4JBLdRI7dargC04p2Ha24kofQBk3vhaf0q8FwSYgnCRwxfvh2RxvhJZk9H7Q91JZp6wgjz/SjvEAYjGCEgAwQ==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/png": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.16.1.tgz", - "integrity": "sha512-iyWoCxEBTW0OUWWn6SveD4LePW89kO7ZOy5sCfYeDM/oTPLpR8iMIGvZpZUz1b8kvzFr27vPst4E5rJhGjwsdw==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "pngjs": "^3.3.3" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/tiff": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.16.1.tgz", - "integrity": "sha512-3K3+xpJS79RmSkAvFMgqY5dhSB+/sxhwTFA9f4AVHUK0oKW+u6r52Z1L0tMXHnpbAdR9EJ+xaAl2D4x19XShkQ==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "utif": "^2.0.1" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/types": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.16.1.tgz", - "integrity": "sha512-g1w/+NfWqiVW4CaXSJyD28JQqZtm2eyKMWPhBBDCJN9nLCN12/Az0WFF3JUAktzdsEC2KRN2AqB1a2oMZBNgSQ==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "@jimp/bmp": "^0.16.1", - "@jimp/gif": "^0.16.1", - "@jimp/jpeg": "^0.16.1", - "@jimp/png": "^0.16.1", - "@jimp/tiff": "^0.16.1", - "timm": "^1.6.1" - }, - "peerDependencies": { - "@jimp/custom": ">=0.3.5" - } - }, - "node_modules/@jimp/utils": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.16.1.tgz", - "integrity": "sha512-8fULQjB0x4LzUSiSYG6ZtQl355sZjxbv8r9PPAuYHzS9sGiSHJQavNqK/nKnpDsVkU88/vRGcE7t3nMU0dEnVw==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "regenerator-runtime": "^0.13.3" - } - }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz", - "integrity": "sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==", - "dependencies": { - "detect-libc": "^1.0.3", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.1", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "rimraf": "^3.0.2", - "semver": "^7.3.4", - "tar": "^6.1.0" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/@sapphire/async-queue": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz", - "integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw==", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@sindresorhus/is": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz", - "integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" - }, - "node_modules/@types/node": { - "version": "16.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.3.tgz", - "integrity": "sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ==" - }, - "node_modules/@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@types/ws": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", - "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@vibrant/color": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/color/-/color-3.2.1-alpha.1.tgz", - "integrity": "sha512-cvm+jAPwao2NerTr3d1JttYyLhp3eD/AQBeevxF7KT6HctToWZCwr2AeTr003/wKgbjzdOV1qySnbyOeu+R+Jw==" - }, - "node_modules/@vibrant/core": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/core/-/core-3.2.1-alpha.1.tgz", - "integrity": "sha512-X9Oa9WfPEQnZ6L+5dLRlh+IlsxJkYTw9b/g3stFKoNXbVRKCeXHmH48l7jIBBOg3VcXOGUdsYBqsTwPNkIveaA==", - "dependencies": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/generator": "^3.2.1-alpha.1", - "@vibrant/image": "^3.2.1-alpha.1", - "@vibrant/quantizer": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1", - "@vibrant/worker": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/generator": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/generator/-/generator-3.2.1-alpha.1.tgz", - "integrity": "sha512-luS5YvMhwMqG01YTj1dJ+cmkuIw1VCByOR6zIaCOwQqI/mcOs88JBWcA1r2TywJTOPlVpjfnDvAlyaKBKh4dMA==", - "dependencies": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/generator-default": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/generator-default/-/generator-default-3.2.1-alpha.1.tgz", - "integrity": "sha512-BWnQhDaz92UhyHnpdAzKXHQecY+jvyMXtzjKYbveFxThm6+HVoLjwONlbck7oyOpFzV2OM7V11XuR85BxaHvjw==", - "dependencies": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/generator": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/image": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/image/-/image-3.2.1-alpha.1.tgz", - "integrity": "sha512-4aF5k79QfyhZOqRovJpbnIjWfe3uuWhY8voqVdd4/qgu4o70/AwVlM+pYmCaJVzI45VWNWWHYA5QlYuKsXnBqQ==", - "dependencies": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/image-browser": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/image-browser/-/image-browser-3.2.1-alpha.1.tgz", - "integrity": "sha512-6xWvQfB20sE6YtCWylgEAHuee3iD8h3aFIDbCS2yj7jIelKcYTrrp5jg2d2BhOOB6pC5JzF+QfpCrm0DmAIlgQ==", - "dependencies": { - "@vibrant/image": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/image-node": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/image-node/-/image-node-3.2.1-alpha.1.tgz", - "integrity": "sha512-/Io/Rpo4EkO6AhaXdcxUXkbOFhSFtjm0LSAM4c0AyGA5EbC8PyZqjk8b11bQAEMCaYaweFQfTdGD7oVbXe21CQ==", - "dependencies": { - "@jimp/custom": "^0.16.1", - "@jimp/plugin-resize": "^0.16.1", - "@jimp/types": "^0.16.1", - "@vibrant/image": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/quantizer": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/quantizer/-/quantizer-3.2.1-alpha.1.tgz", - "integrity": "sha512-iHnPx/+n4iLtYLm1GClSfyg2fFbMatFG0ipCyp9M6tXNIPAg+pSvUJSGBnVnH7Nl/bR8Gkkj1h0pJ4RsKcdIrQ==", - "dependencies": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/image": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/quantizer-mmcq": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/quantizer-mmcq/-/quantizer-mmcq-3.2.1-alpha.1.tgz", - "integrity": "sha512-Wuk9PTZtxr8qsWTcgP6lcrrmrq36syVwxf+BUxdgQYntBcQ053SaN34lVGOJ0WPdK5vABoxbYljhceCgiILtZw==", - "dependencies": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/image": "^3.2.1-alpha.1", - "@vibrant/quantizer": "^3.2.1-alpha.1" - } - }, - "node_modules/@vibrant/types": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/types/-/types-3.2.1-alpha.1.tgz", - "integrity": "sha512-ts9u7nsrENoYI5s0MmPOeY5kCLFKvQndKVDOPFCbTA0z493uhDp8mpiQhjFYTf3kPbS04z9zbHLE2luFC7x4KQ==" - }, - "node_modules/@vibrant/worker": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/worker/-/worker-3.2.1-alpha.1.tgz", - "integrity": "sha512-mtSlBdHkFNr4FOnMtqtHJxy9z5AsUcZzGlpiHzvWOoaoN9lNTDPwxOBd0q4VTYWuGPrIm6Fuq5m7aRbLv7KqiQ==", - "dependencies": { - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "optional": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/any-base": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", - "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==" - }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "node_modules/are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/ascii-table": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", - "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=" - }, - "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "optional": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "optional": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/async-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/async-queue/-/async-queue-0.1.0.tgz", - "integrity": "sha1-5+H2esZtP2x7h1i4XyywuqZbavQ=", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "optional": true - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "optional": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "optional": true, - "dependencies": { - "inherits": "~2.0.0" - }, - "engines": { - "node": "0.4 || >=0.5.8" - } - }, - "node_modules/bmp-js": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", - "integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-equal": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", - "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/canvas": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.9.0.tgz", - "integrity": "sha512-0l93g7uxp7rMyr7H+XRQ28A3ud0dKIUTIEkUe1Dxh4rjUYN7B93+SjC3r1PDKA18xcQN87OFGgUnyw7LSgNLSQ==", - "hasInstallScript": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "nan": "^2.15.0", - "simple-get": "^3.0.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "optional": true - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "dependencies": { - "mimic-response": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/discord-api-types": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz", - "integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A==", - "engines": { - "node": ">=12" - } - }, - "node_modules/discord.js": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.3.1.tgz", - "integrity": "sha512-zn4G8tL5+tMV00+0aSsVYNYcIfMSdT2g0nudKny+Ikd+XKv7m6bqI7n3Vji0GIRqXDr5ArPaw+iYFM2I1Iw3vg==", - "dependencies": { - "@discordjs/builders": "^0.8.1", - "@discordjs/collection": "^0.3.2", - "@discordjs/form-data": "^3.0.1", - "@sapphire/async-queue": "^1.1.8", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.0", - "discord-api-types": "^0.24.0", - "node-fetch": "^2.6.1", - "ws": "^8.2.3" - }, - "engines": { - "node": ">=16.6.0", - "npm": ">=7.0.0" - } - }, - "node_modules/discord.js/node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" - }, - "node_modules/dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dottie": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.2.tgz", - "integrity": "sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg==" - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "optional": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/exif-parser": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", - "integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=" - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "optional": true - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "engines": [ - "node >=0.6.0" - ], - "optional": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "optional": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "optional": true - }, - "node_modules/file-type": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-9.0.0.tgz", - "integrity": "sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "optional": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "node_modules/fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - }, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/fstream/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "optional": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/fstream/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/gauge/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/gifwrap": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.9.2.tgz", - "integrity": "sha512-fcIswrPaiCDAyO8xnWvHSZdWChjKXUanKKpAiWWJ/UTkEi/aYKn5+90e7DE820zbEaVR9CE2y4z9bzhQijZ0BA==", - "dependencies": { - "image-q": "^1.1.1", - "omggif": "^1.0.10" - } - }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/global": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", - "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", - "dependencies": { - "min-document": "^2.19.0", - "process": "^0.11.10" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", - "optional": true - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "optional": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore-walk": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", - "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", - "dependencies": { - "minimatch": "^3.0.4" - } - }, - "node_modules/image-q": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/image-q/-/image-q-1.1.1.tgz", - "integrity": "sha1-/IQJlmRGC5DKhi2TALa/u7+/gFY=", - "engines": { - "node": ">=0.9.0" - } - }, - "node_modules/inflection": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.1.tgz", - "integrity": "sha512-dldYtl2WlN0QDkIDtg8+xFwOS2Tbmp12t1cHa5/YClU6ZQjTFm7B66UcVbh9NQB+HvT5BAd2t5+yKsBkw5pcqA==", - "engines": [ - "node >= 0.4.0" - ] - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/is-function": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==" - }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "optional": true - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "optional": true - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "optional": true - }, - "node_modules/jpeg-js": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.2.tgz", - "integrity": "sha512-+az2gi/hvex7eLTMTlbRLOhH6P6WFdk2ITI8HJsaH2VqYO0I594zXSYEP+tf4FW+8Cy68ScDXoAsQdyQanv3sw==" - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "optional": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "optional": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "optional": true - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "optional": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/load-bmfont": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz", - "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==", - "dependencies": { - "buffer-equal": "0.0.1", - "mime": "^1.3.4", - "parse-bmfont-ascii": "^1.0.3", - "parse-bmfont-binary": "^1.0.5", - "parse-bmfont-xml": "^1.1.4", - "phin": "^2.9.1", - "xhr": "^2.0.1", - "xtend": "^4.0.0" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.50.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", - "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.33", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", - "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", - "dependencies": { - "mime-db": "1.50.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "dependencies": { - "dom-walk": "^0.1.0" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "node_modules/minipass": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", - "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", - "engines": { - "node": "*" - } - }, - "node_modules/moment-timezone": { - "version": "0.5.34", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", - "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", - "dependencies": { - "moment": ">= 2.9.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" - }, - "node_modules/needle": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", - "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", - "dependencies": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "bin": { - "needle": "bin/needle" - }, - "engines": { - "node": ">= 4.4.x" - } - }, - "node_modules/needle/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "optional": true, - "dependencies": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/node-gyp/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "optional": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/node-gyp/node_modules/nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "optional": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/node-gyp/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/node-gyp/node_modules/semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "optional": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/node-gyp/node_modules/tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "deprecated": "This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.", - "optional": true, - "dependencies": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, - "node_modules/node-os-utils": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/node-os-utils/-/node-os-utils-1.3.6.tgz", - "integrity": "sha512-WympE9ELtdOzNak/rAuuIV5DwvX/PTJtN0LjyWeGyTTR2Kt0sY56ldLoGbVBnfM1dz46VeO3sHcNZI5BZ+EB+w==" - }, - "node_modules/node-pre-gyp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", - "deprecated": "Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future", - "dependencies": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/node-pre-gyp/node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "node_modules/node-pre-gyp/node_modules/fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dependencies": { - "minipass": "^2.6.0" - } - }, - "node_modules/node-pre-gyp/node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/node-pre-gyp/node_modules/minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "dependencies": { - "minipass": "^2.9.0" - } - }, - "node_modules/node-pre-gyp/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/node-pre-gyp/node_modules/nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/node-pre-gyp/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/node-pre-gyp/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/node-pre-gyp/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/node-pre-gyp/node_modules/tar": { - "version": "4.4.19", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", - "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", - "dependencies": { - "chownr": "^1.1.4", - "fs-minipass": "^1.2.7", - "minipass": "^2.9.0", - "minizlib": "^1.3.3", - "mkdirp": "^0.5.5", - "safe-buffer": "^5.2.1", - "yallist": "^3.1.1" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/node-pre-gyp/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "node_modules/node-vibrant": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/node-vibrant/-/node-vibrant-3.2.1-alpha.1.tgz", - "integrity": "sha512-EQergCp7fvbvUCE0VMCBnvaAV0lGWSP8SXLmuWQIBzQK5M5pIwcd9fIOXuzFkJx/8hUiiiLvAzzGDS/bIy2ikA==", - "dependencies": { - "@types/node": "^10.12.18", - "@vibrant/core": "^3.2.1-alpha.1", - "@vibrant/generator-default": "^3.2.1-alpha.1", - "@vibrant/image-browser": "^3.2.1-alpha.1", - "@vibrant/image-node": "^3.2.1-alpha.1", - "@vibrant/quantizer-mmcq": "^3.2.1-alpha.1", - "url": "^0.11.0" - } - }, - "node_modules/node-vibrant/node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" - }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/npm-bundled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", - "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", - "dependencies": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "node_modules/npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" - }, - "node_modules/npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "dependencies": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/omggif": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", - "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==" - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/os": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz", - "integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ==" - }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/os-utils": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/os-utils/-/os-utils-0.0.14.tgz", - "integrity": "sha1-KeURaXsZgrjGJ3Ihdf45eX72QVY=", - "engines": { - "node": "*" - } - }, - "node_modules/osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "node_modules/ow": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz", - "integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==", - "dependencies": { - "@sindresorhus/is": "^4.0.1", - "callsites": "^3.1.0", - "dot-prop": "^6.0.1", - "lodash.isequal": "^4.5.0", - "type-fest": "^1.2.1", - "vali-date": "^1.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" - }, - "node_modules/parse-bmfont-ascii": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", - "integrity": "sha1-Eaw8P/WPfCAgqyJ2kHkQjU36AoU=" - }, - "node_modules/parse-bmfont-binary": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", - "integrity": "sha1-0Di0dtPp3Z2x4RoLDlOiJ5K2kAY=" - }, - "node_modules/parse-bmfont-xml": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz", - "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==", - "dependencies": { - "xml-parse-from-string": "^1.0.0", - "xml2js": "^0.4.5" - } - }, - "node_modules/parse-headers": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz", - "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==" - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "optional": true - }, - "node_modules/pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" - }, - "node_modules/phin": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz", - "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==" - }, - "node_modules/pixelmatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", - "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=", - "dependencies": { - "pngjs": "^3.0.0" - }, - "bin": { - "pixelmatch": "bin/pixelmatch" - } - }, - "node_modules/pngjs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", - "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "peerDependencies": { - "@discordjs/opus": "^0.5.0", - "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", - "node-opus": "^0.3.3", - "opusscript": "^0.0.8" - }, - "peerDependenciesMeta": { - "@discordjs/opus": { - "optional": true - }, - "ffmpeg-static": { - "optional": true - }, - "node-opus": { - "optional": true - }, - "opusscript": { - "optional": true - } - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "optional": true - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "optional": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "optional": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "optional": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/retry-as-promised": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-5.0.0.tgz", - "integrity": "sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA==" - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/sequelize": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.16.0.tgz", - "integrity": "sha512-t0RRopzm4EN+nWrkbMt+EvND8pQcwqyPb/8M3k2wJgiMqNZy2X998VSw1SKhk3YzoNV2Ftdrqqy/NXB9th//JQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/sequelize" - } - ], - "dependencies": { - "@types/debug": "^4.1.7", - "debug": "^4.3.3", - "dottie": "^2.0.2", - "inflection": "^1.13.1", - "lodash": "^4.17.21", - "moment": "^2.29.1", - "moment-timezone": "^0.5.34", - "pg-connection-string": "^2.5.0", - "retry-as-promised": "^5.0.0", - "semver": "^7.3.5", - "sequelize-pool": "^7.1.0", - "toposort-class": "^1.0.1", - "uuid": "^8.3.2", - "validator": "^13.7.0", - "wkx": "^0.5.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependenciesMeta": { - "ibm_db": { - "optional": true - }, - "mariadb": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "pg": { - "optional": true - }, - "pg-hstore": { - "optional": true - }, - "snowflake-sdk": { - "optional": true - }, - "sqlite3": { - "optional": true - }, - "tedious": { - "optional": true - } - } - }, - "node_modules/sequelize-pool": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", - "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "node_modules/signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/simple-get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", - "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", - "dependencies": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/sqlite": { - "version": "4.0.23", - "resolved": "https://registry.npmjs.org/sqlite/-/sqlite-4.0.23.tgz", - "integrity": "sha512-dSdmSkrdIhUL7xP/fiEMfFuAo4dxb0afag3rK8T4Y9lYxE3g3fXT0J8H9qSFvmcKxnM0zEA8yvLbpdWQ8mom3g==" - }, - "node_modules/sqlite3": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.2.tgz", - "integrity": "sha512-1SdTNo+BVU211Xj1csWa8lV6KM0CtucDwRyA0VHl91wEH1Mgh7RxUpI4rVvG7OhHrzCSGaVyW5g8vKvlrk9DJA==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^3.0.0", - "node-pre-gyp": "^0.11.0" - }, - "optionalDependencies": { - "node-gyp": "3.x" - }, - "peerDependencies": { - "node-gyp": "3.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "optional": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/timm": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz", - "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==" - }, - "node_modules/tiny-typed-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", - "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==" - }, - "node_modules/tinycolor2": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", - "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==", - "engines": { - "node": "*" - } - }, - "node_modules/toposort-class": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", - "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "optional": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/ts-mixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", - "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" - }, - "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "optional": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "optional": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" - }, - "node_modules/utif": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/utif/-/utif-2.0.1.tgz", - "integrity": "sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==", - "dependencies": { - "pako": "^1.0.5" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/vali-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", - "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/validator": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", - "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "engines": [ - "node >=0.6.0" - ], - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "optional": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wkx": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", - "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xhr": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "dependencies": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/xml-parse-from-string": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", - "integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig=" - }, - "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - }, - "dependencies": { - "@babel/runtime": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", - "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@discordjs/builders": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.8.2.tgz", - "integrity": "sha512-/YRd11SrcluqXkKppq/FAVzLIPRVlIVmc6X8ZklspzMIHDtJ+A4W37D43SHvLdH//+NnK+SHW/WeOF4Ts54PeQ==", - "requires": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.24.0", - "ow": "^0.27.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1" - } - }, - "@discordjs/collection": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.3.2.tgz", - "integrity": "sha512-dMjLl60b2DMqObbH1MQZKePgWhsNe49XkKBZ0W5Acl5uVV43SN414i2QfZwRI7dXAqIn8pEWD2+XXQFn9KWxqg==" - }, - "@discordjs/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "@discordjs/voice": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz", - "integrity": "sha512-DF2fZAnB8gX3Qz5BEWPOUl565ptpda1uVmXJije4iK5aQrECfkqc6XcI+wzbGaNvzsH1Wb76NPzxngsEw8bblw==", - "requires": { - "@types/ws": "^7.4.4", - "discord-api-types": "^0.22.0", - "prism-media": "^1.3.1", - "tiny-typed-emitter": "^2.0.3", - "ws": "^7.4.4" - }, - "dependencies": { - "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "requires": { - "@types/node": "*" - } - }, - "discord-api-types": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz", - "integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==" - } - } - }, - "@jimp/bmp": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.16.1.tgz", - "integrity": "sha512-iwyNYQeBawrdg/f24x3pQ5rEx+/GwjZcCXd3Kgc+ZUd+Ivia7sIqBsOnDaMZdKCBPlfW364ekexnlOqyVa0NWg==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "bmp-js": "^0.1.0" - } - }, - "@jimp/core": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.16.1.tgz", - "integrity": "sha512-la7kQia31V6kQ4q1kI/uLimu8FXx7imWVajDGtwUG8fzePLWDFJyZl0fdIXVCL1JW2nBcRHidUot6jvlRDi2+g==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "any-base": "^1.1.0", - "buffer": "^5.2.0", - "exif-parser": "^0.1.12", - "file-type": "^9.0.0", - "load-bmfont": "^1.3.1", - "mkdirp": "^0.5.1", - "phin": "^2.9.1", - "pixelmatch": "^4.0.2", - "tinycolor2": "^1.4.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "requires": { - "minimist": "^1.2.5" - } - } - } - }, - "@jimp/custom": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.16.1.tgz", - "integrity": "sha512-DNUAHNSiUI/j9hmbatD6WN/EBIyeq4AO0frl5ETtt51VN1SvE4t4v83ZA/V6ikxEf3hxLju4tQ5Pc3zmZkN/3A==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/core": "^0.16.1" - } - }, - "@jimp/gif": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.16.1.tgz", - "integrity": "sha512-r/1+GzIW1D5zrP4tNrfW+3y4vqD935WBXSc8X/wm23QTY9aJO9Lw6PEdzpYCEY+SOklIFKaJYUAq/Nvgm/9ryw==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "gifwrap": "^0.9.2", - "omggif": "^1.0.9" - } - }, - "@jimp/jpeg": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.16.1.tgz", - "integrity": "sha512-8352zrdlCCLFdZ/J+JjBslDvml+fS3Z8gttdml0We759PnnZGqrnPRhkOEOJbNUlE+dD4ckLeIe6NPxlS/7U+w==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "jpeg-js": "0.4.2" - } - }, - "@jimp/plugin-resize": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.16.1.tgz", - "integrity": "sha512-u4JBLdRI7dargC04p2Ha24kofQBk3vhaf0q8FwSYgnCRwxfvh2RxvhJZk9H7Q91JZp6wgjz/SjvEAYjGCEgAwQ==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1" - } - }, - "@jimp/png": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.16.1.tgz", - "integrity": "sha512-iyWoCxEBTW0OUWWn6SveD4LePW89kO7ZOy5sCfYeDM/oTPLpR8iMIGvZpZUz1b8kvzFr27vPst4E5rJhGjwsdw==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/utils": "^0.16.1", - "pngjs": "^3.3.3" - } - }, - "@jimp/tiff": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.16.1.tgz", - "integrity": "sha512-3K3+xpJS79RmSkAvFMgqY5dhSB+/sxhwTFA9f4AVHUK0oKW+u6r52Z1L0tMXHnpbAdR9EJ+xaAl2D4x19XShkQ==", - "requires": { - "@babel/runtime": "^7.7.2", - "utif": "^2.0.1" - } - }, - "@jimp/types": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.16.1.tgz", - "integrity": "sha512-g1w/+NfWqiVW4CaXSJyD28JQqZtm2eyKMWPhBBDCJN9nLCN12/Az0WFF3JUAktzdsEC2KRN2AqB1a2oMZBNgSQ==", - "requires": { - "@babel/runtime": "^7.7.2", - "@jimp/bmp": "^0.16.1", - "@jimp/gif": "^0.16.1", - "@jimp/jpeg": "^0.16.1", - "@jimp/png": "^0.16.1", - "@jimp/tiff": "^0.16.1", - "timm": "^1.6.1" - } - }, - "@jimp/utils": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.16.1.tgz", - "integrity": "sha512-8fULQjB0x4LzUSiSYG6ZtQl355sZjxbv8r9PPAuYHzS9sGiSHJQavNqK/nKnpDsVkU88/vRGcE7t3nMU0dEnVw==", - "requires": { - "@babel/runtime": "^7.7.2", - "regenerator-runtime": "^0.13.3" - } - }, - "@mapbox/node-pre-gyp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz", - "integrity": "sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==", - "requires": { - "detect-libc": "^1.0.3", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.1", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "rimraf": "^3.0.2", - "semver": "^7.3.4", - "tar": "^6.1.0" - } - }, - "@sapphire/async-queue": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz", - "integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw==" - }, - "@sindresorhus/is": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz", - "integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==" - }, - "@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "requires": { - "@types/ms": "*" - } - }, - "@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" - }, - "@types/node": { - "version": "16.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.3.tgz", - "integrity": "sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ==" - }, - "@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, - "@types/ws": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", - "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", - "requires": { - "@types/node": "*" - } - }, - "@vibrant/color": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/color/-/color-3.2.1-alpha.1.tgz", - "integrity": "sha512-cvm+jAPwao2NerTr3d1JttYyLhp3eD/AQBeevxF7KT6HctToWZCwr2AeTr003/wKgbjzdOV1qySnbyOeu+R+Jw==" - }, - "@vibrant/core": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/core/-/core-3.2.1-alpha.1.tgz", - "integrity": "sha512-X9Oa9WfPEQnZ6L+5dLRlh+IlsxJkYTw9b/g3stFKoNXbVRKCeXHmH48l7jIBBOg3VcXOGUdsYBqsTwPNkIveaA==", - "requires": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/generator": "^3.2.1-alpha.1", - "@vibrant/image": "^3.2.1-alpha.1", - "@vibrant/quantizer": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1", - "@vibrant/worker": "^3.2.1-alpha.1" - } - }, - "@vibrant/generator": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/generator/-/generator-3.2.1-alpha.1.tgz", - "integrity": "sha512-luS5YvMhwMqG01YTj1dJ+cmkuIw1VCByOR6zIaCOwQqI/mcOs88JBWcA1r2TywJTOPlVpjfnDvAlyaKBKh4dMA==", - "requires": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "@vibrant/generator-default": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/generator-default/-/generator-default-3.2.1-alpha.1.tgz", - "integrity": "sha512-BWnQhDaz92UhyHnpdAzKXHQecY+jvyMXtzjKYbveFxThm6+HVoLjwONlbck7oyOpFzV2OM7V11XuR85BxaHvjw==", - "requires": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/generator": "^3.2.1-alpha.1" - } - }, - "@vibrant/image": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/image/-/image-3.2.1-alpha.1.tgz", - "integrity": "sha512-4aF5k79QfyhZOqRovJpbnIjWfe3uuWhY8voqVdd4/qgu4o70/AwVlM+pYmCaJVzI45VWNWWHYA5QlYuKsXnBqQ==", - "requires": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "@vibrant/image-browser": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/image-browser/-/image-browser-3.2.1-alpha.1.tgz", - "integrity": "sha512-6xWvQfB20sE6YtCWylgEAHuee3iD8h3aFIDbCS2yj7jIelKcYTrrp5jg2d2BhOOB6pC5JzF+QfpCrm0DmAIlgQ==", - "requires": { - "@vibrant/image": "^3.2.1-alpha.1" - } - }, - "@vibrant/image-node": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/image-node/-/image-node-3.2.1-alpha.1.tgz", - "integrity": "sha512-/Io/Rpo4EkO6AhaXdcxUXkbOFhSFtjm0LSAM4c0AyGA5EbC8PyZqjk8b11bQAEMCaYaweFQfTdGD7oVbXe21CQ==", - "requires": { - "@jimp/custom": "^0.16.1", - "@jimp/plugin-resize": "^0.16.1", - "@jimp/types": "^0.16.1", - "@vibrant/image": "^3.2.1-alpha.1" - } - }, - "@vibrant/quantizer": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/quantizer/-/quantizer-3.2.1-alpha.1.tgz", - "integrity": "sha512-iHnPx/+n4iLtYLm1GClSfyg2fFbMatFG0ipCyp9M6tXNIPAg+pSvUJSGBnVnH7Nl/bR8Gkkj1h0pJ4RsKcdIrQ==", - "requires": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/image": "^3.2.1-alpha.1", - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "@vibrant/quantizer-mmcq": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/quantizer-mmcq/-/quantizer-mmcq-3.2.1-alpha.1.tgz", - "integrity": "sha512-Wuk9PTZtxr8qsWTcgP6lcrrmrq36syVwxf+BUxdgQYntBcQ053SaN34lVGOJ0WPdK5vABoxbYljhceCgiILtZw==", - "requires": { - "@vibrant/color": "^3.2.1-alpha.1", - "@vibrant/image": "^3.2.1-alpha.1", - "@vibrant/quantizer": "^3.2.1-alpha.1" - } - }, - "@vibrant/types": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/types/-/types-3.2.1-alpha.1.tgz", - "integrity": "sha512-ts9u7nsrENoYI5s0MmPOeY5kCLFKvQndKVDOPFCbTA0z493uhDp8mpiQhjFYTf3kPbS04z9zbHLE2luFC7x4KQ==" - }, - "@vibrant/worker": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/@vibrant/worker/-/worker-3.2.1-alpha.1.tgz", - "integrity": "sha512-mtSlBdHkFNr4FOnMtqtHJxy9z5AsUcZzGlpiHzvWOoaoN9lNTDPwxOBd0q4VTYWuGPrIm6Fuq5m7aRbLv7KqiQ==", - "requires": { - "@vibrant/types": "^3.2.1-alpha.1" - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "optional": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "any-base": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", - "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==" - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "ascii-table": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", - "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=" - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "optional": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "optional": true - }, - "async-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/async-queue/-/async-queue-0.1.0.tgz", - "integrity": "sha1-5+H2esZtP2x7h1i4XyywuqZbavQ=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "optional": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "optional": true - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "optional": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "bmp-js": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", - "integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-equal": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", - "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=" - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - }, - "canvas": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.9.0.tgz", - "integrity": "sha512-0l93g7uxp7rMyr7H+XRQ28A3ud0dKIUTIEkUe1Dxh4rjUYN7B93+SjC3r1PDKA18xcQN87OFGgUnyw7LSgNLSQ==", - "requires": { - "@mapbox/node-pre-gyp": "^1.0.0", - "nan": "^2.15.0", - "simple-get": "^3.0.3" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "optional": true - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "requires": { - "ms": "2.1.2" - } - }, - "decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "requires": { - "mimic-response": "^2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" - }, - "discord-api-types": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz", - "integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A==" - }, - "discord.js": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.3.1.tgz", - "integrity": "sha512-zn4G8tL5+tMV00+0aSsVYNYcIfMSdT2g0nudKny+Ikd+XKv7m6bqI7n3Vji0GIRqXDr5ArPaw+iYFM2I1Iw3vg==", - "requires": { - "@discordjs/builders": "^0.8.1", - "@discordjs/collection": "^0.3.2", - "@discordjs/form-data": "^3.0.1", - "@sapphire/async-queue": "^1.1.8", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.0", - "discord-api-types": "^0.24.0", - "node-fetch": "^2.6.1", - "ws": "^8.2.3" - }, - "dependencies": { - "ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", - "requires": {} - } - } - }, - "dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" - }, - "dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", - "requires": { - "is-obj": "^2.0.0" - } - }, - "dottie": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.2.tgz", - "integrity": "sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg==" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "optional": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "exif-parser": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", - "integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=" - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "optional": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "optional": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "optional": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "optional": true - }, - "file-type": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-9.0.0.tgz", - "integrity": "sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw==" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "optional": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "optional": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "gifwrap": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.9.2.tgz", - "integrity": "sha512-fcIswrPaiCDAyO8xnWvHSZdWChjKXUanKKpAiWWJ/UTkEi/aYKn5+90e7DE820zbEaVR9CE2y4z9bzhQijZ0BA==", - "requires": { - "image-q": "^1.1.1", - "omggif": "^1.0.10" - } - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "global": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", - "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", - "requires": { - "min-document": "^2.19.0", - "process": "^0.11.10" - } - }, - "graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", - "optional": true - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "optional": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "optional": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "ignore-walk": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", - "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", - "requires": { - "minimatch": "^3.0.4" - } - }, - "image-q": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/image-q/-/image-q-1.1.1.tgz", - "integrity": "sha1-/IQJlmRGC5DKhi2TALa/u7+/gFY=" - }, - "inflection": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.1.tgz", - "integrity": "sha512-dldYtl2WlN0QDkIDtg8+xFwOS2Tbmp12t1cHa5/YClU6ZQjTFm7B66UcVbh9NQB+HvT5BAd2t5+yKsBkw5pcqA==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "is-function": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==" - }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "optional": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "optional": true - }, - "jpeg-js": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.2.tgz", - "integrity": "sha512-+az2gi/hvex7eLTMTlbRLOhH6P6WFdk2ITI8HJsaH2VqYO0I594zXSYEP+tf4FW+8Cy68ScDXoAsQdyQanv3sw==" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "optional": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "optional": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "optional": true - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "load-bmfont": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz", - "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==", - "requires": { - "buffer-equal": "0.0.1", - "mime": "^1.3.4", - "parse-bmfont-ascii": "^1.0.3", - "parse-bmfont-binary": "^1.0.5", - "parse-bmfont-xml": "^1.1.4", - "phin": "^2.9.1", - "xhr": "^2.0.1", - "xtend": "^4.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.50.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", - "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==" - }, - "mime-types": { - "version": "2.1.33", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", - "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", - "requires": { - "mime-db": "1.50.0" - } - }, - "mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" - }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "requires": { - "dom-walk": "^0.1.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "minipass": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", - "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, - "moment": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", - "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" - }, - "moment-timezone": { - "version": "0.5.34", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", - "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", - "requires": { - "moment": ">= 2.9.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" - }, - "needle": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", - "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "optional": true, - "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "optional": true, - "requires": { - "abbrev": "1" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "optional": true - }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "optional": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - } - } - }, - "node-os-utils": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/node-os-utils/-/node-os-utils-1.3.6.tgz", - "integrity": "sha512-WympE9ELtdOzNak/rAuuIV5DwvX/PTJtN0LjyWeGyTTR2Kt0sY56ldLoGbVBnfM1dz46VeO3sHcNZI5BZ+EB+w==" - }, - "node-pre-gyp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - }, - "dependencies": { - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "requires": { - "minipass": "^2.6.0" - } - }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "requires": { - "minimist": "^1.2.5" - } - }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "tar": { - "version": "4.4.19", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", - "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", - "requires": { - "chownr": "^1.1.4", - "fs-minipass": "^1.2.7", - "minipass": "^2.9.0", - "minizlib": "^1.3.3", - "mkdirp": "^0.5.5", - "safe-buffer": "^5.2.1", - "yallist": "^3.1.1" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - } - } - }, - "node-vibrant": { - "version": "3.2.1-alpha.1", - "resolved": "https://registry.npmjs.org/node-vibrant/-/node-vibrant-3.2.1-alpha.1.tgz", - "integrity": "sha512-EQergCp7fvbvUCE0VMCBnvaAV0lGWSP8SXLmuWQIBzQK5M5pIwcd9fIOXuzFkJx/8hUiiiLvAzzGDS/bIy2ikA==", - "requires": { - "@types/node": "^10.12.18", - "@vibrant/core": "^3.2.1-alpha.1", - "@vibrant/generator-default": "^3.2.1-alpha.1", - "@vibrant/image-browser": "^3.2.1-alpha.1", - "@vibrant/image-node": "^3.2.1-alpha.1", - "@vibrant/quantizer-mmcq": "^3.2.1-alpha.1", - "url": "^0.11.0" - }, - "dependencies": { - "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" - } - } - }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "requires": { - "abbrev": "1" - } - }, - "npm-bundled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", - "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "omggif": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", - "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "os": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz", - "integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ==" - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "os-utils": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/os-utils/-/os-utils-0.0.14.tgz", - "integrity": "sha1-KeURaXsZgrjGJ3Ihdf45eX72QVY=" - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "ow": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz", - "integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==", - "requires": { - "@sindresorhus/is": "^4.0.1", - "callsites": "^3.1.0", - "dot-prop": "^6.0.1", - "lodash.isequal": "^4.5.0", - "type-fest": "^1.2.1", - "vali-date": "^1.0.0" - } - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" - }, - "parse-bmfont-ascii": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", - "integrity": "sha1-Eaw8P/WPfCAgqyJ2kHkQjU36AoU=" - }, - "parse-bmfont-binary": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", - "integrity": "sha1-0Di0dtPp3Z2x4RoLDlOiJ5K2kAY=" - }, - "parse-bmfont-xml": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz", - "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==", - "requires": { - "xml-parse-from-string": "^1.0.0", - "xml2js": "^0.4.5" - } - }, - "parse-headers": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz", - "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "optional": true - }, - "pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" - }, - "phin": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz", - "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==" - }, - "pixelmatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", - "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=", - "requires": { - "pngjs": "^3.0.0" - } - }, - "pngjs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", - "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==" - }, - "prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "requires": {} - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "optional": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "optional": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "optional": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "optional": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "optional": true - } - } - }, - "retry-as-promised": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-5.0.0.tgz", - "integrity": "sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA==" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "sequelize": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.16.0.tgz", - "integrity": "sha512-t0RRopzm4EN+nWrkbMt+EvND8pQcwqyPb/8M3k2wJgiMqNZy2X998VSw1SKhk3YzoNV2Ftdrqqy/NXB9th//JQ==", - "requires": { - "@types/debug": "^4.1.7", - "debug": "^4.3.3", - "dottie": "^2.0.2", - "inflection": "^1.13.1", - "lodash": "^4.17.21", - "moment": "^2.29.1", - "moment-timezone": "^0.5.34", - "pg-connection-string": "^2.5.0", - "retry-as-promised": "^5.0.0", - "semver": "^7.3.5", - "sequelize-pool": "^7.1.0", - "toposort-class": "^1.0.1", - "uuid": "^8.3.2", - "validator": "^13.7.0", - "wkx": "^0.5.0" - } - }, - "sequelize-pool": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", - "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" - }, - "simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" - }, - "simple-get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", - "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", - "requires": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "sqlite": { - "version": "4.0.23", - "resolved": "https://registry.npmjs.org/sqlite/-/sqlite-4.0.23.tgz", - "integrity": "sha512-dSdmSkrdIhUL7xP/fiEMfFuAo4dxb0afag3rK8T4Y9lYxE3g3fXT0J8H9qSFvmcKxnM0zEA8yvLbpdWQ8mom3g==" - }, - "sqlite3": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.2.tgz", - "integrity": "sha512-1SdTNo+BVU211Xj1csWa8lV6KM0CtucDwRyA0VHl91wEH1Mgh7RxUpI4rVvG7OhHrzCSGaVyW5g8vKvlrk9DJA==", - "requires": { - "node-addon-api": "^3.0.0", - "node-gyp": "3.x", - "node-pre-gyp": "^0.11.0" - } - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "optional": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, - "timm": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz", - "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==" - }, - "tiny-typed-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", - "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==" - }, - "tinycolor2": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", - "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" - }, - "toposort-class": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", - "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "optional": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "ts-mixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", - "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" - }, - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "optional": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" - } - } - }, - "utif": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/utif/-/utif-2.0.1.tgz", - "integrity": "sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==", - "requires": { - "pako": "^1.0.5" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "vali-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", - "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=" - }, - "validator": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", - "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - } - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "optional": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "wkx": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", - "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", - "requires": { - "@types/node": "*" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", - "requires": {} - }, - "xhr": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "requires": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "xml-parse-from-string": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", - "integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig=" - }, - "xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - } - }, - "xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index c60d3d3..0000000 --- a/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "tcbv5", - "version": "5.0.0", - "description": "TheCodingBot - A Discord Bot.", - "main": "src/bot.js", - "scripts": { - "start": "node .", - "test": "node . true" - }, - "keywords": [ - "discord", - "bot", - "coding", - "tcb" - ], - "author": "Netro Corporation", - "license": "MIT", - "dependencies": { - "@discordjs/voice": "^0.6.0", - "ascii-table": "^0.0.9", - "async-queue": "^0.1.0", - "canvas": "^2.8.0", - "discord.js": "^13.3.1", - "node-fetch": "^2.6.1", - "node-os-utils": "^1.3.6", - "node-vibrant": "^3.2.1-alpha.1", - "os": "^0.1.2", - "os-utils": "^0.0.14", - "sequelize": "^6.7.0", - "sqlite": "^4.0.23", - "sqlite3": "^5.0.2" - } -} diff --git a/src/app/cfg/app.js b/src/app/cfg/app.js deleted file mode 100644 index 05af3a8..0000000 --- a/src/app/cfg/app.js +++ /dev/null @@ -1,580 +0,0 @@ -/* - THECODINGBOT v5 - App - 6/24/2021 - - https://codingbot.gg/source - https://netrocorp.net -*/ - - -const app = { - name: "TheCodingBot", - shortName: "TCB", - - version: { - major: 5, - minor: 2, - revision: 2, - buildType: "R", - toString: function() { - var major = app.version.major, - minor = app.version.minor, - revision = app.version.revision; - return major + "." + minor + "." + revision; - }, - toBuildString: function() { - var buildType = app.version.buildType; - if (buildType == "A") buildType = "ALPHA"; - else if (buildType == "B") buildType = "BETA"; - else if (buildType == "R") buildType = "RELEASE"; - - return buildType; - }, - toFullString: function() { - return app.version.toString() + " " + app.version.toBuildString(); - } - }, - - types: { - channels: { - GUILD_TEXT: "Text Channel", - GUILD_VOICE: "Voice Channel", - GUILD_CATEGORY: "Category", - GUILD_NEWS: "News Channel", - GUILD_STAGE_VOICE: "Stage Channel" - } - }, - - defaults: { - // -- HEY!!! - // -- WARNING :: THIS IS DANGEROUS | ONLY ACCESS DATA FROM MESSAGE. DO NOT ACCESS DATA FROM OTHER VARIABLES. - // -- It poses a major security risk and Netro Corporation is not responsible for that. - - join: { - msg: "Hello and welcome %user% to the %server%!", - types: [ - // SERVER INFO - { "%server%": { "desc": "Server Name (Cool Place)", "replaceWith": "guild|name" } }, - { "%serverID%": { "desc": "Server ID (99999999999999999)", "replaceWith": "guild|id" } }, - - // USER INFO - { "%username%": { "desc": "Username (John Doe)", "replaceWith": "user|username" } }, - { "%userID%": { "desc": "User ID (99999999999999999)", "replaceWith": "user|id" } }, - { "%userdisc%": { "desc": "User Discriminator (#0001)", "replaceWith": "user|discriminator" } }, - { "%usertag%": { "desc": "User Tag (John Doe#0001)", "replaceWith": "user|tag" } }, - { "%user%": { "desc": "User Mention (@John Doe#0001)", "replaceWith": "user|toString()" } }, - - // INVITE INFO - { "%invitecode%": { "desc": "Invite Code (HdKeWtV)", "replaceWith": "Unknown" } }, - { "%inviteuses%": { "desc": "Invite Uses (34)", "replaceWith": "" } }, - { "%invitername%": { "desc": "Inviter Username (Jane Doe)", "replaceWith": "" } }, - { "%inviterID%": { "desc": "Inviter ID (11111111111111111)", "replaceWith": "" } }, - { "%inviterdisc%": { "desc": "Inviter Discriminator (#0002)", "replaceWith": "" } }, - { "%invitertag%": { "desc": "Inviter Tag (Jane Doe#0001)", "replaceWith": "" } }, - { "%inviter%": { "desc": "Inviter Mention (@Jane Doe#0002)", "replaceWith": "" } } - ] - }, - leave: { - msg: "Aw... %user% just left the server...", - types: [ - // SERVER INFO - { "%server%": { "desc": "Server Name (Cool Place)", "replaceWith": "guild|name" } }, - { "%serverID%": { "desc": "Server ID (99999999999999999)", "replaceWith": "guild|id" } }, - - // USER INFO - { "%username%": { "desc": "Username (John Doe)", "replaceWith": "user|username" } }, - { "%userID%": { "desc": "User ID (99999999999999999)", "replaceWith": "user|id" } }, - { "%userdisc%": { "desc": "User Discriminator (#0001)", "replaceWith": "user|discriminator" } }, - { "%usertag%": { "desc": "User Tag (John Doe#0001)", "replaceWith": "user|tag" } }, - { "%user%": { "desc": "User Mention (@John Doe#0001)", "replaceWith": "user|toString()" } } - ] - } - }, - - functions: { - getTypes: { // these functions were retardly dumb and overly complicated for no reason. - desc: (val) => { - var temp = [], - defaults = app.defaults; - for (var i = 0; i < Object.keys(defaults[val]["types"]).length; i++) temp.push(Object.keys(defaults[val]["types"][i]) + " = " + defaults[val]["types"][i][Object.keys(defaults[val]["types"][i])]["desc"]); - return temp; - }, - - replaceWith: (val) => { - var temp = {}, - defaults = app.defaults; - for (var i = 0; i < Object.keys(defaults[val]["types"]).length; i++) temp[[Object.keys(defaults[val]["types"][i])[0]]] = defaults[val]["types"][i][Object.keys(defaults[val]["types"][i])[0]]["replaceWith"]; - return temp; - } - }, - - isAnimated: function(str) { - return str.substring(0, 2) === 'a_'; - }, - - sleep: function(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - }, - getTicks: () => { return ((new Date().getTime() * 10000) + 621355968000000000); }, - - TStoHR: function(TS) { - let totalSeconds = (TS / 1000); - let days = Math.floor(totalSeconds / 86400); - totalSeconds %= 86400; - let hours = Math.floor(totalSeconds / 3600); - totalSeconds %= 3600; - let minutes = Math.floor(totalSeconds / 60); - let seconds = totalSeconds % 60; - let HR = `${days} days, ${hours} hours, ${minutes} minutes and ${Math.round(seconds)} seconds`; - - if (days == 0) HR = HR.replace(days + " days, ", ""); - else if (days == 1) HR = HR.replace("days", "day"); - - if (hours == 0) HR = HR.replace(hours + " hours, ", ""); - else if (hours == 1) HR = HR.replace("hours", "hour"); - - if (minutes == 0) HR = HR.replace(minutes + " minutes and ", ""); - else if (minutes == 1) HR = HR.replace("minutes", "minute"); - - if (Math.round(seconds) == 1) HR = HR.replace("seconds", "second"); - - return HR; - }, - convertTimestamp: function(unix_timestamp, getDate, bigHour = false) { - var date = new Date(unix_timestamp * 1); // Create Date from timestamp - - var hours = date.getHours(); // Hours part from the timestamp - var minutes = "0" + date.getMinutes(); // Minutes part from the timestamp - var seconds = "0" + date.getSeconds(); // Seconds part from the timestamp - - // Will display time in hh:mm:ss format - var formattedTime = ((bigHour) ? ((hours > 12) ? (hours - 12) : (hours == 0) ? 12 : hours) : hours) + ':' + minutes.substr(-2) + ':' + seconds.substr(-2) + ((bigHour) ? ((hours < 12) ? " AM" : " PM") : ""); - - if (getDate) { - var dd = String(date.getDate()).padStart(2, '0'), - mm = String(date.getMonth() + 1).padStart(2, '0'), //January is 0! - yyyy = date.getFullYear(); - formattedTime = mm + '/' + dd + '/' + yyyy + ' ' + formattedTime; - }; - - // Return that bad boy - return formattedTime; - }, - DB: { - createUser: async function(id) { - const userSetting = await app.DBs.userSettings.create({ - userID: id, - prefix: app.config.system.defaultPrefix, - language: app.config.system.defaultLanguage || "English (en_US)", - acceptedEULA: false, - executedCommands: 0, - errorCommands: 0, - optedOut: false - }); - app.logger.success("DB", `User data for ${id} created in database!`); - - return userSetting; - }, - deleteUser: async function(id) { - const userSetting = await app.DBs.userSettings.destroy({ where: { userID: id } }); - app.logger.warn("DB", `User data for ${id} removed from database!`); - - return userSetting; - }, - createServer: async function(id) { - const serverSetting = await app.DBs.serverSettings.create({ - serverID: id, - loggingDeleteChannel: null, - loggingEditChannel: null, - loggingJoinChannel: null, - loggingLeaveChannel: null - }); - app.logger.success("DB", `Server data for ${id} created in database!`); - - return serverSetting; - }, - deleteServer: async function(id) { - const serverSetting = await app.DBs.serverSettings.destroy({ where: { serverID: id } }); - app.logger.warn("DB", `Server data for ${id} removed from database!`); - - return serverSetting; - }, - - createVerification: async function(serverID, userID, messageID, codeGenerated) { - const verificationSetting = await app.DBs.verification.create({ - serverID: serverID, - userID: userID, - messageID: messageID, - userCode: codeGenerated - }); - app.logger.success("DB", `Verification started for ${userID} in ${serverID} with code ${codeGenerated}!`); - - return verificationSetting; - }, - deleteVerification: async function(serverID, userID) { - const verificationSetting = await app.DBs.verification.destroy({ where: { userID: userID, serverID: serverID } }); - app.logger.warn("DB", `Verification data for ${userID} in ${serverID} removed from database!`); - - return verificationSetting; - } - }, - downloadAttachments: async function(message, attachments) { - if (app.client.waitingForMessageToDelete == undefined) app.client.waitingForMessageToDelete = []; - - var result = { failed: [], succeed: [] }; - app.client.waitingForMessageToDelete.push(message.id); - - for (var attachment of attachments) { - var attachment = attachment[1]; // For some reason, doing it this way, we go into an array? [0] = id, [1] = MessageAttachment - - // The logging API has been shutdown forever ago, so why have it? - result["succeed"].push(attachment.proxyURL); - }; - - app.client.waitingForMessageToDelete = app.functions.removeItemAll(app.client.waitingForMessageToDelete, message.id); - return result; - }, - - hasPermissions: function(message, command) { - return (command.permissions == "DEFAULT" || - message.channel.type.toLowerCase() == "dm" && command.guildOnly || - command.permissions == "BOT_OWNER" && app.config.system.owners.includes(message.author.id) || - app.config.system.owners.includes(message.author.id) && app.client.bypassEnabled || - command.permissions != "BOT_OWNER" && message.member.permissions.has(command.permissions)) - }, - - missingPerms: function(message, edit, cantdo, command) { // 0 = Send, 1 = Edit - var lackedPerms = []; - if (command) { - for (var i = 0; i < command.permissions.length; i++) { - permission = command.permissions[i]; - if (permission == "BOT_OWNER" || - permission == "DEFAULT" - ) - lackedPerms.push("`" + permission + "`"); - else if (!message.member.permissions.has(permission)) - lackedPerms.push("`" + permission + "`"); - }; - - lackedPerms = lackedPerms.join(", "); - app.logger.info("DISCORD", `[MESSAGE] Return ${message.author.id} lacking ${lackedPerms}`); - } else lackedPerms = "permission"; - - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} **Missing Permissions**`, - color: app.config.system.embedColors.red, - description: `You're lacking ${lackedPerms} to ${cantdo}.\nSorry about that...`, - }] - }, edit, true); - }, - - // PATCH 2023-10-13 - pomeloHandler: function(user) { // This helps get user#tag or username. - return user.discriminator && user.discriminator == "0" ? user.username : `${user.username}#${user.discriminator}`; - }, - // END PATCH 2023-10-13 - - msgHandler: async function(message, options, action = 0, doReply = false, callback = null) { // action: 0 = Send, 1 = Edit - var userSettings = (message.author) ? await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }) : "English"; - - if (options.embeds) { - if (options["author"] != null) { - var author = options["author"]; - if (author.id) - options.embeds[0]["author"] = { name: `${(app.lang.getLine((userSettings) ? userSettings.get("language") : "English", "Hello"))}, ${app.functions.pomeloHandler(author)}!`, icon_url: author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }; - delete options["author"]; - }; - if (!options.embeds[0]["footer"]) options.embeds[0]["footer"] = { text: app.config.system.footerText }; // Install branding.exe - if (options.embeds[0]["thumbnail"] != null) { - var user = options.embeds[0]["thumbnail"]; - if (user["url"] == null) - options.embeds[0]["thumbnail"] = { url: user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }; - - } - }; - - var currTime = new Date().getTime(); - - if (action == 0) { - if (doReply && message.channel) options["reply"] = { messageReference: message.id }; - - if (message.channel) - message.channel.send(options).then(msg => { - if (message.createdTimestamp) - app.logger.debug("DISCORD", `[MESSAGE] Got message in ${(currTime - message.createdTimestamp)}ms. | Responded in ${(msg.createdTimestamp - currTime)}ms.`); - if (callback != null) callback(msg); - }).catch(err => { app.logger.warn("DISCORD", `[MESSAGE] Message failed to send! Error: ${err.message}`) }); - else - message.send(options).then(msg => { if (callback != null) callback(msg); }).catch(err => { app.logger.warn("DISCORD", `[MESSAGE] Message failed to send! Error: ${err.message}`) }); - } else if (action == 1) { - if (!message.channel) return; // Hate to break it, but you can't edit a channel as a message. 💀 (imagine that) - if (message.edit) message.edit(options).then(msg => { - if (message.editedTimestamp) app.logger.debug("DISCORD", `[MESSAGE] Edited message in ${(msg.editedTimestamp - currTime)}ms.`); - if (callback != null) callback(msg); - }).catch(err => { app.logger.warn("DISCORD", `[MESSAGE] Message failed to edit! Error: ${err.message}`) }); - else if (message.update) message.update(options).then(msg => { - if (message.editedTimestamp) app.logger.debug("DISCORD", `[MESSAGE] Edited message in ${(msg.editedTimestamp - currTime)}ms.`); - if (callback != null) callback(msg); - }).catch(err => { app.logger.warn("DISCORD", `[MESSAGE] Message failed to update! Error: ${err.message}`) }); - }; - }, - - RemoveReactions: function(app, msg) { - msg.reactions.removeAll().catch(error => { - app.logger.error("DISCORD", "Could not remove ALL reactions due to " + error); - app.functions.msgHandler(msg, { - embeds: [{ - color: app.config.system.embedColors.red, - description: "Failed to remove all reactions! Will attempt to remove my reactions only..." - }] - }, 0, true, (async m => { - var myID = app.client.user.id; - var userReactions = msg.reactions.cache.filter(reaction => reaction.users.cache.has(myID)); - try { - for (const reaction of userReactions.values()) await reaction.users.remove(myID); - m.delete(); - } catch (err) { - app.functions.msgHandler(m, { - embeds: [{ - color: app.config.system.embedColors.red, - description: "Failed to remove my reactions! well, that's an F.", - }] - }, 1, true); - app.logger.error("DISCORD", "Could not remove my reactions due to " + err); - }; - })); - }); - }, - ErrorHandler: function(app, userSettings, message, command, err, type) { - var embedTitle = (type == "error") ? app.config.system.emotes.error + " **Error!**" : app.config.system.emotes.warning + " **Warning!**"; - var embedColor = (type == "error") ? app.config.system.embedColors.red : app.config.system.embedColors.yellow; - - var data = {}; - if ((err.message) ? err.message.includes(app.lang.getLine(userSettings.get("language"), "Command not found")) : err.includes(app.lang.getLine(userSettings.get("language"), "Command not found"))) - data = { - embeds: [{ - title: embedTitle, - color: embedColor, - description: `Command \`${((command.name) ? command.name : command)}\` was not found!`, - fields: [ - { name: "Lost?", value: `You should check out the \`${userSettings.get("prefix")}help\`` } - ] - }] - } - else { - var msg = ((err.message && err.message != "") ? "js\n" + err.message : (err && err != "") ? err : "Unknown Error."); - - data = { - embeds: [{ - title: embedTitle, - color: embedColor, - description: `${app.lang.getLine(userSettings.get("language"), "Failed to execute")} \`${((command.name) ? command.name : command)}\`!`, - fields: [ - { name: "Error Details", value: "```" + msg + "```" } - - ] - }] - }; - if (type == "error" && err.stack) { - var stack = err.stack, - maxLength = 1020, - msg = "(continued)"; - // data.embeds[0].fields.push({ name: "Stacktrace", value: "```js\n" + err.stack + "```" }); - userSettings.update({ executedCommands: (userSettings.get('errorCommands') + 1) }, { where: { userID: message.author.id } }); - }; - }; - - app.functions.msgHandler(message, data, 0, true); - app.logger.error("SYS", "[ERRHANDLER] " + (err.stack || err.message || err)); - return; - }, - - generateRandomCode: function(length, random = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") { // random could be set to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"@#$%^&()-=+[{]}" - var code = ""; - for (var i = 0; i < length; i++) { code += random.charAt(Math.floor(Math.random() * random.length)); }; - return code; - }, - getEmoji: function(app, emojiID, full = false) { - var emoji = app.client.emojis.cache.find(e => e.id === emojiID) || null; - - var theEmoji = emoji; - if (emoji && full) { - theEmoji = "<"; - if (emoji.animated) - emoji += ":a"; - theEmoji += ":" + emoji["name"] + ":" + emoji["id"] + ">"; - }; - return theEmoji || null; - }, - getID: function(string) { return string.replace(/[<#@&!>]/g, ''); }, - doesArrayStartsWith: function(string, array) { return array.findIndex((item) => { return item.startsWith(string); }, string) != -1; }, - arrayDifference: function(arr1, arr2) { - var a = [], - diff = []; - for (var i = 0; i < arr1.length; i++) { a[arr1[i]] = true; }; - for (var i = 0; i < arr2.length; i++) { - if (a[arr2[i]]) { delete a[arr2[i]]; } else { a[arr2[i]] = true; }; - }; - for (var k in a) { diff.push(k); }; - return diff; - }, - - clearCache: function(module) { - if (module == null) - Object.keys(require.cache).forEach(function(key) { delete require.cache[key] }); - else - delete require.cache[module]; - }, - getFiles: async function(dir, filter = []) { - if (filter.length > 2) return "filter too powerfuuuuul [startsWith, endsWith] only please, or no filter."; - - const { resolve } = app.modules["path"]; - const { readdir } = app.modules["fs"].promises; - - const dirents = await readdir(dir, { withFileTypes: true }); - const files = await Promise.all(dirents.map((dirent) => { - let res = resolve(dir, dirent.name); - if (dirent.isDirectory()) return app.functions.getFiles(res, filter); - else { - - if (filter[0] != null || filter[0] != undefined || filter[0] != "") - if (!res.startsWith(filter[0])) return ""; - if (filter[1] != null || filter[1] != undefined || filter[0] != "") - if (!res.endsWith(filter[1])) return ""; - res = app.functions.splitMulti(res, ['\\', '\\\\', '/', '//']) - return res.slice((res.length - 2), res.length).join("/"); - }; - })); - return files.flat().filter(Boolean); - }, - splitMulti: function(str, tokens) { - var tempChar = tokens[0]; - for (var i = 1; i < tokens.length; i++) { - str = str.split(tokens[i]).join(tempChar); - } - str = str.split(tempChar); - return str; - }, - removeItemAll: function(arr, value) { - var i = 0; - while (i < arr.length) - if (arr[i] === value) arr.splice(i, 1); - else ++i; - return arr; - }, - getParameters: function(array, chars) { - if (typeof array != "object" || !array.length) return "gimme a array, not whatever that was!"; - else if (typeof chars != "string" || !chars) return "What am I supposed to split?? Gimme a string!"; - var parameters = []; - for (var i = 0; i < array.length; i++) { - var parameter = array[i].split(chars)[1]; - if (parameter) parameters.push(parameter); - }; - return parameters; - }, - RPSSystem: function(app, action) { - if (app.client == undefined) { return "RPS failed to attach to client! Create Discord Client first." } else if (app.config == undefined) { return "RPS failed to attach to client: Missing config data."; }; - - if (action == "start") { - if (app.config.system.rotatingStatus.enabled) { - if (app.RPS != undefined && app.RPS != null) { - if (!app.RPS.running) { - app.RPS.running = true; - app.RPS.intervalSystem = setInterval(function() { - app.functions.RPSSystem(app, "update"); - }, (app.config.system.rotatingStatus.timeInSec * 1000)); - app.client.user.setActivity("RPS: RPS v" + app.RPS.version + " for " + app.name + ", READY."); - - setTimeout(function() { - app.client.user.setActivity("RPS: Loaded " + app.config.system.rotatingStatus.statuses.length + " statuses!"); - setTimeout(function() { - app.functions.RPSSystem(app, "update"); - }, 2500); - }, 2500); - } else { - return "RPS already started: call RPSUpdate(client, \"stop\")"; - }; - } else { - return "RPS not ready: call RPSUpdate(client, \"init\")"; - }; - }; - } else if (action == "update") { - if (app.RPS != undefined && app.RPS != null) { - if (app.RPS.running && app.config.system.rotatingStatus.enabled) { - var playingstatusarr = app.config.system.rotatingStatus.statuses; - var playingstatus = playingstatusarr[Math.floor(Math.random() * playingstatusarr.length)]; - - if (playingstatus.includes("svrcount")) playingstatus = "Playing on " + app.client.guilds.cache.size + " servers!"; - else if (playingstatus.includes("ver")) playingstatus = `Playing on ${app.version.toFullString()}.`; - - var playingtype = playingstatus.split(" ")[0]; - - if (playingstatus.startsWith("Listening to")) playingstatus = playingstatus.replace("Listening to ", ""); - else playingstatus = playingstatus.replace(playingtype + " ", ""); - - app.client.user.setActivity(playingstatus, { type: playingtype.toUpperCase() }); - return playingtype + " - " + playingstatus; - } else { - return "RPS not started or disabled: call RPSUpdate(client, \"start\")"; - }; - } else { - return "RPS not ready: call RPSUpdate(client, \"init\")"; - }; - } else if (action == "stop") { - if (app.RPS != undefined && app.RPS != null) { - if (app.RPS.running) { - app.RPS.running = false; - clearInterval(app.RPS.intervalSystem); - } else { - return "RPS not started: call RPSUpdate(client, \"start\")"; - }; - } else { - return "RPS not ready: not even initialized!"; - }; - } else if (action == "init") { - if (app.RPS == undefined || app.RPS == null) { - if (app.config.system.rotatingStatus.enabled) { - app.RPS = { - "running": false, - "lastUpdate": 0, - "lastStatus": "", - "intervalSystem": null, - "version": "1.0.0" - }; - } else { - return "RPS fail to init: RPS has been disabled."; - }; - } else { - return "RPS already started: call RPSUpdate(client, \"destroy\")"; - }; - } else if (action == "destroy") { - if (app.RPS != undefined && app.RPS != null) { - if (app.RPS.running) { - app.functions.RPSSystem(app, "stop"); - }; - - app.RPS = null; - } else { - return "RPS not ready: not even initialized!"; - }; - } else { - return "The RPS SYSTEM is confused on what you told it to do."; - }; - } - }, - - dependencies: [ - { name: "fs", required: true }, - { name: "path", required: true }, - { name: "util", required: true }, - { name: "node-fetch", required: true }, - { name: "discord.js", required: true }, - { name: "sequelize", required: true }, - { name: "canvas", required: false }, - { name: "os", required: true } - ] -} - -module.exports = app; \ No newline at end of file diff --git a/src/app/cfg/system.json b/src/app/cfg/system.json deleted file mode 100644 index e1bf88f..0000000 --- a/src/app/cfg/system.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "footerText": "APPNAME, © Netro Corporation 2018-currYear.", - "commandState": "Enabled", - "defaultPrefix": "t/", - "rotatingStatus": { - "statuses": [ - "Playing with svrcount servers!", - "Playing on Version ver.", - "Playing with awesome people!", - "Playing Team Fortress 2", - "Playing Minecraft", - "Playing osu!", - "Playing ROBLOX", - "Playing Chessmaster 10th Edition", - "Playing VirtualBox - Windows 11 (x64)", - "Playing VirtualBox - FluxOS (x64)", - "Playing Discord", - "Playing Connect Port", - "Playing The Counting Game: To Infinity (And Beyond)!", - "Playing The Counting Game 2: Backwards from Infinity!", - "Playing on the interwebs", - "Playing on the interweebz", - "Playing with vaporwave", - "Playing 日本語テキスト", - "Playing with dreams", - "Playing with my meme collection.", - "Playing with a bomb.", - "Playing ", - "Playing ", - "Playing with a microwave. MMMMMMMMMMMMMMMMMMMMMM BEEP. BEEP. BEEP. BEEP.", - "Playing with the Bootstrap Paradox...", - "Playing with a neko!", - "Playing with and throttling the bandwidth.", - "Playing with the person reading this.", - "Playing the playing of the player in the playing player players' playing status-*crashes*", - "Playing with hashes.", - "Playing with the FBI -- wait that's illegal.", - "Playing in the Danger Zone...", - "Playing -- wait, do people actually read this?", - "Playing with a meme", - "Playing with my existence", - "Playing potato", - "Playing with the void. Should I say more?", - "Playing with your mind.", - "Playing Share the light ソウジャナイト", - "Playing bonk", - "Playing Never Gonna Give You Up", - "Playing Visual Studio Code", - "Playing Visual Studio 2022", - "Playing You are now manually breathing.", - - "Watching anime kill hot toast", - "Watching アニメ", - "Watching my meme librawry.", - "Watching MEMES.", - "Watching everyone ...", - "Watching the entire world.", - "Watching my sentient self.", - "Watching all of your commands coming in", - "Watching time; it's just an illusion.", - "Watching you", - "Watching myself", - - "Listening to Matt's Keyboard ASMR", - "Listening to *wholesome sounds*", - "Listening to Kobaryo - Cartoon Candy", - "Listening to Mitsukiyo - Rolling Beat", - "Listening to Rick Astley - Never Gonna Give You Up", - "Listening to BilliumMoto - Line of Gold", - "Listening to C418 - Cat", - "Listening to C418 - Dog", - "Listening to Street - Song of Truth", - "Listening to ∴ [yueni] - Darling! アブダク∵ Me! (feat. MIMI)", - "Listening to Aice Room, Nor - FUTURE DASH", - "Listening to Flite - We Are One", - "Listening to Akira Complex, Such - Consequence of Nature", - "Listening to Camellia, Akira Complex - Reality Distortion" - - ], - "timeInSec": 180, - "enabled": "true" - }, - "embedColors": { - "aqua": 1752220, - "green": 3066993, - "lime": 65280, - "blue": 3447003, - "purple": 10181046, - "gold": 15844367, - "orange": 15105570, - "red": 15158332, - "yellow": 16312092, - "gray": 9807270, - "navy": 3426654, - "pink": 16580705, - "light_orange": 16098851, - "light_gray": 12370112, - "dark_aqua": 1146986, - "dark_green": 2067276, - "dark_blue": 2123412, - "dark_purple": 7419530, - "dark_gold": 12745742, - "dark_orange": 11027200, - "dark_red": 10038562, - "dark_gray": 9936031, - "darker_gray": 8359053, - "dark_navy": 2899536, - "dark_pink": 12320855 - }, - "emotes": { - "lock": ":lock:", - "wait": ":hourglass:", - - "d_wait": ":arrows_counterclockwise:", - "information": ":information_source:", - "warning": ":warning:", - "error": ":x:", - "question": ":question:", - "success": ":white_check_mark:", - - "osu": { - "osuLogo": "<:osuTCBLogo:675155242421321728>", - - "hit300": "<:hit300:684504839610171492>", - "hit100": "<:hit100:684504839748976762>", - "hit50": "<:hit50:684504839350517775>", - - "rankXH": "<:rankingXH:684505581217906742>", - "rankSH": "<:rankingSH:684505446769229839>", - "rankS": ":regional_indicator_s:", - "rankA": ":regional_indicator_a:", - "rankB": ":regional_indicator_b:", - "rankC": ":regional_indicator_c:", - "rankD": ":regional_indicator_d:" - }, - "discord": { - "online": "<:Online:745093648521101313>", - "idle": "<:Idle:745093647942418486>", - "dnd": "<:DoNotDisturb:745093648282026085>", - "offline": "<:Offline:745093648236019774>" - - }, - - "rickroll": "" - - }, - - "imgAPI": "https://api.netrocorp.net/v1/imgs/", - - - "owners": [ - "yourUserIDHere" - ] -} \ No newline at end of file diff --git a/src/app/cfg/tokendata.json.example b/src/app/cfg/tokendata.json.example deleted file mode 100644 index 7cef554..0000000 --- a/src/app/cfg/tokendata.json.example +++ /dev/null @@ -1,4 +0,0 @@ -{ - "discord": "THE FITNESSGRAM PACER TEST IS A MULTISTAGE AERBOIC CAPACITY TEST THAT PROGRESSIVELY GETS MORE DIFFICULT AS IT CONTINUES.", - "osu": "WRITING'S NOT THAT EASY. GRAMMARLY CAN HELP. THIS SENTENCE IS GRAMMATICALLY CORRECT." -} \ No newline at end of file diff --git a/src/app/cmds/Fun/8ball.js b/src/app/cmds/Fun/8ball.js deleted file mode 100644 index e99116c..0000000 --- a/src/app/cmds/Fun/8ball.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = { - name: "8ball", - description: "The magic 8ball will answer *the* question.", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [" "], - execute: async(app, message, args, userSettings) => { - let question = args.slice(0).join(" "); - - if (!question) return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} ${app.lang.getLine(userSettings.get("language"), "Error")}`, - color: app.config.system.embedColors.red, - description: "You need to ask a question!" - }] - }, 0, true); - - var responses = app.lang.getLine(userSettings.get("language"), "8ballResponse"); - var responsePick = Object.keys(responses)[Math.floor(Math.random() * Object.keys(responses).length)]; - - app.functions.msgHandler(message, { - embeds: [{ - title: ":8ball: 8Ball", - color: app.config.system.embedColors[responses[responsePick]], - description: app.lang.getLine(userSettings.get("language"), "Some magic, please!"), - fields: [ - { name: app.lang.getLine(userSettings.get("language"), "Question"), value: question }, - { name: app.lang.getLine(userSettings.get("language"), "Answer"), value: responsePick } - ] - }] - }, 0, true); - } -}; \ No newline at end of file diff --git a/src/app/cmds/Fun/answer.js b/src/app/cmds/Fun/answer.js deleted file mode 100644 index 9898e38..0000000 --- a/src/app/cmds/Fun/answer.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = { - name: "answer", - description: "The true meaning of life.", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - // SHAME ON YOU FOR LOOKING INTO THIS CODE!!! REVEALS SPOILERS AAAAAAAA! - - var rnd = Math.random(), // Math.random() isn't exactly true random but it works ig. - answer = "42"; // Normal response. - - if (rnd < 0.01) // 0.1% chance of sending this >:) - answer = "Nekos"; // I swear I'm going to get hate for this. Just accept it. - else if (rnd < 0.05) // 0.5% chance of sending this >:) - answer = "Niko"; // OneShot joke ig, because why not. - app.functions.msgHandler(message, answer); // Return response - - } -}; \ No newline at end of file diff --git a/src/app/cmds/Fun/cuddle.js b/src/app/cmds/Fun/cuddle.js deleted file mode 100644 index f37d224..0000000 --- a/src/app/cmds/Fun/cuddle.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - name: "cuddle", - description: "Get close and show even more wholesomeness!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 3, - aliases: [], - syntax: [" <@MentionOrUserID>"], - execute: async(app, message, args) => { - var target = message.mentions.users.first() || args[0], - sender = message.author; - if (!target) return app.functions.msgHandler(message, { content: "You need to tag someone to cuddle!" }, 0, true); - else if (target == sender) return app.functions.msgHandler(message, { content: "There there, here's a personal cuddle. :)" }, 0, true); - - var embed = { - color: app.config.system.embedColors.lime, - description: `**${sender} **cuddles** ${target}**!` - }, - url = (app.config.system.imgAPI + "cuddle"); - - const res = await app.modules["node-fetch"](url); - try { - if (res.status != 200) { - throw new Error(res.status); - } else { - const body = await res.json(); - if (body["url"] != null) - embed["image"] = { url: body["url"] }; - - }; - } catch (Ex) { - app.logger.error("SYS", `Failed fetch of image: ${(url)} | ${Ex.message}`); - }; - return app.functions.msgHandler(message, { - embeds: [embed] - }); - - } -} \ No newline at end of file diff --git a/src/app/cmds/Fun/explode.js b/src/app/cmds/Fun/explode.js deleted file mode 100644 index a8e4bc0..0000000 --- a/src/app/cmds/Fun/explode.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - name: "explode", - description: "MAKE THAT THING GO KABOOM!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 3, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - var target = message.mentions.users.first() || args.slice(0).join(" "), - sender = message.author; - if (!target) return app.functions.msgHandler(message, { content: "You need to add something to explode!!" }, 0, true); - else if (target == sender) return app.functions.msgHandler(message, { content: "Why would you want to send a bomb to yourself???" }, 0, true); - - - var embed = { - author: { name: `Bomb sent by ${app.functions.pomeloHandler(sender)}`, icon_url: sender.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, - color: app.config.system.embedColors.blue, - fields: [ - { name: "BOOM!", value: `${target} has been kaboom'd!` }, - { name: "But, uh...", value: "That explosion made a huge mess..." } - ] - }, - url = (app.config.system.imgAPI + "explosion"); - - const res = await app.modules["node-fetch"](url); - try { - if (res.status != 200) { - throw new Error(res.status); - } else { - const body = await res.json(); - if (body["url"] != null) - embed["image"] = { url: body["url"] }; - }; - } catch (Ex) { - app.logger.error("SYS", `Failed fetch of image: ${(url)} | ${Ex.message}`); - }; - return app.functions.msgHandler(message, { - embeds: [embed] - }); - } -} \ No newline at end of file diff --git a/src/app/cmds/Fun/hug.js b/src/app/cmds/Fun/hug.js deleted file mode 100644 index 3055845..0000000 --- a/src/app/cmds/Fun/hug.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - name: "hug", - description: "Hug someone and show wholesomeness!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 3, - aliases: [], - syntax: [" <@MentionOrUserID>"], - execute: async(app, message, args) => { - var target = message.mentions.users.first() || args[0], - sender = message.author; - if (!target) return app.functions.msgHandler(message, { content: "You need to tag someone to hug!" }, 0, true); - else if (target == sender) return app.functions.msgHandler(message, { content: "There there, here's a personal hug. :)" }, 0, true); - - var embed = { - color: app.config.system.embedColors.blue, - description: `**${sender} **hugs** ${target}**!` - }, - url = (app.config.system.imgAPI + "hug"); - - const res = await app.modules["node-fetch"](url); - try { - if (res.status != 200) { - throw new Error(res.status); - } else { - const body = await res.json(); - if (body["url"] != null) - embed["image"] = { url: body["url"] }; - }; - } catch (Ex) { - app.logger.error("SYS", `Failed fetch of image: ${(url)} | ${Ex.message}`); - }; - return app.functions.msgHandler(message, { - embeds: [embed] - }); - } -} \ No newline at end of file diff --git a/src/app/cmds/Fun/kiss.js b/src/app/cmds/Fun/kiss.js deleted file mode 100644 index 6af088a..0000000 --- a/src/app/cmds/Fun/kiss.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - name: "kiss", - description: "Smooooch! Awh, what wholesomeness!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 3, - aliases: [], - syntax: [" <@MentionOrUserID>"], - execute: async(app, message, args) => { - var target = message.mentions.users.first() || args[0], - sender = message.author; - if (!target) return app.functions.msgHandler(message, { content: "You need to tag someone to kiss!" }, 0, true); - else if (target == sender) return app.functions.msgHandler(message, { content: "There there, here's a personal kiss. :)" }, 0, true); - - var embed = { - color: app.config.system.embedColors.red, - description: `**${sender} **kisses** ${target}**!` - }, - url = (app.config.system.imgAPI + "kiss"); - - const res = await app.modules["node-fetch"](url); - try { - if (res.status != 200) { - throw new Error(res.status); - } else { - const body = await res.json(); - if (body["url"] != null) - embed["image"] = { url: body["url"] }; - }; - } catch (Ex) { - app.logger.error("SYS", `Failed fetch of image: ${(url)} | ${Ex.message}`); - }; - return app.functions.msgHandler(message, { - embeds: [embed] - }); - } -} \ No newline at end of file diff --git a/src/app/cmds/Fun/pat.js b/src/app/cmds/Fun/pat.js deleted file mode 100644 index db5cb30..0000000 --- a/src/app/cmds/Fun/pat.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - name: "pat", - description: "There, there! Wholesome pats for everyone!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 3, - aliases: [], - syntax: [" <@MentionOrUserID>"], - execute: async(app, message, args) => { - var target = message.mentions.users.first() || args[0], - sender = message.author; - if (!target) return app.functions.msgHandler(message, { content: "You need to tag someone to pat!" }, 0, true); - else if (target == sender) return app.functions.msgHandler(message, { content: "There there, here's a personal pat. :)" }, 0, true); - - var embed = { - color: app.config.system.embedColors.purple, - description: `**${sender} **pats** ${target}**!` - }, - url = (app.config.system.imgAPI + "pat"); - - const res = await app.modules["node-fetch"](url); - try { - if (res.status != 200) { - throw new Error(res.status); - } else { - const body = await res.json(); - if (body["url"] != null) - embed["image"] = { url: body["url"] }; - }; - } catch (Ex) { - app.logger.error("SYS", `Failed fetch of image: ${(url)} | ${Ex.message}`); - }; - return app.functions.msgHandler(message, { - embeds: [embed] - }); - } -} \ No newline at end of file diff --git a/src/app/cmds/Fun/uwu.js b/src/app/cmds/Fun/uwu.js deleted file mode 100644 index 08c80dc..0000000 --- a/src/app/cmds/Fun/uwu.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - name: "uwu", - description: "UwUify some messages... for some reason..?", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 10, - aliases: ["uwuify"], - syntax: [], - execute: async(app, message, args) => { - if (!args[0]) return app.functions.msgHandler(message, "uwu"); - - function UwUify(msg) { - msg = msg.toLowerCase(); // Convert the message to lowercase for now - const flipList = "ay:ey,ck:cc,ing:in,or:aw,ou:ow,ro:wo,tha:da,the:de,thi:di,wh:w,wr:w,you:yu,mn:m,mb:m,l:w,r:w".split(",").map(i => i.split(":")) - for (let pair of flipList) - msg = msg.split(pair[0]).join(pair[1]); - return msg + ((!msg.endsWith("uwu")) ? " uwu" : ""); - }; - - for (var i = 0; i < args.length; i++) { - if (args[i].includes("<@&") && args[i].includes(">")) - args[i] = message.guild.roles.cache.get(args[i].replace(/[<@&>]/g, '')).name; - }; - app.functions.msgHandler(message, UwUify(args.join(" ")) || "Something went wrong :("); - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/about.js b/src/app/cmds/General/about.js deleted file mode 100644 index 7100aca..0000000 --- a/src/app/cmds/General/about.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - name: "about", - description: `Get info about me!`, - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: ["botinfo", "aboutme"], - syntax: [], - execute: async(app, message, args, userSettings) => { - const os = app.modules["os"]; // Welcome to os(u)~! - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.information} ${app.lang.getLine(userSettings.get("language"), "All about your favorite bot")}, **${app.client.user.tag}**!`, - color: app.config.system.embedColors.blue, - thumbnail: { url: app.client.user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, - fields: [ - { name: app.lang.getLine(userSettings.get("language"), "Bot Information"), value: "** **" }, - { name: app.lang.getLine(userSettings.get("language"), "User Tag"), value: `${app.client.user.tag}`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "User ID"), value: `${app.client.user.id}`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Bot Version"), value: app.version.toFullString(), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Bot Uptime"), value: app.functions.TStoHR(app.client.uptime), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Emote Count"), value: `${Object.keys(app.config.system.emotes).length} total`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Embed Color Count"), value: `${Object.keys(app.config.system.embedColors).length} total`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "RPS Count"), value: `${Object.keys(app.config.system.rotatingStatus.statuses).length} total`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Bot Memory Usage"), value: (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " MiB", inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Servers I'm In"), value: app.client.guilds.cache.size + " total", inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Host System Information"), value: "** **" }, - { name: app.lang.getLine(userSettings.get("language"), "NodeJS Version"), value: `${process.version}`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "NodeJS Uptime"), value: app.functions.TStoHR(process.uptime() * 1000), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "NodeJS Execution Path"), value: `${process.execPath}`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Process PID"), value: `${process.pid}`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "System Platform"), value: `${process.platform}`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), ((process.platform == "linux") ? "Kernel Version" : "System Version")), value: os.version(), inline: true } - // I'd like to have this show the current CPU usage, I'm open to ideas on how to get it to work. - IDeletedSystem64 - ] - }] - }); - } -} \ No newline at end of file diff --git a/src/app/cmds/General/afk.js b/src/app/cmds/General/afk.js deleted file mode 100644 index 392768e..0000000 --- a/src/app/cmds/General/afk.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - name: "afk", - description: "See ya next time!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 10, - aliases: [], - syntax: [], - execute: async(app, message, args, userSettings) => { - if (!userSettings) return app.functions.msgHandler(message, { embeds: [{ color: app.config.system.embedColors.red, description: `${app.config.system.emotes.error} **Could not set to AFK due to missing User Settings.**` }] }) - - var reason = args.slice(0).join(" ") || ""; - var AFKSettings = { - "timestamp": new Date().getTime(), - "reason": reason ? reason.replace(/[<@&>]/g, '') : null, // hotfix because apparently user & role pings are possible. - "mentions": 0 - }; - - const affectedRows = await app.DBs.userSettings.update({ AFKSettings: JSON.stringify(AFKSettings, null, "\t") }, { where: { userID: message.author.id } }); - if (affectedRows.length > 0) { - await app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "You're now AFK")}${((reason != "" ? ": " + reason: "!"))}`, - color: app.config.system.embedColors.lime - }], - author: message.author - }, 0, true, (async msg => { - setTimeout(function() { msg.delete() }, 6000); - })); - } else { - return app.functions.msgHandler(message, { embeds: [{ color: app.config.system.embedColors.red, description: `${app.config.system.emotes.error} **${app.lang.getLine(userSettings.get("language"), "Could not set to AFK due to Database Error!")}**` }] }) - }; - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/help.js b/src/app/cmds/General/help.js deleted file mode 100644 index 1b65d30..0000000 --- a/src/app/cmds/General/help.js +++ /dev/null @@ -1,106 +0,0 @@ -module.exports = { - name: "help", - description: "I need somebody (Help!) Not just anybody (Help!) From a command to all commands (Help!)", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: ["halp", "helpme"], - syntax: [" [commandName/commandAlias]"], - execute: async(app, message, args, userSettings) => { - - // Begin the functions for help. - - function allHelp(temp) { - var cmds = {}, - fields = []; - app.commands.forEach(cmd => { - if (app.functions.hasPermissions(message, cmd) || !cmd.hidden) { - var category = cmd.category || app.lang.getLine(userSettings.get("language"), "Uncategorized"); - if (cmds[category] == undefined) cmds[category] = []; - cmds[category].push("`" + cmd.name + "`"); - }; - }); - for (var i = 0; i < Object.keys(cmds).length; i++) { - var category = Object.keys(cmds)[i]; - fields.push({ name: category, value: cmds[category].join(", ") }); - }; - - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.information} ${app.name} ${app.lang.getLine(userSettings.get("language"), "Help")}`, - color: app.config.system.embedColors.blue, - description: ((temp) ? "The command or category '" + temp + "' is invalid." : `Yeaaah we got it! (Help! Help!)`), - fields: fields - }] - }, 0, true); - }; - - function categoryHelp(categoryName) { - var commands = [], - fields = []; - app.commands.forEach(cmd => { - var category = cmd.category || app.lang.getLine(userSettings.get("language"), "Uncategorized"); - if (category == categoryName && app.functions.hasPermissions(message, cmd)) - commands.push("`" + cmd.name + "`"); - }); - if (commands.length < 1) { return app.functions.missingPerms(message, 0, "view help on " + categoryName); }; - - fields.push({ name: categoryName, value: commands.join(", ") }); - - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.information} ${app.name} ${app.lang.getLine(userSettings.get("language"), "Help")}`, - color: app.config.system.embedColors.pink, - description: `Showing commands for the '${categoryName}' category.`, - fields: fields - }] - }, 0, true); - }; - - function commandHelp(commandName) { - var command = app.commands.get(commandName) || app.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); - - if (!app.functions.hasPermissions(message, command)) { return app.functions.missingPerms(message, 0, "view help on " + commandName, command); }; - var fields = [ - { name: app.lang.getLine(userSettings.get("language"), "Category"), value: command.category || app.lang.getLine(userSettings.get("language"), "Uncategorized"), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Server Only?"), value: (command.guildOnly ? "Yes" : "No"), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Permissions"), value: ("`" + command.permissions.join("`, `") + "`"), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Cooldown"), value: `${command.cooldown}s`, inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Aliases"), value: ((command.aliases.length > 0) ? "`" + command.aliases.join("`\n`") + "`" : "NONE"), inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Syntax"), value: ("`" + commandName + command.syntax.join("`\n`" + commandName) + "`"), inline: true } - ] - if (/(<|>|\[|\])/i.test(command.syntax)) - fields.push({ name: app.lang.getLine(userSettings.get("language"), "Heads up!"), value: "`<>` = " + app.lang.getLine(userSettings.get("language"), "Required") + "\n`[]` = " + app.lang.getLine(userSettings.get("language"), "Optional") }); - - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.information} ${app.lang.getLine(userSettings.get("language"), "Help for")} ${commandName}`, - color: app.config.system.embedColors.lime, - description: command.description, - fields: fields - }] - }, 0, true); - - }; - - // End of the functions for help. - - var temp = args[0]; // temp is just a placeholder. Functions will handle what it is after detection. - if (temp) { - var isCommand = app.commands.get(temp) || app.commands.find(cmd => cmd.aliases && cmd.aliases.includes(temp)); - if (!isCommand) { - var isCategory = app.commands.find(cmd => cmd.category.toLowerCase() == temp.toLowerCase()); - if (!isCategory) - allHelp(temp); // Send all help and tell it's not valid. - else - categoryHelp(temp); // Send category help - } else - commandHelp(temp); // Send command help - } else - allHelp(); // Send all help. - - - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/invite.js b/src/app/cmds/General/invite.js deleted file mode 100644 index 020ca4e..0000000 --- a/src/app/cmds/General/invite.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - name: "invite", - description: "Add me to yo server!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - return app.functions.msgHandler(message, { - embeds: [{ - title: app.config.system.emotes.information + " Invite", - color: app.config.system.embedColors.green, - fields: [ - { name: "OwO? New server?!?", value: `Aw heck yeah!! Add me and become one of the ${app.client.guilds.cache.size} servers using TheCodingBot!` }, - { name: "Add me to dat server!", value: `Add me via [Discord](https://discord.com/oauth2/authorize?scope=bot&client_id=${app.client.user.id}&permissions=1644971945207)` }, - { name: "...is something wrong..?", value: "Join the [Netro Corp Discord](https://discord.gg/HdKeWtV) for support, and much more!" }, - ]}] - }) -}} diff --git a/src/app/cmds/General/inviteinfo.js b/src/app/cmds/General/inviteinfo.js deleted file mode 100644 index fcef866..0000000 --- a/src/app/cmds/General/inviteinfo.js +++ /dev/null @@ -1,86 +0,0 @@ -module.exports = { - name: "inviteinfo", - description: "What the invite doin'?", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 5, - aliases: [], - syntax: [" "], - execute: async(app, message, args) => { - var oInvite = args[0]; - if (!oInvite) return app.functions.msgHandler(message, { content: "You need to enter an invite!" }, 0, true); - var invite = oInvite.replace(/[\/]/g, '').replace("https:", "").replace("http:", "").replace("discord.gg", ""); - - var url = ("https://discord.com/api/v9/invites/" + invite + "?with_counts=true"); - - const res = await app.modules["node-fetch"](url); - try { - if (res.status != 200 && res.status != 404) { - throw new Error(res.status); - } else { - var invite = await res.json(), - embed = {}, - splashData = null; - if (invite["message"]) embed = { - description: `${app.config.system.emotes.error} **${invite["message"]}**`, - color: app.config.system.embedColors.red - } - else { - embed = { - title: `${app.config.system.emotes.information} **${invite.guild.name} (${invite.guild.id})**`, - color: app.config.system.embedColors.blue, - fields: [ - { name: "Channel", value: `#${invite.channel.name} (${invite.channel.id}) | <#${invite.channel.id}>` }, - { name: "Members", value: "About " + invite["approximate_member_count"] }, - { name: "Features", value: ((invite.guild.features.length > 0) ? "`" + invite.guild.features.join("`, `") + "`" : "No special features :(") }, - { name: "Boosts", value: invite.guild["premium_subscription_count"].toString(), inline: true } - ] - }; - if (invite.guild.description != null) embed.description = invite.guild.description; - if (invite.guild["vanity_url_code"]) embed.fields.push({ name: "Vanity URL", value: "https://discord.gg/" + invite.guild["vanity_url_code"], inline: true }); - if (invite["expires_at"]) embed.fields.push({ name: "Expires in", value: app.functions.TStoHR((new Date(invite["expires_at"]).getTime()) - new Date().getTime()), inline: true }); // expires_at Time minus the current Time - if (invite.inviter) { - var user = await app.client.users.cache.get(invite.inviter.id) || await app.client.users.fetch(invite.inviter.id, true); - embed["author"] = { name: `Invite Created by ${app.functions.pomeloHandler(user)} (${user.id})`, icon_url: user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }; - }; - - if (invite.guild.icon != null) - embed.thumbnail = { url: `https://cdn.discordapp.com/icons/${invite.guild.id}/${invite.guild.icon}.${app.functions.isAnimated(invite.guild.icon) ? "gif": "png"}?size=1024` }; - if (invite.guild.splash != null) - splashData = `https://cdn.discordapp.com/splashes/${invite.guild.id}/${invite.guild.splash}.${app.functions.isAnimated(invite.guild.splash) ? "gif": "png"}?size=600`; - if (invite.guild.banner != null) - embed["image"] = { url: `https://cdn.discordapp.com/banners/${invite.guild.id}/${invite.guild.banner}.${app.functions.isAnimated(invite.guild.banner) ? "gif": "png"}?size=512` }; - }; - - var options = { embeds: [embed] }; - if (splashData != null) { - const { MessageAttachment } = app.modules["discord.js"]; - options.files = [new MessageAttachment(splashData)]; - }; - - app.functions.msgHandler(message, options); - }; - } catch (Ex) { - app.logger.error("SYS", `Failed fetch of invite: ${oInvite} | ${Ex.message}`); - var messageData = Ex.message || "Unknown Message"; - - messages = { - "403": "The resource is blocked.", - "500": "Server is experiencing downtime. Please check later.", - "502": "Server is experiencing downtime. Please check later.", - "503": "Server is experiencing downtime. Please check later.", - "520": "Server is experiencing downtime. Please check later." - }; - messageData = (messages[messageData]) ? messages[message] : messageData; - return app.functions.msgHandler(message, { - embeds: [{ - description: `${app.config.system.emotes.error} **${messageData}**`, - color: app.config.system.embedColors.red, - }] - }); - }; - - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/ping.js b/src/app/cmds/General/ping.js deleted file mode 100644 index 97823cd..0000000 --- a/src/app/cmds/General/ping.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - name: "ping", - description: "Check bot latency!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args, userSettings) => { - app.functions.msgHandler(message, `${app.config.system.emotes.wait} :ping_pong: **${app.lang.getLine(userSettings.get("language"), "Pinging...")}**`, 0, true, (msg => { - app.functions.msgHandler(msg, { - content: "** **", - embeds: [{ - title: `${app.config.system.emotes.information} **${app.lang.getLine(userSettings.get("language"), "Latency Test")}** `, - color: app.config.system.embedColors.blue, - fields: [ - { name: app.lang.getLine(userSettings.get("language"), "API"), value: app.client.ws.ping + "ms", inline: true }, - { name: app.lang.getLine(userSettings.get("language"), "Messages"), value: ((msg.createdTimestamp - message.createdTimestamp) + "ms"), inline: true } - ] - }] - }, 1, true) - })); - } -} \ No newline at end of file diff --git a/src/app/cmds/General/profile.js b/src/app/cmds/General/profile.js deleted file mode 100644 index c8af0ff..0000000 --- a/src/app/cmds/General/profile.js +++ /dev/null @@ -1,330 +0,0 @@ -module.exports = { - name: "profile", - description: "It's all about you - update, opt-out, delete, and more on your profile!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - - const { MessageActionRow, MessageButton, MessageSelectMenu } = app.modules["discord.js"]; - - var userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }); - - app.functions.msgHandler(message, { - embeds: [{ - title: app.config.system.emotes.wait + " **Loading**", - color: app.config.system.embedColors.blue - }] - }, 0, true, (async msg => { - try { - if (!userSettings) throw new Error("No profile in database"); // How did they even do this command? - app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Welcome, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.information} It's all about you!`, - color: app.config.system.embedColors.lime, - fields: [ - { name: "Your User Information", value: "** **" }, - { name: "Language", value: userSettings.get("language") || "English", inline: true }, - { name: "Prefix", value: userSettings.get("prefix") || app.config.system.defaultPrefix || "Error", inline: true }, - { name: "Your User Statistics", value: "** **" }, - { name: "Total Commands Executed", value: userSettings.get("executedCommands").toString() || "0", inline: true }, - { name: "Total Commands Errored", value: userSettings.get("errorCommands").toString() || "0", inline: true } - ] - }], - components: [new MessageActionRow() - .addComponents( - new MessageButton() - .setCustomId("cfgsettings") - .setLabel("Change Settings") - .setStyle("SECONDARY"), - new MessageButton() - .setCustomId(((userSettings.get("optedOut")) ? "optin" : "optout")) - .setLabel("Opt-" + ((userSettings.get("optedOut")) ? "in to" : "out of") + " analytics") - .setStyle("SECONDARY"), - new MessageButton() - .setCustomId("delete") - .setLabel("Delete profile") - .setStyle("DANGER") - ) - ] - }, 1, true, (async msg => { - await collectmenu1(msg); - })); - } catch (Ex) { - app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Something happened, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.information} It's all about you!`, - color: app.config.system.embedColors.red, - description: `Sadly, we ran into an error while handling your profile. Here's what we know: ${Ex.message}` - }] - }) - } - })); - - - - // FUNCTIONS - async function errorDB(i, title) { - await i.update({ - embeds: [{ - author: { name: `Eep! Sorry about that, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.warning} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - ${title}`, - color: app.config.system.embedColors.orange, - description: "Could not save your acknowledgement. Please try again.", - }], - components: [] - }).catch(err => {}); - }; - - async function collectmenu1(msg) { - const filter = i => { return ["cfgsettings", "optout", "optin", "delete"].includes(i.customId) && i.user.id === message.author.id }; - - const collector = message.channel.createMessageComponentCollector({ filter, max: 1, dispose: true, time: 10000, errors: ["time"] }); - - collector.on("collect", async i => { - if (i.customId === "cfgsettings") { - i.deferUpdate(); - await app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Change change change, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.question} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - ${app.lang.getLine(userSettings.get("language"), "Change Settings")}`, - color: app.config.system.embedColors.purple, - description: "Alright - from the dropdown - what do you wish to change?" - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Nothing selected") - .addOptions([{ - label: "Language", - description: "Change your language from a list of supported languages!", - value: "language", - }, - { - label: "Prefix", - description: `Maybe you don't want '${userSettings.get("prefix")}' anymore.`, - value: "prefix", - }, - ]), - ) - ] - }, 1, true, (async menumsg => { - await collectmenu2(menumsg); - })); - } else if (i.customId === "optout" || i.customId === "optin") { - var type = i.customId === "optout" ? "Opt-Out" : "Opt-In"; - const affectedRows = await app.DBs.userSettings.update({ optedOut: (i.customId === "optout") }, { where: { userID: message.author.id } }); - if (affectedRows > 0) { - await i.update({ - embeds: [{ - author: { name: `At your request, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - ${type}`, - color: app.config.system.embedColors.lime, - description: `${app.lang.getLine(userSettings.get("language"), "Here's what just happened")}: You successfully ${((i.customId === "optout") ? "dis" : "en")}abled analytics.`, - }], - components: [] - }); - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} opted out.`); - } else { - errorDB(i, type); - }; - } else if (i.customId === "delete") { - const affectedRows = await app.functions.DB.deleteUser(message.author.id); - if (affectedRows > 0) { - await i.update({ - embeds: [{ - author: { name: `We're sad to see you go, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - - title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - Delete Account`, - color: app.config.system.embedColors.lime, - description: `${app.lang.getLine(userSettings.get("language"), "Here's what just happened")}: You successfully deleted your account.`, - }], - components: [] - }); - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} deleted their account.`); - } else { - errorDB(i, "Delete Account"); - }; - - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - - async function collectmenu2(msg) { - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, max: 1, time: 30000, errors: ["time"] }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - i.deferUpdate(); - for (var v in i.values) { - var val = i.values[v]; - if (val === "language") { - var languages = [], - validLangCodes = []; - - if (app.config.langs) { - for (var lp = 0; lp < Object.keys(app.config.langs).length; lp++) { - var lang = app.config.langs[Object.keys(app.config.langs)[lp]]; - await languages.push({ - label: lang.metadata.full_name, - description: lang.metadata.description, - value: lang.metadata.langCode, - }); - validLangCodes.push(lang.metadata.langCode); - - }; - } else { - await languages.push({ - label: "English (en_US)", - description: "English - United States", - value: "en_US", - }); - validLangCodes.push("en_US"); - - }; - - await app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Change change change, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.question} ${app.lang.getLine(userSettings.get("language"), "User Settings")} -${app.lang.getLine(userSettings.get("language"), "Change Language")}`, - color: app.config.system.embedColors.purple, - description: "Neat, choose from the dropdown your new language!" - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Nothing selected") - .addOptions(languages), - ) - ] - }, 1, true, (async menumsg => { - await collectLanguage(menumsg, validLangCodes); - - })); - } else if (val == "prefix") { - await app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Change change change, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.question} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - ${app.lang.getLine(userSettings.get("language"), "Change Prefix")}`, - color: app.config.system.embedColors.purple, - description: "Great! What should that new prefix be?\n*NOTE: If you enter a space, it will only take the first part before the space). Example: `a prefix` -> `a`*" - }], - components: [] - }, 1, true, (async menumsg => { - await collectPrefix(menumsg); - - })); - }; - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - - async function collectLanguage(msg, validLangCodes) { - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, max: 1, time: 30000, errors: ["time"] }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var clp = 0; clp < msg.components[0]["components"][0]["options"].length; clp++) { - var val = msg.components[0]["components"][0]["options"][clp]; - - if (i.values[0] == val["value"] && validLangCodes.includes(i.values[0])) { - var newLang = val["label"] - const affectedRows = await app.DBs.userSettings.update({ language: newLang }, { where: { userID: message.author.id } }); - - if (affectedRows > 0) { - await i.update({ - embeds: [{ - author: { name: `Whoop whoop, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - - title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - ${app.lang.getLine(userSettings.get("language"), "Change Language")}`, - color: app.config.system.embedColors.lime, - description: `${app.lang.getLine(userSettings.get("language"), "Here's what just happened")}: You successfully changed your language to \`${newLang}\`.` - }], - components: [] - }); - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} changed their language.`); - } else { - errorDB(i, "Change Language"); - }; - }; - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - - async function collectPrefix(msg) { - const filter = m => { return m.author.id === message.author.id }; - const collector = message.channel.createMessageCollector({ filter, max: 1, time: 30000, errors: ["time"] }); - - collector.on("collect", async m => { - if (m.content != userSettings.get("prefix")) { - var newPrefix = m.content.split(" ")[0]; - const affectedRows = await app.DBs.userSettings.update({ prefix: newPrefix }, { where: { userID: message.author.id } }); - - if (affectedRows > 0) { - await app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Whoop whoop, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - - title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "User Settings")} - ${app.lang.getLine(userSettings.get("language"), "Change Prefix")}`, - color: app.config.system.embedColors.lime, - description: `${app.lang.getLine(userSettings.get("language"), "Here's what just happened")}: You successfully changed your prefix to \`${newPrefix}\`.` - }], - components: [] - }, 1, true); - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} changed their prefix.`); - } else { - errorDB(i, "Change Prefix"); - }; - } - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/serverinfo.js b/src/app/cmds/General/serverinfo.js deleted file mode 100644 index 5ce3517..0000000 --- a/src/app/cmds/General/serverinfo.js +++ /dev/null @@ -1,80 +0,0 @@ -module.exports = { - name: "serverinfo", - description: "Extra! Extra! Info on the server!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 5, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - try { - var guild = message.guild, - splashData = null; - - guild.acronym = guild.name.match(/\b(\w)/g).join(""); // Cool thing - - var members = { - "total": guild.members.cache.size - }; - members["users"] = guild.members.cache.filter(member => !member.user.bot).size; - members["bots"] = members.total - members.users; - - - var embed = { - title: `${app.config.system.emotes.information} **${guild.name}**`, - color: app.config.system.embedColors.blue, - fields: [ - { name: "ID", value: guild.id, inline: true }, - { name: "Acronym", value: guild.acronym, inline: true }, - { name: "Boosts", value: guild.premiumSubscriptionCount.toString() || "N/A", inline: true }, - { name: "Preferred Locale", value: guild.preferredLocale, inline: true }, - { name: "Owner", value: `<@${guild.ownerId}> (${guild.ownerId})`, inline: true }, - { name: "Features", value: ((guild.features.length > 0) ? "`" + guild.features.join("`, `") + "`" : "No special features :(") }, - - { name: "Channels", value: guild.channels.cache.size.toString() || "N/A", inline: true }, - { name: "Roles", value: guild.roles.cache.size.toString() || "N/A", inline: true }, - { name: "Bans", value: guild.bans.cache.size.toString() || "N/A", inline: true }, - - { name: "Invites", value: guild.invites.cache.size.toString() || "N/A", inline: true }, - { name: "Emojis", value: guild.emojis.cache.size.toString() || "N/A", inline: true }, - { name: "Stickers", value: guild.stickers.cache.size.toString() || "N/A", inline: true }, - - { name: "Total Members", value: members.total.toString() || "N/A", inline: true }, - { name: "Users", value: members.users.toString() || "N/A", inline: true }, - { name: "Bots", value: members.bots.toString() || "N/A", inline: true } - ] - }; - - if (guild.description != null) embed.description = guild.description; - if (guild.vanityURLCode) embed.fields.push({ name: "Vanity URL", value: "https://discord.gg/" + guild["vanityURLCode"], inline: true }, { name: "Vanity Uses", value: (guild.vanityURLUses != null) ? guild.vanityURLUses.toString() : "None", inline: true }); - - embed.fields.push({ "name": "Server Created", "value": new Date(guild.createdTimestamp).toString() || "N/A" }, { "name": `${app.name} Joined`, "value": new Date(guild.joinedTimestamp).toString() || "N/A" }); - - if (guild.icon != null) - embed.thumbnail = { url: `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.${app.functions.isAnimated(guild.icon) ? "gif": "png"}?size=1024` }; - if (guild.splash != null) - splashData = `https://cdn.discordapp.com/splashes/${guild.id}/${guild.splash}.${app.functions.isAnimated(guild.splash) ? "gif": "png"}?size=600`; - if (guild.banner != null) - embed["image"] = { url: `https://cdn.discordapp.com/banners/${guild.id}/${guild.banner}.${app.functions.isAnimated(guild.banner) ? "gif": "png"}?size=512` }; - - var options = { embeds: [embed] }; - if (splashData != null) { - const { MessageAttachment } = app.modules["discord.js"]; - options.files = [new MessageAttachment(splashData)]; - }; - - app.functions.msgHandler(message, options); - - } catch (Ex) { - console.log(Ex); - return app.functions.msgHandler(message, { - embeds: [{ - description: `${app.config.system.emotes.error} **${Ex.message}**`, - color: app.config.system.embedColors.red, - }] - }); - }; - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/source.js b/src/app/cmds/General/source.js deleted file mode 100644 index 43b9983..0000000 --- a/src/app/cmds/General/source.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - name: "source", - description: "A link to the source for the bot!", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - return app.functions.msgHandler(message, { - embeds: [{ - title: app.config.system.emotes.information + " Source", - color: app.config.system.embedColors.green, - fields: [ - { name: "OwO? Source Code?!?", value: `The source code for TheCodingBot can be found [here](https://codingbot.gg/source)!` } - ]}] - }) -}} diff --git a/src/app/cmds/General/test.js b/src/app/cmds/General/test.js deleted file mode 100644 index c7cc57d..0000000 --- a/src/app/cmds/General/test.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - name: "test", - description: "Testing testing, is this thing on?", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - app.functions.msgHandler(message, { content: "Hello!" }, 0, true); - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/userinfo.js b/src/app/cmds/General/userinfo.js deleted file mode 100644 index 4155880..0000000 --- a/src/app/cmds/General/userinfo.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - name: "userinfo", - description: "User data, need info on da user...", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 5, - aliases: [], - syntax: [" <@MentionOrUserID>"], - execute: async(app, message, args) => { - async function userInfo(userID) { - var states = { - "offline": app.config.system.emotes.discord.offline + " **Offline**", - "idle": app.config.system.emotes.discord.idle + " **Idle**", - "dnd": app.config.system.emotes.discord.dnd + " **Do Not Disturb**", - "online": app.config.system.emotes.discord.online + " **Online**" - }; - - function getJoinPosition(ID) { - var memberJoins = message.guild.members.cache.map(member => member).sort((a, b) => a.joinedAt - b.joinedAt); - for (var i = 0; i < memberJoins.length; i++) { if (memberJoins[i].id == ID) return i; }; - }; - - try { - var user = await app.client.api.users(userID).get(); - if (!user) - throw new Error("That user does not exist."); - - var embed = { - title: `${app.config.system.emotes.information} **${app.functions.pomeloHandler(user)} ${(user.bot ? "*[BOT]*" : "")}**`, - color: (user["accent_color"]) ? user["accent_color"] : app.config.system.embedColors.blue, - fields: [ - { name: "Username", value: user.username, inline: true }, - - ] - }; - - // PATCH 2023-10-13 - if (user.discriminator != "0") { - embed.fields.push( - { name: "Discriminator", value: user.discriminator, inline: true }, - { name: "Full Tag", value: app.functions.pomeloHandler(user), inline: true }, - ); - }; - embed.fields.push({ name: "User ID", value: user.id, inline: false }); - // END PATCH 2023-10-13 - - if (user.avatar != null) - embed["thumbnail"] = { url: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${app.functions.isAnimated(user.avatar) ? "gif": "png"}?size=1024` }; - else - embed["thumbnail"] = { url: `https://cdn.discordapp.com/embed/avatars/${user.discriminator % 5}.png?size=1024` }; - - - if (user.banner != null) - embed["image"] = { url: `https://cdn.discordapp.com/banners/${user.id}/${user.banner}.${app.functions.isAnimated(user.banner) ? "gif": "png"}?size=600` }; - - if (message.guild) { - var serverUser = await message.guild.members.cache.get(userID) || await message.guild.members.fetch(userID, true); - if (serverUser.roles) { - var roles = serverUser.roles.cache.map(role => role).filter(role => role.id != message.guild.id).sort((a, b) => a.comparePositionTo(b)).map(role => role); - embed.fields.push({ name: `Roles (**${roles.length}**)`, value: roles.length > 0 ? roles.join(" ") : "No roles :(", inline: true }) - }; - if (serverUser.presence) embed.description = states[serverUser.presence.status]; - if (serverUser.nickname) - embed.fields.push({ name: `Nickname`, value: serverUser.nickname, inline: true }); - embed.fields.push({ name: "Join Position", value: (getJoinPosition(userID) + 1).toString(), inline: true }, { name: "Joined", value: (app.functions.TStoHR(new Date().getTime() - new Date(serverUser.joinedTimestamp).getTime()) + " ago"), inline: true }) - }; - - app.functions.msgHandler(message, { embeds: [embed] }); - } catch (Ex) { - return app.functions.msgHandler(message, { - embeds: [{ - description: `${app.config.system.emotes.error} **${Ex.message}**`, - color: app.config.system.embedColors.red, - }] - }); - }; - }; - if (!args[0]) return userInfo(message.author.id); - else return userInfo(app.functions.getID(args[0])); - - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/verify.js b/src/app/cmds/General/verify.js deleted file mode 100644 index b218bc5..0000000 --- a/src/app/cmds/General/verify.js +++ /dev/null @@ -1,243 +0,0 @@ -module.exports = { - name: "verify", - description: "Verify yo self!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 10, - aliases: ["letmein"], - syntax: [" <--channel:#channelORID> <--role:<@&role>ORID>"], - execute: async(app, message, args) => { - if (args[0] == "setup") { - // Setting up a server for verification :O - - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.wait} Preparing`, - color: app.config.system.embedColors.blue, - description: "Hello! We're loading the verification set up. Please wait." - }], - author: message.author - }, 0, true, (async msg => { - if (message.member.permissions.has("MANAGE_GUILD")) { - // Permission checks out, let's-a-go! - - var parameters = await app.functions.getParameters(args.slice(0), "--"); - if (parameters.length < 2 || - !app.functions.doesArrayStartsWith("channel:", parameters) || - !app.functions.doesArrayStartsWith("role:", parameters) - ) return app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.error} Missing Parameters`, - color: app.config.system.embedColors.red, - description: "You're missing `--channel:#channelORID` and/or `--role:<@&role>ORID`.\n" + ((parameters.length > 0) ? "Got parameters: `" + parameters.join("`, `") + "`" : "Got no parameters!") - }], - author: message.author - }, 1, true); - try { - var sParameters = {}; - for (var i = 0; i < parameters.length; i++) { - var sTemp = parameters[i].split(":"); - sParameters[sTemp[0]] = app.functions.getID(sTemp[1]) || sTemp[1]; - }; - - var channel = message.guild.channels.cache.get(sParameters["channel"]); - if (!channel) throw new Error("UNKNOWN_CHANNEL"); - var role = message.guild.roles.cache.get(sParameters["role"]); - if (!role) throw new Error("UNKNOWN_ROLE"); - - if (channel.type != "GUILD_TEXT") throw new Error("CHANNEL_NOT_PERMITTED") - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.wait} Configuring Verification...`, - color: app.config.system.embedColors.blue, - description: `Setting up verification with the following information:\n - **Role to give**: ${role.name}\n - **Channel to verify in**: #${channel.name} (<#${channel.id}>)` - }], - author: message.author - }, 1, true); - - const affectedRows = await app.DBs.serverSettings.update({ verification: JSON.stringify(sParameters, null, "\t") }, { where: { serverID: message.guild.id } }); - if (affectedRows > 0) { - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.success} Configured Verification!`, - color: app.config.system.embedColors.lime, - description: `Great news! Verification is now setup!\nNow, go tell them newcomers to verify in ${channel.name} (<#${channel.id}>)!` - }], - author: message.author - }, 1, true); - } else { - throw new Error("Failed to save to database"); - }; - - } catch (Ex) { - if (Ex.message == "UNKNOWN_CHANNEL" || Ex.message == "UNKNOWN_ROLE") { - var type = Ex.message.split("UNKNOWN_")[1].toLowerCase(); - return app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.error} Unknown ${type.replace(/^./, str => str.toUpperCase())}!`, - color: app.config.system.embedColors.red, - description: `Whoopsie! That ${type} does not exist!`, - fields: [ - { name: "Here's what to do", value: " -> Please ensure you typed the name correctly and that it does exist.\n -> Please also verify that I have permissions to check its existence.\n -> Please try your request again" } - ] - }], - author: message.author - }, 1, true); - } else if (Ex.message == "CHANNEL_NOT_PERMITTED") - return app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.error} That doesn't look right...`, - color: app.config.system.embedColors.red, - description: `Here's what just happened: The channel specified cannot be used for verification.`, - fields: [ - { name: "Here's what to do", value: " -> Please ensure that the channel you provided is a text channel - not a stage or voice channel.\n -> Please try your request again" } - ] - }], - author: message.author - }, 1, true); - else - return app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.error} Whoopsie! Something went wrong!`, - color: app.config.system.embedColors.red, - description: `Here's what just happened: ${Ex.message}`, - fields: [ - { name: "Here's what to do", value: " -> Please try your request again" } - ] - }], - author: message.author - }, 1, true); - }; - } else { - return app.functions.missingPerms(msg, 1, "configure verification on this server"); - } - })); - } else { // Do the verification here. - message.delete().catch(err => {}); // Try to delete message, don't do anything if we can't. - - var verificationData = await app.DBs.verification.findOne({ where: { serverID: message.guild.id, userID: message.author.id } }); - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.wait} Preparing to verify you...`, - color: app.config.system.embedColors.blue, - description: "Looking for you (in the database)..." - }], - author: message.author - }, 0, false, (async msg => { - async function errorDB(msg, Ex) { - var messages = { - "VERIFY_NOT_SETUP": ["Verification is not set up in this server", " -> Contact a Staff member"], - "ROLE_NOT_EXIST": ["The verified role does not exist", " -> Contact a Staff member"], - "CHANNEL_NOT_EXIST": ["The verification channel does not exist", " -> Contact a Staff member"], - "ALREADY_VERIFY": ["You have already been verified", " -> Contact a Staff member"], - "NOT_VERIFY_CHANNEL": ["This channel is not the verification channel", " -> Go to the correct channel\n -> If in correct channel, contact a Staff member"], - "DEFAULT": [Ex.message, " -> Please try your request again"] - }; - - await app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Eep! Sorry about that, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.warning} Verification failed!`, - color: app.config.system.embedColors.orange, - description: `Here's what just happened: ${messages[Ex.message] ? messages[Ex.message][0] : messages["DEFAULT"][0]}.`, - fields: [{ - name: "Here's what to do", - value: messages[Ex.message] ? messages[Ex.message][1] : messages["DEFAULT"][1] - }] - }], - components: [] - }, 1, false, (async msgC => { setTimeout(function() { msgC.delete().catch(err => {}); }, 10000); })).catch(err => {}); - app.logger.error("DISCORD", `[MESSAGE] Verification for ${message.author.id} failed! Error: ${Ex.stack}`); - }; - - try { - - if (verificationData) try { await app.functions.DB.deleteVerification(message.guild.id, message.author.id); } catch (Ex) {}; - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - var verificationSettings = serverSettings.get("verification"); - if (!verificationSettings) throw new Error("VERIFY_NOT_SETUP"); - verificationSettings = JSON.parse(verificationSettings); - - if (!verificationSettings["channel"] || message.channel.id != verificationSettings["channel"]) throw new Error("NOT_VERIFY_CHANNEL"); - if (!verificationSettings["role"] || !message.guild.roles.cache.get(verificationSettings["role"])) throw new Error("ROLE_NOT_EXIST"); - - if (message.member.roles.cache.has(verificationSettings["role"])) throw new Error("ALREADY_VERIFY"); - - // DM-ing is kinda broken, so we're just editing in the channel for right now. - var codeGen = app.functions.generateRandomCode(8); - - await app.functions.DB.createVerification(message.guild.id, message.author.id, msg.id, codeGen); - return app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.information} Welcome to the server!`, - color: app.config.system.embedColors.blue, - fields: [ - { name: `Welcome to ${message.guild.name}!`, value: "Ah, a newcomer! How fun!\nPlease ensure to read the server rules." }, - { name: "Okay, enough talk.", value: `Your code is: \`${codeGen}\`.\nYour next message should be the code.` }, - ] - }], - author: message.author - }, 1, false, (async msg => { - await collectVerificationCode(codeGen, msg); - })); - } catch (Ex) { - return errorDB(msg, Ex); - }; - - - - // FUNCTIONS - async function collectVerificationCode(codeGen, msg) { - const filter = m => { return m.channel.id === message.channel.id && m.author.id === message.author.id }; - const collector = message.channel.createMessageCollector({ filter, max: 1, time: 30000, errors: ["time", "max"] }); - - collector.on("collect", async m => { - if (m.content == codeGen) { - try { - // collector.dispose(); - m.delete().catch(err => {}); - try { await app.functions.DB.deleteVerification(message.guild.id, message.author.id); } catch (Ex) {}; - if (verificationData) try { await app.functions.DB.deleteVerification(message.guild.id, message.author.id); } catch (Ex) {}; - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - var verificationSettings = serverSettings.get("verification"); - if (!verificationSettings) throw new Error("VERIFY_NOT_SETUP"); - verificationSettings = JSON.parse(verificationSettings); - - if (!verificationSettings["channel"] || message.channel.id != verificationSettings["channel"]) throw new Error("NOT_VERIFY_CHANNEL"); - if (!verificationSettings["role"] || !message.guild.roles.cache.get(verificationSettings["role"])) throw new Error("ROLE_NOT_EXIST"); - - if (message.member.roles.cache.has(verificationSettings["role"])) throw new Error("ALREADY_VERIFY"); - - message.member.roles.add(verificationSettings["role"]).catch(err => { throw new Error(err); }); - - await app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Whoop whoop, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.success} Verified!`, - color: app.config.system.embedColors.lime, - description: `Here's what just happened: You successfully verified!\nHave fun and enjoy your stay!` - }], - components: [] - }, 1, false, (async msgC => { setTimeout(function() { msgC.delete().catch(err => {}); }, 10000); })).catch(err => {}); - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} sucessfully verified.`); - - } catch (Ex) { - errorDB(msg, Ex); - } - } else { - m.react(app.config.system.emotes.error).catch(err => {}); - } - }); - - collector.on("end", async(collected) => { - var codeEnteredGood = collected.map(x => x.content == codeGen); - if (!codeEnteredGood[0]) return errorDB(msg, new Error(`You did not enter the code ${((collected.size < 1) ? "in time" : "correctly")}`)); - }); - }; - })); - } - } -}; \ No newline at end of file diff --git a/src/app/cmds/General/yttogether.js b/src/app/cmds/General/yttogether.js deleted file mode 100644 index 24dd487..0000000 --- a/src/app/cmds/General/yttogether.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - name: "yttogether", - description: "Generate a YouTube Together [BETA] link!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["STREAM"], - cooldown: 30, - aliases: ["ytnchill", "watchyt"], - syntax: [], - execute: async(app, message, args) => { - function title(emoji) { var response = app.config.system.emotes[emoji] + " **YouTube Together**"; return response; }; - - if (!message.guild) { app.functions.msgHandler(message, { content: `${title("error")}\nYou cannot execute this in DMs!` }, 0, true); return; } - var channel = message.member.voice.channel; - if (!channel) { app.functions.msgHandler(message, { content: `${title("error")}\nPlease join a voice channel first!!` }, 0, true); return; } - - app.functions.msgHandler(message, { content: title("wait") + "\nGenerating link, please wait." }, 0, true, (m => { - app.modules["node-fetch"](`https://discord.com/api/v9/channels/${channel.id}/invites`, { - method: "POST", - body: JSON.stringify({ max_age: 86400, max_uses: 0, target_application_id: "755600276941176913", target_type: 2, temporary: false, validate: null }), - headers: { - "Authorization": `Bot ${app.client.token}`, - "Content-Type": "application/json" - } - }).then(res => res.json()).then(invite => { - if (!invite.code) { - m.edit(`${title("error")}\nSorry, something went wrong and I could create the link.`); - } else if (invite.code == 10003) { - m.edit(`${title("error")}\nSorry, I could not find the channel.`); - } else m.edit(`${title("success")}\nLink generated!\nhttps://discord.com/invite/${invite.code}`); - return; - }); - })); - } -}; \ No newline at end of file diff --git a/src/app/cmds/Moderation/ban.js b/src/app/cmds/Moderation/ban.js deleted file mode 100644 index ccd5606..0000000 --- a/src/app/cmds/Moderation/ban.js +++ /dev/null @@ -1,80 +0,0 @@ -module.exports = { - name: "ban", - description: "Ban those pesky members!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["BAN_MEMBERS"], - cooldown: 5, - aliases: ["banhammer"], - syntax: [" <@MentionOrUserID> [reason]"], - execute: async(app, message, args) => { - function BanError(msg) { - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} Ban Error!`, - color: app.config.system.embedColors.red, - description: msg ? msg : "Missing error data??", - }], - author: message.author - }, 0, true); - }; - if (!args[0]) return BanError("Well, you can't really ban air, can you..."); - - var userID = app.functions.getID(args[0]), - reason = args.slice(1).join(" "); - - var user; - await app.client.users.fetch(userID, true, true) - .then(u => { - user = u; - }) - .catch(err => { - if (err.message.includes("Unknown User")) { - return BanError("That was an invalid user. I even tried searching through Discord..."); - } else { - return BanError(`Something went wrong while fetching the user.\nError: ${err.message}`); - }; - }); - - if (user.id) { - if (user.id === message.author.id) return BanError("Banning yourself is rather pointless."); - var guildMember = message.guild.members.cache.get(user.id), - forced = false; - - - var getBan = async(userID) => await message.guild.bans.fetch(userID, true, true).then(b => { return true; }).catch(() => { return false; }); - - - if (!guildMember) - forced = true; - else { - if (!guildMember.bannable) return BanError("That user is higher than me... sorry kiddo."); - forced = false; - }; - - try { - if (await getBan(userID)) return BanError("That user is already banned!"); - var banReason = app.functions.pomeloHandler(message.author) + " " + ((reason) ? reason : "provided no reason for the ban."); - message.guild.members.ban(userID, { reason: banReason }).then(() => { - var embed = { - title: `${app.config.system.emotes.success} ${(forced) ? "Force-" : ""}Ban Success!`, - color: app.config.system.embedColors.lime, - description: `You know the rules and so do I, so say goodbye to ${app.functions.pomeloHandler(user)}!`, - fields: [] - }; - if (reason) embed.fields.push({ name: "Reason", value: ((reason) ? reason : "Missing reason yet this is here???") }); - - return app.functions.msgHandler(message, { - embeds: [embed], - author: message.author - }, 0, true); - }).catch(err => { - return BanError(`I failed to ban that user because: ${err.message}`); - }) - } catch (Ex) { - return BanError(`I failed to ban that user because: ${Ex.message}`); - } - } - } -}; \ No newline at end of file diff --git a/src/app/cmds/Moderation/config.js b/src/app/cmds/Moderation/config.js deleted file mode 100644 index 2680460..0000000 --- a/src/app/cmds/Moderation/config.js +++ /dev/null @@ -1,473 +0,0 @@ -module.exports = { - name: "config", - description: "Configure your server the way you want!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["MANAGE_GUILD", "MANAGE_ROLES", "MANAGE_MESSAGES"], - cooldown: 5, - aliases: ["configuration"], - syntax: [], - execute: async(app, message, args) => { - const { MessageActionRow, MessageButton, MessageSelectMenu } = app.modules["discord.js"]; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - - app.functions.msgHandler(message, { - embeds: [{ - title: app.config.system.emotes.wait + " **Loading**", - color: app.config.system.embedColors.blue - }] - }, 0, true, (async msg => { - try { - if (!serverSettings) throw new Error("No server in database"); // How did they even do this command? - var dropdownData = [{ - label: "Logging", - description: "Configure logging settings.", - value: "logging" - }, { - label: "Join & Leave Messages", - description: "Configure join and leave messages.", - value: "joinleave" - }]; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Configure ${app.name} - Select Option`, - color: app.config.system.embedColors.purple, - description: "Alright - from the dropdown - what are we going to be configuring?", - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Choose an option!") - .addOptions(dropdownData), - ) - ], - author: message.author - }, 1, true, (async() => { - - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, time: 30000, errors: ["time"] }); - - const cancelFilter = m => { if (m.user) return m.user.id === message.author.id; }; - const cancelCollector = message.channel.createMessageCollector({ filter: cancelFilter, time: 30000, errors: ["time"] }); - cancelCollector.on("collect", async m => { - if (!m.content == "cancel") return; - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var v in i.values) { - i.deferUpdate(); - cancelCollector.stop("done"); - collector.stop("done"); - var val = i.values[v]; - - if (val == "logging") { - // Have to hardcore this for now. eww.. - dropdownData = [{ - label: "Member Event Channel", - description: "The channel member events are logged to (joins, leaves, and updates)", - value: "loggingMemberChannel" - }, { - label: "Server Event Channel", - description: "The channel guild events are logged to (role + channel creates/updates/deletes & server updates)", - value: "loggingGuildChannel" - }, { - label: "Message Event Channel", - description: "The channel message events are logged to (message updates/deletes/bulkdeletes)", - value: "loggingMessageChannel" - }]; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Configure ${app.name} - Type of Logging`, - color: app.config.system.embedColors.purple, - description: "My favorite! Alright, what type of logging should we configure?", - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Choose an option!") - .addOptions(dropdownData), - ) - ], - author: message.author - }, 1, true, (async menumsg => { - await collectLoggingType(menumsg); - - })); - } else if (val == "joinleave") { - // Have to hardcore this for now. eww.. - dropdownData = [{ - label: "Join Messages & Channel", - description: "Hello (user) and welcome to the server!", - value: "join" - }, { - label: "Leave Messages & Channel", - description: "Oh no! (user) left the server!", - value: "leave" - }]; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Configure ${app.name} - Join or Leave??`, - color: app.config.system.embedColors.purple, - description: "Bet! What would you like to set up?", - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Choose an option!") - .addOptions(dropdownData), - ) - ], - author: message.author - }, 1, true, (async menumsg => { - await collectJoinLeave(menumsg); - - })); - }; - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - })); - - var defaults = app.defaults; - - // FUNCTIONS - async function collectLoggingType() { - - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, time: 30000, errors: ["time"] }); - - const cancelFilter = m => { if (m.user) return m.user.id === message.author.id }; - const cancelCollector = message.channel.createMessageCollector({ filter: cancelFilter, time: 30000, errors: ["time"] }); - cancelCollector.on("collect", async m => { - if (!m.content == "cancel") return; - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var v in i.values) { - i.deferUpdate(); - cancelCollector.stop("done"); - collector.stop("done"); - var val = i.values[v]; - await collectNewLoggingChannel(val); - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - - async function collectNewLoggingChannel(typeOfLog) { - if (!typeOfLog) return; - var cData = []; - var logID = serverSettings.get(typeOfLog) || ""; - - var bigChannelSize = (message.guild.channels.cache.size > 25), - filteredChannels = await message.guild.channels.cache.filter(c => c.type == "GUILD_TEXT" && c.id != logID).map(x => ({ x, r: Math.random() })).sort((a, b) => a.r - b.r).map(a => a.x).slice(0, 25); - await filteredChannels.forEach(channel => { - var topic = (channel["topic"]) ? channel["topic"].match(/.{1,100}/g)[0] : "No topic."; - cData.push({ - label: "#" + ((channel["id"] == message.channel.id) ? `${channel["name"]} (This channel)` : channel["name"]), - description: topic, - value: channel["id"] - }); - }); - - var warning = (bigChannelSize) ? app.config.system.emotes.warning + "**You have more than the amount of channels we can show (25).** The list is random. If you do not see your desired channel, send `cancel` and rerun this command." : ""; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Configure ${app.name} - Select Logging Channel`, - color: app.config.system.embedColors.purple, - description: "Sick! What channel are we going to be setting this up in?\n" + warning, - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Choose a channel!") - .addOptions(cData), - ) - ], - author: message.author - }, 1, true, (async() => { - - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, time: 30000, errors: ["time"] }); - - const cancelFilter = m => { if (m.user) return m.user.id === message.author.id }; - const cancelCollector = message.channel.createMessageCollector({ filter: cancelFilter, time: 30000, errors: ["time"] }); - cancelCollector.on("collect", async m => { - if (!m.content == "cancel") return; - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var v in i.values) { - collector.stop("done"); - var channelID = i.values[v]; - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.wait} Configure ${app.name} - Logging Channel Saving`, - color: app.config.system.embedColors.blue, - description: "Fantastic! Saving your settings..." - }], - components: [], - author: message.author - }, 1, true, (async() => { - const affectedRows = await app.DBs.serverSettings.update({ - [typeOfLog]: channelID - }, { where: { serverID: message.guild.id } }); - if (affectedRows > 0) { - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.success} Configure ${app.name}`, - color: app.config.system.embedColors.lime, - description: `Woohoo! We're done here!\nYour selected logs is ready to go!` - }], - components: [], - author: message.author - }, 1, true); - } else { - new Error("Database saving failed!"); - }; - })); - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - })); - }; - - - - async function collectJoinLeave() { - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, time: 30000, errors: ["time"] }); - - const cancelFilter = m => { if (m.user) return m.user.id === message.author.id }; - const cancelCollector = message.channel.createMessageCollector({ filter: cancelFilter, time: 30000, errors: ["time"] }); - cancelCollector.on("collect", async m => { - if (!m.content == "cancel") return; - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var v in i.values) { - i.deferUpdate(); - cancelCollector.stop("done"); - collector.stop("done"); - var val = i.values[v]; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Configure ${app.name} - ${val.substr(0, 1).toUpperCase() + val.substr(1)} Message`, - color: app.config.system.embedColors.purple, - description: "Great! What should the " + val + " message be? Send `done` when done or if you like the current, send `next`.\nDefault: `" + defaults[val]["msg"] + "`", - fields: [ - { name: "Variable Help", value: app.functions.getTypes.desc(val).join("\n") } - ] - }], - components: [], - author: message.author - }, 1, true, (async() => { - - const msgFilter = m => { return m.author.id === message.author.id }; - const msgCollector = message.channel.createMessageCollector({ msgFilter, time: 30000, errors: ["time"] }); - - msgCollector.on("collect", async m => { - if (m.content === "cancel") { - msgCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - } else if (m.content == "next") { - var tmpContent = (serverSettings.get("other")[val]) ? JSON.parse(serverSettings.get("other")[val]) || { msg: defaults[val]["msg"], channel: null } : { msg: defaults[val]["msg"], channel: null }; - if (tmpContent["msg"]) { - msgCollector.stop("done"); - await collectJoinLeaveChannel(val, tmpContent); - m.react(app.config.system.emotes.success).catch(err => {}); - } else m.react(app.config.system.emotes.error).catch(err => {}); - } else { - msgCollector.stop("done"); - var tmpContent = { msg: m.content || defaults[val]["msg"], channel: null }; - await collectJoinLeaveChannel(val, tmpContent); - m.react(app.config.system.emotes.success).catch(err => {}); - } - }); - - msgCollector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }) - })); - }; - }; - }); - }; - - async function collectJoinLeaveChannel(evtType, evtData) { - if (!evtType) return; - if (!evtData) evtData = serverSettings.get("other")[evtType + "Channel"]; - if (!evtData) return; - - var cData = []; - var bigChannelSize = (message.guild.channels.cache.size > 25), - filteredChannels = await message.guild.channels.cache.filter(c => c.type == "GUILD_TEXT" || evtData["channel"] && c.id != evtData).map(x => ({ x, r: Math.random() })).sort((a, b) => a.r - b.r).map(a => a.x).slice(0, 25); - await filteredChannels.forEach(channel => { - var topic = (channel["topic"]) ? channel["topic"].match(/.{1,100}/g)[0] : "No topic."; - cData.push({ - label: "#" + ((channel["id"] == message.channel.id) ? `${channel["name"]} (This channel)` : channel["name"]), - description: topic, - value: channel["id"] - }); - }); - - var warning = (bigChannelSize) ? app.config.system.emotes.warning + "**You have more than the amount of channels we can show (25).** The list is random. If you do not see your desired channel, send `cancel` and rerun this command." : ""; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Configure ${app.name} - Select ${evtType.substr(0, 1).toUpperCase() + evtType.substr(1)} Channel`, - color: app.config.system.embedColors.purple, - description: "Sick! What channel are we going to be setting this up in?\n" + warning, - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Choose a channel!") - .addOptions(cData), - ) - ], - author: message.author - }, 1, true, (async() => { - - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, time: 30000, errors: ["time"] }); - - const cancelFilter = m => { if (m.user) return m.user.id === message.author.id }; - const cancelCollector = message.channel.createMessageCollector({ filter: cancelFilter, time: 30000, errors: ["time"] }); - cancelCollector.on("collect", async m => { - if (!m.content == "cancel") return; - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var v in i.values) { - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - var channelID = i.values[v]; - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.wait} Configure ${app.name} - ${evtType.substr(0, 1).toUpperCase() + evtType.substr(1)} Saving`, - color: app.config.system.embedColors.blue, - description: "Fantastic! Saving your settings..." - }], - components: [], - author: message.author - }, 1, true, (async() => { - var data = { join: { msg: defaults["join"]["msg"], channel: null }, leave: { msg: defaults["leave"]["msg"], channel: null } }; - if (serverSettings.get("other")) - data = JSON.parse(serverSettings.get("other")) - data[evtType] = { - msg: evtData["msg"], - channel: channelID - }; - - const affectedRows = await app.DBs.serverSettings.update({ - other: JSON.stringify(data, null, "\t") - }, { where: { serverID: message.guild.id } }); - if (affectedRows > 0) { - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.success} Configure ${app.name}`, - color: app.config.system.embedColors.lime, - description: `Woohoo! We're done here!\nYour ${evtType} message & channel are both ready to go!\n\n\`${evtData["msg"]}\`` - }], - components: [], - author: message.author - }, 1, true); - } else { - new Error("Database saving failed!"); - }; - })); - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - })); - }; - - - } catch (Ex) { - app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Something happened, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.information} Configure ${app.name} - Unexpected Error`, - color: app.config.system.embedColors.red, - description: `Sadly, we ran into an error while setting up your reaction roles. Here's what we know: ${Ex.message}` - }] - }); - }; - })); - - } -}; \ No newline at end of file diff --git a/src/app/cmds/Moderation/kick.js b/src/app/cmds/Moderation/kick.js deleted file mode 100644 index e146976..0000000 --- a/src/app/cmds/Moderation/kick.js +++ /dev/null @@ -1,70 +0,0 @@ -module.exports = { - name: "kick", - description: "The boot. At your service!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["KICK_MEMBERS"], - cooldown: 5, - aliases: ["boot"], - syntax: [" <@MentionOrUserID> [reason]"], - execute: async(app, message, args) => { - function KickError(msg) { - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} Kick Error!`, - color: app.config.system.embedColors.red, - description: msg ? msg : "Missing error data??", - }], - author: message.author - }, 0, true); - }; - if (!args[0]) return KickError("You kicked some air..."); - - var userID = app.functions.getID(args[0]), - reason = args.slice(1).join(" "); - - var user; - await app.client.users.fetch(userID, true, true) - .then(u => { - user = u; - }) - .catch(err => { - if (err.message.includes("Unknown User")) { - return KickError("That was an invalid user. I even tried searching through Discord..."); - } else { - return KickError(`Something went wrong while fetching the user.\nError: ${err.message}`); - }; - }); - - if (user && user.id) { - if (user.id === message.author.id) return KickError("Kicking yourself is rather pointless."); - var guildMember = message.guild.members.cache.get(user.id); - - if (!guildMember) return KickError("That user does not exist in the server!") - if (!guildMember.kickable) return KickError("That user is higher than me... sorry kiddo."); - - try { - var kickReason = app.functions.pomeloHandler(message.author) + " " + ((reason) ? reason : "provided no reason for the kick."); - message.guild.members.kick(userID, { reason: kickReason }).then(() => { - var embed = { - title: `${app.config.system.emotes.success} Kick Success!`, - color: app.config.system.embedColors.lime, - description: `Yeet! The boot has kicked ${app.functions.pomeloHandler(user)} out!`, - fields: [] - }; - if (reason) embed.fields.push({ name: "Reason", value: ((reason) ? reason : "Missing reason yet this is here???") }); - - return app.functions.msgHandler(message, { - embeds: [embed], - author: message.author - }, 0, true); - }).catch(err => { - return KickError(`I failed to kick that user because: ${err.message}`); - }) - } catch (Ex) { - return KickError(`I failed to kick that user because: ${Ex.message}`); - } - } - } -}; \ No newline at end of file diff --git a/src/app/cmds/Moderation/purge.js b/src/app/cmds/Moderation/purge.js deleted file mode 100644 index eac92bc..0000000 --- a/src/app/cmds/Moderation/purge.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = { - name: "purge", - description: "Purge those spicy messages", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["MANAGE_MESSAGES"], - cooldown: 5, - aliases: ["prune"], - syntax: [" "], - execute: async(app, message, args) => { - let msgcount = args.slice(" ") - - if (!isNaN(args[0])) { - try { - message.delete(); - await message.channel.messages.fetch({ limit: msgcount }).then(fetchedMsgs => { - const msgsPrune = fetchedMsgs.filter(msg => !msg.pinned); - return message.channel.bulkDelete(msgsPrune).then(prunedMsgs => { - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.success} Purge Successful!`, - color: app.config.system.embedColors.lime, - description: `Successfully purged ${prunedMsgs.size} spicy messages!`, - footer: { text: app.config.system.footerText + " | This message will blow up in a few seconds." } - }] - }, 0, false, (msg => { setTimeout(() => msg.delete(), 5000) })); - }); - }).catch(err => {}); - } catch (e) { - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} Uh-Oh! Something went wrong!`, - color: app.config.system.embedColors.red, - description: `Could not purge messages due to: **${e.message}**`, - footer: { text: app.config.system.footerText + " | An error occurred." } - }] - }); - } - } else { - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} Purge Error`, - color: app.config.system.embedColors.red, - description: "You need to specify how many messages to delete!", - footer: { text: app.config.system.footerText + " | An error occurred." } - }] - }, 0, true); - } - } -} \ No newline at end of file diff --git a/src/app/cmds/Moderation/reactionroles.js b/src/app/cmds/Moderation/reactionroles.js deleted file mode 100644 index 0b172d5..0000000 --- a/src/app/cmds/Moderation/reactionroles.js +++ /dev/null @@ -1,271 +0,0 @@ -module.exports = { - name: "reactionroles", - description: "Setup reaction roles for your server!", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["MANAGE_MESSAGES", "MANAGE_ROLES"], - cooldown: 5, - aliases: ["rr", "rrmsg"], - syntax: [], - execute: async(app, message, args) => { - const { MessageActionRow, MessageButton, MessageSelectMenu } = app.modules["discord.js"]; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - - app.functions.msgHandler(message, { - embeds: [{ - title: app.config.system.emotes.wait + " **Loading**", - color: app.config.system.embedColors.blue - }] - }, 0, true, (async msg => { - try { - if (!serverSettings) throw new Error("No server in database"); // How did they even do this command? - var cData = []; - var bigChannelSize = (message.guild.channels.cache.size > 25), - filteredChannels = await message.guild.channels.cache.filter(c => c.type == "GUILD_TEXT").map(x => ({ x, r: Math.random() })).sort((a, b) => a.r - b.r).map(a => a.x).slice(0, 25); - await filteredChannels.forEach(channel => { - var topic = (channel["topic"]) ? channel["topic"].match(/.{1,100}/g)[0] : "No topic."; - cData.push({ - label: "#" + ((channel["id"] == message.channel.id) ? `${channel["name"]} (This channel)` : channel["name"]), - description: topic, - value: channel["id"] - }); - }); - - var channelID = 0, - messageID = 0, - reactions = [], - customTitle = "", - customDesc = ""; - - - var warning = (bigChannelSize) ? app.config.system.emotes.warning + "**You have more than the amount of channels we can show (25).** The list is random. If you do not see your desired channel, send `cancel` and rerun this command." : ""; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Reaction Roles - Select Channel`, - color: app.config.system.embedColors.purple, - description: "Alright - from the dropdown - What channel are we going to be setting this up in?\n" + warning, - }], - components: [new MessageActionRow() - .addComponents( - new MessageSelectMenu() - .setCustomId("select") - .setPlaceholder("Choose a channel!") - .addOptions(cData), - ) - ], - author: message.author - }, 1, true, (async() => { - - const filter = i => { return ["select"].includes(i.customId) && i.user.id === message.author.id }; - const collector = message.channel.createMessageComponentCollector({ filter, time: 30000, errors: ["time"] }); - - const cancelFilter = m => { if (m.user) return m.user.id === message.author.id }; - const cancelCollector = message.channel.createMessageCollector({ filter: cancelFilter, time: 30000, errors: ["time"] }); - cancelCollector.on("collect", async m => { - if (!m.content == "cancel") return; - collector.stop("cancelled by user"); - cancelCollector.stop("cancelled by user"); - m.react(app.config.system.emotes.success).catch(err => {}); - }); - - collector.on("collect", async i => { - if (i.customId === "select" && i.values.length > 0) { - for (var v in i.values) { - cancelCollector.stop("done"); - collector.stop("done"); - var val = i.values[v]; - channelID = val; - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Reaction Roles - Set title & description`, - color: app.config.system.embedColors.purple, - description: "Nice channel!\nPlease enter the embed title and description so your users know what is what!\nExample: `This is a test|Get roles here :)`", - }], - components: [], - author: message.author - }, 1, true, (async menumsg => { - await collectRRMsg(menumsg); - - })); - }; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - })); - - // FUNCTIONS - async function collectRRMsg() { - const filter = m => { return m.author.id === message.author.id }; - const collector = message.channel.createMessageCollector({ filter, time: 30000, errors: ["time"] }); - - collector.on("collect", async m => { - if (m.content.includes("|")) { - m.delete().catch(err => {}); - collector.stop("done"); - var splitMsg = m.content.split("|"); - customTitle = splitMsg[0], - customDesc = splitMsg[1]; - - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.question} Reaction Roles - Create Reactions`, - color: app.config.system.embedColors.purple, - description: "Great! What should the reaction roles be? Send `done` when done.\nSend in this format: `:white_check_mark:|13-18|999999999999999999`\n(Example is below)" - }], - components: [], - author: message.author - }, 1, true, (async() => { - await app.functions.msgHandler(message, { - embeds: [{ - title: customTitle, - description: customDesc, - footer: { text: " !! EXAMPLE !! - " + app.config.system.footerText } - - }] - }, 0, false, (async exMsg => { await collectRR(exMsg); })); - })); - } else if (m.content === "cancel") { - m.react(app.config.system.emotes.success).catch(err => {}); - collector.stop("cancelled by user"); - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - - async function collectRR(exMsg = null) { - const filter = m => { return m.author.id === message.author.id }; - const collector = message.channel.createMessageCollector({ filter, time: 90000, errors: ["time"] }); - - collector.on("collect", async m => { - if (m.content == "done") { - collector.stop("done"); - if (exMsg != null) exMsg.delete().catch(err => {}); - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.wait} Reaction Roles - Saving`, - color: app.config.system.embedColors.blue, - description: "Fantastic! Saving your settings..." - }], - components: [], - author: message.author - }, 1, true, (async() => { - var channel = message.guild.channels.cache.get(channelID), - reactionsList = []; - for (var reaction in reactions) { reactionsList.push((app.functions.getEmoji(app, reactions[reaction]["emoji"]["id"], true) || reactions[reaction]["emoji"]["name"]) + " " + reactions[reaction]["roleMsg"]); }; - await channel.send({ - embeds: [{ - title: customTitle, - description: customDesc + "\n\n" + reactionsList.join("\n"), - }] - }).then(msg => { - messageID = msg.id; - - for (var reaction in reactions) { msg.react(reactions[reaction]["emoji"]["id"]); }; - }).catch(err => new Error(err)); - - var data = JSON.parse(serverSettings["reactionRoles"]) || {}; - data[channelID] = { - message: messageID, - reactionRoles: reactions - }; - - const affectedRows = await app.DBs.serverSettings.update({ reactionRoles: JSON.stringify(data, null, "\t") }, { where: { serverID: message.guild.id } }); - - if (affectedRows > 0) { - await app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.success} Reaction Roles`, - color: app.config.system.embedColors.lime, - description: `Woohoo! We're done here! Go see your lovely reaction roles [now](https://discord.com/channels/${message.guild.id}/${channelID}/${messageID}).\nPlease note that reactions may take a bit to apply due to ratelimits.` - }], - components: [], - author: message.author - }, 1, true); - } else { - throw new Error("Database saving failed!"); - }; - - m.react(app.config.system.emotes.success).catch(err => {}); - - })); - } else if (m.content === "cancel") { - m.react(app.config.system.emotes.success).catch(err => {}); - collector.stop("cancelled by user"); - } else { - var splitMsg = m.content.split("|"); - if (splitMsg.length < 3) return; // Ignore the message. - var emoji = splitMsg[0], - roleMsg = splitMsg[1], - roleID = app.functions.getID(splitMsg[2]) || splitMsg[2]; - - if (emoji.startsWith("<:") || emoji.startsWith(":")) { - emoji = app.functions.getID(emoji); - if (emoji.startsWith("a:")) emoji = emoji.split("a:")[1] - emoji = emoji.split(":")[2]; - - const theEmoji = await app.client.emojis.cache.find(e => e.id === emoji) || false; - - if (!theEmoji) { - m.react(app.config.system.emotes.error).catch(err => {}); - app.functions.msgHandler(m, { content: "Cannot use that custom emoji. Must be emoji from server I'm in!\n(You can also use built-in Discord emojis)" }, 0, true, (async errMsg => { setTimeout(() => { errMsg.delete() }, 10000) })); - return; - }; - emoji = { name: theEmoji["name"], id: theEmoji["id"] }; - } else - emoji = { name: emoji, id: 0 }; - reactions.push({ - emoji: emoji, - roleID: roleID, - roleMsg: roleMsg - }); - - if (exMsg) { - var embs = exMsg.embeds; - embs[0].description += ((reactions.length < 1) ? "\n" : "") + "\n" + ((app.functions.getEmoji(app, emoji["id"], true) || emoji["name"]) + " " + roleMsg); - exMsg.edit({ embeds: embs }).catch(err => {}); - }; - - m.react(app.config.system.emotes.success).catch(err => {}); - }; - }); - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: msg.embeds || [], - components: [] - }, 1, true); - }; - }); - }; - } catch (Ex) { - app.functions.msgHandler(msg, { - embeds: [{ - author: { name: `Something happened, ${app.functions.pomeloHandler(message.author)}!`, icon_url: message.author.displayAvatarURL({ format: "png", dynamic: true, size: 1024 }) }, - title: `${app.config.system.emotes.information} Reaction Roles - Setup`, - color: app.config.system.embedColors.red, - description: `Sadly, we ran into an error while setting up your reaction roles. Here's what we know: ${Ex.message}` - }] - }); - } - })); - } -}; \ No newline at end of file diff --git a/src/app/cmds/Moderation/softclear.js b/src/app/cmds/Moderation/softclear.js deleted file mode 100644 index 1c1cd42..0000000 --- a/src/app/cmds/Moderation/softclear.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - name: "softclear", - description: "Soft clears a chat - by sending several lines of emptiness.", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["MANAGE_MESSAGES"], - cooldown: 30, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - times = args[0] || 1; - for (var t = 0; t < times; t++) { - var emptyThing = "** **\n"; - for (var i = 0; i < 332; i++) emptyThing = emptyThing + "** **\n"; - app.functions.msgHandler(message, emptyThing, 0, false); - }; - } -}; \ No newline at end of file diff --git a/src/app/cmds/Moderation/unban.js b/src/app/cmds/Moderation/unban.js deleted file mode 100644 index 157baa2..0000000 --- a/src/app/cmds/Moderation/unban.js +++ /dev/null @@ -1,71 +0,0 @@ -module.exports = { - name: "unban", - description: "They did the crime, they did the time.", - guildOnly: true, - authorizedGuilds: [], - hidden: false, - permissions: ["BAN_MEMBERS"], - cooldown: 5, - aliases: ["unbanhammer"], - syntax: [" <@MentionOrUserID> [reason]"], - execute: async(app, message, args) => { - function UnbanError(msg) { - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} Unban Error!`, - color: app.config.system.embedColors.red, - description: msg ? msg : "Missing error data??", - }], - author: message.author - }, 0, true); - }; - if (!args[0]) return UnbanError("The air isn't banned...?"); - - var userID = app.functions.getID(args[0]), - reason = args.slice(1).join(" "); - - var user; - await app.client.users.fetch(userID, true, true) - .then(u => { - user = u; - }) - .catch(err => { - if (err.message.includes("Unknown User")) { - return UnbanError("That was an invalid user. I even tried searching through Discord..."); - } else { - return UnbanError(`Something went wrong while fetching the user.\nError: ${err.message}`); - }; - }); - - if (user.id) { - if (user.id === message.author.id) return UnbanError("...you wouldn't be running this command if you were banned."); - var guildMember = message.guild.members.cache.get(user.id); - - var getBan = async(userID) => await message.guild.bans.fetch(userID, true, true).then(b => { return true; }).catch(() => { return false; }); - - if (guildMember || !await getBan(userID)) return UnbanError("That user is not banned!"); - - try { - var unbanReason = app.functions.pomeloHandler(message.author) + " " + ((reason) ? reason : "provided no reason for the unban."); - message.guild.members.unban(userID, unbanReason).then(() => { - var embed = { - title: `${app.config.system.emotes.success} Unban Success!`, - color: app.config.system.embedColors.lime, - description: `Unhammered the user, ${app.functions.pomeloHandler(user)}!`, - fields: [] - }; - if (reason) embed.fields.push({ name: "Reason", value: ((reason) ? reason : "Missing reason yet this is here???") }); - - return app.functions.msgHandler(message, { - embeds: [embed], - author: message.author - }, 0, true); - }).catch(err => { - return UnbanError(`I failed to unban that user because: ${err.message}`); - }) - } catch (Ex) { - return UnbanError(`I failed to unban that user because: ${Ex.message}`); - } - } - } -}; \ No newline at end of file diff --git a/src/app/cmds/NSFW/nsfw.js b/src/app/cmds/NSFW/nsfw.js deleted file mode 100644 index d917d51..0000000 --- a/src/app/cmds/NSFW/nsfw.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - name: "nsfw", - description: "mmm the nice command ;)", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [], - syntax: [], - execute: async(app, message, args) => { - if (!message.channel.nsfw) { - return app.functions.msgHandler(message, { - files: [process.cwd() + "/app/imgs/bonk.gif"], - embeds: [{ - title: `${app.config.system.emotes.information} BONK!`, - color: app.config.system.embedColors.blue, - image: { url: "attachment://bonk.gif" } - }] - }, 0, true); - } else { - return app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.error} NSFW`, - color: app.config.system.embedColors.red, - description: "We're sorry, but NSFW is still being worked on.\n***TIP:** Try running outside a NSFW channel.*" - }] - }, 0, true); - }; - } -}; \ No newline at end of file diff --git a/src/app/cmds/Owner/botcontrols.js b/src/app/cmds/Owner/botcontrols.js deleted file mode 100644 index 001d00a..0000000 --- a/src/app/cmds/Owner/botcontrols.js +++ /dev/null @@ -1,107 +0,0 @@ -module.exports = { - name: "botcontrols", - description: "Bot Control.", - guildOnly: false, - authorizedGuilds: [], - hidden: true, - permissions: ["BOT_OWNER"], - cooldown: 0, - aliases: ["bc"], - syntax: [" "], - execute: async(app, message, args) => { - - function srHandle(message, type) { - const { MessageActionRow, MessageButton } = app.modules["discord.js"]; - const row = new MessageActionRow() - .addComponents( - new MessageButton() - .setCustomId('agree') - .setLabel(`Yes, ${type.toLowerCase()} now`) - .setStyle('SUCCESS'), - new MessageButton() - .setCustomId('disagree') - .setLabel('Nevermind') - .setStyle('DANGER') - ); - - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.warning} **${type}**`, - color: app.config.system.embedColors.yellow, - fields: [ - { name: `Are you sure you wish for me to ${type}?`, value: `To confirm, use the buttons.` } - ] - }], - components: [row] - }, 0, true, (msg => { - const filter = i => ["agree", "disagree"].includes(i.customId) && i.user.id === message.author.id; - const collector = message.channel.createMessageComponentCollector({ filter, max: 1, time: 90000 }); - - collector.on('collect', async i => { - if (i.customId === 'agree') { - app.config.system.commandState = type; - var actionDoing = ((type == "Shutdown") ? "Shutting down" : "Restarting"); - app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.wait} **${actionDoing}**`, - color: app.config.system.embedColors.blue, - description: `I'm ${((type == "Shutdown") ? "shutting down and will be gone in a moment." : "restarting! Be back soon!")}` - }], - components: [] - }, 1, true, (async() => { - app.logger.debug("SYS", `${app.name} ${actionDoing.toLowerCase()} as of ${new Date()}.`); - if (type == "Restart") { - try { app.modules.fs.writeFileSync(process.cwd() + "/app/cache/restart.tmp", msg.channel.id + "-" + msg.id); } catch (Ex) {}; - await process.exitHandler({ app: app, cleanup: true, exit: false, restart: true }, 0); - - } else { process.exitHandler({ app: app, cleanup: true, exit: true }, 0); }; - })); - denied = false, buttonStuffWaiting = false; - - } else if (i.customId === 'disagree') { - await i.update({ - embeds: [{ - title: `${app.config.system.emotes.error} **${type}**`, - color: app.config.system.embedColors.red, - description: "Operation cancelled." - }], - components: [] - }); - - buttonStuffWaiting = false; - }; - }); - - collector.on('end', async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.error} **${type}**`, - color: app.config.system.embedColors.red, - description: "Operation timed out." - }], - components: [] - }, 1, true); - }; - buttonStuffWaiting = false; - }); - })); - }; - - var action = args[0]; - if (!action) return app.functions.msgHandler(message, { content: "Improper syntax used!" }, 0, true); - - switch (action) { - case "shutdown": - srHandle(message, "Shutdown"); - break; - case "restart": - srHandle(message, "Restart"); - break; - default: - app.functions.msgHandler(message, { content: "I do not know what you want me to do!" }, 0, true); - break; - } - - } -} \ No newline at end of file diff --git a/src/app/cmds/Owner/eval.js b/src/app/cmds/Owner/eval.js deleted file mode 100644 index c2a5d82..0000000 --- a/src/app/cmds/Owner/eval.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = { - name: "eval", - description: "JavaScript executor.", - guildOnly: false, - authorizedGuilds: [], - hidden: true, - permissions: ["BOT_OWNER"], - cooldown: 0, - aliases: [], - syntax: [" "], - execute: async(app, message, args) => { - function clean(text) { // gotta sweep sweep sweep - if (typeof(text) === "string") return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203)); - else return text; - }; - try { - const code = message.content.split(" ").slice(1).join(" "); - - if (message.author.id != app.config.system.owners[0] && code.includes("client.token") || code.includes("tokendata.json")) { - throw new Error("`Loading tokens/api keys are disallowed on this bot. Please see the true BOT_OWNER for more information.`"); - }; - - let evaled = eval(code); - - if (typeof evaled !== "string") evaled = app.modules.util.inspect(evaled); - if (evaled !== "Promise { }") { - var result = []; - if (evaled == "") - result.push({ name: "Execution Result", value: "```js\n\"\"```" }); - else - result.push({ name: "Execution Result", value: "```js\n" + clean(evaled) + "```" }); - app.functions.msgHandler(message, { - embeds: [{ - color: app.config.system.embedColors.aqua, - fields: result - }] - }, 0, true); - }; - } catch (err) { - app.functions.msgHandler(message, { - embeds: [{ - color: app.config.system.embedColors.red, - fields: [ - { name: "Execution Failure!", value: "```js\n" + err.message + "```" } - ] - }] - }, 0, true); - app.logger.warn("SYS", `[EVAL] ${err.message}\n${err.stack}`); - }; - } -}; \ No newline at end of file diff --git a/src/app/cmds/Owner/override.js b/src/app/cmds/Owner/override.js deleted file mode 100644 index 78cc8bb..0000000 --- a/src/app/cmds/Owner/override.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - name: "override", - description: "Override permission system.", - guildOnly: false, - authorizedGuilds: [], - hidden: true, - permissions: ["BOT_OWNER"], - cooldown: 0, - aliases: ["bypass"], - syntax: [" "], - execute: async(app, message, args) => { - if (!args[0]) return app.functions.msgHandler(message, ( - (app.client.bypassEnabled) ? - `${app.config.system.emotes.success} **Bypass is enabled!**` : - `${app.config.system.emotes.error} **Bypass is disabled!**`)); - - else if (args[0] == "enable" || args[0] == "disable") { - app.client.bypassEnabled = (args[0] == "enable"); - message.react(app.config.system.emotes.success); - }; - } -}; \ No newline at end of file diff --git a/src/app/evts/channelCreate.js b/src/app/evts/channelCreate.js deleted file mode 100644 index 06caed4..0000000 --- a/src/app/evts/channelCreate.js +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = async(app, newChannel) => { - if (newChannel.partial) await newChannel.fetch().catch(err => {}); - - if (newChannel.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = newChannel.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${app.types.channels[newChannel.type] || "Unknown Channel Type"} created!`, - color: app.config.system.embedColors.green, - description: `There are now ${guild.channels.cache.size} channels.`, - fields: [ - { name: "Name", value: newChannel.name, inline: true }, - { name: "ID", value: newChannel.id, inline: true }, - { name: "Created At", value: new Date(newChannel.createdTimestamp).toString() } - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "CHANNEL_CREATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define channelLog - const channelLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the channel was created. - Date.now() - entry.createdTimestamp < 5000 - ); - if (channelLog) { - const { executor } = channelLog; - - embed.fields.push({ name: "Created by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }); - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/channelDelete.js b/src/app/evts/channelDelete.js deleted file mode 100644 index 84403e6..0000000 --- a/src/app/evts/channelDelete.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = async(app, oldChannel) => { - if (oldChannel.partial) await oldChannel.fetch().catch(err => {}); - - if (oldChannel.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldChannel.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${app.types.channels[oldChannel.type] || "Unknown Channel Type"} deleted!`, - color: app.config.system.embedColors.dark_blue, - description: `There are now ${guild.channels.cache.size} channels.`, - fields: [ - { name: "Name", value: oldChannel.name, inline: true }, - { name: "ID", value: oldChannel.id, inline: true }, - { name: "Deleted At", value: new Date().toString() } - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "CHANNEL_DELETE", - }).catch(err => { app.logger.warn("DISCORD", "Cannot fetch audit log because " + err.message); }); - if (fetchedLogs) { - //define channelLog - const channelLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the channel was deleted. - Date.now() - entry.createdTimestamp < 5000 - ); - if (channelLog) { - const { executor } = channelLog; - - embed.fields.push({ name: "Deleted by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/channelUpdate.js b/src/app/evts/channelUpdate.js deleted file mode 100644 index 4e88f71..0000000 --- a/src/app/evts/channelUpdate.js +++ /dev/null @@ -1,63 +0,0 @@ -module.exports = async(app, oldChannel, newChannel) => { - if (oldChannel.partial) await oldChannel.fetch().catch(err => {}); - if (newChannel.partial) await newChannel.fetch().catch(err => {}); - - if (oldChannel == newChannel) return; // how does this even work - - if (oldChannel.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldChannel.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${app.types.channels[oldChannel.type] || "Unknown Channel Type"} updated!`, - color: app.config.system.embedColors.yellow, - fields: [] - }; - - if (oldChannel.name !== newChannel.name) // Check channel name - embed.fields.push({ name: "Name", value: oldChannel.name + " -> " + newChannel.name, inline: true }); - else - embed.fields.push({ name: "Name", value: oldChannel.name, inline: true }); - embed.fields.push({ name: "ID", value: oldChannel.id, inline: true }); - - if (oldChannel.topic != newChannel.topic) // Check channel topic - embed.fields.push({ name: "Topic", value: oldChannel.topic + " -> " + newChannel.topic }); - - if (oldChannel.parentId != newChannel.parentId) // Check channel emoji - embed.fields.push({ name: "Category", value: oldChannel.parentId + " -> " + newChannel.parentId }); - - if (oldChannel.nsfw != newChannel.nsfw) // Check channel is nsfw - embed.fields.push({ name: "NSFW", value: oldChannel.nsfw + " -> " + newChannel.nsfw }); - - if (oldChannel.rawPosition != newChannel.rawPosition) // Check channel position - embed.fields.push({ name: "Position", value: oldChannel.rawPosition + " -> " + newChannel.rawPosition }); - - embed.fields.push({ name: "Updated At", value: new Date().toString() }) - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "CHANNEL_UPDATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define channelLog - const channelLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the channel was updated. - Date.now() - entry.createdTimestamp < 5000 - ); - if (channelLog) { - const { executor } = channelLog; - - embed.fields.push({ name: "Updated by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/debug.js b/src/app/evts/debug.js deleted file mode 100644 index 3973ce6..0000000 --- a/src/app/evts/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = (app, data) => { - if (/(Sending a heartbeat|Latency of)/i.test(data)) return null; - if (app.debugMode) { - if (app.logger) - app.logger.debug("DISCORD", data); - else - console.log(data); - }; -}; \ No newline at end of file diff --git a/src/app/evts/emojiCreate.js b/src/app/evts/emojiCreate.js deleted file mode 100644 index 0e758ca..0000000 --- a/src/app/evts/emojiCreate.js +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = async(app, newEmoji) => { - if (newEmoji.partial) await newEmoji.fetch().catch(err => {}); - - if (newEmoji.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = newEmoji.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${(newEmoji.animated) ? "Animated" : "Standard"} Emoji created!`, - color: app.config.system.embedColors.green, - description: `There are now ${guild.emojis.cache.size} emojis.`, - fields: [ - { name: "Name", value: newEmoji.name, inline: true }, - { name: "ID", value: newEmoji.id, inline: true }, - { name: "Created At", value: new Date(newEmoji.createdTimestamp).toString() }, - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "EMOJI_CREATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define emojiLog - const emojiLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the emoji was created. - Date.now() - entry.createdTimestamp < 5000 - ); - if (emojiLog) { - const { executor } = emojiLog; - - embed.fields.push({ name: "Uploaded by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = { url: `https://cdn.discordapp.com/emojis/${newEmoji.id}.${(newEmoji.animated) ? "gif" : "png"}` }; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/emojiDelete.js b/src/app/evts/emojiDelete.js deleted file mode 100644 index e5ad59a..0000000 --- a/src/app/evts/emojiDelete.js +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = async(app, oldEmoji) => { - if (oldEmoji.partial) await oldEmoji.fetch().catch(err => {}); - - if (oldEmoji.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldEmoji.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${(oldEmoji.animated) ? "Animated" : "Standard"} Emoji deleted!`, - color: app.config.system.embedColors.dark_blue, - description: `There are now ${guild.emojis.cache.size} emojis.`, - fields: [ - { name: "Name", value: oldEmoji.name, inline: true }, - { name: "ID", value: oldEmoji.id, inline: true }, - { name: "Deleted At", value: new Date().toString() }, - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "EMOJI_DELETE", - }).catch(err => {}); - if (fetchedLogs) { - - //define emojiLog - const emojiLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the emoji was created. - Date.now() - entry.createdTimestamp < 5000 - ); - if (emojiLog) { - const { executor } = emojiLog; - - embed.fields.push({ name: "Deleted by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = { url: `https://cdn.discordapp.com/emojis/${oldEmoji.id}.${(oldEmoji.animated) ? "gif" : "png"}` }; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/emojiUpdate.js b/src/app/evts/emojiUpdate.js deleted file mode 100644 index 2e7b6c7..0000000 --- a/src/app/evts/emojiUpdate.js +++ /dev/null @@ -1,55 +0,0 @@ -module.exports = async(app, oldEmoji, newEmoji) => { - if (oldEmoji.partial) await oldEmoji.fetch().catch(err => {}); - if (newEmoji.partial) await newEmoji.fetch().catch(err => {}); - - if (oldEmoji == newEmoji) return; // how does this even work - - if (oldEmoji.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldEmoji.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${(oldEmoji.animated) ? "Animated" : "Standard"} Emoji updated!`, - color: app.config.system.embedColors.yellow, - fields: [] - }; - - if (oldEmoji.name !== newEmoji.name) // Check emoji name - embed.fields.push({ name: "Name", value: oldEmoji.name + " -> " + newEmoji.name, inline: true }); - else - embed.fields.push({ name: "Name", value: oldEmoji.name, inline: true }); - embed.fields.push({ name: "ID", value: oldEmoji.id, inline: true }); - - if (oldEmoji.color != newEmoji.color) // Check emoji color - embed.fields.push({ name: "Color", value: oldEmoji.color + " -> " + newEmoji.color }); - - - embed.fields.push({ name: "Updated At", value: new Date().toString() }) - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "EMOJI_UPDATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define emojiLog - const emojiLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the emoji was updated. - Date.now() - entry.createdTimestamp < 5000 - ); - if (emojiLog) { - const { executor } = emojiLog; - - embed.fields.push({ name: "Updated by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = { url: `https://cdn.discordapp.com/emojis/${oldEmoji.id}.${(oldEmoji.animated) ? "gif" : "png"}` }; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/guildBanAdd.js b/src/app/evts/guildBanAdd.js deleted file mode 100644 index 69e40bc..0000000 --- a/src/app/evts/guildBanAdd.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = async(app, ban) => { - if (ban.partial) await ban.fetch().catch(err => {}); - - if (ban.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = ban.guild, - user = ban.user; - - if (!guild || !user) return; // We MUST have the guild and user so we can get the correct data. (Just safety) - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMemberChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: ((user.bot) ? "Bot" : "User") + " Banned!", - color: app.config.system.embedColors.orange, - fields: [ - { name: "Full Tag", value: app.functions.pomeloHandler(user), inline: true }, - { name: "ID", value: user.id, inline: true }, - { name: "Banned at", value: new Date().toString() } - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "MEMBER_BAN_ADD", - }).catch(err => {}); - if (fetchedLogs) { - - //define banLog - const banLog = fetchedLogs.entries.find(entry => { // To avoid false positives, we look for a timeframe of when the ban was created, and if the user banned is the correct entry. - Date.now() - entry.createdTimestamp < 5000 - }); - if (banLog) { - const { executor } = banLog; - - embed.fields.push({ name: "Banned by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }); - if (banLog.reason) - embed.fields.push({ name: "Reason", value: banLog.reason }); - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/guildBanRemove.js b/src/app/evts/guildBanRemove.js deleted file mode 100644 index 16c6707..0000000 --- a/src/app/evts/guildBanRemove.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = async(app, ban) => { - if (ban.partial) await ban.fetch().catch(err => {}); - - if (ban.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = ban.guild, - user = ban.user; - - if (!guild || !user) return; // We MUST have the guild and user so we can get the correct data. (Just safety) - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMemberChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: ((user.bot) ? "Bot" : "User") + " Unbanned!", - color: app.config.system.embedColors.lime, - fields: [ - { name: "Full Tag", value: app.functions.pomeloHandler(user), inline: true }, - { name: "ID", value: user.id, inline: true }, - { name: "Unbanned at", value: new Date().toString() } - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "MEMBER_BAN_REMOVE", - }).catch(err => {}); - if (fetchedLogs) { - - //define banLog - const banLog = fetchedLogs.entries.find(entry => { // To avoid false positives, we look for a timeframe of when the ban was created, and if the user banned is the correct entry. - Date.now() - entry.createdTimestamp < 5000 - }); - if (banLog) { - const { executor } = banLog; - - embed.fields.push({ name: "Unbanned by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }); - - if (banLog.reason) - embed.fields.push({ name: "Reason", value: banLog.reason }); - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/guildCreate.js b/src/app/evts/guildCreate.js deleted file mode 100644 index 345ca5c..0000000 --- a/src/app/evts/guildCreate.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = async(app, newGuild) => { - app.logger.debug("DISCORD", `Added to the server ${newGuild.name} (${newGuild.id}).`); - newGuild.invites.fetch().then(guildInvites => { - app.client.guildInvites.set(newGuild.id, new Map(guildInvites.map((invite) => [invite.code, invite.uses]))); - }) -}; \ No newline at end of file diff --git a/src/app/evts/guildDelete.js b/src/app/evts/guildDelete.js deleted file mode 100644 index e413878..0000000 --- a/src/app/evts/guildDelete.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = async(app, oldGuild) => { - app.logger.debug("DISCORD", `Removed from the server ${oldGuild.name} (${oldGuild.id}).`); - app.client.guildInvites.delete(guild.id); -}; \ No newline at end of file diff --git a/src/app/evts/guildMemberAdd.js b/src/app/evts/guildMemberAdd.js deleted file mode 100644 index d85421d..0000000 --- a/src/app/evts/guildMemberAdd.js +++ /dev/null @@ -1,210 +0,0 @@ -module.exports = async(app, newMember) => { - if (newMember.partial) await newMember.fetch().catch(err => {}); - - if (newMember.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = newMember.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMemberChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - - var GetInviteInfo = async() => { - try { - if (newMember.user.bot) return { "msg": "OAuth" }; - - const newInvites = await guild.invites.fetch(); - const oldInvites = await app.client.guildInvites.get(guild.id); - const usedInvite = await newInvites.find(i => i.uses > oldInvites.get(i.code)); - if (!usedInvite) return { "msg": "I do not know how they joined" }; - const inviter = app.client.users.cache.get(usedInvite.inviter.id); - - return { "inviter": { "tag": app.functions.pomeloHandler(inviter), "id": inviter.id }, "code": usedInvite.code, "uses": usedInvite.uses }; - - } catch (Ex) { - app.logger.error("DISCORD", `[guildMemberAdd] [GetInviteInfo] ${Ex.message}\n${Ex.stack}`); - return { msg: "Sorry, something went wrong while fetching this information." }; - }; - }; - - var inviteInfo = await GetInviteInfo(); // shush ik im using the old system from v4. - if (inviteInfo) - if (inviteInfo["msg"] == null) { - if (inviteInfo["code"] == null) - inviteInfo["code"] = "I do not know how they joined."; - if (inviteInfo["inviter"] == null) - inviteInfo["inviter"] = { "tag": "Unknown#0000", "id": "0" }; - if (inviteInfo["uses"] == null) - inviteInfo["uses"] = 0; - - }; - - - function nth(n) { return n + (["st", "nd", "rd"][((n + 90) % 100 - 10) % 10 - 1] || "th") }; - const newMemberNth = nth(guild.members.cache.size); - var logMemberJoin = async() => { - // -- LOG THAT USER JOINED - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${(newMember.user.bot) ? "Bot Added" : "User Joined"}`, - color: app.config.system.embedColors.green, - description: `They are the ${newMemberNth} member.`, - fields: [ - { name: "Full Tag", value: app.functions.pomeloHandler(newMember.user), inline: true }, - { name: "ID", value: newMember.user.id, inline: true }, - { name: "Created", value: new Date(newMember.user.createdTimestamp).toString() }, - ], - thumbnail: newMember.user - }; - if (inviteInfo) - embed.fields.push({ name: "Invited by", value: (inviteInfo["msg"] != null ? inviteInfo["msg"] : "**" + inviteInfo["inviter"]["tag"] + "** (" + inviteInfo["inviter"]["id"] + ") using code **" + inviteInfo["code"] + "**. It now has **" + inviteInfo["uses"] + "** uses.") }); - - await app.functions.msgHandler(logChannel, { - embeds: [embed] - }); - }; - - var announceMemberJoin = async() => { - // -- GENERATE MEMBER JOIN MESSAGES - if (newMember.user.bot) return; // cough, i said member, not bot. - - var otherSettings = serverSettings.get("other"); - if (!otherSettings) return; - try { otherSettings = JSON.parse(otherSettings); } catch (Ex) { return; }; - - joinSettings = otherSettings["join"]; - if (!joinSettings) return; - - var announceChannelID = joinSettings["channel"]; - var announceMessageTemplate = joinSettings["msg"]; - var announceChannel = app.client.channels.cache.get(announceChannelID); - if (!announceChannel || !announceMessageTemplate) return; // Something's wrong here? - - // -- ANNOUNCE MESSAGE - var announceMessage = null, - placeholders = announceMessageTemplate.match(/%\w+%/g) || null; - var safePlaceholders = app.functions.getTypes.replaceWith("join"); - if (placeholders.length > 0) { - for (var i = 0; i < placeholders.length; i++) { - if (Object.keys(safePlaceholders).includes(placeholders[i])) { - if (placeholders[i].startsWith("%invite")) { - var whatWeLookingFor = placeholders[i].replaceAll("%", ""); - - if (whatWeLookingFor.startsWith("inviter")) { - if (!inviteInfo || !inviteInfo["inviter"]) announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], "Unknown"); - else { - var inviter = app.client.users.cache.get(inviteInfo["inviter"]["id"]) || null; - if (inviteInfo["msg"] == null && inviter == null) announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], "Unknown"); - else { - - switch (whatWeLookingFor.split("inviter")[0]) { - case "name": - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], (inviter.username) ? inviter.username : ""); - case "ID": - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], (inviter.id) ? inviter.id : ""); - case "tag": - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], (inviter.tag) ? inviter.tag : ""); - default: - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], (inviter) ? inviter.toString() : ""); - }; - }; - }; - } else if (!whatWeLookingFor.startsWith("inviter")) { - switch (whatWeLookingFor.split("invite")[1]) { - case "code": - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], (inviteInfo["code"] != null) ? inviteInfo["code"] : "Unknown"); - case "uses": - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], (inviteInfo["uses"] != null) ? inviteInfo["uses"] : ""); - default: - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], "Unknown"); - }; - } - } else // -- WARNING :: THIS IS DANGEROUS | DO NOT SEND ANYTHING OTHER THAN newMember AND PLACEHOLDERS. - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], new Function('newMember, safePlaceholders, placeholders', - 'return newMember.' + safePlaceholders[placeholders[i]].replaceAll("|", ".") - )(newMember, safePlaceholders, placeholders)); - }; - }; - announceMessage = announceMessageTemplate; - }; - - // -- WELCOME IMAGE GENERATION - var attachment = null, - location = process.cwd() + "/app/imgs/welcome/"; - const templateFiles = app.modules["fs"].readdirSync(location).filter(file => file.startsWith('welimg') && file.endsWith('.png')); - if (templateFiles.length == 0) app.logger.error("SYS", "Load welcome templates failed!"); - else { - var templateName = templateFiles[Math.floor(Math.random() * templateFiles.length)]; - var templateFile = location + templateName; - - function containsSpecialCharacters(s) { - return /[^\u0000-\u00ff]/.test(s); - }; - - // Canvas jazz crap - const Canvas = app.modules["canvas"]; - const canvas = Canvas.createCanvas(1772, 633), - ctx = canvas.getContext('2d'); - - // Register custom font - Canvas.registerFont(location + "/fonts/segoeuib.ttf", { family: "Segoe UI" }); - // Draw the background - const background = await Canvas.loadImage(templateFile); - ctx.drawImage(background, 0, 0, canvas.width, canvas.height); - ctx.strokeStyle = '#f2f2f2'; - ctx.strokeRect(0, 0, canvas.width, canvas.height); - - // Draw welcome text - var welcomeText = `Welcome to the server,`; - ctx.font = '69px Genta'; - ctx.fillStyle = '#f2f2f2'; - ctx.fillText(welcomeText, 700, canvas.height / 2 - 150); - - // Draw username (make it small if necessary) - const userText = `${newMember.user.username}`; - const tSize = (userText.length >= 14) ? (150 - (userText.length * 3.59)) : "150" - ctx.font = tSize + 'px "Segoe UI"'; - ctx.fillStyle = '#f2f2f2'; - ctx.fillText(userText, 700, canvas.height / 2 + 20); - - - // Draw Nth member count - var memCountText = `You're the ${newMemberNth} member!`; - ctx.font = '36px Genta'; - ctx.fillStyle = '#f2f2f2'; - ctx.fillText(memCountText, 705, canvas.height / 2 + 125); - - // Draw avatar circle - ctx.beginPath(); - ctx.arc(315, canvas.height / 2, 250, 0, Math.PI * 2, true); //position of img - ctx.closePath(); - ctx.clip(); - // Draw avatar now - const avatar = await Canvas.loadImage(newMember.user.displayAvatarURL({ format: 'png', dynamic: true, size: 512 })); - ctx.drawImage(avatar, 65, canvas.height / 2 - 250, 500, 500); - - attachment = new app.modules["discord.js"].MessageAttachment(canvas.toBuffer(), 'tcbwelcome.png'); - - }; - - - var data = { - content: (announceMessage != null) ? announceMessage : "** **", - files: (attachment) ? [attachment] : [], - }; - - - if (announceMessage != null) - await app.functions.msgHandler(announceChannel, data); - }; - - - - - await logMemberJoin(); - await announceMemberJoin(); -}; \ No newline at end of file diff --git a/src/app/evts/guildMemberRemove.js b/src/app/evts/guildMemberRemove.js deleted file mode 100644 index bbdf93f..0000000 --- a/src/app/evts/guildMemberRemove.js +++ /dev/null @@ -1,86 +0,0 @@ -module.exports = async(app, oldMember) => { - if (oldMember.partial) await oldMember.fetch().catch(err => {}); - - if (oldMember.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldMember.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMemberChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var logMemberLeave = async() => { - // -- LOG THAT USER LEFT - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${(oldMember.user.bot) ? "Bot Removed" : "User Left"}`, - color: app.config.system.embedColors.dark_blue, - description: `There are now ${guild.members.cache.size} members.`, - fields: [ - { name: "Full Tag", value: app.functions.pomeloHandler(oldMember.user), inline: true }, - { name: "ID", value: oldMember.user.id, inline: true }, - { name: "Joined", value: new Date(oldMember.joinedTimestamp).toString() } - ], - thumbnail: oldMember.user - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "MEMBER_KICK", - }).catch(err => {}); - if (fetchedLogs) { - - //define kickLog - const kickLog = fetchedLogs.entries.find(entry => { // To avoid false positives, we look for a timeframe of when the ban was created, and if the user banned is the correct entry. - Date.now() - entry.createdTimestamp < 5000 - }); - if (kickLog) { - const { executor } = kickLog; - - embed.fields.push({ name: "Kicked by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }); - if (kickLog.reason) - embed.fields.push({ name: "Reason", value: kickLog.reason }); - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); - }; - - var announceMemberLeave = async() => { - // -- GENERATE MEMBER LEAVE MESSAGES - - var otherSettings = serverSettings.get("other"); - if (!otherSettings) return; - try { otherSettings = JSON.parse(otherSettings); } catch (Ex) { return; }; - - leaveSettings = otherSettings["leave"]; - if (!leaveSettings) return; - - var announceChannelID = leaveSettings["channel"]; - var announceMessageTemplate = leaveSettings["msg"]; - var announceChannel = app.client.channels.cache.get(announceChannelID); - if (!announceChannel || !announceMessageTemplate) return; // Something's wrong here? - - var announceMessage = null, - placeholders = announceMessageTemplate.match(/%\w+%/g) || null; - var safePlaceholders = app.functions.getTypes.replaceWith("leave"); - if (placeholders.length > 0) { - for (var i = 0; i < placeholders.length; i++) { - if (Object.keys(safePlaceholders).includes(placeholders[i])) { - // -- WARNING :: THIS IS DANGEROUS | DO NOT SEND ANYTHING OTHER THAN oldMember AND PLACEHOLDERS. - announceMessageTemplate = announceMessageTemplate.replaceAll(placeholders[i], new Function('oldMember, safePlaceholders, placeholders', 'return oldMember.' + safePlaceholders[placeholders[i]].replaceAll("|", "."))(oldMember, safePlaceholders, placeholders)); - }; - }; - announceMessage = announceMessageTemplate; - }; - - if (announceMessage != null) - await app.functions.msgHandler(announceChannel, { content: announceMessage }); - }; - - await logMemberLeave(); - await announceMemberLeave(); -}; \ No newline at end of file diff --git a/src/app/evts/guildMemberUpdate.js b/src/app/evts/guildMemberUpdate.js deleted file mode 100644 index ba0b3f4..0000000 --- a/src/app/evts/guildMemberUpdate.js +++ /dev/null @@ -1,68 +0,0 @@ -module.exports = async(app, oldMember, newMember) => { - if (oldMember.partial) await oldMember.fetch().catch(err => {}); - if (newMember.partial) await newMember.fetch().catch(err => {}); - - if (oldMember == newMember) return; // how does this even work - - if (oldMember.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldMember.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMemberChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: `${(oldMember.user.bot) ? "Bot" : "User"} updated!`, - color: app.config.system.embedColors.yellow, - fields: [] - }; - - - embed.fields.push({ name: "User", value: app.functions.pomeloHandler(oldMember.user), inline: true }); - embed.fields.push({ name: "ID", value: oldMember.user.id, inline: true }); - - if (oldMember.nickname != newMember.nickname) // Check member nickname - embed.fields.push({ name: "Nickname", value: oldMember.nickname + " -> " + newMember.nickname }); - - // This doesn't seem to fire correctly, so it's disabled until probably D.JSv14 when I can get server banners/avatars to work. - // if (oldMember.avatar != newMember.avatar) // Check member avatar - // embed.fields.push({ name: "Avatar", value: oldMember.avatar + " -> " + newMember.avatar, inline: true }); - - // if (oldMember.banner != newMember.banner) // Check member banner - // embed.fields.push({ name: "Banner", value: oldMember.banner + " -> " + newMember.banner, inline: true }); - - if (oldMember.roles.cache.size != newMember.roles.cache.size) { // Check member roles - var roleUpdated = app.functions.arrayDifference(oldMember.roles.cache.filter(r => r.id != guild.id).map(rF => rF.name), newMember.roles.cache.filter(r => r.id != guild.id).map(rF => rF.name)) - for (var i = 0; i < roleUpdated.length; i++) roleUpdated[i] = "`" + roleUpdated[i] + "`"; - if (oldMember.roles.cache.size > newMember.roles.cache.size) embed.fields.push({ name: "Roles Removed", value: roleUpdated.join(", ") || "Failed to get roles removed" }); // rip features - else if (oldMember.roles.cache.size < newMember.roles.cache.size) embed.fields.push({ name: "Roles Added", value: roleUpdated.join(", ") || "Failed to get roles added" }); // ooo features - }; - - if (embed.fields.length < 4) return; // Since we aren't subscribing to all updates, stop here if it was something else non-related to what we have. - - embed.fields.push({ name: "Updated At", value: new Date().toString() }) - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - }).catch(err => {}); - if (fetchedLogs) { - - //define memberLog - const memberLog = fetchedLogs.entries.filter(e => e.action === "MEMBER_UPDATE" || e.action === "MEMBER_ROLE_UPDATE").find(entry => // To avoid false positives, we look for a timeframe of when the member was updated. - Date.now() - entry.createdTimestamp < 5000 - ); - if (memberLog) { - const { executor } = memberLog; - - if (executor.id != oldMember.user.id) - embed.fields.push({ name: "Updated by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/guildUpdate.js b/src/app/evts/guildUpdate.js deleted file mode 100644 index 435c7bb..0000000 --- a/src/app/evts/guildUpdate.js +++ /dev/null @@ -1,101 +0,0 @@ -module.exports = async(app, oldGuild, newGuild) => { - if (oldGuild.partial) await oldGuild.fetch().catch(err => {}); - if (newGuild.partial) await newGuild.fetch().catch(err => {}); - - if (oldGuild == newGuild) return; // how does this even work - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: oldGuild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${newGuild.name} (${newGuild.id})`, icon_url: newGuild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: "Server updated!", - color: app.config.system.embedColors.yellow, - fields: [] - }; - - if (oldGuild.name !== newGuild.name) // Check guild name - embed.fields.push({ name: "Name", value: oldGuild.name + " -> " + newGuild.name, inline: true }); - else - embed.fields.push({ name: "Name", value: oldGuild.name, inline: true }); - embed.fields.push({ name: "ID", value: oldGuild.id, inline: true }); - - - if (oldGuild.icon != newGuild.icon) // Check guild icon - embed.fields.push({ name: "Icon", value: oldGuild.icon + " -> " + newGuild.icon }); - - if (oldGuild.ownerId != newGuild.ownerId) // Check guild ownerId - embed.fields.push({ name: "Owner ID", value: oldGuild.ownerId + " -> " + newGuild.ownerId }); - - if (oldGuild.features !== newGuild.features) { // Check guild features - var featureUpdated = app.functions.arrayDifference(oldGuild.features, newGuild.features) - for (var i = 0; i < featureUpdated.length; i++) featureUpdated[i] = "`" + featureUpdated[i] + "`"; - if (oldGuild.features.length > newGuild.features.length) embed.fields.push({ name: "Features Removed", value: featureUpdated.join(", ") || "Failed to get features removed" }); // rip features - else if (oldGuild.features.length < newGuild.features.length) embed.fields.push({ name: "Features Added", value: featureUpdated.join(", ") || "Failed to get features added" }); // ooo features - }; - - if (oldGuild.description != newGuild.description) // Check guild description - embed.fields.push({ name: "Description", value: oldGuild.description + " -> " + newGuild.description }); - - if (oldGuild.splash != newGuild.splash) // Check guild splash - embed.fields.push({ name: "Splash", value: oldGuild.splash + " -> " + newGuild.splash }); - - if (oldGuild.discoverySplash != newGuild.discoverySplash) // Check guild discoverySplash - embed.fields.push({ name: "Discovery Splash", value: oldGuild.discoverySplash + " -> " + newGuild.discoverySplash }); - - if (oldGuild.banner != newGuild.banner) // Check guild banner - embed.fields.push({ name: "Banner", value: oldGuild.banner + " -> " + newGuild.banner }); - - if (oldGuild.verificationLevel != newGuild.verificationLevel) // Check guild verificationLevel - embed.fields.push({ name: "Verification Level", value: oldGuild.verificationLevel + " -> " + newGuild.verificationLevel }); - - if (oldGuild.vanityURLCode != newGuild.vanityURLCode) // Check guild vanityURLCode - embed.fields.push({ name: "Vanity URL Code", value: oldGuild.vanityURLCode + " -> " + newGuild.vanityURLCode }); - - if (oldGuild.afkChannelId != newGuild.afkChannelId) // Check guild afkChannelId - embed.fields.push({ name: "AFK Channel ID", value: oldGuild.afkChannelId + " -> " + newGuild.afkChannelId, inline: true }); - - if (oldGuild.systemChannelId != newGuild.systemChannelId) // Check guild systemChannelId - embed.fields.push({ name: "System Channel ID", value: oldGuild.systemChannelId + " -> " + newGuild.systemChannelId, inline: true }); - - if (oldGuild.rulesChannelId != newGuild.rulesChannelId) // Check guild rulesChannelId - embed.fields.push({ name: "Rules Channel ID", value: oldGuild.rulesChannelId + " -> " + newGuild.rulesChannelId, inline: true }); - - if (oldGuild.rulesChannelId != newGuild.publicUpdatesChannelId) // Check guild publicUpdatesChannelId - embed.fields.push({ name: "Public Updates Channel ID", value: oldGuild.publicUpdatesChannelId + " -> " + newGuild.publicUpdatesChannelId, inline: true }); - - if (oldGuild.mfaLevel != newGuild.mfaLevel) // Check guild mfaLevel - embed.fields.push({ name: "2FA Level", value: oldGuild.mfaLevel + " -> " + newGuild.mfaLevel }); - - if (oldGuild.defaultMessageNotifications != newGuild.defaultMessageNotifications) // Check guild defaultMessageNotifications - embed.fields.push({ name: "Default Message Notifications", value: oldGuild.defaultMessageNotifications + " -> " + newGuild.defaultMessageNotifications }); - - if (!embed.fields.length > 2) return; // Since we aren't subscribing to all updates, stop here if it was something else non-related to what we have. - - - embed.fields.push({ name: "Updated At", value: new Date().toString() }) - - const fetchedLogs = await newGuild.fetchAuditLogs({ - limit: 6, - type: "GUILD_UPDATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define guildLog - const guildLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the guild was updated. - Date.now() - entry.createdTimestamp < 5000 - ); - if (guildLog) { - const { executor } = guildLog; - - embed.fields.push({ name: "Updated by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/inviteCreate.js b/src/app/evts/inviteCreate.js deleted file mode 100644 index 4818d77..0000000 --- a/src/app/evts/inviteCreate.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = async(app, invite) => { - if (app.client.guilds.cache.size < 100) // To prevent spam, we'll cap it at 100 to log. - app.logger.debug("DISCORD", `Invite ${invite.code} with ${invite.uses} uses was created in ${invite.guild.id}. The new invite will be cached.`); - app.client.guildInvites.get(invite.guild.id).set(invite.code, invite.uses); -}; \ No newline at end of file diff --git a/src/app/evts/inviteDelete.js b/src/app/evts/inviteDelete.js deleted file mode 100644 index 82ba16a..0000000 --- a/src/app/evts/inviteDelete.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = async(app, invite) => { - if (app.client.guilds.cache.size < 100) // To prevent spam, we'll cap it at 100 to log. - app.logger.debug("DISCORD", `Invite ${invite.code} with ${invite.uses} uses was deleted from ${invite.guild.id}. Removing from cache...`); - app.client.guildInvites.get(invite.guild.id).delete(invite.code); -}; \ No newline at end of file diff --git a/src/app/evts/messageCreate.js b/src/app/evts/messageCreate.js deleted file mode 100644 index 78532ee..0000000 --- a/src/app/evts/messageCreate.js +++ /dev/null @@ -1,188 +0,0 @@ -module.exports = async(app, message) => { - if (message.author.bot) return; - - if (!app.client.eulaMsgSent) app.client.eulaMsgSent = []; - if (!app.client.cooldowns) app.client.cooldowns = {}; - - var serverSettings = null; - if (message.guild) { - serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - if (!serverSettings) { - await app.functions.DB.createServer(message.guild.id); - serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - }; - }; - - var userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }); - if (!userSettings) { - await app.functions.DB.createUser(message.author.id); - userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }); - }; - - - if (userSettings.get("AFKSettings")) { - var AFKSettings = JSON.parse(userSettings.get("AFKSettings")) || null; - if (AFKSettings != null) { - try { - app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "Welcome back!")}`, - color: app.config.system.embedColors.lime, - description: `${app.lang.getLine(userSettings.get("language"), "You were AFK for")} **${app.functions.TStoHR(new Date().getTime() - AFKSettings["timestamp"])}**.${(AFKSettings["mentions"] > 0) ? "\nYou were mentioned **" + AFKSettings["mentions"] + "** times!" : ""}` - }] - }, 0, true, (async msg => { - var rowsUpdated = await app.DBs.userSettings.update({ AFKSettings: null }, { where: { userID: message.author.id } }); - if (rowsUpdated < 1) - return app.functions.msgHandler(message, { content: app.lang.getLine(userSettings.get("language"), "Something went wrong while updating your database entry!") }, 0, true); - userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }); - setTimeout(function() { msg.delete(); }, 6000); - })); - } catch (Ex) {}; - }; - }; - - var prefix = userSettings.get("prefix"); - if (!prefix) { - prefix = app.config.system.defaultPrefix; - - var rowsUpdated = await app.DBs.userSettings.update({ prefix: prefix }, { where: { userID: message.author.id } }); - if (rowsUpdated < 1) - return app.functions.msgHandler(message, { content: app.lang.getLine(userSettings.get("language"), "Something went wrong while updating your database entry!") }, 0, true); - userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }); - }; - - if (!message.content.startsWith(prefix)) { // If the user did not include prefix - if (message.mentions.has(app.client.user.id) && !message.mentions.everyone && !message.reference) // ...and did not reply to & actually pinged the bot. - return app.functions.msgHandler(message, { content: `n-nya! My prefix is \`${prefix}\`` }, 0, true); - else if (!message.mentions.has(app.client.user.id) && !message.mentions.everyone) { - var AFKpeeps = []; - var usersSettings = await app.DBs.userSettings.findAll({ where: {}, raw: true }); // WARNING: Do not expose this variable. - for (user in usersSettings) { - user = usersSettings[user]; - if (user["AFKSettings"] != null) { - var AFKSettings = JSON.parse(user["AFKSettings"]); - if (message.mentions.has(user["userID"])) { - AFKSettings["mentions"]++; - let AFKReason = ((AFKSettings["reason"]) != "." ? ": " + AFKSettings["reason"].replace(/[<@&>]/g, '') : ""); // hotfix because apparently user & role pings are possible. - AFKpeeps.push(`${app.functions.pomeloHandler(app.client.users.cache.get(user["userID"]))} ${app.lang.getLine(userSettings.get("language"), "has been AFK since")} ${app.functions.TStoHR(new Date().getTime() - AFKSettings["timestamp"])} ago${AFKReason}`); - try { await app.DBs.userSettings.update({ AFKSettings: JSON.stringify(AFKSettings, null, "\t") }, { where: { userID: user["userID"] } }); } catch (Ex) {}; - }; - }; - }; - - if (AFKpeeps.length > 0) - app.functions.msgHandler(message, { - content: `${AFKpeeps.join("\n") || app.lang.getLine(userSettings.get("langugage"), "Something went wrong while fetching AFK data.")}` - }, 0, true); - return; - } else return; - }; - - const args = message.content.slice(prefix.length).split(/ +/); - const commandName = args.shift().toLowerCase(); - - - if (!commandName) { - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} just triggered prefix. (${prefix})`); - return; - }; - - var command = app.commands.get(commandName) || app.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); - if (!command) return app.functions.ErrorHandler(app, userSettings, message, commandName, new Error(app.lang.getLine(userSettings.get("language"), "Command not found.")), "warning"); - - if (!args || - args && args.slice(0)) - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} running ${commandName}`); - else - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} running ${commandName} with args: ${args.join(" ")}`); - - - - - try { - - if (app.client.cooldowns[message.author.id]) { - var userCooldown = app.client.cooldowns[message.author.id].filter(item => item.command == command.name); - if (userCooldown.length > 0) { - var cooldownTime = (userCooldown[0].time - message.createdTimestamp); - if (cooldownTime > 1000) { - var responses = app.lang.getLine(userSettings.get("language"), "coolDownResponse"); - return app.functions.msgHandler(message, { - embeds: [{ - color: app.config.system.embedColors.red, - description: `${responses[Math.floor(Math.random() * responses.length)]}\n*(${app.lang.getLine(userSettings.get("language"), "On cooldown for")} ${app.functions.TStoHR(cooldownTime)})*` - }] - }, 0, true); - } else { - app.client.cooldowns[message.author.id] = [userCooldown][0] = null; - } - }; - - }; - - if (!app.config.system.owners.includes(message.author.id)) { - if (app.config.system.commandState == "Disabled") { - app.logger.info("DISCORD", `[MESSAGE] Return ${message.author.id} command: Disabled.`); - - return app.functions.ErrorHandler(app, userSettings, message, command.name, new Error(app.lang.getLine(userSettings.get("language"), "Commands are disabled!")), "warning"); - - }; - }; - var eC = command.category + "/" + command.name; - loaded = await app.bootloader.loadHandler(app, "command", [eC], true, false); - if (loaded.success[0] == eC) { - if (userSettings.get('acceptedEULA') === false && command.category != "Moderation" && command.name != "eval") { - if (app.client.eulaMsgSent.includes(message.author.id)) - return; - - var eulaFile = `./special/eula.js`; - await app.functions.clearCache(eulaFile); - var eulaResult = { denied: false, done: false }; - try { - var eula = require(eulaFile); - eulaResult = await eula(app, message); - if (eulaResult["denied"]) return; - } catch (Ex) { - return app.functions.ErrorHandler(app, userSettings, message, command.name, new Error(`Nya.. ${app.lang.getLine(userSettings.get("language"), "End-User Agreement failed to load. How does that even happen...")}`), "error"); - }; - - }; - - if (command.guildOnly == true && message.guild == null) { - app.logger.info("DISCORD", `[MESSAGE] Return ${message.author.id} command: server-only.`); - return app.functions.ErrorHandler(app, userSettings, message, command.name, new Error("Server-only command!"), "warning"); - }; - if (app.functions.hasPermissions(message, command)) { - try { - await app.functions.clearCache(command.file); // Clear cache :> - command = require(command.file); - await command.execute(app, message, args, userSettings); - if (!userSettings.get('optedOut')) - userSettings.update({ executedCommands: (userSettings.get('executedCommands') + 1) }, { where: { userID: message.author.id } }); - if (command.cooldown != null) { - if (command.cooldown < 0) { // how do you even have a negative cooldown?? - var defaultCooldown = 2; - app.logger.info("SYS", `Command ${command.name} has a cooldown of ${command.cooldown} (expected 0 or higher); it's been set to ${defaultCooldown}.`); - command.cooldown = defaultCooldown; - }; - if (command.cooldown != 0) { - if (!app.client.cooldowns[message.author.id]) app.client.cooldowns[message.author.id] = []; - app.client.cooldowns[message.author.id].push({ command: command.name, time: (message.createdTimestamp + (command.cooldown * 1000)) }) - }; - }; - } catch (err) { - app.logger.error("DISCORD", "[MESSAGE] Whoops! Something went wrong!\n" + err); - - return app.functions.ErrorHandler(app, userSettings, message, command.name, err, "error"); - }; - app.logger.success("DISCORD", "[MESSAGE] Command execution complete."); - } else return app.functions.missingPerms(message, 0, "execute the " + command.name + " command", command); - } else { - throw new Error("There was an unknown error while loading the command: " + command.name); - } - } catch (err) { - app.logger.error("DISCORD", "[MESSAGE] Whoops! Something went wrong!\n" + err); - - return app.functions.ErrorHandler(app, userSettings, message, command.name, err, "error"); - }; -}; \ No newline at end of file diff --git a/src/app/evts/messageDelete.js b/src/app/evts/messageDelete.js deleted file mode 100644 index 24669f1..0000000 --- a/src/app/evts/messageDelete.js +++ /dev/null @@ -1,66 +0,0 @@ -module.exports = async(app, message) => { - if (message.partial) await message.fetch(true, true).catch(() => { app.logger.warn("DISCORD", `[MESSAGE] Message with ID ${message.id} was not in cache when deleted. Cannot get details.`); return; }); - - if (message.guild == null) // Stop if we not in a guild. - return; - else if (message.guild != null && message.author) // Or stop if we are in a guild and the author exists. - if (message.author.bot) return; // - and stop if we getting data from a bot. - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMessageChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var msgAttachments; - if (message.attachments.size > 0) { - msgAttachments = await app.functions.downloadAttachments(message, message.attachments); - - while (app.client.waitingForMessageToDelete.includes(message.id)) { - await app.functions.sleep(1000); - }; - }; - - var embs = { - color: app.config.system.embedColors.orange, - description: `Message ID: ${message.id} | [Message link](https://discord.com/channels/${message.guild.id}/${message.channel.id}/${message.id})`, - fields: [ - { name: ((message.partial) ? "Warning!" : "Content"), value: ((message.partial) ? "***Message was sent before cached. The contents are lost.***" : message.content) || "** **" }, - { name: "Deleted In", value: `${message.channel.name} (${message.channel.id}) | <#${message.channel.id}>` } - ] - }; - - if (message.author) embs["author"] = { name: `Message by ${app.functions.pomeloHandler(message.author)} (${ message.author.id}) deleted.`, icon_url: message.author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }; - const fetchedLogs = await message.guild.fetchAuditLogs({ - limit: 6, - type: "MESSAGE_DELETE", - }).catch(err => {}); - if (fetchedLogs) { - const deleteLog = fetchedLogs.entries.find(entry => // To avoid false positives, we sort by message author, message channel, and a timeframe of when the message was deleted. - ((message.author) ? entry.executor.id !== message.author.id : true) && - entry.extra.channel.id === message.channel.id && - Date.now() - entry.createdTimestamp < 5000 - ); - if (deleteLog) { // If none, we may be missing permissions to fetch audit log. - const { executor } = deleteLog; - embs.fields.push({ name: "Deleted by", value: (executor) ? `${app.functions.pomeloHandler(executor)} (${executor.id})` : "Unknown" }); - embs["thumbnail"] = executor; - - }; - }; // May be missing permissions to fetch audit log. - - - if (message.attachments.size > 0) { - embs.fields.push({ - name: "Attachments", - value: - ((msgAttachments.succeed.length > 0) ? `${msgAttachments.succeed.join("\n")}` : "") + - ((msgAttachments.failed.length > 0) ? `**Failed (${msgAttachments.failed.length}):**\n ${msgAttachments.failed.join("\n ")}` : "") - }); - }; - - await app.functions.msgHandler(logChannel, { - embeds: [embs] - }); -} \ No newline at end of file diff --git a/src/app/evts/messageDeleteBulk.js b/src/app/evts/messageDeleteBulk.js deleted file mode 100644 index d7f587d..0000000 --- a/src/app/evts/messageDeleteBulk.js +++ /dev/null @@ -1,79 +0,0 @@ -module.exports = async(app, messages) => { - const firstMsg = messages.first() || null; - if (!firstMsg) return; - else if (firstMsg.guild == null) // Stop if we not in a guild. - return; - else if (firstMsg.guild != null && firstMsg.author) // Or stop if we are in a guild and the author exists. - if (firstMsg.author.bot) return; // - and stop if we getting data from a bot. - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: messages.first().guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMessageChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var data = new Map(); - - await messages.forEach(async message => { - if (message.partial) { await message.fetch().catch(() => messages.delete(message)); return }; // Try to get the message. - if (message.author.bot) { return messages.delete(message); }; // Stop if we getting data from a bot. - - var msgAttachments; - if (message.attachments.size > 0) { - msgAttachments = await app.functions.downloadAttachments(message, message.attachments); - - while (app.client.waitingForMessageToDelete.includes(message.id)) { - await app.functions.sleep(1000); - }; - }; - - var temp = `[${message.id} | ${app.functions.convertTimestamp(message.createdTimestamp, true, true)}] ${app.functions.pomeloHandler(message.author)}: ${message.content}`; - if (message.attachments.size > 0) { - temp = temp + - ((msgAttachments.succeed.length > 0) ? `\n\tAttachments: ${msgAttachments.succeed.join("\n")}` : "") + - ((msgAttachments.failed.length > 0) ? `\n\t**Failed (${msgAttachments.failed.length}):**\n ${msgAttachments.failed.join("\n ")}` : ""); - }; - - data.set(message.id, temp); - }); - - while (data.size < messages.size) { - await app.functions.sleep(1000); - }; - - data = new Map([...data.entries()].sort()); - var msgData = []; - data.forEach(val => msgData.push(val)); - - var options = { - embeds: [{ - author: { name: `${messages.size} messages deleted.`, icon_url: app.client.user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, - color: app.config.system.embedColors.orange, - description: `[Start Message link](https://discord.com/channels/${messages.first().guild.id}/${messages.first().channel.id}/${messages.first().id}) | [End Message link](https://discord.com/channels/${messages.last().guild.id}/${messages.last().channel.id}/${messages.last().id})`, - fields: [ - { name: "Deleted In", value: `${messages.first().channel.name} (${messages.first().channel.id}) | <#${messages.first().channel.id}>` } - ] - }] - }; - - try { // WRITE TO THE FILEEE!!! - const fileName = `bulkDel-${firstMsg.guild.id}-${firstMsg.channel.id}_${(new Date().getTime())}.txt`; - const fs = app.modules["fs"], - fileToExportTo = `${process.cwd()}/app/cache/${fileName}`; - - - await fs.appendFile(fileToExportTo, `// Message Bulk Delete Log\n// Time deleted: ${app.functions.convertTimestamp(new Date().getTime(), true, true)}\n\n${((msgData) ? ((msgData.length > 0) ? msgData.join("\n") : "No messages fetched. Bummer.") : "Something went wrong?")}`, 'utf8', (err) => { if (err) { console.error(err); } }); - await app.functions.sleep(1000); - - await app.functions.msgHandler(logChannel, options); - await app.functions.msgHandler(logChannel, { files: [fileToExportTo] }); - } catch (Ex) { - app.logger.error("DISCORD", "[MESSAGE] Delete Bulk errored! " + Ex.stack); - options["embeds"][0]["fields"].unshift({ name: "Contents (First-Last)", value: ((msgData) ? ((msgData.length > 0) ? msgData.join("\n") : "No messages fetched. Bummer.") : "Something went wrong?") }); - - await app.functions.msgHandler(logChannel, options); - }; - - -}; \ No newline at end of file diff --git a/src/app/evts/messageReactionAdd.js b/src/app/evts/messageReactionAdd.js deleted file mode 100644 index 5c3de00..0000000 --- a/src/app/evts/messageReactionAdd.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = async(app, reaction, user) => { - if (!reaction || !user) return; // Just making sure. - if (user.bot) return; // No bots >:( - - var message = reaction.message; - if (!message) return; // hmm, no message? - var guild = message.guild, - channel = message.channel; - if (!guild) return; // Must be in a server :) - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - if (!serverSettings) return; - - if (serverSettings["reactionRoles"] != null) { - var reactionRolesSettings = JSON.parse(serverSettings["reactionRoles"]); - - for (var dbChannel in reactionRolesSettings) { - if (channel.id === dbChannel) { - var settings = reactionRolesSettings[dbChannel]; - if (message.id === settings["message"]) { - var reactionThing = reaction.emoji.name || reaction.emoji.id; - reactionRoles = settings["reactionRoles"]; - - for (var i = 0; i < reactionRoles.length; i++) { - try { - var data = reactionRoles[i]; - if (data["emoji"]["name"] === reactionThing || data["emoji"]["id"] == reactionThing) { - const member = guild.members.cache.get(user.id), - role = guild.roles.cache.get(data["roleID"]); - member.roles.add(role, "Reaction Role").catch(err => {}); - return; - }; - } catch (Ex) { - app.logger.error("SYS", `Unable to give user ${user.id} the role ${data["roleID"]}...`); - return; - }; - }; - }; - }; - - }; - }; -}; \ No newline at end of file diff --git a/src/app/evts/messageReactionRemove.js b/src/app/evts/messageReactionRemove.js deleted file mode 100644 index 2276753..0000000 --- a/src/app/evts/messageReactionRemove.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = async(app, reaction, user) => { - if (!reaction || !user) return; // Just making sure. - if (user.bot) return; // No bots >:( - - var message = reaction.message; - if (!message) return; // hmm, no message? - var guild = message.guild, - channel = message.channel; - if (!guild) return; // Must be in a server :) - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: message.guild.id } }); - if (!serverSettings) return; - - if (serverSettings["reactionRoles"] != null) { - var reactionRolesSettings = JSON.parse(serverSettings["reactionRoles"]); - - for (var dbChannel in reactionRolesSettings) { - if (channel.id === dbChannel) { - var settings = reactionRolesSettings[dbChannel]; - if (message.id === settings["message"]) { - var reactionThing = reaction.emoji.name || reaction.emoji.id; - reactionRoles = settings["reactionRoles"]; - - for (var i = 0; i < reactionRoles.length; i++) { - try { - var data = reactionRoles[i]; - if (data["emoji"]["name"] === reactionThing || data["emoji"]["id"] == reactionThing) { - const member = guild.members.cache.get(user.id), - role = guild.roles.cache.get(data["roleID"]); - member.roles.remove(role, "Reaction Role").catch(err => {}); - - return; - }; - } catch (Ex) { - app.logger.error("SYS", `Unable to remove user ${user.id} from role ${data["roleID"]}...`); - return; - }; - }; - }; - }; - - }; - }; -}; \ No newline at end of file diff --git a/src/app/evts/messageUpdate.js b/src/app/evts/messageUpdate.js deleted file mode 100644 index 0e9a3f6..0000000 --- a/src/app/evts/messageUpdate.js +++ /dev/null @@ -1,33 +0,0 @@ -module.exports = async(app, omessage, nmessage) => { - if (omessage.partial) await omessage.fetch(true).catch(err => {}); - if (nmessage.partial) await nmessage.fetch(true).catch(err => {}); - - if (omessage.content == nmessage.content) return; - - if (omessage.guild == null) // Stop if we not in a guild. - return; - else if (omessage.guild != null && omessage.author) // Or stop if we are in a guild and the author exists. - if (omessage.author.bot) return; // - and stop if we getting data from a bot. - else {} - else return; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: omessage.guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingMessageChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - await app.functions.msgHandler(logChannel, { - embeds: [{ - author: { name: `Message by ${app.functions.pomeloHandler(omessage.author)} (${ omessage.author.id}) edited.`, icon_url: omessage.author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, - color: app.config.system.embedColors.yellow, - description: `Message ID: ${omessage.id} | [Go to message](https://discord.com/channels/${omessage.guild.id}/${omessage.channel.id}/${omessage.id})`, - fields: [ - { name: "Before", value: omessage.content }, - { name: "After", value: nmessage.content }, - { name: "Edited In", value: `${omessage.channel.name} (${omessage.channel.id}) | <#${omessage.channel.id}>` } - ], - }] - }); -} \ No newline at end of file diff --git a/src/app/evts/rateLimit.js.ignore b/src/app/evts/rateLimit.js.ignore deleted file mode 100644 index f8f6cfd..0000000 --- a/src/app/evts/rateLimit.js.ignore +++ /dev/null @@ -1,20 +0,0 @@ -/* - TheCodingBot v6 - https://tcb.nekos.tech -*/ - -module.exports = { - name: "rateLimit", - description: "Runs when the Gateway ratelimits you.", - author: ["Aisuruneko"], - - execute: async(app, data) => { - const msg = `-- Ratelimit detected! --\n` + - `Discord has placed a limit on ${data.path} for ${data.limit} requests.\n` + - `This ratelimit is ${(data.global) ? "global" : "non-global"} and will expire in ${data.timeout}ms.\n`; - if (app.logger) - app.logger.error("DISCORD", msg); - else - console.error(msg); - } -} \ No newline at end of file diff --git a/src/app/evts/ready.js b/src/app/evts/ready.js deleted file mode 100644 index ba094bd..0000000 --- a/src/app/evts/ready.js +++ /dev/null @@ -1,134 +0,0 @@ -module.exports = (app) => { - if (!app.client) return app.logger.error("SYS", "CLIENT IS NOT READY YET!!"); - - app.config["tokendata"] = undefined; // This makes it so no crazy people can find the token (tho, the only way is through eval and uh.. you should keep that to yourself..) - // app.client.connections.success = true; - // clearInterval(client.connections.updateTime); - - app.config.system.footerText = app.config.system.footerText.replace("APPNAME", app.name).replace("currYear", new Date().getFullYear()); // Update year - - app.logger.success("DISCORD", `Logged in as ${app.client.user.tag} | ${app.client.user.id}.`); - - // Finish up anything else - app.bypassEnabled = false; // Disable bypass - app.functions.RPSSystem(app, "init"); // Init RPSUpdater - - // Init inviteData - app.client.guildInvites = new Map();; - - // Broadcast we up - app.client.uptimeTimestamp = new Date().getTime(); - var timeTook = (app.client.uptimeTimestamp - app.startTime) || 0; - app.logger.debug("SYS", `${app.name} online as of ${new Date(app.client.uptimeTimestamp)} | It took ~${app.functions.TStoHR(timeTook)} (${timeTook}ms) to start.`); - setTimeout(async function() { - if (app.lastMessageID != null) { - await app.client.channels.fetch(app.lastMessageID.split("-")[0]).then(channel => { - - channel.messages.fetch(app.lastMessageID.split("-")[1]).then(msg => { - app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.success} **Restart complete**`, - color: app.config.system.embedColors.lime, - description: "Restart was successful!" - }] - }, 1, true); - }).catch(err => app.logger.debug("DISCORD", err)); - }).catch(err => app.logger.debug("DISCORD", err)); - app.lastMessageID = null; - }; - - await app.functions.RPSSystem(app, "start"); // Start RPSUpdater - - // PATCH 2023-10-13 - // This patch actually is a bit weird. - // I have no plans to really fix it tbh. v5 is a dumpster fire. - // ~ TheCodingGuy, 2023-12-20 - const fixCache = async() => { - await app.client.guilds.fetch(true, true).catch(() => {}); - await app.client.guilds.cache.forEach(async g => { - await g.members.fetch(true, true).catch(() => {}); - await g.roles.fetch(true, true).catch(() => {}); - await g.channels.fetch(true, true).catch(() => {}); - }); - }; - fixCache(); - setInterval(fixCache, (60 * 30) * 1000); // This should patch the fact about cache firing randomly. Refreshes every 30 minutes. - // END PATCH 2023-10-13 - - setTimeout(async function() { - // Reaction Roles - if (app.client.isReady()) app.logger.info("DISCORD", `Initializing Reaction Roles...`); - var serverSettings = await app.DBs.serverSettings.findAll({ where: {}, raw: true }); // WARNING: Do not expose this variable. - for (server in serverSettings) { - server = serverSettings[server]; - var serverID = server["serverID"]; - if (server["reactionRoles"] != null) { - var reactionRolesSettings = JSON.parse(server["reactionRoles"]); - - for (var channelID in reactionRolesSettings) { - var guild = app.client.guilds.cache.get(serverID) || null; - if (!guild || !guild.id) continue; - - channel = app.client.channels.cache.get(channelID) || null; - if (!channel || !channel.id) { - app.logger.warn("DISCORD", `Channel ${channelID} cannot be resolved! Removing from database...`); - delete reactionRolesSettings[channelID]; - try { await app.DBs.serverSettings.update({ reactionRoles: JSON.stringify(reactionRolesSettings, null, "\t") }, { where: { serverID: serverID } }); } catch (Ex) {}; - continue; - }; - var messageID = reactionRolesSettings[channelID]["message"], - reactionRoles = reactionRolesSettings[channelID]["reactionRoles"]; - - message = channel.messages.cache.get(messageID) || channel.messages.fetch(messageID, true, true) || null; - if (!message) { - app.logger.warn("DISCORD", `Message ${message} in ${channelID} cannot be resolved! Removing from database...`); - delete reactionRolesSettings[channelID][messageID]; - try { await app.DBs.serverSettings.update({ reactionRoles: JSON.stringify(reactionRolesSettings, null, "\t") }, { where: { serverID: serverID } }); } catch (Ex) {}; - continue; - }; - app.logger.debug("DISCORD", `Loaded reaction roles for ${serverID}/${channelID}-${messageID}!`); - }; - }; - }; - app.logger.success("DISCORD", `Initialized Reaction Roles!`); - - // Cache invites - app.logger.info("DISCORD", `Caching all invites of ${app.client.guilds.cache.size} servers...`); - - var inviteCount = 0, - serverCount = 0, - done = false, - guilds = Array.from(app.client.guilds.cache.keys()); - - for (var i = 0; i < guilds.length; i++) { - const guild = app.client.guilds.cache.get(guilds[i]); - - // check guild existence, etc. - if (!guild) break; - if (guild.partial) await guild.fetch().catch(err => app.logger.error("DISCORD", "Something went wrong while fetching the guild " + guild.id + " | " + err.message)); - - if (i != 0 && (i % 15) == 0) - await app.functions.sleep(1500); - - // try to get invites - try { - const firstInvites = await guild.invites.fetch(); - app.client.guildInvites.set(guild.id, new Map(firstInvites.map((invite) => [invite.code, invite.uses]))); - app.logger.debug("DISCORD", `Cached ${firstInvites.size} invites from ${guild.id}.`); - inviteCount += firstInvites.size; - serverCount = (serverCount + 1); - } catch (err) { - if (err.code !== app.modules["discord.js"].Constants.APIErrors.MISSING_PERMISSIONS) { - app.logger.error("DISCORD", `Failed to cache invites for ${guild.name} (${guild.id}) | ${err.message}.`); - }; - } finally { - if ((i + 1) === guilds.length) - done = true; - }; - }; - while (!done) await app.functions.sleep(1500); - app.logger.success("DISCORD", `Cached ${inviteCount} invites from ${((serverCount == app.client.guilds.cache.size) ? serverCount : serverCount + "/" + app.client.guilds.cache.size)} servers.`); - }, 3500); // Wait an addition 3.5 seconds - }, 2000); - -}; \ No newline at end of file diff --git a/src/app/evts/roleCreate.js b/src/app/evts/roleCreate.js deleted file mode 100644 index 5a36568..0000000 --- a/src/app/evts/roleCreate.js +++ /dev/null @@ -1,48 +0,0 @@ -module.exports = async(app, newRole) => { - if (newRole.partial) await newRole.fetch().catch(err => {}); - - if (newRole.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = newRole.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: "Role created!", - color: app.config.system.embedColors.green, - description: `There are now ${guild.roles.cache.size} roles.`, - fields: [ - { name: "Name", value: newRole.name, inline: true }, - { name: "ID", value: newRole.id, inline: true }, - { name: "Created At", value: new Date(newRole.createdTimestamp).toString() } - ] - }; - - if (newRole.managed) - embed["fields"].push({ name: "Managed", value: "This role was created and is managed by an application." }); - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "ROLE_CREATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define roleLog - const roleLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the role was created. - Date.now() - entry.createdTimestamp < 5000 - ); - if (roleLog) { - const { executor } = roleLog; - - embed.fields.push({ name: "Created by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/roleDelete.js b/src/app/evts/roleDelete.js deleted file mode 100644 index 91e62d9..0000000 --- a/src/app/evts/roleDelete.js +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = async(app, oldRole) => { - if (oldRole.partial) await oldRole.fetch().catch(err => {}); - - if (oldRole.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldRole.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: "Role deleted!", - color: app.config.system.embedColors.dark_blue, - description: `There are now ${guild.roles.cache.size} roles.`, - fields: [ - { name: "Name", value: oldRole.name, inline: true }, - { name: "ID", value: oldRole.id, inline: true }, - { name: "Deleted At", value: new Date().toString() } - ] - }; - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "ROLE_DELETE", - }).catch(err => {}); - if (fetchedLogs) { - - //define roleLog - const roleLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the role was deleted. - Date.now() - entry.createdTimestamp < 5000 - ); - if (roleLog) { - const { executor } = roleLog; - - embed.fields.push({ name: "Deleted by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/roleUpdate.js b/src/app/evts/roleUpdate.js deleted file mode 100644 index a05301c..0000000 --- a/src/app/evts/roleUpdate.js +++ /dev/null @@ -1,81 +0,0 @@ -module.exports = async(app, oldRole, newRole) => { - if (oldRole.partial) await oldRole.fetch().catch(err => {}); - if (newRole.partial) await newRole.fetch().catch(err => {}); - - if (oldRole == newRole) return; // how does this even work - - if (oldRole.guild == null) return; // Stop if we not in a guild? (Just safety) - var guild = oldRole.guild; - - var serverSettings = await app.DBs.serverSettings.findOne({ where: { serverID: guild.id } }); - if (!serverSettings) return; - - var logChannelID = serverSettings.get("loggingGuildChannel"); - var logChannel = app.client.channels.cache.get(logChannelID); - if (!logChannel) return; // Something's wrong here? - - var embed = { - author: { name: `${guild.name} (${guild.id})`, icon_url: guild.iconURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: "Role updated!", - color: app.config.system.embedColors.yellow, - fields: [] - }; - - if (oldRole.name !== newRole.name) // Check role name - embed.fields.push({ name: "Name", value: oldRole.name + " -> " + newRole.name, inline: true }); - else - embed.fields.push({ name: "Name", value: oldRole.name, inline: true }); - embed.fields.push({ name: "ID", value: oldRole.id, inline: true }); - - if (oldRole.icon != newRole.icon) // Check role icon - embed.fields.push({ name: "Icon", value: oldRole.icon + " -> " + newRole.icon }); - - if (oldRole.unicodeEmoji != newRole.unicodeEmoji) // Check role emoji - embed.fields.push({ name: "Unicode Emoji", value: oldRole.unicodeEmoji + " -> " + newRole.unicodeEmoji }); - - if (oldRole.color != newRole.color) // Check role color - embed.fields.push({ name: "Color", value: oldRole.color + " -> " + newRole.color }); - - if (oldRole.hoist != newRole.hoist) // Check role is hoisted - embed.fields.push({ name: "Hoisted", value: oldRole.hoist + " -> " + newRole.hoist }); - - if (oldRole.rawPosition != newRole.rawPosition) // Check role position - embed.fields.push({ name: "Position", value: oldRole.rawPosition + " -> " + newRole.rawPosition }); - - if (oldRole.permissions !== newRole.permissions) { // Check role permissions - const oldPerms = oldRole.permissions.serialize(), - newPerms = newRole.permissions.serialize(), - permUpdated = []; - - for (const [key, element] of Object.entries(oldPerms)) { - if (newPerms[key] !== element) permUpdated.push(`\`${key}\``); - } - if (oldRole.permissions > newRole.permissions) embed.fields.push({ name: "Permissions Removed", value: permUpdated.join(", ") }); // rip permissions - else if (oldRole.permissions < newRole.permissions) embed.fields.push({ name: "Permissions Added", value: permUpdated.join(", ") }); // ooo permissions - }; - - if (oldRole.mentionable != newRole.mentionable) // Check role is mentionable - embed.fields.push({ name: "Mentionable", value: oldRole.mentionable + " -> " + newRole.mentionable }); - - embed.fields.push({ name: "Updated At", value: new Date().toString() }) - - const fetchedLogs = await guild.fetchAuditLogs({ - limit: 6, - type: "ROLE_UPDATE", - }).catch(err => {}); - if (fetchedLogs) { - - //define roleLog - const roleLog = fetchedLogs.entries.find(entry => // To avoid false positives, we look for a timeframe of when the role was updated. - Date.now() - entry.createdTimestamp < 5000 - ); - if (roleLog) { - const { executor } = roleLog; - - embed.fields.push({ name: "Updated by", value: `${app.functions.pomeloHandler(executor)} (${executor.id})` }) - embed["thumbnail"] = executor; - }; - }; // May be missing permissions to fetch audit log. - - await app.functions.msgHandler(logChannel, { embeds: [embed] }); -}; \ No newline at end of file diff --git a/src/app/evts/special/eula-data.json b/src/app/evts/special/eula-data.json deleted file mode 100644 index 13610d5..0000000 --- a/src/app/evts/special/eula-data.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { "name": "**!! IMPORTANT !!**", "value": "Hey! Before you continue, please read the [End-User License Agreement](https://codingbot.gg/eula)." }, - { "name": "**This bot has a Terms of Service and Privacy Policy!**", "value": "Please also read the [Terms of Service](https://codingbot.gg/terms) and [Privacy Policy](https://codingbot.gg/privacy)!" }, - { "name": "**By continuing...**", "value": "You're agreeing you've read the [End-User License Agreement](https://codingbot.gg/eula), [Terms of Service](https://codingbot.gg/terms), and [Privacy Policy](https://codingbot.gg/privacy)!" } - -] \ No newline at end of file diff --git a/src/app/evts/special/eula.js b/src/app/evts/special/eula.js deleted file mode 100644 index 7ac5fc4..0000000 --- a/src/app/evts/special/eula.js +++ /dev/null @@ -1,120 +0,0 @@ -module.exports = async(app, message) => { - if (!app.client.eulaMsgSent) app.client.eulaMsgSent = []; - - var userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }); - - - var buttonStuffWaiting = true, - denied = true; - const { MessageActionRow, MessageButton } = app.modules["discord.js"]; - const row = new MessageActionRow() - .addComponents( - new MessageButton() - .setCustomId('agree') - .setLabel(app.lang.getLine(userSettings.get("language"), 'I agree to these terms.')) - .setStyle('SUCCESS'), - new MessageButton() - .setCustomId('disagree') - .setLabel(app.lang.getLine(userSettings.get("language"), 'I disagree to these terms.')) - .setStyle('DANGER') - ); - - async function handleEOA(msg) { - const filter = i => ["agree", "disagree"].includes(i.customId) && i.user.id === message.author.id; - const collector = message.channel.createMessageComponentCollector({ filter, max: 1, time: 90000 }); - - collector.on('collect', async i => { - if (i.customId === 'agree') { - const affectedRows = await app.DBs.userSettings.update({ acceptedEULA: true }, { where: { userID: message.author.id } }); - if (affectedRows > 0) { - await i.update({ - embeds: [{ - title: `${app.config.system.emotes.success} **${app.lang.getLine(userSettings.get("language"), "End-User License Agreement")}**`, - color: app.config.system.embedColors.lime, - description: `${app.lang.getLine(userSettings.get("language"), "You successfully agreed to the EULA! Thank you and have fun!")}\n${app.lang.getLine(userSettings.get("language"), "(You may need to rerun your command again.)")}`, - footer: { text: app.config.system.footerText } - }], - components: [] - }); - app.logger.info("DISCORD", `[MESSAGE] ${message.author.id} accepted the EOA!`); - - denied = false; - } else { - await i.update({ - embeds: [{ - title: `${app.config.system.emotes.warning} **${app.lang.getLine(userSettings.get("language"), "End-User License Agreement")}**`, - color: app.config.system.embedColors.orange, - description: app.lang.getLine(userSettings.get("language"), "Could not save your acknowledgement. Please try again."), - footer: { text: app.config.system.footerText } - }], - components: [] - }); - - }; - buttonStuffWaiting = false; - - } else if (i.customId === 'disagree') { - await i.update({ - embeds: [{ - title: `${app.config.system.emotes.error} **${app.lang.getLine(userSettings.get("language"), "End-User License Agreement")}**`, - color: app.config.system.embedColors.red, - description: app.lang.getLine(userSettings.get("language"), "You denied the EULA."), - footer: { text: app.config.system.footerText } - }], - components: [] - }); - - buttonStuffWaiting = false; - }; - }); - - collector.on("end", async(collected) => { - if (collected.size < 1) { - app.functions.msgHandler(msg, { - embeds: [{ - title: `${app.config.system.emotes.error} **${app.lang.getLine(userSettings.get("language"), "End-User License Agreement")}**`, - color: app.config.system.embedColors.red, - description: app.lang.getLine(userSettings.get("language"), "Operation timed out.") - }], - components: [] - }, 1, true); - }; - buttonStuffWaiting = false; - }); - }; - - fields = []; - if (userSettings) - fields = app.lang.getLine(userSettings.get("language") || "English", "EULA"); - else - fields = app.lang.getLine("English", "EULA"); - - for (var i = 0; i < fields.length; i++) { // Placeholder moment - var text = fields[i]["value"]; - if (text != null) { - // text = text.replaceAll("PREFIX", "Pref"); - fields[i]["value"] = text; - }; - }; - - await app.functions.msgHandler(message, { - embeds: [{ - title: `${app.config.system.emotes.question} **${app.lang.getLine(userSettings.get("language"), "End-User License Agreement")}**`, - color: app.config.system.embedColors.purple, - description: app.lang.getLine(userSettings.get("language"), "Before continuing, you must agree to the bot's End-User License Agreement."), - fields: fields - }], - components: [row] - }, 0, true, (async msg => { - // await message.react("📬"); - await handleEOA(msg); - app.client.eulaMsgSent.push(message.author.id); - })); - - while (buttonStuffWaiting) { await app.functions.sleep(1000); } - - var index = app.client.eulaMsgSent.indexOf(message.author.id); - if (index > -1) { app.client.eulaMsgSent.splice(index, 1); }; - - return { denied: denied, done: true }; -}; \ No newline at end of file diff --git a/src/app/extras/extras.json b/src/app/extras/extras.json deleted file mode 100644 index 0637a08..0000000 --- a/src/app/extras/extras.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/src/app/functions/bootloader.js b/src/app/functions/bootloader.js deleted file mode 100644 index b24c3ef..0000000 --- a/src/app/functions/bootloader.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - THECODINGBOT v5 - Bootloader - 6/24/2021 - - https://codingbot.gg/source - https://netrocorp.net -*/ - -class BootLoader { - - printLogo = function() { - console.log("\n\n"); - console.log(" ________ _____ ___ ___ __ "); - console.log("/_ __/ / ___ / ___/__ ___/ (_)__ ___ _/ _ )___ / /_"); - console.log(" / / / _ \\/ -_) /__/ _ \\/ _ / / _ \\/ _ `/ _ / _ \\/ __/ "); - console.log("/_/ /_//_/\\__/\\___/\\___/\\_,_/_/_//_/\\_, /____/\\___/\\__/ "); - console.log(" /___/ "); - // console.log(" Copyright Netro Corporation 2018-2021. "); - console.log(" Copyright Netro Corporation 2018-" + new Date().getFullYear() + ". "); - console.log("\n\n"); - } - - extraHandler = async function(app, extras, hideLoadingText = false, fromBoot = true) { - var results = { success: [], fail: [] }; - app.functions.clearCache(); // Clear cache :> - - - var startTime = new Date(), - err = false; - - for (var i = 0; i < extras.length; i++) { - var extra = extras[i]; - try { - if (extra.extraEnab) { - app.extras[extra.extraName] = { - extraName: extra.extraName, - extraCfg: require(process.cwd() + "/app/extras/" + extra.extraCfg), - extraApp: require(process.cwd() + "/app/extras/" + extra.extraApp), - }; - - extra = app.extras[extra.extraName]; // redefine the extra, since now we actually in its instance now. - - var missingDeps = extra.extraCfg.info.extraDeps.filter(function(x) { return !Object.keys(app.modules).includes(x); }); - if (missingDeps.length > 0) { - var deps = [], - temp = []; - for (var mD = 0; mD < missingDeps.length; mD++) deps.push(Object.keys(missingDeps[mD])); - - app.logger.warn("SYS", `${extra.extraName} cannot be enabled due to missing package(s): ${deps.join(", ")}; attempting to find and enable...`); - - for (var mD = 0; mD < missingDeps.length; mD++) { - var name = (Object.keys(missingDeps[mD])[0]); - temp.push({ name: name, required: missingDeps[name] }) - }; - await app.bootloader.loadHandler(app, "dependency", temp, false, false); - - }; - app.logger.info("SYS", `Enabling Extra: ${extra.extraName}...`); - extra.extraApp = new extra.extraApp; - await extra.extraApp.init(app, extra.extraCfg.settings); - }; - } catch (error) { - err = error; - } finally { - var endTime = new Date(); - var elapsedMS = (endTime - startTime) / 1000; - if (err === false) { - if (!hideLoadingText) app.logger.success("SYS", `Loaded & enabled ${extra.extraName} v${extra.extraCfg.info.extraVers} in ${elapsedMS}ms.`); - results["success"].push(extra.extraName); - } else { - results["fail"].push(extra.extraName); - - app.logger.error("SYS", `Could not load extra ${extra.extraName}.\n Error: ${err}`); - console.log(err.stack); - }; - - }; - }; - return results; - } - loadHandler = async function(app, varType, varToUse, hideLoadingText = false, fromBoot = true) { - var results = { success: [], fail: [] }; - - if (app.logger === undefined) - console.log("Uh, yeah, the logger is gone. What did you do?!"); - - if (fromBoot) { - if (varType == "dependency") app.modules = {}; - else if (varType == "configuration") app.config = {}; - else if (varType == "database") { - app.DBs = {}; - var err = false; - const Sequelize = app.modules["sequelize"]; - try { - app.db = new Sequelize('database', 'user', 'password', { - host: 'localhost', - dialect: 'sqlite', - logging: data => { if (app.debugMode) app.logger.debug("DB", data); }, - // SQLite only - storage: './app/cfg/app.sqlite', - }); - - app.DBs = { - // invites: app.db.define('invites', { - // discordUser: Sequelize.STRING, - // inviter: Sequelize.STRING, - // invites: Sequelize.NUMBER, - // guildID: Sequelize.STRING - // }), - userSettings: app.db.define('userSettings', { - userID: { // The executing user - type: Sequelize.STRING, - unique: true, - primaryKey: true - }, - prefix: { // The user's desired command prefix - type: Sequelize.STRING, - defaultValue: app.config.system.defaultPrefix, - allowNull: false - }, - language: { // The user's desired languager - type: Sequelize.STRING, - defaultValue: app.config.system.defaultLanguage || "English (en_US)", - allowNull: false - }, - acceptedEULA: Sequelize.BOOLEAN, // DID THE USER ACCEPT THE EOA?! - executedCommands: { // The user's count of executed commands (will be -1 if optedOut) - type: Sequelize.NUMBER, - defaultValue: 0, - allowNull: false - }, - errorCommands: { // The user's count of errored commands (will be -1 if optedOut) - type: Sequelize.NUMBER, - defaultValue: 0, - allowNull: false - }, - optedOut: { // Did the user opt-out of analytics? - type: Sequelize.BOOLEAN, - defaultValue: 0, - allowNull: false - }, - AFKSettings: { // We'll be right back. - type: Sequelize.STRING, - defaultValue: null, - allowNull: true - } - }), - serverSettings: app.db.define('serverSettings', { - serverID: { // The executing server - type: Sequelize.STRING, - unique: true, - primaryKey: true - }, - loggingMessageChannel: { // Message Update/Deletes - type: Sequelize.STRING, - defaultValue: null, - allowNull: true - }, - loggingMemberChannel: { // Member Joins/Updates/Leaves - type: Sequelize.STRING, - defaultValue: null, - allowNull: true - }, - loggingGuildChannel: { // Role Adds/Updates/Deletes, Emoji Adds/Updates/Deletes, Channel Adds/Updates/Deletes - type: Sequelize.STRING, - defaultValue: null, - allowNull: true - }, - verification: { // Tells the verification system where to accept verification and what role to give - type: Sequelize.STRING, - defaultValue: null, - allowNull: true - }, - reactionRoles: { // Reaction Roles :D - type: Sequelize.STRING, - defaultValue: null, - allowNull: true - }, - other: { // Other settings - like join images, leave channel, etc. - type: Sequelize.STRING, - defaultValue: JSON.stringify({ - "join": { - "channel": null, - "msg": app.defaults.join.msg - }, - "leave": { - "channel": null, - "msg": app.defaults.leave.msg - } - }, null, "\t"), - allowNull: true - } - }), - verification: app.db.define('verification', { - serverID: { // The executing server - type: Sequelize.STRING, - defaultValue: null, - unique: false - }, - userID: { // The executing user - type: Sequelize.STRING, - defaultValue: null, - allowNull: true, - unique: true, - primaryKey: true - - }, - messageID: { // Allows us to edit the same message (if in a server) - type: Sequelize.STRING, - defaultValue: null, - unique: true, - allowNull: true - }, - userCode: { // The code generated - type: Sequelize.STRING, - unique: true, - allowNull: false - }, - }) - }; // damn this has gotten longer over the past month... - Object.keys(app.DBs).forEach(db => { - app.logger.debug("DB", "Syncing database table: " + db); - app.DBs[db].sync(); - }); // Sync go brrr (Make sure the tables and stuff are created) - } catch (error) { - err = error; - } finally { - if (err === false && !hideLoadingText) { - app.logger.success("SYS", `Loaded ${varType}.`); - } else { - - app.logger.error("SYS", `Could not load ${varType}.\n\tError Details:\n\t${err}`); - if (varType == "database") { - if (!hideLoadingText) app.logger.error("SYS", `A required dependency is missing and we are not able to boot.`); - process.exit(1); - }; - }; - } - return; - } else if (varType == "event") {} // There's nothing to do for events, app.client handles that. - else if (varType == "command") { - try { app.commands = new app.modules["discord.js"].Collection(); } catch (err) { - app.logger.error("SYS", `Could not load Discord dependency.\n Error: ${err}`); - console.log(err.stack); - return results; - }; - } else if (varType == "slashCommand") { - try { app.slashCommands = new app.modules["discord.js"].Collection(); } catch (err) { - app.logger.error("SYS", `Could not load Discord dependency.\n Error: ${err}`); - console.log(err.stack); - return results; - }; - } else { return; }; // Ignore this function call if all else fails. - }; - for (var i = 0; i < varToUse.length; i++) { - var startTime = new Date(), - err = false, - varName = ((varType == "dependency") ? varToUse[i] : ((varType == "configuration") ? varToUse[i].split(".json")[0] : varToUse[i].split(".js")[0])); - var varSimpleName = ((varType == "dependency") ? varName["name"] : varName); - - if (!hideLoadingText) app.logger.debug("SYS", `Loading ${varType}: ${varSimpleName}...`); - - try { - app.functions.clearCache(); // Clear cache :> - - if (!hideLoadingText) app.logger.debug("SYS", `Enabling ${varType}: ${varSimpleName}...`); // Lol this is Minecraft now - if (varType == "dependency") { - app.modules[varSimpleName] = require(varSimpleName); - } else if (varType == "configuration") { - app.config[varSimpleName] = require(process.cwd() + "/app/cfg/" + varSimpleName); - } else if (varType == "event") { - var event = require(process.cwd() + "/app/evts/" + varSimpleName); - app.client.on(varSimpleName, event.bind(null, app)); - } else if (varType == "command") { - // Discord is gonna make us devs move to slash commands fully in the future. - // I think, personally, it's a bit overcomplicated but whatever. - // I'm not even a verified bot yet. - - var fileLocation = process.cwd() + "/app/" + ((varSimpleName.split("/")[0] == "cmds") ? varSimpleName : "cmds/" + varSimpleName); - var command = require(fileLocation); - command.file = fileLocation; - command.category = ((varSimpleName.split("/")[0] == "cmds") ? "" : varSimpleName.split("/")[0]) || "Uncategorized"; - app.commands.set(command.name, command); - } else if (varType == "slashCommand") { - // app.client.api.applications(app.client.user.id).commands.post({data: { - // name: 'ping', - // description: 'ping pong!' - // }}) - - // var fileLocation = process.cwd() + "/app/cmds/" + varSimpleName; - // var command = require(fileLocation); - // command.file = fileLocation; - // app.client.api.applications(app.client.user.id).guilds('sometestguild').commands.post({ - // data: { - // name: command.name, - // description: command.description - // } - // }).catch(err => { throw new err; }); - // app.slashCommands.set(command.name, command); - } else { return; }; - - } catch (error) { - err = error; - } finally { - var endTime = new Date(); - var elapsedMS = (endTime - startTime) / 1000; - if (err === false) { - if (!hideLoadingText) app.logger.success("SYS", `Loaded & enabled ${varSimpleName} in ${elapsedMS}ms.`); - results["success"].push(varSimpleName); - } else { - results["fail"].push(varSimpleName); - - app.logger.error("SYS", `Could not load ${varType} ${varSimpleName}.\n\tError Details:\n\t${err}`); - console.log(err.stack); - if (varType == "dependency") { - if (varName["required"]) { - if (!hideLoadingText) app.logger.error("SYS", `A required dependency is missing and we are not able to boot.`); - process.exit(1); - } else { - if (!hideLoadingText) app.logger.error("SYS", `A dependency is missing but not required; attempting to boot anyways.`); - }; - } else if (varType == "database") { - if (!hideLoadingText) app.logger.error("SYS", `A required dependency is missing and we are not able to boot.`); - process.exit(1); - }; - }; - - }; - - }; - return results; - } -} - - -module.exports = BootLoader; \ No newline at end of file diff --git a/src/app/functions/logger.js b/src/app/functions/logger.js deleted file mode 100644 index 13b1e23..0000000 --- a/src/app/functions/logger.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - THECODINGBOT v5 - Logger - 6/24/2021 - - https://codingbot.gg/source - https://netrocorp.net -*/ - - -const app = require("../cfg/app.js"); - -const loggingcolors = { - "Reset": "\x1b[0m", - - "FgBlack": "\x1b[30m", - "FgRed": "\x1b[31m", - "FgGreen": "\x1b[32m", - "FgYellow": "\x1b[33m", - "FgBlue": "\x1b[34m", - "FgMagenta": "\x1b[35m", - "FgCyan": "\x1b[36m", - "FgWhite": "\x1b[37m", - - "BgBlack": "\x1b[40m", - "BgRed": "\x1b[41m", - "BgGreen": "\x1b[42m", - "BgYellow": "\x1b[43m", - "BgBlue": "\x1b[44m", - "BgMagenta": "\x1b[45m", - "BgCyan": "\x1b[46m", - "BgWhite": "\x1b[47m" -}; - -getTimestamp = () => { return `${loggingcolors.Reset}[${loggingcolors.FgCyan}${app.functions.convertTimestamp(new Date().getTime(), true, true)}${loggingcolors.Reset}] `; }; -const knownLocations = { "SYS": loggingcolors.FgGreen, "DISCORD": loggingcolors.FgMagenta, "WEB": loggingcolors.FgBlue, "DB": loggingcolors.FgYellow }; -const knownTypes = { "X": loggingcolors.FgRed, "i": loggingcolors.FgBlue, "!": loggingcolors.FgYellow, "S": loggingcolors.FgGreen, "D": loggingcolors.FgMagenta }; -log = function(type, location, message, useTimeStamp, logToFile) { // no need to = true or = false, we should have the passed already. - var typecolor = knownTypes[type] || loggingcolors.FgWhite; - var locationcolor = knownLocations[location] || loggingcolors.FgWhite; - console.log(`${((useTimeStamp) ? getTimestamp() : "")}${loggingcolors.Reset}[${typecolor}${type}${loggingcolors.Reset}] [${locationcolor}${location}${loggingcolors.Reset}] ${message}`); -} -class Logger { - error = (location, message, useTimeStamp = true, logToFile = true) => { log("X", location, message, useTimeStamp, logToFile); }; - info = (location, message, useTimeStamp = true, logToFile = true) => { log("i", location, message, useTimeStamp, logToFile); }; - warn = (location, message, useTimeStamp = true, logToFile = true) => { log("!", location, message, useTimeStamp, logToFile); }; - success = (location, message, useTimeStamp = true, logToFile = true) => { log("S", location, message, useTimeStamp, logToFile); }; - debug = (location, message, useTimeStamp = true, logToFile = true) => { if (app.debugMode) log("D", location, message, useTimeStamp, logToFile); }; - bigWarn = async(message, useTimeStamp = true, logToFile = true) => { - console.log(`${((useTimeStamp) ? getTimestamp() : "")}${loggingcolors.BgRed}WARNING: ${message}${loggingcolors.Reset}`); - }; - warnAboutDebug = async(debug) => { - if (debug) { - this.bigWarn(`Debug messages are spammy!!${loggingcolors.Reset} (They really are...)`); - await app.functions.sleep(1069); - }; - } -} - -module.exports = Logger; \ No newline at end of file diff --git a/src/app/imgs/bonk.gif b/src/app/imgs/bonk.gif deleted file mode 100644 index c03ca55..0000000 Binary files a/src/app/imgs/bonk.gif and /dev/null differ diff --git a/src/app/imgs/welcome/fonts/segoeuib.ttf b/src/app/imgs/welcome/fonts/segoeuib.ttf deleted file mode 100644 index ff196d6..0000000 Binary files a/src/app/imgs/welcome/fonts/segoeuib.ttf and /dev/null differ diff --git a/src/app/imgs/welcome/welimg1.png b/src/app/imgs/welcome/welimg1.png deleted file mode 100644 index 1fddbc2..0000000 Binary files a/src/app/imgs/welcome/welimg1.png and /dev/null differ diff --git a/src/app/imgs/welcome/welimg2.png b/src/app/imgs/welcome/welimg2.png deleted file mode 100644 index e10315b..0000000 Binary files a/src/app/imgs/welcome/welimg2.png and /dev/null differ diff --git a/src/app/imgs/welcome/welimg3.png b/src/app/imgs/welcome/welimg3.png deleted file mode 100644 index 961e5ec..0000000 Binary files a/src/app/imgs/welcome/welimg3.png and /dev/null differ diff --git a/src/app/imgs/welcome/welimg4.png b/src/app/imgs/welcome/welimg4.png deleted file mode 100644 index ef3d324..0000000 Binary files a/src/app/imgs/welcome/welimg4.png and /dev/null differ diff --git a/src/app/imgs/welcome/welimg5.png b/src/app/imgs/welcome/welimg5.png deleted file mode 100644 index a07ca62..0000000 Binary files a/src/app/imgs/welcome/welimg5.png and /dev/null differ diff --git a/src/app/imgs/welcome/welimg6.png b/src/app/imgs/welcome/welimg6.png deleted file mode 100644 index 811a6c5..0000000 Binary files a/src/app/imgs/welcome/welimg6.png and /dev/null differ diff --git a/src/app/imgs/welcome/welimg7.png b/src/app/imgs/welcome/welimg7.png deleted file mode 100644 index 6854196..0000000 Binary files a/src/app/imgs/welcome/welimg7.png and /dev/null differ diff --git a/src/app/lang/English.json b/src/app/lang/English.json deleted file mode 100644 index 9d6d581..0000000 --- a/src/app/lang/English.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "metadata": { - "name": "English", - "full_name": "English (en_US)", - "description": "English - United States", - "langCode": "en_US", - "translator": "Netro Corporation", - "version": "1.0.0.0" - }, - "translations": { - "End-User License Agreement": "End-User License Agreement", - "End-User Agreement failed to load. How does that even happen...": "End-User Agreement failed to load. How does that even happen...", - "Before continuing, you must agree to the bot's End-User License Agreement.": "Before continuing, you must agree to the bot's End-User License Agreement.", - "EULA": [ - { "name": "**!! IMPORTANT !!**", "value": "Hey! Before you continue, please read the [End-User License Agreement](https://codingbot.gg/eula)." }, - { "name": "**This bot has a Terms of Service and Privacy Policy!**", "value": "Please also read the [Terms of Service](https://codingbot.gg/terms) and [Privacy Policy](https://codingbot.gg/privacy)!" }, - { "name": "**By continuing...**", "value": "You're agreeing you've read the [End-User License Agreement](https://codingbot.gg/eula), [Terms of Service](https://codingbot.gg/terms), and [Privacy Policy](https://codingbot.gg/privacy)!" } - ], - "I agree to these terms.": "I agree to these terms.", - "I disagree to these terms.": "I disagree to these terms.", - "Operation timed out.": "Operation timed out.", - "You denied the EULA.": "You denied the EULA.", - "You successfully agreed to the EULA! Thank you and have fun!": "You successfully agreed to the EULA! Thank you and have fun!", - "(You may need to rerun your command again.)": "(You may need to rerun your command again.)", - "Could not save your acknowledgement. Please try again.": "Could not save your acknowledgement. Please try again.", - - - "Hello": "Hello", - "Woop woop": "Woop woop", - "Something went wrong while updating your database entry!": "Something went wrong while updating your database entry!", - "Failed to execute": "Failed to execute", - "Error": "Error", - "Error Details": "Error Details", - "Command not found.": "Command not found.", - "Commands are disabled.": "Commands are disabled.", - - - "Pinging...": "Pinging...", - "Latency Test": "Latency Test", - "API": "API", - "Messages": "Messages", - - - "All about your favorite bot": "All about your favorite bot", - "Bot Information": "Bot Information", - "User Tag": "User Tag", - "User ID": "User ID", - "Bot Uptime": "Bot Uptime", - "Bot Version": "Bot Version", - "Emote Count": "Emote Count", - "Embed Color Count": "Embed Color Count", - "RPS Count": "RPS Count", - "Bot Memory Usage": "Bot Memory Usage", - "Servers I'm In": "Servers I'm In", - "Host System Information": "Host System Information", - "NodeJS Version": "NodeJS Version", - "NodeJS Uptime": "NodeJS Uptime", - "NodeJS Execution Path": "NodeJS Execution Path", - "Process PID": "Process PID", - "System Platform": "System Platform", - "Kernel Version": "Kernel Version", - "System Version": "System Version", - - - "Help": "Help", - "Help for": "Help for", - "Category": "Category", - "Uncategorized": "Uncategorized", - "Server Only?": "Server Only?", - "Permissions": "Permissions", - "Cooldown": "Cooldown", - "Aliases": "Aliases", - "Syntax": "Syntax", - "Heads up!": "Heads up!", - "Required": "Required", - "Optional": "Optional", - - - "You're now AFK": "You're now AFK", - "Could not set to AFK due to Database Error!": "Could not set to AFK due to Database Error!", - "Something went wrong while fetching AFK data.": "Something went wrong while fetching AFK data.", - "Welcome back!": "Welcome back!", - "You were AFK for": "You were AFK for", - "has been AFK since": "has been AFK since", - - - "User Settings": "User Settings", - "Change Settings": "Change Settings", - "Change Language": "Change Language", - "Change Prefix": "Change Prefix", - "Here's what just happened": "Here's what just happened", - - - "Some magic, please!": "Some magic, please!", - "Question": "Question", - "Answer": "Answer", - "8ballResponse": { - "Yes!": "lime", - "For sure": "lime", - "Reach for the stars!": "lime", - "Definitely!": "lime", - "No.": "red", - "Don't even think about it.": "red", - "Why would you do that!?": "red", - "Don't.": "red", - "I actually don't know..": "purple", - "Let me think about it": "purple", - "Uhh...": "purple", - "Just like the future, I'm uncertain on what to answer.": "purple" - }, - - - "coolDownResponse": [ - "I'm not *that* fast! S-Slow it down!", "This is difficult, you know...", - "Never let a computer know you're in a hurry...", "A computer will do what you tell it to do, but that may be much different from what you had in mind. :pensive:", - "L-Let me have my boba tea first!", "I think I am, therefore, I am.... I think.", - "Where there's a will, there's a relative!", "I-I swear I'm not lazy...", - "Are we there yet?", "", - "No need to step on the Gas! Gas! Gas!", "Calm down a bit- p-please!" - ], - "On cooldown for": "On cooldown for" - } -} \ No newline at end of file diff --git a/src/app/lang/Japanese.json b/src/app/lang/Japanese.json deleted file mode 100644 index 495b3fc..0000000 --- a/src/app/lang/Japanese.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "metadata": { - "name": "Japanese", - "full_name": "Japanese (ja_JP)", - "description": "日本語 - 日本", - "langCode": "ja_JP", - "translator": "Netro Corporation", - "version": "0.0.0.0" - }, - "translations": { - "End-User License Agreement": "エンドユーザーラーイセンス契約", - "End-User Agreement failed to load. How does that even happen...": "エンドーユーザー使用許諾契約の読み込みに失敗しました。 それはどのように起こりますか...", - "Before continuing, you must agree to the bot's End-User License Agreement.": "続行する前に、ボットのエンドユーザー使用許諾契ー約に同意する必要があります。", - "EULA": [ - { "name": "**!! 重要 !!**", "value": "おい! 続行する前に、[エンドユーザー使用許諾契約書](https://codingbot.gg/eula)をお読みください。" }, - { "name": "**このボットには利用規約とプライバシーポリシーがあります!**", "value": "[利用規約](https://codingbot.gg/terms)と[プライバシーポリシー](https://codingbot.gg/privacy)もお読みください。" }, - { "name": "**続けることで...**", "value": "あなたはあなたが読んだことに同意しています[エンドユーザー使用許諾契約](https://codingbot.gg/eula)、[利用規約](https://codingbot.gg/terms)、および[プライバシーポリシー](https://codingbot.gg/privacy)!" } - ], - "I agree to these terms.": "私はこれらの条件に同意します。", - "I disagree to these terms.": "私はこれらの条件に同意しません。", - "Operation timed out.": "操作がタイムアウトしました。", - "You denied the EULA.": "君はEULAを拒否しました。", - "You successfully agreed to the EULA! Thank you and have fun!": "あなたはEULAに首尾よく同意しました! ありがとう、楽しんでください!", - "(You may need to rerun your command again.)": "(コマンドを再実行する必要がある場合があります。)", - "Could not save your acknowledgement. Please try again.": "謝辞を保存できませんでした。 もう一度やり直してください。", - - - "Hello": "こんにちは", - "Woop woop": "ウープウープ", - "Something went wrong while updating your database entry!": "データベースエントリの更新中に問題が発生しました。", - "Failed to execute": "実行に失敗しました", - "Error": "エラー", - "Error Details": "エラー詳細", - "Command not found.": "コマンドが見つかりません。", - "Commands are disabled.": "コマンドが無 身体障害者 。", - - - "Pinging...": "Pinging...", - "Latency Test": "レイテンシーテスト", - "API": "API", - "Messages": "メッセージ", - - - "All about your favorite bot": "All about your favorite bot", - "Bot Information": "ボット情報", - "User Tag": "ユーザータグ", - "User ID": "ユーザーID", - "Bot Uptime": "ボットの稼働時間", - "Bot Version": "ボットバージョン", - "Emote Count": "エモートカウント", - "Embed Color Count": "埋め込みカラーカウント", - "RPS Count": "RPSカウント", - "Bot Memory Usage": "ボットのメモリ使用量", - "Servers I'm In": "Servers I'm In", - "Host System Information": "ホストシステム情報", - "NodeJS Version": "NodeJSバージョン", - "NodeJS Uptime": "NodeJS の稼働時間", - "NodeJS Execution Path": "NodeJS 実行パス", - "Process PID": "プロセスPID", - "System Platform": "システムプラットフォーム", - "Kernel Version": "カーネルバージョン", - "System Version": "システムバージョン", - - - "Help": "ヘルプ", - "Help for": "のヘルプ", - "Category": "カテゴリー", - "Uncategorized": "未分類", - "Server Only?": "サーバーのみ?", - "Permissions": "許可", - "Cooldown": "クールダウン", - "Aliases": "エイリアス", - "Syntax": "構文", - "Heads up!": "注意喚起!", - "Required": "必修", - "Optional": "オプショナル", - - - "You're now AFK": "あなたは今ですAFK", - "Could not set to AFK due to Database Error!": "データベースエラーのため、AFK設定できませんでした!", - "Something went wrong while fetching AFK data.": "AFKデータのフェッチ中に問題が発生しました。", - "Welcome back!": "いらっしゃいませ戻る!", - "You were AFK for": "あなたはAFKでした", - "has been AFK since": "以来AFKされています", - - - "User Settings": "ユーザー設定", - "Change Settings": "設定を変更する", - "Change Language": "言語を変くだ", - "Change Prefix": "プレフィックスの更", - "Here's what just happened": "これがちょうど起こったことです", - - - "Some magic, please!": "いくつか魔法, お願いします!", - "Question": "質問", - "Answer": "答え", - "8ballResponse": { - "はい!": "lime", - "確かに": "lime", - "星に手を伸ばせ!": "lime", - "間違いなく!": "lime", - "いいえ。": "red", - "それについて考えさえしないでください。": "red", - "なんでそんなことするの!?": "red", - "しないでください。": "red", - "実はわからない…": "purple", - "考えさせて": "purple", - "うーん...": "purple", - "未来と同じように、私は何に答えるべきかわからない。": "purple" - }, - - - "coolDownResponse": [ - "私はそ*れほど*速くはありません! S-遅くして!", "これは難しいです、あなたは知っています...", - "たが急いいるとをコンピュータに決して知らせないでください...", "コンピューターはあなたが指示したことを実行しますが、それはあなたが考えていたものとは大きく異なるかもしれません。:pensive:", - "L-最初にボバティーを飲ませてく!", "我思う、故に, 我あり... 我思う。", - "意志があるところには親戚がいます!", "私-私は怠け者ではないことを誓います...", - "私たちもうそこに?", "<エレベーター音楽>", - "ガスを踏む必要はありません! ガス! ガス!", "少し落ち着いてください- p-お願いします!" - ], - "On cooldown for": "ためにオンクールダウン" - } -} \ No newline at end of file diff --git a/src/app/lang/lang.js b/src/app/lang/lang.js deleted file mode 100644 index 79e9df9..0000000 --- a/src/app/lang/lang.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - THECODINGBOT v5 - Language - 3/29/2022 - - https://codingbot.gg/source - https://netrocorp.net -*/ - -class Language { - constructor(app, defaultLang) { - this.app = app; - this.defaultLang = defaultLang; - } - loadLang = async function(langs, init = true) { - if (!this.app) return "NO APP, NO LANG"; - if (init) - this.app.config.langs = {}; - - var results = { success: [], fail: [] }; - - for (var i = 0; i < langs.length; i++) { - var lang = langs[i].split(".json")[0]; - try { - var startTime = new Date(), - err = false; - - this.app.logger.debug("SYS", `Loading language: ${lang}...`); - - var theLanguage = require(process.cwd() + "/app/lang/" + lang); - this.app.logger.debug("SYS", `${lang} (${theLanguage.metadata.full_name}) Language by ${theLanguage.metadata.translator} (v${theLanguage.metadata.version})...`); - - this.app.config.langs[lang] = theLanguage; - - } catch (error) { - err = error; - } finally { - var endTime = new Date(); - var elapsedMS = (endTime - startTime) / 1000; - if (err === false) { - this.app.logger.success("SYS", `Loaded & enabled ${lang} language in ${elapsedMS}ms.`); - results["success"].push(lang); - } else { - results["fail"].push(lang); - - this.app.logger.error("SYS", `Could not load ${lang} language.\n\tError Details:\n\t${err}`); - console.log(err.stack); - }; - - }; - }; - // 1. Load in language files - } - - getLine = function(lang, line) { - if (!this.app) return "NO APP, NO LANG"; - - if (!this.app.config.langs[lang]) { - for (var i = 0; i < Object.keys(this.app.config.langs).length; i++) { - var l = this.app.config.langs[Object.keys(this.app.config.langs)[i]]; - if (lang == l.metadata.name || lang == l.metadata.full_name) - return l.translations[line] || // Try the language first - this.app.config.langs["English"].translations[line] || // Then try English - line || // If all fails, return the line - "TRANSLATION_FAIL"; // and somehow if this executes, that's the world ending. - }; - return this.app.config.langs["English"].translations[line] || // Then try English - line || // If all fails, return the line - "TRANSLATION_FAIL"; // and somehow if this executes, that's the world ending. - }; - - // Return line - return this.app.config.langs[lang].translations[line] || // Try the language first - this.app.config.langs["English"].translations[line] || // Then try English - line || // If all fails, return the line - "TRANSLATION_FAIL"; // and somehow if this executes, that's the world ending. - } -}; - -module.exports = Language; -module.exports = Language; \ No newline at end of file diff --git a/src/bot-maintenance.js b/src/bot-maintenance.js new file mode 100644 index 0000000..75ab793 --- /dev/null +++ b/src/bot-maintenance.js @@ -0,0 +1,166 @@ +//TCG Bot - Created in Discord.JS (https://discord.js.org). Bot created by TheCodingGuy#6697. +const Discord = require("discord.js"); +const client = new Discord.Client(); +const fs = require("fs"); +const config = require("./config.json"); +const prefix = config.prefix; + +const TCG = "222073294419918848"; + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var time; +var date; +var systemlog = ""; +var messagelog = ""; + +var version = "1.2"; +var footertxt = "TCG Bot.\nMaintenance Mode.\nBot created by TheCodingGuy#6697.\nVersion: "+version; + +function syslog(type, message) { + console.log(`\n[${type}] ${message}`); + if(type == "WARN") { emcolor = colors[3]; } else { emcolor = colors[0]; } + client.channels.get(systemlog).send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${message}`, + footer:{text:footertxt} + }}); + client.fetchUser(TCG).then(user => {user.send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${message}`, + footer:{text:footertxt} + }}); }); +} + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + + +client.on('ready', () => { + GetTime(); + GetDate(); + var msg = `TCG Bot is online [IN MAINTENANCE MODE] as of ${time} on ${date}`; + syslog("INFO", `${msg}`); + client.user.setActivity("Maintenance Mode v1.5"); +}); + +// EVENTS +client.on("guildCreate", guild => { + try { + syslog("JOIN", `Added to server: ${guild.name} | Server ID: ${guild.id} | Members: ${guild.memberCount} | At Time: ${time} on ${date}`); + let defaultChannel = ""; + guild.channels.forEach((channel) => { + if(channel.type == "text" && defaultChannel == "") { + if(channel.permissionsFor(guild.me).has("SEND_MESSAGES")) { defaultChannel = channel; } + } + }); + //defaultChannel will be the channel object that it first finds the bot has permissions for + defaultChannel.send({embed: { + title: "TCG Bot | Welcome", + color: colors[1], + description: "__**Hi! I'm TCG Bot.**__\nPrefix: "+prefix+"\nGet TCG Bot Help Commands: "+prefix+" help\n\nThanks for adding me and I'll be here if you need me.\nProblems? **Report to TheCodingGuy#6697**.", + footer: { text: footertxt } + }}); + } catch (err) { syslog("ERROR", err); } //Catch the error + +}); + +client.on("guildDelete", guild => { + GetTime(); + GetDate(); + syslog("REMOVE", `Added to server: ${guild.name} | Server ID: ${guild.id} | At Time: ${time} on ${date}`); +}); +client.on("messageDelete", (msgdel) => { + GetTime(); + GetDate(); + var message = `User: @${msgdel.author.username}#${msgdel.author.discriminator}\nMessage: ${msgdel.content}\nDeleted from: #${msgdel.channel.name} on ${msgdel.guild}\nTime sent: ${time} on ${date}`; + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Message Deleted", + color: colors[3], + description: `${message}`, + footer:{text:footertxt} + }}); + //Created by TCG +}); + +client.on('messageUpdate', (omsg, nmsg) => { + + if(omsg.author.bot) return; + GetTime(); + GetDate(); + var message = `User: @${nmsg.author.username}#${nmsg.author.discriminator}\nOld Message: ${omsg.content}\nNew Message: ${nmsg.content}\nSent in: #${nmsg.channel.name} on ${nmsg.guild}\nTime sent: ${time} on ${date}`; + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Message Update", + color: colors[0], + description: `${message}`, + footer:{text:footertxt} + }}); + //Created by TCG +}); + + +client.on("message", message => { + if(message.author.bot) return; + + var msg = `@${message.author.username}#${message.author.discriminator}\nMessage: ${message.content}\nIn: ${message.guild} | #${message.channel.name}\nSent: ${message.createdAt}`; + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Message Sent", + color: colors[1], + description: `${msg}`, + footer:{text:footertxt} + }}); + + if(!message.content.startsWith(prefix)) return; + if(message.content == prefix + " ping") { try { let commandFile = require(`./commands/ping.js`); commandFile.run(client, message, footertxt, prefix); } + catch (err){ + var msg = `Ping command failed.\n${err}`; + syslog("WARN", `${msg}`); + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Failed to ping.", + color: colors[3], + description: `${msg}`, + footer:{text:footertxt} + }}); + } + return; + } + if(message.content.startsWith(prefix)) { + message.channel.send({embed:{ + title: "TCG Bot | Error", + color: colors[3], + description: "**Whoops.**\nSorry about this, but the bot is currently in maintenance mode.\nThis means the bot cannot handle any commands (example: ``/tcg help``).\n**TCG:**\nIf this is an error, please verify you started the bot with ``maintenance`` set to ``no``.\n** **\n**Thank you for your use of TCG Bot**.", + footer:{text:footertxt} + }}); + }; + +}); + +client.login(config.token); \ No newline at end of file diff --git a/src/bot-v1.js b/src/bot-v1.js new file mode 100644 index 0000000..7277a84 --- /dev/null +++ b/src/bot-v1.js @@ -0,0 +1,562 @@ +const Discord = require("discord.js"); +const client = new Discord.Client(); +const config = require("./config.json"); +const weather = require('weather-js'); + +const token = config.token; +const prefix = config.prefix; +let wprefix = "/tcg wgen"; + +const TCG = "222073294419918848"; +// Embed colors: + +var blue = "3447003"; +var lime = "65280"; +var yellow = "16312092"; +var red = "15158332"; + + +// Quote Generator stuff: + +fs = require("fs"); +var data; + +// TCG Stuff: +var build = "M"; +var ver = "1.0.1"; +var version; +var numb = 1; + +if(build == "A") { version = ver+" ALPHA" } else +if(build == "B") { version = ver+" BETA" } else +if(build == "T") { version = ver+" TEST MODE" } else +if(build == "" || build == " ") { version = ver; } +var footertxt = "Bot created by TheCodingGuy#6697.\nBot version: "+version; +if(build == "M") { version = ver+" MAINTENANCE MODE"; footertxt = "Bot is in maintenance mode. Please tell TheCodingGuy#6997 if there are any problems"; } + +// Mortal Kombat Simulator Stuff: +var playerID = []; +var playerHP = []; +var ready = "no"; +var playerActive = 0; // Add 1 to get the actual player number. +var player1HP; +var player2HP; +var mkgameenable = "No"; + +client.on("guildCreate", guild => { + console.log("\n"); + console.log(`[INFO] Joined a server\n\tI have joined: ${guild.name} (id: ${guild.id}). This server has ${guild.memberCount} members!`); + let defaultChannel = ""; + guild.channels.forEach((channel) => { + if(channel.type == "text" && defaultChannel == "") { + if(channel.permissionsFor(guild.me).has("SEND_MESSAGES")) { + defaultChannel = channel; + } + } + }); + //defaultChannel will be the channel object that it first finds the bot has permissions for + defaultChannel.send({embed: { + title: "TCG Bot | Welcome", + color: 255, + description: "Hi! I'm TCG Bot. I am here to give weather or support via quotes.\nFor Weather: **"+wprefix+" location**.\nFor Quotes: **"+prefix+"qhelp**. \n\nThanks for adding me and I'll be here if you need me.\nProblems? **Report to TheCodingGuy#6697**.", + footer: { + text: footertxt + } + }}); //Catch the error, DM me, with the custom message. +}); + +client.on("guildDelete", guild => { + console.log("\n"); + // this event triggers when the bot is removed from a guild. + console.log(`[INFO] Removed from a server\n\tRemoved from: ${guild.name} (id: ${guild.id})`); +}); + +function ConLogEvt(type, message){ + console.log(`[${type}] ${message}`); +} +client.on('ready', () => { + //client.user.setStatus("online"); + //client.user.setActivity(" "); + client.user.setStatus("dnd"); + client.user.setActivity("maintenance mode."); + console.log("Playing: "); + function resetBot() { + // Mortal Kombat Simulator Stuff: + var playerID = []; + var playerHP = []; + var ready = "no"; + var playerActive = 0; // Add 1 to get the actual player number. + var player1HP; + var player2HP; + } + function AfterParty() { + var hrs = new Date().getHours(); + var min = new Date().getMinutes(); + var sec = new Date().getSeconds(); + if (hrs == 10 && min == 46 && sec == 45) { + // Handle After Party message + ConLogEvt("AFTER PARTY", "After Party message is about to begin."); + client.channels.get("276166375574077440").send({embed:{title:"After Party",color:lime,description:`The time is: ${hrs}:${min}:${sec} Eastern Time which means an After Party is starting here.\nJoin nkrsRadio now for the After Party experience.\n*Enjoy the experience:tm:*.`,footer:{text:footertxt} }}); + } + }; + + console.log("\n[TCG Bot Information] TCG Bot is now ready."); + resetBot(); //Execute the bot to clear everything, in clear of restart too + AfterParty(); //Execute on load to check for AfterParty + setInterval(function() { AfterParty(); }, 1000); +}); + +client.on('message', message => { + + // NEEDED for Weather System: + let cont = message.content.slice(wprefix.length).split(" "); + let args = cont.slice(1); + let conte = message.content.slice(prefix.length).split(" "); + let args1 = cont.slice(1); + + // Mortal Kombat Simulator + + function MKError(MKerr) { + message.channel.send({embed:{ + title: "TCG Bot | Mortal Kombat", + color: red, + description: "**An error occurred:**\n"+MKerr, + footer: { text:footertxt } + }}); + } + if(message.content == "mk!join") { + console.log(`Player: ${message.author.username} attempting join...`); + if(playerID.includes(message.author.id)) { + MKError("Oops. You are already in this game, silly..."); + console.log(message.author.username + " is already in this game."); + }else if(playerID.length == 2){ + MKError("Max players reached. Please try again when the current game has finished."); + console.log(message.author.username + " wants to join, but the max players has been reached"); + }else{ + playerID.push(message.author.id); + playerHP.push(100); + message.channel.send({embed: { + title: "TCG Bot | Mortal Kombat", + color: lime, + description: "Welcome! You are Player "+playerID.length+".", + footer: { text: footertxt } + }}); + console.log("Player IDs Logged:"); + console.log(playerID); // test build ready + if(player1HP == 100){ + player2HP = playerHP[1]; + }else{ + player1HP = playerHP[0]; + } + } + }else if(message.content == "mk!start") { + if(playerID.includes(message.author.id)) { + if (playerID[0] == message.author.id) { + if (ready == "yes") { + MKError("Game is not ready to start. Oh wait, it was already started :b:oi."); + console.log("The game was attempted to be started, but it was already started."); + }else if(playerID.length == 2){ + ready = "yes"; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Welcome to Mortal Kombat Simulator. The game is ready to begin. Please, verify no one else interrupts you. Thanks for wanting to play! Player 1, run \`mk!fight\`.", footer: { text: footertxt } }}); + console.log(`The game was started by ${message.author.username} in ${message.guild.name}.`); + }else{ + MKError("Game is not ready to start. Please ensure both players have joined using mk!join.\nCurrently joined players: " +playerID.length); + console.log("The game was attempted to be started, but not all players are in the game.\nCurrently joined players: "+playerID.length); + } + } else { MKError("Only Player 1 (<@!"+playerID[0]+">) can execute this command."); } + } else { MKError("You aren't even in the game."); } + }else if(message.content.startsWith("mk!fight")) { + if(!playerID.includes(message.author.id)) { + MKError("You aren't even in the game."); + return; + }else + if(playerID.length == 2 && ready == "yes") { //Ensures the game is ACTUALLY started + if(playerID[playerActive] != message.author.id){ //Ensures player's turn + MKError("You cannot fight yet. It is currently <@!" + playerID[playerActive] + ">'s turn"); + return; + } + var fightargs = message.content.split(" "); + var damage = Math.floor(Math.random() * 10) + 1; + var used = "fists"; + if(fightargs[1]) { + if(fightargs[1] == "kick"){ + damage = Math.floor(Math.random() * 20) + 1; + used = "kick"; + + }else if(fightargs[1] == "weapon"){ + damage = Math.floor(Math.random() * 30) + 1; + used = "a weapon"; + } + } + if(playerActive == 0){ + if(player2HP < 30 && used == "a weapon") { MKError("Player 2's HP is less than 30 HP (HP: "+player2HP+"). Please use kick or normal mk!fight instead."); return; }else + if(player2HP < 20 && used == "kick") { MKError("Player 2's HP is less than 20 HP (HP: "+player2HP+"). Please use normal mk!fight instead."); return; } + player2HP = player2HP - damage; + message.channel.send({embed:{ title: "TCG Bot | Mortal Kombat", color: blue, description: `Player 1 dealt ${damage} damage to Player 2 with ${used}.\nPlayer 2 now has ${player2HP} HP.` }}); + if (player2HP < 0 || player2HP == 0) { + message.channel.send({embed:{ color: red, description: "Player 2 (<@!"+playerID[1]+">) has died. Player 1 (<@!"+playerID[0]+">) has won." }}); + GameOver(); + return; + }else + if (player2HP < 10 && player2HP > 0) { + message.channel.send({embed:{ color: yellow, description: ":warning: **|** WARNING: Player 2 (<@!"+playerID[1]+">) is below 10 HP ("+player2HP+")." }}); + } + playerActive = 1; + message.channel.send({embed: { color: lime, description: "Player 2 (<@!"+playerID[1]+">)'s turn." }}); + }else + if(playerActive == 1){ + if(player1HP < 30 && used == "a weapon") { MKError("Player 1's HP is less than 30 HP (HP: "+player1HP+"). Please use kick or normal mk!fight instead."); return; }else + if(player1HP < 20 && used == "kick") { MKError("Player 1's HP is less than 20 HP (HP: "+player1HP+"). Please use normal mk!fight instead."); return; } + player1HP = player1HP - damage; + message.channel.send({embed:{ title: "TCG Bot | Mortal Kombat", color: blue, description: `Player 2 dealt ${damage} damage to Player 1 with ${used}.\nPlayer 1 now has ${player1HP} HP.` }}); + if (player1HP < 0 || player1HP == 0) { + message.channel.send({embed:{ color: red, description: "Player 1 (<@!"+playerID[0]+">) has died. Player 2 (<@!"+playerID[1]+">) has won." }}); + GameOver(); + return; + }else + if (player1HP < 10 && player1HP > 0) { + message.channel.send({embed:{ color: yellow, description: ":warning: **|** WARNING: Player 1 (<@!"+playerID[0]+">) is below 10 HP ("+player1HP+")." }}); + } + playerActive = 0; + message.channel.send({embed: { color: lime, description: "Player 1 (<@!"+playerID[0]+">)'s turn." }}); + } + }else{ MKError("The game hasn't been started yet.\nTry again when everyone uses ``mk!join`` or when Player 1 executes ``mk!start``"); } + }else if(message.content == "mk!reset"){ + if (message.author.id == TCG) { + if (playerID.length == 1) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "OK, resetting the game, this will take a few seconds...", footer: { text: footertxt } }}); + GameOver(); + } else { MKError("There must be at least 1 player in the game in order to perform this command"); } + }else{ + MKError("You do not specific permissions to do this."); + } + }else if(message.content == "mk!players"){ + if (playerID.length == 2) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "There are " + playerID.length + " players in the game currently.\nPlayer 1: <@!" + playerID[0] + ">\nPlayer 2: <@!" + playerID[1] +">.", footer: { text: footertxt } }}); + } else if(playerID.length == 1) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: blue, description: "There is only 1 player in the game. That player is: <@!" + playerID[0] +">.", footer: { text: footertxt } }}); + } else { + MKError("There are no players in the game. What are you thinking?"); + } + }else if(message.content == "mk!leave") { + if (playerID.includes(message.author.id)) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "This command is coming soon. Please continue the game, it'd be better if you did. Just saying...", footer: { text: footertxt } }}); + } else { + MKError("You are not in the game."); + } + }else if(message.content == "mk!help") { + message.channel.send("Mortal Kombat Simulator.\nCreated by TheCodingGuy and RealTTNetwork.\nCopyright 2018.\nBot version: "+version+"\n**Commands:**\nmk!join -- Joins a game\nmk!start -- Starts the game\nmk!fight -- Fights the other player\nmk!players -- shows the players in the game\nmk!leave -- Leaves the game, making other player win.\nmk!help -- Gives this help screen."); + } + + function GameOver() { + console.log("\n[WARNING] Resetting Mortal Kombat game...\n"); + //Handles the game over + setTimeout(function() { + ready = "no"; + console.log("[INFO] Set the game to not ready."); + playerID.length = 0; + console.log("[INFO] CLEARED Player IDs, basically kicked."); + playerHP.length = 0; + console.log("[INFO] RESETTED all HPs."); + playerActive = 0; + console.log("[INFO] CLEARED playerActive value.\n"); + console.log("\n[ALL CLEAR] Successful reset.\n"); + }, 2000); + } + + // TCG Commands + + function ErrorHandler(Error){ + message.channel.send({embed: { + title: "TCG Bot | Error", + color: red, + description: `An error has occurred.\n**Error code:** __${Error}__\nIf you think is this is incorrect, give **TheCodingGuy#6697** that error.`, + footer: { text: footertxt } + }}); + return; + } + function cmdstuff(cmdname, colur, descript) { + message.channel.send({embed:{ + title: "TCG Bot | "+cmdname, + color: colur, + description: descript, + footer:{text:footertxt} + }}); + } + + + if(message.content == prefix+"botdata"){ + if(message.author.id == TCG) { + cmdstuff("Bot data", blue, `I am on with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} servers.\n**Thank you everyone who has added this bot to their server!**`); + }else{ ErrorHandler("You don't have permission to perform this command."); } + }else + if(message.content.startsWith(prefix+"prune")){ + if (message.guild === null) { + ErrorHandler("You cannot run this command in a DM."); + return; + } + var pruarg = message.content.split(' '); + var messages = "1"; + if(pruarg[2]) { messages = pruarg[2]; } + console.log(`${message.author.username} wanting to delete ${messages} messages.`); + if (!message.channel.permissionsFor(message.author).has("MANAGE_MESSAGES")) { + ErrorHandler("User does not have permission: MANAGE MESSAGES."); + console.log("Sorry, you don't have the permission to execute the command \""+message.content+"\""); + return; + } else if (!message.channel.permissionsFor(client.user).has("MANAGE_MESSAGES")) { + ErrorHandler("Bot does not have permission: MANAGE MESSAGES."); + console.log("Bot doesn't have the permission MANAGE MESSAGES to prune."); + return; + } + message.delete(); + if (message.channel.type == 'text') { + message.channel.fetchMessages() + .then( () => { + message.channel.bulkDelete(messages); + messagesDeleted = messages; // number of messages deleted + + // Logging the number of messages deleted on both the channel and console. + if(messages == "1"){ msgwithornots = "message" } else { var msgwithornots = "messages" } + message.channel.send({embed:{title:"TCG Bot | Prune Successful",color:lime,description:`Deletion of messages successful.\nDeleted **${messages}** ${msgwithornots}.`,footer:{text:footertxt} }}) + .then(msg => { setTimeout(function() { msg.delete(0); }, 4000); }); + console.log('Deletion of messages successful. Total messages deleted: '+messagesDeleted); + }).catch(err => { + console.log('Error while doing Bulk Delete'); + console.log(err); + ErrorHandler("Error while doing deleting: "+err); + }); + } + }else + if(message.content == prefix+"invite") { + cmdstuff("Add me to your server!", blue, "Add me into your server today!\nhttps://discordapp.com/oauth2/authorize?client_id=438532019924893707&scope=bot&permissions=54000704"); + }else + if(message.content.startsWith(prefix+"status")){ + if(message.author.id == TCG){ + //args is already defined, so I had to make it a new (and args1 is defined too) + var args2 = message.content.split(' '); + if(args2[3] == "default"){ + client.user.setStatus("online"); + client.user.setActivity(`on ${client.guilds.size} servers`); + if(message.guild == null){ + message.channel.send(`**DEBUG: **Setting online status: online\nSetting playing status to: on ${client.guilds.size} servers`); + } + return; + }else if (args2[3]) { + client.user.setStatus(args2[2]); + console.log(`Setting status to: ${args2[2]}`); + var activity = args2[3].split(':'); + var activityName = message.content.split('"'); + client.user.setActivity(activityName[1], { type: activity[0] }); + console.log(`Setting playing status to: ${activity[0]} ${activityName[1]}`); + if(message.guild == null){ + message.channel.send(`**DEBUG: **Setting online status: ${args2[2]}\nSetting playing status to: ${activity[0]} ${activityName[1]}`); + } + cmdstuff("Status Update", lime, ":white_check_mark: Status has been updated."); + return; + }else{ + client.user.setStatus(args2[2]); + console.log(`Setting status to: ${args2[2]}`); + if (message.guild === null) { + message.channel.send(`**DEBUG: **Setting online status: ${args2[2]}`); + } + cmdstuff("Status Update", lime, ":white_check_mark: Status has been updated."); + } + }else{ + ErrorHandler("You don't have permission to perform this command."); + } + }else + if(message.content == prefix+"ping") { + var APIPing = Math.round(client.ping); + // var APIPing = "0"; // Testing + if (APIPing == "0") { msg = "YA... right..."; } else + if (APIPing < 0) { msg = "OK, what? Not a positive number! Ahhh!"; } else + if (APIPing > 2000 || APIPing == 2000) { msg = "Discord or the hoster's machine is slow or unstable."; } else + if (APIPing > 500 || APIPing == 500) { msg = "Whoa. Getting slow there..."; } else + if (APIPing < 500) { msg = "Fast, I suppose."; } else + if (APIPing < 50 || APIPing == 50) { msg = "WHOA! LIGHTNING FAST... almost."; + } else { msg = "Hmm... unable to create message based on ping."; } + message.channel.send(":ping_pong: Waiting for the ball...!").then(m => { + m.edit({embed: { + title: "TCG Bot | Ping-Pong", + color: blue, + description: `:ping_pong: Pong!\nLatency: ${m.createdTimestamp - message.createdTimestamp}ms.\nAPI Latency: `+APIPing+`ms.\n`+msg, + footer:{text:footertxt} + }}); + }); + } else + if(message.content == prefix+"version") { + cmdstuff("Version", blue, "Version: "+version); + } else + if(message.content == prefix+"reboot") { + console.log(`${message.author.username} is trying to restart the bot, making sure it is the right person or people.`); + if (message.author.id == TCG) { + message.channel.send({embed:{title:"TCG Bot | Rebooting...", color:blue, description:"OK, give me a moment. I will be back shortly. :wave:", footer:{text:footertxt} }}) + .then(msg => { client.user.setActivity("restarting..."); console.log("Please wait, restarting...\n\n\n\n\n"); client.destroy(); }) + .then(() => { console.log("Please wait, logging in."); client.login(token)}); + } else { + ErrorHandler("You don't have permission to perform this command."); + console.log(`Failed to reboot. ${message.author.username} is not TheCodingGuy.`); + } + } else + if(message.content == prefix+"shutdown") { + console.log(`${message.author.username} is trying to shutdown the bot, making sure it is the right person or people.`); + if (message.author.id == TCG) { + message.channel.send({embed:{title:"TCG Bot | Shutting down...", color:blue, description:"OK, give me a moment. I will be gone shortly. :wave:", footer:{text:footertxt} }}) + .then(msg => { client.user.setActivity("shutting down..."); console.log("Please wait, shutting down...\n\n\n\n\n"); client.destroy(); process.exit(0); }); + } else { + ErrorHandler("You don't have permission to perform this command."); + console.log(`Failed to shutdown. ${message.author.username} is not TheCodingGuy.`); + } + } else if(message.content == "Stop acting like Microsoft Sam!") { message.channel.send("Stop fighting Goddamnit..."); }else + if(message.content.startsWith(prefix+"8ball")) { + var responses = ["Totally. You should know that!","Some guy said yes.","Some other guy said no.","TheCodingGuy said no.","TheROFL98 said no.","VeryBadKids said no.","megaMan9521 said no.","TheCodingGuy said yes.","TheROFL98 said yes.","VeryBadKids said yes.","megaMan9521 said yes.","Yup!","Sure","Nah.","I'm unsure, try asking again?","No.","Yes.","I suppose.","Oops. I forgot what the answer was.","error","YES OF FREAKING COURSE!","mmhmm.","Uh... no.",":100:% YES",":100:% NO!"] + var ballmsg = responses[Math.floor(Math.random() * responses.length)]; + if(ballmsg == "error") { cmdstuff("8ball", red, ":question: Question: "+args.join(" ")+"\n:8ball: Answer: Sorry. Something went wrong. If you see **TheCodingGuy#6697**, tell him: TCGBOTERROR8ballRESPONSEFATAL6017174302018"); } + else{ cmdstuff("8ball", blue, ":question: Question: "+args.join(" ")+"\n:8ball: Answer: "+ballmsg); } + } else + //if(message.content == prefix+"divideby0") { message.channel.send({embed: { title: "TCG Bot | Dividing by 0...", color: yellow, description: "Please wait...", footer: { text: footertxt } }}).then(msg => { setTimeout(function() { msg.delete(0); message.channel.send({embed: { title: " ", color: blue, description: "Imagine you have 0 pieces of bacon, and you cut it up among 0 friends. See? It doesn't make any freaking sense. Bacon is sad there is no bacon bacon ba-bacon, and you are sad you have 0 friends still. And even if you had some friends, they probably won't like Bacon.", footer: { text: footertxt } }}); }, 1000); }); } else + if(message.content == prefix+"social") { + cmdstuff("Social", blue, "Here's TCG's Social Media:\n**Youtube:** https://www.youtube.com/channel/UCc5Gp0c85XKV90Z-NrUjYMQ\n**Twitter:** https://twitter.com/OfficialTCGMatt/"); + } else + if(message.content == prefix+"help") { + cmdstuff("Help", blue, "**__Welcome to the new help__.**\n**Prefix: "+prefix+"**\n**COMMANDS:**\n"+prefix+"help\n"+prefix+"invite **(Add me to another server\)**\n"+prefix+"prune number **(REQUIRES MANAGE MESSAGES Permission)**\n"+prefix+"support **(After the word support, you @ someone. Leave it blank to support yourself.)**\n"+prefix+"8ball\n"+prefix+"numgen **(Generate a number 1-10, put a number and it will generate a number from 1-your number.)**\n"+prefix+"ping\n"+prefix+"social\n"+prefix+"version\n"+prefix+"qgen **(Quote Generator command)**\n"+prefix+"qhelp **(Quote Generator command)**\n"+wprefix+" location **(Weather System command)**\n\n**Problems? Notify TheCodingGuy#6697.**"); + } else + if(message.content.startsWith(prefix+"support")) { + if(message.content == prefix+"support <@!438532019924893707>" || prefix+"support @TCG Bot"){ + message.channel.send("Hey there, TCG Bo- Wait what... why would I need support? Support a human, not me. Thanks!"); + } else if(message.content == prefix+"support") { + message.channel.send("Hey there, <@!"+message.author.id+">, TCG Bot here,\nI don't know extactly what the problem is, but I want you to know, you are needed & wonderful.\nBelieve you can do it and your half-way there.\nLife can be hard at times, but I believe you will get through it.\nBe happy, enjoy life, and continue to be strong.\nYou may get support whenever.\nGood luck to you, your family, your friends, and everyone else you know.\nFrom,\n\tTCG Bot."); + } else { + message.channel.send("Hey there, "+args[0]+", TCG Bot & <@!"+message.author.id+"> here,\nWe (at least I) may not know extactly what the problem is, but we want you to know, you are needed & wonderful.\nBelieve you can do it and your half-way there.\nLife can be hard at times, but we believe you will get through it.\nBe happy, enjoy life, and continue to be strong.\nYou may get support whenever.\nGood luck to you, your family, your friends, and everyone else you know.\nFrom,\n\tTCG Bot & <@!"+message.author.id+">."); + } + } else + if(message.content.startsWith(prefix+"numgen")) { + if(message.content == prefix+"numgen") { + var num = Math.floor(Math.random() * 10) + 1; + cmdstuff("Random Number Generator", blue, "Random number between 1 & 10:\nNumber: "+num); + }else{ + var num = Math.floor(Math.random() * args.join(" ")) + 1; + if(num == "NaN" || num == null || num == "" || num == NaN) { + ErrorHandler("Invaild number"); + }else{ + cmdstuff("Random Number Generator", blue, "Random number between 1 & "+args.join(" ")+":\nNumber: "+num); + } + } + } else + if(message.content.startsWith("Bad TCG Bot")) { + if (numb == "1") {message.channel.send("I'm sorry. I'll try to do better."); numb = "2"; } else + if (numb == "2") {message.channel.send("I didn't mean it. Sorry."); numb = "3"; } else + if (numb == "3") {message.channel.send("Please don't hate me."); numb = "1"; } + } else + if(message.content == prefix+"crash") { + message.delete(); + message.channel.send({embed:{title:"TCG Bot", color:red, description:"**A problem has been detected and TCG OS has shutdown to prevent damage to this computer.**\n\n**Error:** *FORCE_CRASH*\n**File caused:** *C:/TCG-Bot/System/System.tcg*\n\n**STOP CODE:** *0x000f12*\n**Technical data:** *0x000f12 caused over render of 0x001f11*\n\n**Generating a crash report...**\n**Dumping to C:/TCG-Bot/System/Crashes/crash.tcgdmp**\n**Dump complete.**\n\n**Contact your system administrator or technical support group for help.**" }}); + } else + // Quote Generator code + + if(message.content == prefix+"qhelp") { + message.channel.send({embed: { + title: "TCG Bot | Quote Generator", + color: blue, + description: "*Type* **"+prefix+"qgen** *for the magic to happen.", + footer: { + text: footertxt + } + }}); + } else + if (message.content == prefix+"qgen") { + message.channel.send({embed: { + title: "TCG Bot | Quote Generator", + color: yellow, + description: "Please wait, generating a quote.", + footer: { + text: footertxt + } + }}).then(msg => { setTimeout(function() { msg.delete(0); QuoteGen() }, 200); }); + } else if(message.content.startsWith("/tcg")) { + ErrorHandler("Invaild command"); + } + function randomInt (low, high) { + return Math.floor(Math.random() * (high - low) + low); + } + function QuoteGen() { + if (message.guild === null) { + console.log(`User ${message.author.username} in DMs is running Quote Generator command.`); + } else { + console.log(`User ${message.author.username} in ${message.guild.name} is running Quote Generator command.`); + } + fs.readFile('quotes.txt', 'utf8', function (err,rawData) { + if (err) { + ErrorHandler(err); + console.log(err); + return; + } + data = rawData.split('\n'); + var quote = data[randomInt(0,data.length)]; + message.channel.send({embed: { + title: "TCG Bot | Quote Generator", + color: blue, + description: ""+quote+"", + footer: { + text: footertxt + } + }}); + console.log("Returned: "+quote); + }); + } + + // Weather System code + + if(message.content.startsWith(wprefix)) { + message.channel.send({embed: { + title: "TCG Bot | Weather System", + color: yellow, + description: "Please wait, getting the weather.", + "image": { + "url": "http://nkrstech.co/Weather/assets/sun-loading.gif" + }, + footer: { + text: footertxt + } + }}).then(msg => { setTimeout(function() { msg.delete(0); GetWeather() }, 200); }); + } + + function GetWeather() { + if (message.guild === null) { + console.log(`User ${message.author.username} in DMs is running Weather System command.`); + } else { + console.log(`User ${message.author.username} in ${message.guild.name} is running Weather System command.`); + } + weather.find({search: args.join(" "), degreeType: 'F'}, function(err, result) { + if (err) { + ErrorHandler(err); + console.log(err); + return; + } + if (result === undefined || result.length === 0) { + ErrorHandler("Please enter a vaild location."); + console.log("ERROR: User entered a invaild location."); + return; + } + + var current = result[0].current; // current part + var location = result[0].location; // location part + + var weather = `It is currently: ${current.skytext}\nTimezone: UTC${location.timezone}\nTemperature: ${current.temperature} `+location.degreetype+`\nFeels like: ${current.feelslike}\nWinds: `+current.winddisplay+`\nHumidity: ${current.humidity}%`; + message.channel.send({embed: { + title: `TCG Bot | Weather System | Weather for ${current.observationpoint}`, + color: blue, + description: ""+weather+"", + footer: { + text: footertxt + } + }}); + console.log(`Returned:\nWeather System | Weather for ${current.observationpoint}\n`+weather); + }); + } +}); + +console.log("Please wait, logging in."); +client.login(token); + +//Invite: https://discordapp.com/oauth2/authorize?client_id=438532019924893707&scope=bot&permissions=37084224 \ No newline at end of file diff --git a/src/bot-v2-old.js b/src/bot-v2-old.js new file mode 100644 index 0000000..29b519d --- /dev/null +++ b/src/bot-v2-old.js @@ -0,0 +1,120 @@ +//TCG Bot - Created in Discord.JS (https://discord.js.org). Bot created by TheCodingGuy#6697. +const Discord = require("discord.js"); +const client = new Discord.Client(); +const fs = require("fs"); +const config = require("./config.json"); +const prefix = config.prefix; + +//TCB File Import +let codingbytes = JSON.parse(fs.readFileSync("./Bytes-File.json", "utf8")); +let userData = ""; +const TCG = "222073294419918848"; + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var version = "1.1 Beta"; +var footertxt = "Bot created by TheCodingGuy#6697.\nVersion: "+version; + + +client.on('ready', () => { + console.log("\n\n[INFO] TCG Bot is online"); +}); + +client.on("messageDelete", (messageDelete) => { + console.log(`\n[DELETED] @${messageDelete.author.username}#${messageDelete.author.discriminator}: ${messageDelete.content} (In: ${messageDelete.guild}, #${messageDelete.channel.name} at: ${messageDelete.createdAt} `); +}); + +client.on('messageUpdate', (omsg, nmsg) => { + console.log('\n[UPDATED] @%s#%s Old message: %s => New message: %s in: %s, #%s', nmsg.author.username, nmsg.author.discriminator, omsg.content, nmsg.content, nmsg.guild ,nmsg.name); +}); + + +client.on("message", message => { + if(message.author.bot) return; + console.log(`\n@${message.author.username}#${message.author.discriminator}: ${message.content} (In: ${message.guild}, #${message.channel.name} at: ${message.createdAt} `); + + //TCB System + if (codingbytes[message.author.id]) { + //Load the data from Bytes-File.JSON + userData = codingbytes[message.author.id]; + //Count up + userData.counter++; + + //Count up locally + let curcounter = Math.floor(3 * Math.sqrt(userData.counter)); + console.log(`Counter for ${message.author.username} file counter: ${userData.counter} local counter: ${curcounter}`); + if (curcounter > userData.counter) { + //Reset counter + curcounter = userData.counter; + + //Give them free TheCodingBytes + var num = Math.floor(Math.random() * 10) + 1; + + userData.bytes = Math.floor(userData.bytes + num); + + //Notify them + message.reply(`you have been rewarded **${num}** Bytes.`); + } + //Write the data to the file + fs.writeFile("./Bytes-File.json", JSON.stringify(codingbytes), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + } + + if(message.content.indexOf(config.prefix) !== 0) return; + let cont = message.content.split(" "); + let command = cont[1]; + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + //Command Handler + + try { + console.log(`User is wanting to run command: ${command} command`); + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBucks [TCB]**\n"+prefix+" bytes-create\n"+prefix+" bytes-bal",footer:{text:footertxt} }}); + }else + if(command == "bytes-bal"){ + if(message.author.id == TCG) { + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[0], description:`You have 9999999 Bytes`,footer:{text:footertxt} }}); + }else if (!codingbytes[message.author.id]) { + ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one."); + }else{ + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[0], description:`You have ${userData.bytes} Bytes`,footer:{text:footertxt} }}); } + } + else if(command == "bytes-create") { + try { + if (!codingbytes[message.author.id]) { + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`We are creating your Bytes Account for you.\n__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + } else { + ErrorHandler("You already have an account."); + return; + } + //Check if user has TheCodingBytes -- if not, create the data + if (!codingbytes[message.author.id]) codingbytes[message.author.id] = { + bytes: 0, + counter: 0 + }; + } catch (err) { ErrorHandler(err); } + }else{ + let commandFile = require(`./commands/${command}.js`); + commandFile.run(client, message, footertxt, prefix); } + } catch (err) { + if(err == `Error: Cannot find module './commands/${command}.js'`){ + ErrorHandler(`The command "${command}" does not exist.`); + }else{ + ErrorHandler(err); + } + console.error(err); + }; +}); + + +client.login(config.token); \ No newline at end of file diff --git a/src/bot.js b/src/bot.js index 6727c81..c35c13b 100644 --- a/src/bot.js +++ b/src/bot.js @@ -1,327 +1,200 @@ -/* - THECODINGBOT v5 - 6/24/2021 - - Now open-source! - - Can you believe it took Matt 4 years (as of 2022) - to open-source his bot projects? - Yeah, I know crazy. wait.. why am I talking third-person again? - - https://codingbot.gg/source - https://netrocorp.net -*/ - -var logger; -process.waitingForCleanup = false; -async function bot(debug) { - - - // ========== PRE-BOOT - var startTime = new Date().getTime(); - if (debug) console.log("- PRE-BOOT"); - if (debug) console.log(` -- App is starting as of ${new Date(startTime).toString()} -- `); - - - async function exitHandler(options, exitCode) { - // if (process.waitingForCleanup) return; // stops from trying to keep process a million times - process.waitingForCleanup = false; - - var app = ((options) ? options.app : app) || app; - - var log = function(type, from, msg) { - if (logger) logger.info("SYS", msg); - else console.log(`[${type}] [${from}] ${msg}`); - } - - if (exitCode) - if (!isNaN(exitCode)) - log("i", "SYS", "Process is about to exit with code {" + exitCode + "}"); - else - log("i", "SYS", "Process attempted to exit with " + exitCode); - - var appName = ((app !== undefined) ? app.name : "Now"); - - if (options.cleanup && !process.waitingForCleanup) { - process.waitingForCleanup = true; - if (app !== undefined) { - if (app.client !== undefined) { // Close Discord - log("i", "SYS", "Logging out..."); - try { - - await app.client.destroy(); - } catch (err) { - log('X', 'SYS', err); - }; - - if (app.client) { - if (app.client._events) { - var events = Object.keys(app.client._events) - for (var i = 0; i < events.length; i++) { - log("i", "SYS", "Unloading event " + events[i]); - await app.client.removeListener(events[i], () => {}); - }; - }; - }; - app.client = null; - }; - if (app.db !== undefined) { // Close DBs - log("i", "SYS", "Closing databases..."); - try { - await app.db.close(); - } catch (err) { - log('X', 'SYS', err); - }; - - app.db = null; - }; - if (app.extras !== undefined) { // Close extras - log("i", "SYS", "Unloading extras..."); - try { - for (var extra in app.extras) { - extra = app.extras[extra]; - await extra.extraApp.uninit(app); - }; - } catch (err) { - log('X', 'SYS', err); - }; - - app.extras = null; - }; - - app = null; - }; - - process.waitingForCleanup = false; - - if (options.restart) { - require("child_process") - .spawn( - process.argv.shift(), - process.argv, { - cwd: process.cwd(), - detached: true, - stdio: "inherit" - } - ); - }; - }; - - process.waitingForCleanupTM = setInterval(function() { - if (!process.waitingForCleanup) { - clearInterval(process.waitingForCleanupTM); - - if (options.exit) { - log("i", "SYS", `${appName} exiting as of ${new Date()}.`); - - process.exit(0); - }; - }; - }, 500); - - - }; - - process.exitHandler = (options, exitCode) => exitHandler(options, exitCode); - - // Kinda dumb how I had to shove it into the bot function but it's whatever. - process.stdin.resume(); // Let's not close immediately, thanks. - - process.on('uncaughtException', error => { - const errreason = new Error(error.message); - const errstack = ` Caused By:\n ${error.stack}`; - - const msg = ` == UNCAUGHT EXCEPTION THROWN ==\n${errreason}\n${errstack}\n ================================`; - - if (logger) logger.error("SYS", msg); - else console.log(`[X] [SYS] ${msg}`); - }); // Catch all them nasty uncaughtException errors :/ - - process.on('unhandledRejection', error => { - const errreason = new Error(error.message); - const errstack = ` Caused By:\n ${error.stack}`; - - const msg = ` == UNHANDLED REJECTION THROWN ==\n${errreason}\n${errstack}\n ================================`; - - if (logger) logger.info("SYS", msg); - else console.log(`[i] [SYS] ${msg}`); - }); // Catch all them nasty unhandledRejection errors :/ - - - - // Change directory - try { - if (process.cwd().split("\\").slice(-1) != "src") // attempt to change into 'src' - process.chdir(process.cwd() + "/src"); - } catch (Ex) {}; // Assume it's okay to continue. - - // Do our require - if (debug) console.log("-> Init: Bootloader"); - const BootLoader = require("./app/functions/bootloader.js"); - const bootloader = new BootLoader(); - await bootloader.printLogo(); // Print that healthy logo. Logo got back - - - if (debug) console.log("-> Init: Logger"); - const Log = require("./app/functions/logger.js"); - if (debug) console.log("-> Start: Logging"); - logger = new Log(); - logger.info("SYS", `Logging is now enabled!`); - - await logger.warnAboutDebug(debug); // warn about debugging (if it applies) - - if (debug) console.log("-> Init: App"); - const app = require("./app/cfg/app.js"); - app.debugMode = debug; - app.logger = logger; - app.bootloader = bootloader; - app.startTime = startTime; - logger.info("SYS", `App core successfully loaded!`); - - process.once('exit', exitHandler.bind(null, { cleanup: true, exit: true })); // Let's catch the app before it exits. - process.once('SIGINT', exitHandler.bind(null, { app: app, exit: true, cleanup: true })); // Let's catch CTRL+C. - process.once('SIGTERM', exitHandler.bind(null, { app: app, exit: true, cleanup: true })); - // catches "kill pid" (for example: nodemon restart) - process.once('SIGUSR1', exitHandler.bind(null, { exit: true, cleanup: true })); - process.once('SIGUSR2', exitHandler.bind(null, { exit: true, cleanup: true })); - - - if (debug) console.log("-> Init: Dependencies"); - const dependencies = app["dependencies"]; - if (debug) console.log(` > Dependencies: ${dependencies.length}`); - if (debug) logger.debug("SYS", `Dependencies are now ready to load!`); - - - // ========== BOOT - if (debug) console.log("-> Start: Boot"); - logger.info("SYS", `Starting ${app.name} ${app.version.toFullString()}!`); - - - logger.info("SYS", `Enabling dependencies...`); - if (!process.waitingForCleanup) await bootloader.loadHandler(app, "dependency", dependencies); - - - if (debug) console.log("-> Init: Configuration"); - const configuration = await app.modules.fs.readdirSync('./app/cfg').filter(file => file.endsWith('.json')); - if (debug) console.log(` > Configuration: ${configuration.length}`); - if (debug) logger.debug("SYS", `Configuration files are now ready to load!`); - - - logger.info("SYS", `Enabling configuration...`); - if (!process.waitingForCleanup) await bootloader.loadHandler(app, "configuration", configuration); - - if (debug) console.log("-> Init: Languages"); - const LanguageLoader = require("./app/lang/lang.js"); - const languageloader = new LanguageLoader(app, "English"); - app.lang = languageloader; - const languages = await app.modules.fs.readdirSync('./app/lang').filter(file => file.endsWith('.json')); - if (debug) console.log(` > Languages: ${languages.length}`); - if (debug) logger.debug("SYS", `Languages files are now ready to load!`); - - - logger.info("SYS", `Enabling languages...`); - if (!process.waitingForCleanup) await languageloader.loadLang(languages); - - - if (debug) console.log("-> Init: Discord Client..."); - const { Client } = app.modules["discord.js"]; - const client = new Client({ - partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER", "USER"], - // intents: 32767 // btw, this forces discord.js to do ALL intents. not recommended. - intents: 98047 // all intents excluding presence - }); - app.client = client; - if (debug) console.log(` > New Discord Client created.`); - - - if (debug) console.log("-> Check: If Restarted..."); - lastMessageID = null; - try { lastMessageID = await app.modules.fs.readFileSync(process.cwd() + "/cache/restart.tmp", "utf8"); } catch (Ex) {}; - if (lastMessageID != null) app.lastMessageID = lastMessageID; - try { app.modules.fs.unlinkSync(process.cwd() + "/cache/restart.tmp"); } catch (Ex) {}; - if (debug) console.log(` > Cheked If Restart completed.`); - - - if (debug) console.log("-> Init: Extras"); - const extras = await require('./app/extras/extras.json'); // this is probably inefficent, but it works ig - app.extras = {}; - if (debug) console.log(` > Extras: ${extras.length}`); - if (debug) logger.debug("SYS", `Extras are now ready to load!`); - - - logger.info("SYS", `Enabling Extras...`); - if (!process.waitingForCleanup) await bootloader.extraHandler(app, extras); - - - logger.info("SYS", `Enabling database...`); - if (!process.waitingForCleanup) await bootloader.loadHandler(app, "database", null); - - - if (debug) console.log("-> Init: Events"); - const events = await app.modules.fs.readdirSync('./app/evts').filter(file => file.endsWith('.js')); - if (debug) console.log(` > Events: ${events.length}`); - if (debug) logger.debug("SYS", `Events are now ready to load!`); - - - logger.info("SYS", `Enabling events...`); - if (!process.waitingForCleanup) await bootloader.loadHandler(app, "event", events); - - - if (debug) console.log("-> Init: Commands"); - // const commands = await app.modules.fs.readdirSync('./app/cmds').filter(file => file.endsWith('.js')); - const commands = await app.functions.getFiles('./app/cmds', ["", ".js"]); - if (debug) console.log(` > Commands: ${commands.length}`); - if (debug) logger.debug("SYS", `Commands are now ready to load!`); - - - logger.info("SYS", `Enabling commands...`); - if (!process.waitingForCleanup) await bootloader.loadHandler(app, "command", commands); - - // if (debug) console.log("-> Init: Slash Commands"); - // const slashcommands = await app.modules.fs.readdirSync('./app/cmds/slash').filter(file => file.endsWith('.js')); - // if (debug) console.log(` > Slash Commands: ${slashcommands.length}`); - // if (debug) logger.debug("SYS", `Slash Commands are now ready to load!`); - - // logger.info("SYS", `Enabling slash commands...`); - // await bootloader.loadHandler(app, "slashCommand", slashcommands); - - // I don't know how I want to do slash commands, although this code *kinda* works. - // You just gotta tweak around in bootloader to get it to actually load. Otherwise, - // this is a waste of bytes. Hmph. - - try { - logger.info("SYS", `Logging in...`); - if (!process.waitingForCleanup) await client.login(app.config.tokendata.discord); - - // Assume we good - logger.success("SYS", `Welcome to ${app.name}.`); - } catch (Ex) { - if (Ex.message.includes("Cannot read properties of undefined (reading 'discord')")) - app.logger.error("SYS", "Hey, you probably forgot to follow the README!\nYou need to ensure 'tokendata.json.example' to 'tokendata.json'.\nIf you've done this, please ensure your JSON is not broken.\nIf it's not, please open an issue on the GitHub."); - else if (Ex.stack.includes("DISALLOWED_INTENTS")) - app.logger.error("SYS", "Hey, you need to allow intents for your bot!\nIntents required: 'SERVER MEMBERS', 'MESSAGE CONTENT'.\nPlease view the README for more information and how to enable intents for " + app.name + ".\nIf you've done this, please open an issue on the GitHub."); - else - app.logger.error("SYS", "I could not connect to Discord. Sorry about that.\nI can't provide much help, but if this issue is caused by programming not by you, please open a GitHub issue with the following information:\n" + Ex); - process.exit(-1); // I mean ig this is a good thing to do? - }; - +//TCG Bot - Created in Discord.JS (https://discord.js.org). Bot created by TheCodingGuy#6697. + +function syslog(type, message) { + console.log(`\n[${type}] ${message}`); + if(type == "WARN" || type == "ERR") { emcolor = colors[3]; } else { emcolor = colors[0]; } + client.channels.get(systemlog).send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${message}`, + footer:{text:footertxt} + }}); + client.fetchUser(TCG).then(user => {user.send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${message}`, + footer:{text:footertxt} + }}); }); }; -// ARGUMENTS ACCEPTED: -// - true/false | SETS THE BOT TO DEBUG ON/OFF - -// WARNING: Debug is really spammy. It's the equivalent -// of asking "GOOD LORD, WHAT IS HAPPENING IN THERE?" -const cmdArgs = process.argv.slice(2); // Get args -switch (cmdArgs[0]) { - case "true": - bot(true); - break; - default: - bot(); - break; -}; // Just tell the bot to either start with debug or nah :D - - - -// The heck is that all the way down here for? Beats me. \ No newline at end of file +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + +var count = ""; +var bootTime = ""; +var countmin = "0"; +var countsec = "0"; +var botload = ""; +function Starting() { + GetDate(); + GetTime(); + console.log(`[INFO] TCG BOT is attempting start at ${time} on ${date}...`); + botload = `${time} on ${date}`; +} +Starting(); +count = setInterval(function() { + if(countsec == "60" || countsec == 60) { + console.log("[WARNING] TCG Bot couldn't connect within 60 seconds.\nVerify you have a stable internet connection and the Discord servers are done."); + client.destroy(); + process.exit(0); + return; + } + countsec++; + bootTime = countsec + " seconds"; +}, 1000); +const Discord = require("discord.js"); +const client = new Discord.Client(); +const fs = require("fs"); +const config = require("./config.json"); +const prefix = config.prefix; + +const TCG = "222073294419918848"; + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var version = "1.2-u2"; +//var version = "TEST BUILD"; +if(version == "TEST BUILD") { var footertxt = "!! WARNING !!\nWelcome to the future of TCG Bot.\nThis version is not yet public.\nIf errors occurr, contact TheCodingGuy#6697 ASAP."; } +else { var footertxt = "Bot created by TheCodingGuy#6697.\nVersion: "+version; } + +var time; +var date; + +var systemlog = ""; +var messagelog = ""; + + +// This loop reads the /events/ folder and attaches each event file to the appropriate event. +fs.readdir("./events/", (err, files) => { + if (err) return syslog("ERR", err); + files.forEach(file => { + let eventFunction = require(`./events/${file}`); + let eventName = file.split(".")[0]; + // super-secret recipe to call events with all their proper arguments *after* the `client` var. + client.on(eventName, (...args) => eventFunction.run(client, ...args, footertxt)); + }); +}); + +// EVENTS +client.on("ready", () => { + + //client.user.setActivity("Starting up..."); + GetTime(); + GetDate(); + clearInterval(count); + var msg = `TCG Bot was loaded at ${botload}\nAt ${time} on ${date}, the bot logged in.\nIt took the bot **${bootTime}** to load.\nI'm ready.`; + syslog("INFO", `${msg}`); + console.log("\n\n\n"); + var i = 0; + function Activity() { + if(i == 3) { + stuff = setInterval(function(){ GetTime(); GetDate(); client.user.setActivity(`${time} ${date}`); }, 1000); + setTimeout(function(){clearInterval(stuff); i=0; Activity(); }, 5000); + } else { + var statuses = [`with ${prefix}help`, `as version ${version}`, `on ${client.guilds.size} servers. Use ${prefix}invite to add me.`, "with the future.", "on TCG's site: http://officialtcgmatt.ml"]; + var newgame = statuses[Math.floor(Math.random() * statuses.length)]; + client.user.setActivity(newgame).then(() => console.log("[INFO] Set playing status: "+newgame)); + i++; + setTimeout(function(){Activity();}, 300000); + } + } + Activity(); + + +}); + + + +client.on("message", message => { + let cont = message.content.slice(prefix.length).split(" "); + let command = cont[0]; + + if(!message.author.username == "TCG Bot") { + var msg = `@${message.author.username}#${message.author.discriminator}\nMessage: ${message.content}\nIn: ${message.guild} | #${message.channel.name}\nSent: ${message.createdAt}`; + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Message Sent", + color: colors[1], + description: `${msg}`, + footer:{text:footertxt} + }}); + } + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + //Command Handler + + //TCB System + try{ + if(command == "write" || message.content.startsWith(prefix+"bytes")) { + if(!message.author.id == TCG) { + ErrorHandler(`The Bytes system is currently getting rewritten`); return; + } else { + let commandFile = require(`./commands/bytes-new.js`); + commandFile.run(client, message, footertxt, prefix, command); + } + } + } catch (err) { + if(err == `Error: Cannot find module './commands/bytes-new.js'`){ + ErrorHandler(`Bytes system handler was not found. __Report now__.`); + return; + } + } + + try { + if(message.content.startsWith("/tcg")) { ErrorHandler("``/tcg`` prefix was removed. It is now ``/``. This warning message will be removed from the bot on 6/30/2018."); return; } + if(!message.content.startsWith(prefix)) return; + console.log(`[INFO] ${message.author.username}#${message.author.discriminator} is trying to run: ${command} command`); + let commandFile = require(`./commands/${command}.js`); + commandFile.run(client, message, footertxt, prefix, command, cont); + } catch (err) { + if(err == `Error: Cannot find module './commands/${command}.js'`){ + if(message.guild == null) return syslog("ERR", `This no longer sends to the user if command was not found.\n${message.author.username}#${message.author.discriminator} tried to run the command, "${command}", in DMs, but it does not exist.`); + syslog("ERR", `This no longer sends to user if command was not found.\n${message.author.username}#${message.author.discriminator} tried to run the command, "${command}", in #${message.channel.name}, on the server, ${message.guild}, but it does not exist.`); + return; + + }else{ + ErrorHandler(err); + console.error(err); + syslog("ERR", `An error occurred while running command: ${command}\n**Details:** ${err}\nMore information has been said in console.`); + + } + }; +}); + + +client.login(config.token); diff --git a/src/commands-1.1/8ball.js b/src/commands-1.1/8ball.js new file mode 100644 index 0000000..48aeebd --- /dev/null +++ b/src/commands-1.1/8ball.js @@ -0,0 +1,11 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + let cont = message.content.slice(prefix.length).split(" "); + let args = cont.slice(2); + if(!args || args == null || args == "" || args == " ") {message.channel.send({embed:{title:"TCG Bot | 8ball", color:colors[3], description:"**ERROR:** You did not ask a question.", footer:{text:footertxt} }}); return;} + var responses = ["Totally. You should know that!","Some guy said yes.","Some other guy said no.","TheCodingGuy said no.","TheROFL98 said no.","SnakeSpiderScorpion said no.","megaMan9521 said no.","TheCodingGuy said yes.","TheROFL98 said yes.","SnakeSpiderScorpion said yes.","megaMan9521 said yes.","Yup!","Sure","Nah.","I'm unsure, try asking again?","No.","Yes.","I suppose.","Oops. I forgot what the answer was.","Bacon ate this answer because it contained bacon bacon bacon.","YES OF FREAKING COURSE!","mmhmm.","Uh... no.",":100:% YES",":100:% NO!"] + var ballmsg = responses[Math.floor(Math.random() * responses.length)]; + message.channel.send({embed:{title:"TCG Bot | 8ball", color:colors[0], description:":question: **Your Question:** "+args.join(" ")+"\n:8ball: **Answer:** "+ballmsg, footer:{text:footertxt} }}); +} \ No newline at end of file diff --git a/src/commands-1.1/assume.js b/src/commands-1.1/assume.js new file mode 100644 index 0000000..e8c7a8f --- /dev/null +++ b/src/commands-1.1/assume.js @@ -0,0 +1,22 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Assume the Position v1.0"; +const TCG = "222073294419918848"; +const ZarvoxNad = "357645434354794497"; +const megaMan = "391417866244718593"; +const ROFL = "271086062976237569"; +const nkrs200 = "201602260126400512"; +const DoubleT = "353287289021005827"; + +exports.run = (client, message, footertxt, prefix) => { + let cont = message.content.slice(prefix.length).split(" "); + let args = cont.slice(2); + if(!args || args == null || args == "" || args == " ") {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** You did input who should assume the position.", footer:{text:footertxt} }}); return;}else + //if(args == "TheCodingGuy" || args.join(" ").includes("TCG") || args.join(" ").includes("tcg") || args.join(" ").includes("Matt") || args == "<@!"+TCG+">") {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** :b: You cannot make my bot owner assume the position.", footer:{text:footertxt} }}); return;}else + if(args == "Nadeko" || args == "Zarvox" || args == "<@!"+ZarvoxNad+">") {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** You cannot make my good bot friend assume the position.", footer:{text:footertxt} }}); return;}else + if(args.join(" ").includes("bacon") || args.join(" ").includes("Bacon")) {message.channel.send({embed:{title:cmdtitle, color:colors[0], description: args.join(" ")+", please assume the bacon position. Bacon bacon. Needs more bacon. Assume the position for Bacon.", footer:{text:footertxt} }}); return; }else + if(args.join(" ").includes("DoubleT") || args.join(" ").includes("Double-T") || args.join(" ").includes("RealTT") || args.join(" ").includes("mega") || args.join(" ").includes("ROFL") || args.join(" ").includes("nkrs") || args.join(" ").includes("<@!"+ROFL+">") || args.join(" ").includes("<@!"+nkrs200+">") || args.join(" ").includes("<@!"+megaMan+">") || args.join(" ").includes("<@!"+DoubleT+">")) {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** You cannot make my good friend assume the position.", footer:{text:footertxt} }}); return;}else + if(args.join(" ") == "TCG Bot" || args.join(" ").includes("<@!438532019924893707>")) {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** You cannot make me assume the position.", footer:{text:footertxt} }}); return;}else + if(args.join(" ").includes(message.author) || args.join(" ").includes(message.author.id)) { message.channel.send({embed:{title:cmdtitle, color:colors[2], description:"Now, why make yourself assume the positon? Try someone else.",footer:{text:footertxt} }}); return; }; + message.channel.send({embed:{title:cmdtitle, color:colors[0], description: args.join(" ")+", please assume the position.", footer:{text:footertxt} }}); +} \ No newline at end of file diff --git a/src/commands-1.1/bytes-json.js b/src/commands-1.1/bytes-json.js new file mode 100644 index 0000000..534ac01 --- /dev/null +++ b/src/commands-1.1/bytes-json.js @@ -0,0 +1,199 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const fs = reqiure("fs"); + +//TCB File Import +//var codingbytes = JSON.parse(fs.readFileSync("./Bytes-File.json", "utf8")); +var file = "/var/www/html/account/Bytes-File.json" +var codingbytes = JSON.parse(fs.readFileSync(file, "utf8")); +let userData; +let collectable = false; +let counter = 0; +var num = 0; +var maxnum = 0; +var m; +var msgfreeb; +maxnum = Math.floor(Math.random() * 19 + 1); + +const TCG = "222073294419918848"; + +exports.run = async (client, message, footertxt, prefix, command) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}).then( msg => { if(Error == "There is nothing to collect."){ msg.delete(4000); } }); + } + + //Load the data from Bytes-File.JSON + userData = codingbytes[message.author.id]; + + //Count up + if(!collectable) counter++; + console.log(`Counter: ${counter} | Max Counter: ${maxnum}`); + if (maxnum == counter || counter > maxnum) { + if(command == "write"){ + message.delete(0); + if(collectable){ + m.delete(0); + if(codingbytes[message.author.id]){ + + //Run the code! + userData.bytes = userData.bytes + num; + + //Sent the success! + message.channel.send({embed:{title:"TCG Bot | Bytes | Written", color:colors[1], description:`Written ${num} bytes to ${message.author.username}.tcgbank.\nThis file now has ${userData.bytes} Bytes.`,footer:{text:footertxt} }}).then( msg => { setTimeout(function() { msg.delete(0); }, 8000); }); + + //Change collectable to false: + collectable = false; + counter = 0; + maxnum = Math.floor(Math.random() * 19 + 1); + }else{ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one.");} + }else{ErrorHandler("There is nothing to collect.");} + return; + } + if(!collectable){num = Math.floor(Math.random() * 19) + 1; + m = await message.channel.send({embed:{title:"TCG Bot | Bytes | Collect",color:colors[2],description:"You need "+num+" Bytes for your account file. Run ``/tcg write`` to write them to your account file.",footer:{text:footertxt} }}) + collectable = true; + } + }else + if (counter > maxnum + 10) { + if(collectable){ + maxnum = Math.floor(Math.random() * 19 + 1); + collectable = false; + counter = 0; + console.log("No one collected the "+num+" Bytes. Resetted."); + } + } + //Write the data to the file + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + if(!message.content.startsWith(prefix)) return; + + //TCB Shop + if(command == "bytes-shop"){ + var responses = "1 | Byte Collector [ROLE] | 1,024 Bytes\n2 | Byte Hunter [ROLE] | 5,000 Bytes\n3 | Byte Hoarder [ROLE] | 10,000 Bytes\n"; + message.channel.send({embed:{ title:"TCG Bot | TCB Shop", color:colors[0], description:"Currently in the shop:\n**ID NUMBER | ITEM NAME | PRICE**\n"+responses,footer:{text:footertxt} }}); + }else + if(command == "bytes-buy"){ + var buyargs = message.content.split(' '); + if(isNaN(buyargs[2])) { ErrorHandler("You must put the ID Number you want to buy. Run ``/tcg bytes-shop`` to find a ID Number"); return;} + let role; + let amount; + if(buyargs[2] == "1") { role = message.guild.roles.find("name", "Byte Collector"); amount = "1024";}else + if(buyargs[2] == "2") { role = message.guild.roles.find("name", "Byte Hunter"); amount = "5000";}else + if(buyargs[2] == "3") { role = message.guild.roles.find("name", "Byte Hoarder"); amount = "10000";} + else{ ErrorHandler("That ID Number ("+buyargs[2]+") does not exist in the database. Run ``/tcg bytes-shop`` to find a ID Number"); return;} + if (message.member.roles.has(role.id)) { ErrorHandler("You already have that. Run ``/tcg bytes-shop`` to find another a ID Number"); return;} + message.author.addRole(role); + message.channel.send({embed:{title:"TCG Bot | TCB Shop | Purchase Complete", color:colors[1], description:"Purchase complete!",footer:{text:footertxt} }}); + userData.bytes = userData.bytes - amount; + }else + if(command == "free-bytes"){ + if(message.author.id == TCG){ + message.delete(0); + msgfreeb = await message.channel.send({embed:{ + title: "TCG Bot | Free Bytes", + color: colors[2], + description: "Whoa! 500 Free Bytes are up, but for only a minute!\nCollect them now by reacting to the check!", + footer:{text:footertxt} + }}).then(() => { message.react('☑️') }); + + const filter = (reaction, user) => { + return ['☑️'].includes(reaction.emoji.name) && user.id === message.author.id; + }; + + message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] }) + .then(collected => { + const reaction = collected.first(); + + if (reaction.emoji.name === '☑️') { + console.log(`TCG is starting a reaction event`); + if(!codingbytes[message.author.id]){ console.log("User: "+message.author.id+" does not have a account yet."); return; } + else{userData = codingbytes[message.author.id]; } + userData.bytes = userData.bytes + 500; + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + console.log(`Written 500 Bytes to ${message.author.id}'s account.`); + } + }).catch(collected => { + console.log(`After a minute, only ${collected.size} out of 4 reacted.`); + msgfreeb.delete(0); + }); + } else { + ErrorHandler("You do not have permission to do this."); + } + } else + if(command == "bytes-award"){ + if(message.author.id == TCG){ + var awardargs = message.content.split(' '); + var awardnum = awardargs[2]; + if(isNaN(awardnum)) return; + var person = awardargs[3]; + console.log(`${message.author.username} is awarding ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + if(!codingbytes[personid]){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + else{userData = codingbytes[personid]; } + userData.bytes = userData.bytes + parseInt(awardnum); + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Write", color:colors[0], description:`Written ${awardnum} Bytes to <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }else{ + ErrorHandler("You do not have permission to do this."); + } + }else + if(command == "bytes-wipe"){ + if(message.author.id == TCG){ + var wipeargs = message.content.split(' '); + var wipenum = wipeargs[2]; + var person = wipeargs[3]; + console.log(`${message.author.username} is wiping ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + if(!codingbytes[personid]){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + else{userData = codingbytes[personid]; } + if(wipenum > userData.bytes){ErrorHandler(`This user does not have that much Bytes. (${userData.bytes} Bytes is all they have)`); return; } + userData.bytes = userData.bytes - wipenum; + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Wipe", color:colors[0], description:`Wiped ${wipenum} Bytes from <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }else{ + ErrorHandler("You do not have permission to do this."); + } + }else + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBytes [TCB]**\n"+prefix+" bytes-create\n"+prefix+" bytes-bal\n"+prefix+" write",footer:{text:footertxt} }}); + }else + if(command == "bytes-bal"){ + var balargs = message.content.split(' '); + if(!balargs[2] || balargs[2] == null || balargs[2] == "" || balargs[2] == " "){ + if (!codingbytes[message.author.id]) { + ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one."); + return; + }else{ + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[1], description:`You have ${userData.bytes} Bytes.`,footer:{text:footertxt} }}); + } + }else{ + var person = balargs[2]; + var personid = person.replace(/[<@!>]/g, ''); + if(!codingbytes[personid]){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + else{userData = codingbytes[personid];} + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[0], description:`<@!${personid}> has ${userData.bytes} Bytes.`,footer:{text:footertxt} }}); + } + }else if(command == "bytes-create") { + try { + if (!codingbytes[message.author.id]) { + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`We are creating your Bytes Account for you.\n__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + } else { + ErrorHandler("You already have an account."); + return; + } + //Check if user has TheCodingBytes -- if not, create the data + if (!codingbytes[message.author.id]) codingbytes[message.author.id] = { + bytes: 0 + }; + } catch (err) { ErrorHandler(err); } + } + +}; \ No newline at end of file diff --git a/src/commands-1.1/bytes-new.js b/src/commands-1.1/bytes-new.js new file mode 100644 index 0000000..cd5837a --- /dev/null +++ b/src/commands-1.1/bytes-new.js @@ -0,0 +1,69 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const mysql = require("mysql"); +var con = mysql.createConnection({ + host: 'localhost', + user: 'account', + password: 'data', + database: 'accountdata' +}); +con.connect(err => { + console.log("[INFO] Connecting to the database..."); + if(err) { ErrorHandler(err); console.log(err); return; } + console.log("[INFO] Connected to the database!"); +}); +let collectable = false; +let counter = 0; +var num = 0; +var maxnum = Math.floor(Math.random() * 19 + 1); +const TCG = "222073294419918848"; + +exports.run = async(client, message, footertxt, prefix, command) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}).then( msg => { console.log("[ERROR] "+Error); if(Error == "There is nothing to collect."){ msg.delete(4000); } }); + } + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBytes [TCB]**\n"+prefix+" bytes-create\n"+prefix+" bytes-bal\n"+prefix+" write",footer:{text:footertxt} }}); + } + + // Counting stuff + + if (!collectable) counter++; + console.log(`[BYTES] Counter: ${counter} | Max Counter: ${maxnum}`); + + + // Now loading the Bytes stuff from MySQL + + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,rows) => { + if(err) ErrorHandler(err); + rows.forEach( (row) => { + // TCG Bytes -- Create + if(command == "bytes-create") { + try { + if (!row) { + //Check if user has TheCodingBytes -- if not, create the data: + var sql = ""; + con.query('INSERT INTO bytesdata(id, user, bytes) VALUES(message.author.id, "NULL", "0"'), (err) => { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + }); + } else { + ErrorHandler("You already have an account."); + return; + } + } catch (err) { ErrorHandler(err); } + } + } + }); + + +}; \ No newline at end of file diff --git a/src/commands-1.1/bytes.js b/src/commands-1.1/bytes.js new file mode 100644 index 0000000..fa22116 --- /dev/null +++ b/src/commands-1.1/bytes.js @@ -0,0 +1,150 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const mysql = require("mysql"); +var con = mysql.createConnection({ + host: 'localhost', + user: 'account', + password: 'data', + database: 'accountdata' +}); +con.connect(err => { + if(err) { ErrorHandler(err); console.log(err); return; } + console.log("Connected to the database!"); +}); +let userData; +let row; +let collectable = false; +let counter = 0; +var num = 0; +var maxnum = 0; +var msgfreeb; +maxnum = Math.floor(Math.random() * 19 + 1); +const TCG = "222073294419918848"; + +exports.run = async(client, message, footertxt, prefix, command) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}).then( msg => { console.log("[ERROR] "+Error); if(Error == "There is nothing to collect."){ msg.delete(4000); } }); + } + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBytes [TCB]**\n"+prefix+" bytes-create\n"+prefix+" bytes-bal\n"+prefix+" write",footer:{text:footertxt} }}); + } + //Load the data from MySQL + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,row) => { + if(err) ErrorHandler(err); + //Count up. + if (!collectable) counter++; + console.log(`[BYTES] Counter: ${counter} | Max Counter: ${maxnum}`); + if (maxnum >= counter){ + if(command=="write"){ + message.delete(0); + if(collectable){ + + if(!row){ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one."); } + + //Run the code! + con.query("UPDATE `bytesdata` SET `bytes`='"+Math.floor(row.bytes+num)+"' WHERE id='"+message.author.id+"'"); + + //Sent the success! + message.channel.send({embed:{title:"TCG Bot | Bytes | Written", color:colors[1], description:`Written ${num} bytes to ${message.author.username}.tcgbank.\nThis file now has `+row.bytes+` Bytes.`,footer:{text:footertxt} }}).then( msg => { setTimeout(function() { msg.delete(0); }, 8000); }); + + //Change collectable to false: + collectable = false; + counter = 0; + maxnum = Math.floor(Math.random() * 19 + 1); + }else{ErrorHandler("There is nothing to collect.");} + }else if(!collectable){ + num = Math.floor(Math.random() * 19) + 1; + message.channel.send({embed:{title:"TCG Bot | Bytes | Collect",color:colors[2],description:"You need "+num+" Bytes for your account file. Run ``/tcg write`` to write them to your account file.",footer:{text:footertxt} }}) + .then( msg => { msg.delete(60000); }); + collectable = true; + } + } + }); + if(!message.content.startsWith(prefix)) return; + if(command == "bytes-award"){ + if(message.author.id == TCG){ + var awardargs = message.content.split(' '); + var awardnum = awardargs[2]; + if(isNaN(awardnum)) return; + var person = awardargs[3]; + console.log(`${message.author.username} is awarding ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + con.query('SELECT * FROM bytesdata WHERE id = "'+personid+'"', (err,row) => { + if(!row) { + var sql = `UPDATE bytesdata SET bytes = ${row.bytes + parseInt(awardnum)} WHERE id = ${personid}`; + con.query(sql, function (err, result) { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Write", color:colors[0], description:`Written ${awardnum} Bytes to <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }); + } else { ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + }); + } else { ErrorHandler("You do not have permission to do this."); } + }else + if(command == "bytes-wipe"){ + if(message.author.id == TCG){ + var wipeargs = message.content.split(' '); + var wipenum = wipeargs[2]; + var person = wipeargs[3]; + console.log(`${message.author.username} is wiping ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + con.query('SELECT * FROM bytesdata WHERE id = "'+personid+'"', (err,row) => { + if(!row) { + if(wipenum > row.bytes){ErrorHandler(`This user does not have that much Bytes. (${userData.bytes} Bytes is all they have)`); return; } + var sql = `UPDATE bytesdata SET bytes = ${row.bytes - wipenum} WHERE id = ${personid}`; + con.query(sql, function (err, result) { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Wipe", color:colors[0], description:`Wiped ${wipenum} Bytes from <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }); + } else { ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + }); + }else{ ErrorHandler("You do not have permission to do this."); } + }else + if(command == "bytes-bal"){ + var balargs = message.content.split(' '); + if(!balargs[2] || balargs[2] == null || balargs[2] == "" || balargs[2] == " "){ + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,rows) => { + rows.forEach( (row) => { + if (!row) { + ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one."); + return; + }else{ + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[1], description:`You have ${row.bytes} Bytes.`,footer:{text:footertxt} }}); + return; + } + }); + }); + }else{ + var person = balargs[2]; + var personid = person.replace(/[<@!>]/g, ''); + con.query('SELECT * FROM bytesdata WHERE id = "'+personid+'"', (err,row) => { + if(!row){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[0], description:`<@!${personid}> has `+row.bytes+` Bytes.`,footer:{text:footertxt} }}); + }); + } + }else if(command == "bytes-create") { + try { + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,row) => { + if (!row) { + //Check if user has TheCodingBytes -- if not, create the data: + var sql = "INSERT INTO bytesdata(id, user, bytes) VALUES(message.author.id, 'NULL', '0')"; + con.query(sql, function (err, result) { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + }); + } else { + ErrorHandler("You already have an account."); + return; + } + }); + } catch (err) { ErrorHandler(err); } + } +}; \ No newline at end of file diff --git a/src/commands-1.1/help.js b/src/commands-1.1/help.js new file mode 100644 index 0000000..2aa43a4 --- /dev/null +++ b/src/commands-1.1/help.js @@ -0,0 +1,23 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + var responses = [prefix+" help\n", + prefix+" ping\n", + prefix+" 8ball **question**\n", + prefix+" assume **person**\n", + prefix+" invite\n\n", + "**CURRENCY (in TheCodingBytes [TCB]**\n", + prefix+" bytes-create\n", + prefix+" bytes-bal\n", + prefix+" write\n\n", + "**ADMINISTRATION**\n", + prefix+" prune **number-to-delete**"]; + + message.channel.send({embed: { + title: "TCG Bot | Command Help", + color: colors[0], + description: `__**Welcome to the new TCG Bot Command Help.**__\nWe hope you enjoy your experience with TCG Bot.\n\n${responses.join("")}\n`, + footer:{text:footertxt} + }}); +}; \ No newline at end of file diff --git a/src/commands-1.1/invite.js b/src/commands-1.1/invite.js new file mode 100644 index 0000000..2698017 --- /dev/null +++ b/src/commands-1.1/invite.js @@ -0,0 +1,6 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + message.channel.send({embed:{title:"TCG Bot | Add Me",color:colors[0], description:"Add me into your server today!\nhttps://discordapp.com/oauth2/authorize?client_id=438532019924893707&scope=bot&permissions=54000704",footer:{text:footertxt} }}); +} \ No newline at end of file diff --git a/src/commands-1.1/kill.js b/src/commands-1.1/kill.js new file mode 100644 index 0000000..45f951c --- /dev/null +++ b/src/commands-1.1/kill.js @@ -0,0 +1,16 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Killing Machine v1.0"; + +exports.run = (client, message, footertxt, prefix) => { + var args = message.content.split('"') + if(args.length >= 3){ + var target = args[1] + if(args.length == 5){ + var weapon = args[3] + message.channel.send("**" + target + "** has been killed by **" + message.author.username + "** using **" + weapon + "**") + }else{ + message.channel.send("**" + target + "** has been killed by **" + message.author.username + "**") + } + } +}; \ No newline at end of file diff --git a/src/commands-1.1/numgen.js b/src/commands-1.1/numgen.js new file mode 100644 index 0000000..6782502 --- /dev/null +++ b/src/commands-1.1/numgen.js @@ -0,0 +1,28 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + let args = message.content.split(' '); + + if(!args[2]) { + var num = Math.floor(Math.random() * 10) + 1; + message.channel.send({embed:{title:"TCG Bot | Random Number Generator", color:colors[0], description:"Random number between 1 & 10:\nNumber: "+num, footer:{footertxt} }}); + }else{ + if(isNaN(args[2])) { + ErrorHandler("Invaild number"); + return; + } + var num = Math.floor(Math.random() * args[2]) + 1; + message.channel.send({embed:{title:"TCG Bot | Random Number Generator", color:colors[0], description:"Random number between 1 & "+args[2]+":\nNumber: "+num, footer:{footertxt} }}); + } +}; \ No newline at end of file diff --git a/src/commands-1.1/ping.js b/src/commands-1.1/ping.js new file mode 100644 index 0000000..d4a018f --- /dev/null +++ b/src/commands-1.1/ping.js @@ -0,0 +1,23 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + var responses = ["I love Ping-Pong. Let's keep going.", "I missed the ball. You win.", "What did I say again?", "A fun-pack inside every ping.", "Oh... uh... My paddle is getting red." ] + var APIPing = Math.round(client.ping); + // var APIPing = "0"; // Testing + if (APIPing == "0") { msg = "YA... right..."; } else + if (APIPing < 0) { msg = "OK, what? Not a positive number! Ahhh!"; } else + if (APIPing > 2000 || APIPing == 2000) { msg = "Discord or the hoster's machine is slow or unstable."; } else + if (APIPing > 500 || APIPing == 500) { msg = "Whoa. Getting slow there..."; } else + if (APIPing < 500) { msg = "Fast, I suppose."; } else + if (APIPing < 50 || APIPing == 50) { msg = "WHOA! LIGHTNING FAST... almost."; + } else { msg = "Hmm... unable to create message based on ping."; } + message.channel.send(":ping_pong: Waiting for the ball...!").then(m => { + m.edit({embed: { + title: "TCG Bot | Ping-Pong", + color: colors[0], + description: `:ping_pong: Pong! ${responses[Math.floor(Math.random() * responses.length)]}\nLatency: ${m.createdTimestamp - message.createdTimestamp}ms.\nAPI Latency: ${APIPing}ms.\n${msg}`, + footer:{text:footertxt} + }}); + }); +}; \ No newline at end of file diff --git a/src/commands-1.1/prune.js b/src/commands-1.1/prune.js new file mode 100644 index 0000000..c0d57a1 --- /dev/null +++ b/src/commands-1.1/prune.js @@ -0,0 +1,50 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + if (message.guild === null) { + ErrorHandler("You cannot run this command in a DM."); + return; + } + var pruarg = message.content.split(' '); + var messages = "1"; + if(pruarg[2]) { messages = pruarg[2]; } + console.log(`${message.author.username} wanting to delete ${messages} messages.`); + if (!message.channel.permissionsFor(message.author).has("MANAGE_MESSAGES")) { + ErrorHandler("User does not have permission: MANAGE MESSAGES."); + console.log("Sorry, you don't have the permission to execute the command \""+message.content+"\""); + return; + } else if (!message.channel.permissionsFor(client.user).has("MANAGE_MESSAGES")) { + ErrorHandler("Bot does not have permission: MANAGE MESSAGES."); + console.log("Bot doesn't have the permission MANAGE MESSAGES to prune."); + return; + } + message.delete(); + if (message.channel.type == 'text') { + message.channel.fetchMessages() + .then( () => { + message.channel.bulkDelete(messages); + messagesDeleted = messages; // number of messages deleted + + // Logging the number of messages deleted on both the channel and console. + if(messages == "1"){ msgwithornots = "message" } else { var msgwithornots = "messages" } + message.channel.send({embed:{title:"TCG Bot | Prune Successful",color:colors[1],description:`Deletion of messages successful.\nDeleted **${messages}** ${msgwithornots}.`,footer:{text:footertxt} }}) + .then(msg => { setTimeout(function() { msg.delete(0); }, 4000); }); + console.log('Deletion of messages successful. Total messages deleted: '+messagesDeleted); + }).catch(err => { + console.log('Error while doing Bulk Delete'); + console.log(err); + ErrorHandler(err); + }); + } +}; \ No newline at end of file diff --git a/src/commands-1.1/radio.js b/src/commands-1.1/radio.js new file mode 100644 index 0000000..373c66c --- /dev/null +++ b/src/commands-1.1/radio.js @@ -0,0 +1,61 @@ +// TCG Radio +// Version 1.0.0.0 + + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; +var footertxt = "TCG Radio\nMade by TheCodingGuy#6697"; +var prefix = "/tcg-r" + +function log(type, message) { + console.log("\n["+type+"] "+message); +}; + +exports.run = (client, message) => { + + message.delete(0); + function embed(embedtitle, embedcolor, content) { + message.channel.send({embed: { + title: "TCG Radio | "+embedtitle, + color: embedcolor, + description: content, + footer:{text:footertxt} + }}); + }; + + if(!message.content.startsWith(prefix)) return; + + if(message.content == prefix + " start") { + + log("RADIO", "User is wanting to start TCG Radio..."); + if(message.author.id == TCG) { + const voiceChannel = message.member.voiceChannel; + if (!voiceChannel || voiceChannel.type !== 'voice') return embed("Error", colors[3], "You are not in a voice channel. Please connect to one and try again."); + voiceChannel.join().then(connection =>{ + message.channel.send({embed: { title: "TCG Radio | Starting...", color: colors[0], description: "Starting TCG Radio...", footer:{text:footertxt} }}).then((msg) => {msg.delete(3000);}); + log("RADIO", "Started. Playing intro sound."); + var dispatcher = message.guild.voiceConnection.playFile("./start.mp3"); + dispatcher.on("end", end => { + log("RADIO", "End of broadcast, playing end sound..."); + var dispatcher = message.guild.voiceConnection.playFile("./end.mp3"); + dispatcher.on("end", end => { + message.channel.send({embed: { title: "TCG Radio | End of broadcast", color: colors[1], description: "The radio has reached the end of the broadcast.", footer:{text:footertxt} }}).then((msg) => {msg.delete(3000);}); + message.member.voiceChannel.leave(); + }); + }); + }).catch(err => { log("ERROR", err); embed("Error", colors[3], "Cannot start TCG Radio because of:\n"+err); }); + + } else { + embed("Error", colors[3], "You do not have permission to execute this command"); + return; + } + } else + if(message.content == prefix + " end") { + log("RADIO", "Ending TCG Radio...") + message.channel.send({embed: { title: "TCG Radio | Ending...", color: colors[0], description: "Ending TCG Radio", footer:{text:footertxt} }}).then((msg) => {msg.delete(3000);}); + message.member.voiceChannel.leave(); + return; + } +}; \ No newline at end of file diff --git a/src/commands-1.1/reboot.js b/src/commands-1.1/reboot.js new file mode 100644 index 0000000..c082dd2 --- /dev/null +++ b/src/commands-1.1/reboot.js @@ -0,0 +1,30 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +const TCG = "222073294419918848"; +const fs = require('fs'); + +const config = require("../config.json"); +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + console.log(`${message.author.username} is trying to restart the bot, making sure it is the right person or people.`); + if (message.author.id == TCG) { + message.channel.send({embed:{title:"TCG Bot | Rebooting...", color:colors[1], description:"OK, give me a moment. I will be back shortly. :wave:", footer:{text:footertxt} }}); + client.user.setActivity("restarting..."); + console.log("Please wait, restarting...\n\n\n\n\n"); + client.destroy(); + console.log("Please wait, logging in."); + client.login(config.token); + } else { + ErrorHandler("You don't have permission to perform this command."); + console.log(`Failed to reboot. ${message.author.username} is not TheCodingGuy.`); + } +} \ No newline at end of file diff --git a/src/commands-1.1/shutdown.js b/src/commands-1.1/shutdown.js new file mode 100644 index 0000000..ae5303d --- /dev/null +++ b/src/commands-1.1/shutdown.js @@ -0,0 +1,25 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +const TCG = "222073294419918848"; +const fs = require('fs'); + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + console.log(`${message.author.username} is trying to shutdown the bot, making sure it is the right person or people.`); + if (message.author.id == TCG) { + message.channel.send({embed:{title:"TCG Bot | Shutting down...", color:colors[1], description:"OK, give me a moment. I will be gone shortly. :wave:", footer:{text:footertxt} }}) + .then(() => { client.user.setActivity("shutting down..."); console.log("Please wait, shutting down...\n\n\n\n\n"); client.destroy(); process.exit(0); }) + } else { + ErrorHandler("You don't have permission to perform this command."); + console.log(`Failed to reboot. ${message.author.username} is not TheCodingGuy.`); + } +} \ No newline at end of file diff --git a/src/commands-1.1/sound/end.mp3 b/src/commands-1.1/sound/end.mp3 new file mode 100644 index 0000000..02c94e9 Binary files /dev/null and b/src/commands-1.1/sound/end.mp3 differ diff --git a/src/commands-1.1/sound/start.mp3 b/src/commands-1.1/sound/start.mp3 new file mode 100644 index 0000000..d455581 Binary files /dev/null and b/src/commands-1.1/sound/start.mp3 differ diff --git a/src/commands-1.1/test.js b/src/commands-1.1/test.js new file mode 100644 index 0000000..eaae450 --- /dev/null +++ b/src/commands-1.1/test.js @@ -0,0 +1,23 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848" + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + if(message.author.id == TCG) { + var args = message.content.split(' '); + var userID = args[2]; + var member = message.guild.member(userID); + message.channel.send({embed:{description:`${member}` }}); + } +}; \ No newline at end of file diff --git a/src/commands/8ball.js b/src/commands/8ball.js new file mode 100644 index 0000000..242fd42 --- /dev/null +++ b/src/commands/8ball.js @@ -0,0 +1,62 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + message.channel.send({embed:{title:"TCG Bot | 8ball",colors:colors[2],description:" Thinking of a 8ball answer, hang tight.",footer:{text:footertxt} }}) + .then(msg => { + msg.delete(); // Delete the wait message + let cont = message.content.slice(prefix.length).split(" "); + let args = cont.slice(1).join(" "); + if(!args || args == null || args == "" || args == " ") {message.channel.send({embed:{title:"TCG Bot | 8ball", color:colors[3], description:"**ERROR:** You did not ask a question.", footer:{text:footertxt} }}); return;} + var responses = [ + "Honestly, I don't know. For real.", + "I'm unsure, try asking again?", + "I suppose.","Oops. I forgot what the answer was.", + + "Totally. You should know that!", + "Green light. Yup!", + "Let me think about th-Yes.", + "Oh yeah!", + "Yup!", + "Sure.", + "Yes.", + "YES OF FREAKING COURSE!", + "mmhmm.", + ":100:% YES!", + "The way I see it, I say yes.", + + "No. You should know that!", + "Red light. No.", + "Let me think about th-No.", + "Uh... no.", + "Nope!", + "Nah.", + "No.", + "NO OF FREAKING COURSE!", + "Uh-huh.", + ":100:% NO!", + "The way I see it, I say no." + ]; + + var things = [ + "OK", + "Alright", + "Sure", + "Cool", + "Well", + "Okay", + "Hmm", + "Here it is" + ]; + + var thing = things[Math.floor(Math.random() * things.length)]; + var ballmsg = responses[Math.floor(Math.random() * responses.length)]; + var question = ""; + + + if(args.includes("?")) { question = `"**${args}**"`; } else { question = `"**${args}**?"`; } + //message.channel.send({embed:{title:"TCG Bot | 8ball", color:colors[0], description:":question: **Your Question:** "+args+"\n:8ball: **Answer:** "+ballmsg+"\n:busts_in_silhouette: **Asker:** "+message.author.username+"#"+message.author.discriminator, footer:{text:footertxt} }}); + message.channel.send({embed:{title:"TCG Bot | 8ball", color:colors[0], description: `So, **${message.author.username}#${message.author.discriminator}**, you want to know my response to ${question}\n${thing}, my response is, "**${ballmsg}**"`, footer:{text:footertxt} }}); + }); + +} \ No newline at end of file diff --git a/src/commands/announce.js b/src/commands/announce.js new file mode 100644 index 0000000..6d3c3d6 --- /dev/null +++ b/src/commands/announce.js @@ -0,0 +1,81 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; + +exports.run = (client, message, footertxt, prefix) => { + if(message.author.id == TCG) { + + if(message.content == prefix+"announce sample-update") { + message.channel.send("**:x::warning::x: SAMPLE :x::warning::x:**"); + message.channel.send("**---------------------**\n**TCG Bot | Update**\n**---------------------**\nWhy hello there, TCG Bot just updated to version 1.2-u2.\n\nThis update includes:\n**! Re-did TCG Bot's 8ball command**\n**+ Added `/format`** *(currently supports from A: to N:)*\n**+ Added `/serverinfo`** *Accurate and quick*\n**+ Added `/userinfo`** *Also accurate and quick*\n**+ Added `/uptime`** *Useful to know how long the bot's been on.*\n**! RE-ADDED THE ALMOST FORGOTTEN `/quote`**\n**! Re-did ``/help``, you can do** ``/help`` **``command`` now to see more information on a command!**"); + message.channel.send("**:x::warning::x: SAMPLE :x::warning::x:**"); + } else + if(message.content == prefix+"announce update") { + let guild = message.guild; + var guildList = client.guilds.array(); + try { + guildList.forEach(guild => { + + let defaultChannel = ""; + guild.channels.forEach((channel) => { + if(channel.type == "text" && defaultChannel == "") { + if(channel.permissionsFor(guild.me).has("SEND_MESSAGES")) { defaultChannel = channel; } + } + }); + //defaultChannel will be the channel object that it first finds the bot has permissions for + defaultChannel.send("**---------------------**\n**TCG Bot | Update**\n**---------------------**\nWhy hello there, TCG Bot just updated to version 1.2-u2.\n\nThis update includes:\n**! Re-did TCG Bot's 8ball command**\n**+ Added `/format`** *(currently supports from A: to N:)*\n**+ Added `/serverinfo`** *Accurate and quick*\n**+ Added `/userinfo`** *Also accurate and quick*\n**+ Added `/uptime`** *Useful to know how long the bot's been on.*\n**! RE-ADDED THE ALMOST FORGOTTEN `/quote`**\n**! Re-did ``/help``, you can do** ``/help`` **``command`` now to see more information on a command!**"); + message.channel.send(`:white_check_mark: **|** Sent message update message to ${guild.name}`); + }).catch(err,guild => { + console.log("Could not send message to " + guild.name); + console.error(err); + message.channel.send({embed: { + title: "TCG Bot | Error while sending your message to "+guild.name, + color: colors[3], + description: "**ERROR:\n**"+err, + footer: { text: footertxt } + }}); + }); + } catch (err) { message.channel.send("ERROR: "+err); console.error(err); } + } else + if(message.content.startsWith(prefix+"announce")) { + let cont = message.content.split(' '); + let colornum = cont[1]; + if(isNaN(colornum)) return message.channel.send({embed: { title: "TCG Bot | Error while sending your message", color: colors[3], description: "**ERROR:\n**Please use the colors for embeds:\n**COLORS:**\n0 = Blue\n1 = Lime\n2 = Yellow\n3 = Red", footer: { text: footertxt } }}); + let msg = cont.slice(2).join(" "); + if(!msg) return message.channel.send({embed: { title: "TCG Bot | Error while sending your message", color: colors[3], description: "**ERROR:\n**Please supply the message.", footer: { text: footertxt } }}); + let guild = message.guild; + var guildList = client.guilds.array(); + try { + guildList.forEach(guild => { + + let defaultChannel = ""; + guild.channels.forEach((channel) => { + if(channel.type == "text" && defaultChannel == "") { + if(channel.permissionsFor(guild.me).has("SEND_MESSAGES")) { defaultChannel = channel; } + } + }); + //defaultChannel will be the channel object that it first finds the bot has permissions for + defaultChannel.send({embed: { + title: "TCG Bot | Announcement", + color: colors[colornum], + description: msg, + footer: { text: footertxt } + + }}); + message.channel.send(`:white_check_mark: **|** Sent message "${msg}" to ${guild.name}`); + }); + } catch (err) { + console.log("Could not send message to " + guild.name); + console.error(err); + message.channel.send({embed: { + title: "TCG Bot | Error while sending your message to "+guild.name, + color: colors[3], + description: "**ERROR:\n**"+err, + footer: { text: footertxt } + }}); + } + } + } else { message.channel.send({embed: { title: "TCG Bot | Error while sending your message", color: colors[3], description: "**ERROR:\n**You do not have permission to do this.", footer: { text: footertxt } }}); } + +} \ No newline at end of file diff --git a/src/commands/ban.js b/src/commands/ban.js new file mode 100644 index 0000000..0a1fe26 --- /dev/null +++ b/src/commands/ban.js @@ -0,0 +1,82 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Administration > Ban"; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + + +exports.run = (client, message, footertxt, prefix) => { + if (message.guild === null) return message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\nCommand cannot be ran in DMs.", footer:{text:footertxt} }}); + + let cont = message.content.split(' '); + let user = cont[1]; + if(isNaN(user)) user = message.mentions.members.first(); + let reason = cont.slice(2).join(" "); + if(!user) {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** invalid user to ban.", footer:{text:footertxt} }}); return;} + if (!message.channel.permissionsFor(message.author).has("BAN_MEMBERS")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nYou do not have permission to ban people.",footertext:{text:footertxt} }}); + if (!message.channel.permissionsFor(client.user).has("BAN_MEMBERS")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nI do not have permission to ban people.",footertext:{text:footertxt} }}); + if (!user.bannable) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nI cannot ban "+user+".\nThey may have a higher role or is not on this server.",footertext:{text:footertxt} }}); + user.ban().then(() => { + GetTime(); + GetDate(); + if(!reason || reason == null || reason == "" || reason == " ") { + message.channel.send({embed:{ + title:cmdtitle, + color:colors[1], + description: `**User Banned**\nUser: ${user} (ID: ${user.id})\nReason: __No reason provided.__\nServer: ${message.guild.name}\nAt: ${time} on ${date}.`, + footer:{text:footertxt} + }}); + client.fetchUser(user.id).then(user => { user.send({embed:{ + title: `TCG Bot | Banned from server`, + color: colors[3], + description: `You were Banned from the server: ${message.guild.name}.\nAt: ${time} on ${date}.\nAdmin: ${message.author.username}#${message.author.discriminator}\nReason: __No reason provided.__`, + footer:{text:footertxt} + }}); }).catch(() => { message.reply(":x: **|** Failed to inform "+user+" of ban"); }); + return; + } else { + message.channel.send({embed:{ + title:cmdtitle, + color:colors[1], + description: `**User Banned**\nUser: ${user} (ID: ${user.id})\nReason: ${reason}\nServer: ${message.guild.name}\nAt: ${time} on ${date}.`, + footer:{text:footertxt} + }}); + client.fetchUser(user.id).then(user => { user.send({embed:{ + title: `TCG Bot | Banned from server`, + color: colors[3], + description: `You were Banned from the server: ${message.guild.name}.\nAt: ${time} on ${date}.\nAdmin: ${message.author.username}#${message.author.discriminator}\nReason: ${reason}`, + footer:{text:footertxt} + }}); }).catch(() => { message.reply(":x: **|** Failed to inform "+user+" of ban"); }); + return; + } + }).catch(err => { + message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n"+err,footertext:{text:footertxt} }}); + }); + +} \ No newline at end of file diff --git a/src/commands/blacklist.js b/src/commands/blacklist.js new file mode 100644 index 0000000..e010b1c --- /dev/null +++ b/src/commands/blacklist.js @@ -0,0 +1,29 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; +const fs = require("fs"); + +exports.run = (client, message, footertxt, cont, blockedidsfile, blockedids) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + if(message.author.id == TCG || message.author.hasPermission('ADMINISTRATOR')) { + let idblock = cont[2]; + let idblockname = message.guild.channels.get(idblock); + blockedids.ids = blockedids.ids + ", "+idblock; + fs.writeFile("../Bytes-Blacklist.json", JSON.stringify(blockedids), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + message.channel({embed:{title:"TCG Bot | Bytes | Blacklist",color:colors[1],description:`Blocked channel #${idblockname.name} (ID: ${idblock}) from TheCodingBytes commands & collection.`,footer:{text:footertxt} }}); + }else{ + ErrorHandler("You do not have permission to do this."); + } +} \ No newline at end of file diff --git a/src/commands/bytes-json.js b/src/commands/bytes-json.js new file mode 100644 index 0000000..534ac01 --- /dev/null +++ b/src/commands/bytes-json.js @@ -0,0 +1,199 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const fs = reqiure("fs"); + +//TCB File Import +//var codingbytes = JSON.parse(fs.readFileSync("./Bytes-File.json", "utf8")); +var file = "/var/www/html/account/Bytes-File.json" +var codingbytes = JSON.parse(fs.readFileSync(file, "utf8")); +let userData; +let collectable = false; +let counter = 0; +var num = 0; +var maxnum = 0; +var m; +var msgfreeb; +maxnum = Math.floor(Math.random() * 19 + 1); + +const TCG = "222073294419918848"; + +exports.run = async (client, message, footertxt, prefix, command) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}).then( msg => { if(Error == "There is nothing to collect."){ msg.delete(4000); } }); + } + + //Load the data from Bytes-File.JSON + userData = codingbytes[message.author.id]; + + //Count up + if(!collectable) counter++; + console.log(`Counter: ${counter} | Max Counter: ${maxnum}`); + if (maxnum == counter || counter > maxnum) { + if(command == "write"){ + message.delete(0); + if(collectable){ + m.delete(0); + if(codingbytes[message.author.id]){ + + //Run the code! + userData.bytes = userData.bytes + num; + + //Sent the success! + message.channel.send({embed:{title:"TCG Bot | Bytes | Written", color:colors[1], description:`Written ${num} bytes to ${message.author.username}.tcgbank.\nThis file now has ${userData.bytes} Bytes.`,footer:{text:footertxt} }}).then( msg => { setTimeout(function() { msg.delete(0); }, 8000); }); + + //Change collectable to false: + collectable = false; + counter = 0; + maxnum = Math.floor(Math.random() * 19 + 1); + }else{ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one.");} + }else{ErrorHandler("There is nothing to collect.");} + return; + } + if(!collectable){num = Math.floor(Math.random() * 19) + 1; + m = await message.channel.send({embed:{title:"TCG Bot | Bytes | Collect",color:colors[2],description:"You need "+num+" Bytes for your account file. Run ``/tcg write`` to write them to your account file.",footer:{text:footertxt} }}) + collectable = true; + } + }else + if (counter > maxnum + 10) { + if(collectable){ + maxnum = Math.floor(Math.random() * 19 + 1); + collectable = false; + counter = 0; + console.log("No one collected the "+num+" Bytes. Resetted."); + } + } + //Write the data to the file + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + if(!message.content.startsWith(prefix)) return; + + //TCB Shop + if(command == "bytes-shop"){ + var responses = "1 | Byte Collector [ROLE] | 1,024 Bytes\n2 | Byte Hunter [ROLE] | 5,000 Bytes\n3 | Byte Hoarder [ROLE] | 10,000 Bytes\n"; + message.channel.send({embed:{ title:"TCG Bot | TCB Shop", color:colors[0], description:"Currently in the shop:\n**ID NUMBER | ITEM NAME | PRICE**\n"+responses,footer:{text:footertxt} }}); + }else + if(command == "bytes-buy"){ + var buyargs = message.content.split(' '); + if(isNaN(buyargs[2])) { ErrorHandler("You must put the ID Number you want to buy. Run ``/tcg bytes-shop`` to find a ID Number"); return;} + let role; + let amount; + if(buyargs[2] == "1") { role = message.guild.roles.find("name", "Byte Collector"); amount = "1024";}else + if(buyargs[2] == "2") { role = message.guild.roles.find("name", "Byte Hunter"); amount = "5000";}else + if(buyargs[2] == "3") { role = message.guild.roles.find("name", "Byte Hoarder"); amount = "10000";} + else{ ErrorHandler("That ID Number ("+buyargs[2]+") does not exist in the database. Run ``/tcg bytes-shop`` to find a ID Number"); return;} + if (message.member.roles.has(role.id)) { ErrorHandler("You already have that. Run ``/tcg bytes-shop`` to find another a ID Number"); return;} + message.author.addRole(role); + message.channel.send({embed:{title:"TCG Bot | TCB Shop | Purchase Complete", color:colors[1], description:"Purchase complete!",footer:{text:footertxt} }}); + userData.bytes = userData.bytes - amount; + }else + if(command == "free-bytes"){ + if(message.author.id == TCG){ + message.delete(0); + msgfreeb = await message.channel.send({embed:{ + title: "TCG Bot | Free Bytes", + color: colors[2], + description: "Whoa! 500 Free Bytes are up, but for only a minute!\nCollect them now by reacting to the check!", + footer:{text:footertxt} + }}).then(() => { message.react('☑️') }); + + const filter = (reaction, user) => { + return ['☑️'].includes(reaction.emoji.name) && user.id === message.author.id; + }; + + message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] }) + .then(collected => { + const reaction = collected.first(); + + if (reaction.emoji.name === '☑️') { + console.log(`TCG is starting a reaction event`); + if(!codingbytes[message.author.id]){ console.log("User: "+message.author.id+" does not have a account yet."); return; } + else{userData = codingbytes[message.author.id]; } + userData.bytes = userData.bytes + 500; + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + console.log(`Written 500 Bytes to ${message.author.id}'s account.`); + } + }).catch(collected => { + console.log(`After a minute, only ${collected.size} out of 4 reacted.`); + msgfreeb.delete(0); + }); + } else { + ErrorHandler("You do not have permission to do this."); + } + } else + if(command == "bytes-award"){ + if(message.author.id == TCG){ + var awardargs = message.content.split(' '); + var awardnum = awardargs[2]; + if(isNaN(awardnum)) return; + var person = awardargs[3]; + console.log(`${message.author.username} is awarding ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + if(!codingbytes[personid]){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + else{userData = codingbytes[personid]; } + userData.bytes = userData.bytes + parseInt(awardnum); + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Write", color:colors[0], description:`Written ${awardnum} Bytes to <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }else{ + ErrorHandler("You do not have permission to do this."); + } + }else + if(command == "bytes-wipe"){ + if(message.author.id == TCG){ + var wipeargs = message.content.split(' '); + var wipenum = wipeargs[2]; + var person = wipeargs[3]; + console.log(`${message.author.username} is wiping ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + if(!codingbytes[personid]){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + else{userData = codingbytes[personid]; } + if(wipenum > userData.bytes){ErrorHandler(`This user does not have that much Bytes. (${userData.bytes} Bytes is all they have)`); return; } + userData.bytes = userData.bytes - wipenum; + fs.writeFile(file, JSON.stringify(codingbytes, null, 2), (err) => { if (err) { console.error(err); ErrorHandler(err); } }); + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Wipe", color:colors[0], description:`Wiped ${wipenum} Bytes from <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }else{ + ErrorHandler("You do not have permission to do this."); + } + }else + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBytes [TCB]**\n"+prefix+" bytes-create\n"+prefix+" bytes-bal\n"+prefix+" write",footer:{text:footertxt} }}); + }else + if(command == "bytes-bal"){ + var balargs = message.content.split(' '); + if(!balargs[2] || balargs[2] == null || balargs[2] == "" || balargs[2] == " "){ + if (!codingbytes[message.author.id]) { + ErrorHandler("You do not have a account yet. Run ``/tcg bytes-create`` to make one."); + return; + }else{ + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[1], description:`You have ${userData.bytes} Bytes.`,footer:{text:footertxt} }}); + } + }else{ + var person = balargs[2]; + var personid = person.replace(/[<@!>]/g, ''); + if(!codingbytes[personid]){ ErrorHandler("This user does not have a account yet. Run ``/tcg bytes-create`` to make one."); return; } + else{userData = codingbytes[personid];} + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[0], description:`<@!${personid}> has ${userData.bytes} Bytes.`,footer:{text:footertxt} }}); + } + }else if(command == "bytes-create") { + try { + if (!codingbytes[message.author.id]) { + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`We are creating your Bytes Account for you.\n__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + } else { + ErrorHandler("You already have an account."); + return; + } + //Check if user has TheCodingBytes -- if not, create the data + if (!codingbytes[message.author.id]) codingbytes[message.author.id] = { + bytes: 0 + }; + } catch (err) { ErrorHandler(err); } + } + +}; \ No newline at end of file diff --git a/src/commands/bytes-new.js b/src/commands/bytes-new.js new file mode 100644 index 0000000..8ce1204 --- /dev/null +++ b/src/commands/bytes-new.js @@ -0,0 +1,83 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const mysql = require("mysql"); +var con = mysql.createConnection({ + host: 'localhost', + user: 'account', + password: 'data', + database: 'accountdata' +}); +con.connect(err => { + console.log("[INFO] Connecting to the database..."); + if(err) { ErrorHandler(err); console.log(err); return; } + console.log("[INFO] Connected to the database!"); +}); +let collectable = false; +let counter = 0; +var num = 0; +var maxnum = Math.floor(Math.random() * 19 + 1); +const TCG = "222073294419918848"; + +exports.run = async(client, message, footertxt, prefix, command) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}).then( msg => { console.log("[ERROR] "+Error); if(Error == "There is nothing to collect."){ msg.delete(4000); } }); + } + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBytes [TCB]**\n"+prefix+" bytes-create\n"+prefix+" bytes-bal\n"+prefix+" write",footer:{text:footertxt} }}); + } + + // Counting stuff + + if (!collectable) counter++; + console.log(`[BYTES] Counter: ${counter} | Max Counter: ${maxnum}`); + + + // Now loading the Bytes stuff from MySQL + + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,rows) => { + if(err) ErrorHandler(err); + rows.forEach( (row) => { + // TCG Bytes -- Balance + if(command == "bytes-bal") { + try { + if (!row) { + //Check if user has TheCodingBytes -- if not, create the data: + var sql = ""; + con.query('INSERT INTO bytesdata(id, user, bytes) VALUES(message.author.id, "NULL", "0"'), (err) => { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + }); + } else { + ErrorHandler("You already have an account."); + return; + } + // TCG Bytes -- Create + if(command == "bytes-create") { + try { + if (!row) { + //Check if user has TheCodingBytes -- if not, create the data: + var sql = ""; + con.query('INSERT INTO bytesdata(id, user, bytes) VALUES(message.author.id, "NULL", "0"'), (err) => { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + }); + } else { + ErrorHandler("You already have an account."); + return; + } + } catch (err) { ErrorHandler(err); } + } + } + }); + + +}; \ No newline at end of file diff --git a/src/commands/bytes.js b/src/commands/bytes.js new file mode 100644 index 0000000..d110d51 --- /dev/null +++ b/src/commands/bytes.js @@ -0,0 +1,150 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const mysql = require("mysql"); +var con = mysql.createConnection({ + host: 'localhost', + user: 'account', + password: 'data', + database: 'accountdata' +}); +con.connect(err => { + if(err) { ErrorHandler(err); console.log(err); return; } + console.log("Connected to the database!"); +}); +let userData; +let row; +let collectable = false; +let counter = 0; +var num = 0; +var maxnum = 0; +var msgfreeb; +maxnum = Math.floor(Math.random() * 19 + 1); +const TCG = "222073294419918848"; + +exports.run = async(client, message, footertxt, prefix, command) => { + + //Error Handler + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}).then( msg => { console.log("[ERROR] "+Error); if(Error == "There is nothing to collect."){ msg.delete(4000); } }); + } + if(command == "bytes"){ + message.channel.send({embed:{title:"TCG Bot | Bytes | Help", color:colors[0], description:"**CURRENCY (in TheCodingBytes [TCB]**\n"+prefix+"bytes-create\n"+prefix+"bytes-bal\n"+prefix+"write",footer:{text:footertxt} }}); + } + //Load the data from MySQL + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,row) => { + if(err) ErrorHandler(err); + //Count up. + if (!collectable) counter++; + console.log(`[BYTES] Counter: ${counter} | Max Counter: ${maxnum}`); + if (maxnum >= counter){ + if(command=="write"){ + message.delete(0); + if(collectable){ + + if(!row){ErrorHandler("You do not have a account yet. Run ``/bytes-create`` to make one."); } + + //Run the code! + con.query("UPDATE `bytesdata` SET `bytes`='"+Math.floor(row.bytes+num)+"' WHERE id='"+message.author.id+"'"); + + //Sent the success! + message.channel.send({embed:{title:"TCG Bot | Bytes | Written", color:colors[1], description:`Written ${num} bytes to ${message.author.username}.tcgbank.\nThis file now has `+row.bytes+` Bytes.`,footer:{text:footertxt} }}).then( msg => { setTimeout(function() { msg.delete(0); }, 8000); }); + + //Change collectable to false: + collectable = false; + counter = 0; + maxnum = Math.floor(Math.random() * 19 + 1); + }else{ErrorHandler("There is nothing to collect.");} + }else if(!collectable){ + num = Math.floor(Math.random() * 19) + 1; + message.channel.send({embed:{title:"TCG Bot | Bytes | Collect",color:colors[2],description:"You need "+num+" Bytes for your account file. Run ``/write`` to write them to your account file.",footer:{text:footertxt} }}) + .then( msg => { msg.delete(60000); }); + collectable = true; + } + } + }); + if(!message.content.startsWith(prefix)) return; + if(command == "bytes-award"){ + if(message.author.id == TCG){ + var awardargs = message.content.split(' '); + var awardnum = awardargs[2]; + if(isNaN(awardnum)) return; + var person = awardargs[3]; + console.log(`${message.author.username} is awarding ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + con.query('SELECT * FROM bytesdata WHERE id = "'+personid+'"', (err,row) => { + if(!row) { + var sql = `UPDATE bytesdata SET bytes = ${row.bytes + parseInt(awardnum)} WHERE id = ${personid}`; + con.query(sql, function (err, result) { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Write", color:colors[0], description:`Written ${awardnum} Bytes to <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }); + } else { ErrorHandler("This user does not have a account yet. Run ``/bytes-create`` to make one."); return; } + }); + } else { ErrorHandler("You do not have permission to do this."); } + }else + if(command == "bytes-wipe"){ + if(message.author.id == TCG){ + var wipeargs = message.content.split(' '); + var wipenum = wipeargs[2]; + var person = wipeargs[3]; + console.log(`${message.author.username} is wiping ${awardnum} to ${person}`); + var personid = person.replace(/[<@!>]/g, ''); + con.query('SELECT * FROM bytesdata WHERE id = "'+personid+'"', (err,row) => { + if(!row) { + if(wipenum > row.bytes){ErrorHandler(`This user does not have that much Bytes. (${userData.bytes} Bytes is all they have)`); return; } + var sql = `UPDATE bytesdata SET bytes = ${row.bytes - wipenum} WHERE id = ${personid}`; + con.query(sql, function (err, result) { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Force Wipe", color:colors[0], description:`Wiped ${wipenum} Bytes from <@!${personid}>.tcgbank.`,footer:{text:footertxt} }}); + }); + } else { ErrorHandler("This user does not have a account yet. Run ``/bytes-create`` to make one."); return; } + }); + }else{ ErrorHandler("You do not have permission to do this."); } + }else + if(command == "bytes-bal"){ + var balargs = message.content.split(' '); + if(!balargs[2] || balargs[2] == null || balargs[2] == "" || balargs[2] == " "){ + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,rows) => { + rows.forEach( (row) => { + if (!row) { + ErrorHandler("You do not have a account yet. Run ``/bytes-create`` to make one."); + return; + }else{ + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[1], description:`You have ${row.bytes} Bytes.`,footer:{text:footertxt} }}); + return; + } + }); + }); + }else{ + var person = balargs[2]; + var personid = person.replace(/[<@!>]/g, ''); + con.query('SELECT * FROM bytesdata WHERE id = "'+personid+'"', (err,row) => { + if(!row){ ErrorHandler("This user does not have a account yet. Run ``/bytes-create`` to make one."); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Current", color:colors[0], description:`<@!${personid}> has `+row.bytes+` Bytes.`,footer:{text:footertxt} }}); + }); + } + }else if(command == "bytes-create") { + try { + con.query('SELECT * FROM bytesdata WHERE id = "'+message.author.id+'"', (err,row) => { + if (!row) { + //Check if user has TheCodingBytes -- if not, create the data: + var sql = "INSERT INTO bytesdata(id, user, bytes) VALUES(message.author.id, 'NULL', '0')"; + con.query(sql, function (err, result) { + if(err) { ErrorHandler(err); console.log(err); return; } + message.channel.send({embed:{title:"TCG Bot | Bytes | Create", color:colors[0], description:`__**Welcome!**__\nBalance: \`\`${prefix} bytes-bal\`\`\n`,footer:{text:footertxt} }}); + }); + } else { + ErrorHandler("You already have an account."); + return; + } + }); + } catch (err) { ErrorHandler(err); } + } +}; \ No newline at end of file diff --git a/src/commands/dsay.js b/src/commands/dsay.js new file mode 100644 index 0000000..0cd06ac --- /dev/null +++ b/src/commands/dsay.js @@ -0,0 +1,16 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; +exports.run = (client, message, footertxt, prefix) => { + + message.delete(); + if(message.content == prefix+"dsay") { + if(message.author.id == TCG) { + let cont = message.content.split(' '); + let msg = cont.slice(1).join(" "); + if(!msg) return message.channel.send({embed: { title: "TCG Bot | Error while sending your message", color: colors[3], description: "**ERROR:\n**Please supply the message.", footer: { text: footertxt } }}); + message.channel.send(msg); + } + } +} \ No newline at end of file diff --git a/src/commands/eradio.js b/src/commands/eradio.js new file mode 100644 index 0000000..d69799a --- /dev/null +++ b/src/commands/eradio.js @@ -0,0 +1,61 @@ +// TCG Radio +// Version 1.0.0.0 + + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; +var footertxt = "TCG Radio\nMade by TheCodingGuy#6697"; +var prefix = "/radio" + +function log(type, message) { + console.log("\n["+type+"] "+message); +}; + +exports.run = (client, message) => { + + message.delete(0); + function embed(embedtitle, embedcolor, content) { + message.channel.send({embed: { + title: "TCG Radio | "+embedtitle, + color: embedcolor, + description: content, + footer:{text:footertxt} + }}); + }; + + if(!message.content.startsWith(prefix)) return; + + if(message.content == prefix + " start") { + + log("RADIO", "User is wanting to start TCG Radio..."); + if(message.author.id == TCG) { + const voiceChannel = message.member.voiceChannel; + if (!voiceChannel || voiceChannel.type !== 'voice') return embed("Error", colors[3], "You are not in a voice channel. Please connect to one and try again."); + voiceChannel.join().then(connection =>{ + message.channel.send({embed: { title: "TCG Radio | Starting...", color: colors[0], description: "Starting TCG Radio...", footer:{text:footertxt} }}).then((msg) => {msg.delete(3000);}); + log("RADIO", "Started. Playing intro sound."); + var dispatcher = message.guild.voiceConnection.playFile("./start.mp3"); + dispatcher.on("end", end => { + log("RADIO", "End of broadcast, playing end sound..."); + var dispatcher = message.guild.voiceConnection.playFile("./end.mp3"); + dispatcher.on("end", end => { + message.channel.send({embed: { title: "TCG Radio | End of broadcast", color: colors[1], description: "The radio has reached the end of the broadcast.", footer:{text:footertxt} }}).then((msg) => {msg.delete(3000);}); + message.member.voiceChannel.leave(); + }); + }); + }).catch(err => { log("ERROR", err); embed("Error", colors[3], "Cannot start TCG Radio because of:\n"+err); }); + + } else { + embed("Error", colors[3], "You do not have permission to execute this command"); + return; + } + } else + if(message.content == prefix + " end") { + log("RADIO", "Ending TCG Radio...") + message.channel.send({embed: { title: "TCG Radio | Ending...", color: colors[0], description: "Ending TCG Radio", footer:{text:footertxt} }}).then((msg) => {msg.delete(3000);}); + message.member.voiceChannel.leave(); + return; + } +}; \ No newline at end of file diff --git a/src/commands/explode.js b/src/commands/explode.js new file mode 100644 index 0000000..3281861 --- /dev/null +++ b/src/commands/explode.js @@ -0,0 +1,14 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Exploder v1.0"; +const TCG = "222073294419918848"; + +exports.run = (client, message, footertxt, prefix) => { + let cont = message.content.split(' '); + let args = cont.slice(1); + if(!args || args == null || args == "" || args == " ") {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** You did not input what or who should go boom.", footer:{text:footertxt} }}); return;}else + if(args.join(" ").includes("TheCodingGuy") || args.join(" ").includes("TCG") && !args.join(" ").includes("Bot") || args.join(" ").includes("tcg") || args.join(" ").includes("Matt") || args.join(" ").includes(TCG)) {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** :b: You cannot make my bot owner go boom.", footer:{text:footertxt} }}); return;}else + if(args.join(" ").includes("TCG Bot") || args.join(" ") == "<@!438532019924893707>") {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** You cannot make me go kaboom.", footer:{text:footertxt} }}); return;}else + if(args.join(" ").includes(message.author) || args.join(" ").includes(message.author.id)) { message.channel.send({embed:{title:cmdtitle, color:colors[2], description:"Now, why make yourself go kaboom? Try someone or something else.",footer:{text:footertxt} }}); return; }; + message.channel.send({embed:{title:cmdtitle, color:colors[0], description: "**BOOM**\n"+args.join(" ")+" has exploded into a million pieces.\n:thinking: **|** What a mess.", footer:{text:footertxt} }}); +} \ No newline at end of file diff --git a/src/commands/format.js b/src/commands/format.js new file mode 100644 index 0000000..8ff887f --- /dev/null +++ b/src/commands/format.js @@ -0,0 +1,62 @@ +const Discord = require('discord.js'); +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + message.channel.send(" **|** TCG Formatter is starting up...").then(msg => { + let drive = message.content.split(" "); + drive = drive[1]; + let avadrvs = ["A:", "B:", "C:", "D:", "E:", "F:", "G:", "H:", "I:", "J:", "K:", "L:", "M:", "N:" ]; + if(!drive) { msg.delete(); message.channel.send({embed:{title:"TCG Formatter",color:colors[3],description:"No drive to format inserted.\n__Available drives:__ \n"+avadrvs.join("\n"),footer:{text:footertxt} }}); return; } + let length = avadrvs.length; + let baddriv = true; + while(length--) { + if (drive.indexOf(avadrvs[length])!=-1) { + msg.delete(); + baddriv = false; + message.channel.send({embed:{title:"TCG Formatter",color:colors[3],description:"**WARNING:**\nFormatting "+drive+" will deleted __ALL__ data on this device.\nAre you sure? Y/n",footer:{text:"TCG Formatter. Copyright TCG. Licensed for use for TCG Bot.\n"+footertxt} }}); + const collector = new Discord.MessageCollector(message.channel, m => m.author.id === message.author.id, { time: 10000000 }); + collector.on('collect', message => { + if (message.content == "Yes" || message.content == "yes" || message.content == "Y" || message.content == "y") { + message.channel.send("Formatting "+drive+"..."); + collector.cleanup(); + message.channel.send(":warning: **| Starting formatter, do not remove your device.**\n**0%** complete\n<:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>") + .then(msg => { + let i = 1; + let loaderthing = ""; + var FormatterTime = ""; + function Formatting() { + let random = (Math.floor((Math.random()*9)+1)); + i = i + random; + if(i > 100 || i == 100) { + msg.edit(`:white_check_mark: **| Formatting ${drive} completed**\n**100%** complete\n<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550>`); + clearInterval(FormatterTime); + return; + } + if(i > 0) { loaderthing = "<:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 10 || i == 10) { loaderthing = "<:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 20 || i == 20) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 30 || i == 30) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 40 || i == 40) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 50 || i == 50) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 60 || i == 60) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 70 || i == 70) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 80 || i == 80) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422><:white:447395911425851422>"; } + if(i > 90 || i == 90) { loaderthing = "<:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:blurple:447395912474689550><:white:447395911425851422>"; } + msg.edit(` **| Formatting ${drive}, do not remove your device.**\n**${i}%** complete\n${loaderthing}`); + } + FormatterTime = setInterval(function(){ Formatting(); }, Math.floor((Math.random()*1000)+1)); + + }); + return; + } else if (message.content == "No" || message.content == "no" || message.content == "N" || message.content == "n") { + message.channel.send("Cancelling..."); + collector.cleanup(); + return; + } + }); + } + } + setTimeout(function(){if(baddriv) { msg.delete(); message.channel.send({embed:{title:"TCG Formatter",color:colors[3],description:"Invalid drive selected.\n__Available drives:__ \n"+avadrvs.join("\n"),footer:{text:footertxt} }}); return; } }, 2000); + }); +} \ No newline at end of file diff --git a/src/commands/help.js b/src/commands/help.js new file mode 100644 index 0000000..ae39b9f --- /dev/null +++ b/src/commands/help.js @@ -0,0 +1,75 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + + if(message.content == prefix+"help") { + var responses = [ + "**Commands:**\n", + prefix+"help\n", + prefix+"ping\n", + prefix+"quote\n", + prefix+"8ball\n", + prefix+"explode\n", + prefix+"numgen\n", + prefix+"roll\n", + prefix+"serverinfo\n", + prefix+"userinfo\n", + prefix+"format\n", + prefix+"uptime\n", + prefix+"say\n", + prefix+"invite\n\n", + "**CURRENCY (in TheCodingBytes [TCB]):**\nThis is getting rewritten, standby.\n\n", + "**ADMINISTRATION:**\n", + prefix+"prune\n", + prefix+"kick\n", + prefix+"ban\n", + prefix+"unban\n", + prefix+"lockdown\n\n", + "**BOT OWNER ONLY:**\n", + prefix+"shutdown\n", + prefix+"reboot\n", + prefix+"test"]; + + message.channel.send({embed: { + title: "TCG Bot | Help > Command List", + color: colors[0], + description: `__**Welcome to the TCG Bot Command Help.**__\n**NEW:** You can do ${prefix}help **command** to show more information on a command.\n\n${responses.join("")}\n`, + footer:{text:footertxt} + }}); + return; + } + if(message.content.startsWith(prefix+"help")) { + var cont = message.content.split(" "); + var command = cont[1]; + var helpmsg = ""; + + if(command == "help") { helpmsg = "Generates help screen\nUsage: "+prefix+"help\n**Additional:** You can get indiviual command help & info by using: "+prefix+"help **command**"; } + else if(command == "ping") { helpmsg = "Ping-Pong! (Checks Latency & API Latency)\nUsage: "+prefix+"ping"; } + else if(command == "quote") { helpmsg = "Generates a random quote\nUsage: "+prefix+"quote\n**Additional:** You can get a quote you love by using: "+prefix+"quote **number**"; } + else if(command == "8ball") { helpmsg = "Generates a random answer to a question\nUsage: "+prefix+"8ball question"; } + else if(command == "explode") { helpmsg = "Explodes something or someone\nUsage: "+prefix+"explode object\n**Additional:** You cannot blow up the bot, the bot creator, or yourself."; } + else if(command == "numgen") { helpmsg = "Generates a random number from 1-10\nUsage: "+prefix+"numgen\n**Additional:** You can generate a random number from 1 to your own number by using: "+prefix+"numgen **number**"; } + else if(command == "roll") { helpmsg = "Rolls a dice from 1-6\nUsage: "+prefix+"roll"; } + else if(command == "serverinfo") { helpmsg = "Gets info on the server\nUsage: "+prefix+"serverinfo"; } + else if(command == "userinfo") { helpmsg = "Gets info on a user\nUsage: "+prefix+"userinfo\n**Additional:** Not supplying or putting a invalid user ID or a mention (By using: "+prefix+"userinfo **userID or mention**) will return info on yourself."; } + else if(command == "format") { helpmsg = "Formats a drive\nUsage: "+prefix+"format **drive**\n**Additional:** Only supports A: to N:"; } + else if(command == "uptime") { helpmsg = "Returns how long bot has been online\nUsage: "+prefix+"uptime"; } + else if(command == "say") { helpmsg = "Makes bot say something\nUsage: "+prefix+"say **message**\n**Additional:** It does output who said requested to say the message."; } + else if(command == "invite") { helpmsg = "Returns invite of bot\nUsage: "+prefix+"invite"; } + //Administration: + else if(command == "prune") { helpmsg = "Deletes x number of messages\nUsage: "+prefix+"prune **number**\n**Additional:** Not supplying a number will delete 1 message by default.\n**Requires:** bot & user to have ``MANAGE MESSAGES`` permission."; } + else if(command == "kick") { helpmsg = "Kicks a user from server\nUsage: "+prefix+"kick **mention** **reason**\n**Additional:** You can still kick a user if no reason provided.\n**Requires:** bot & user to have ``KICK MEMBERS`` permission."; } + else if(command == "ban") { helpmsg = "Bans a user from server\nUsage: "+prefix+"ban **mention** **reason**\n**Additional:** You can still ban a user if no reason provided.\n**Requires:** bot & user to have ``BAN MEMBERS`` permission."; } + else if(command == "unban") { helpmsg = "Unbans a user from server\nUsage: "+prefix+"unban **userID**\n**Additional:** You can cannot use a mention for this.\n**Requires:** bot & user to have ``BAN MEMBERS`` permission."; } + else if(command == "lockdown") { helpmsg = "Locks a channel for a specific time\nUsage: "+prefix+"lockdown **time**\n**Additional:** You can put `30s`, `5m`, or `1d` (Supports miliseconds, minutes, hours, and days).\n**Requires:** bot & user to have ``MANAGE ROLES`` permission."; } + else { message.channel.send({embed:{ title:"TCG Bot | Help > Command Help",color:colors[3],description:"**ERROR:** Cannot find that command in the help section.\nTry doing ``/help``",footer:{text:footertxt} }}); return; }; + message.channel.send({embed:{ + title:"TCG Bot | Help > Command help", + color: colors[0], + description: `__Command help for \`\`${prefix}${command}\`\`__\n\n${helpmsg}`, + footer:{text:footertxt} + }}); + return; + } +}; \ No newline at end of file diff --git a/src/commands/invite.js b/src/commands/invite.js new file mode 100644 index 0000000..2698017 --- /dev/null +++ b/src/commands/invite.js @@ -0,0 +1,6 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + message.channel.send({embed:{title:"TCG Bot | Add Me",color:colors[0], description:"Add me into your server today!\nhttps://discordapp.com/oauth2/authorize?client_id=438532019924893707&scope=bot&permissions=54000704",footer:{text:footertxt} }}); +} \ No newline at end of file diff --git a/src/commands/kick.js b/src/commands/kick.js new file mode 100644 index 0000000..bf2d44b --- /dev/null +++ b/src/commands/kick.js @@ -0,0 +1,80 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Administration > Kick"; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + + +exports.run = (client, message, footertxt, prefix) => { + if (message.guild === null) return message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\nCommand cannot be ran in DMs.", footer:{text:footertxt} }}); + + let cont = message.content.split(' '); + let user = message.mentions.members.first() || message.guild.members.get(cont[1]); + let reason = cont.slice(2).join(" "); + if(!user) {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** Invaild user to kick.", footer:{text:footertxt} }}); return;} + if (!message.channel.permissionsFor(message.author).has("KICK_MEMBERS")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nYou do not have permission to kick people.",footertext:{text:footertxt} }}); + if (!message.channel.permissionsFor(client.user).has("KICK_MEMBERS")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nI do not have permission to kick people.",footertext:{text:footertxt} }}); + if (!user.kickable) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nI cannot kick "+user+".\nThey may have a higher role.",footertext:{text:footertxt} }}); + user.kick().then((member) => { + GetTime(); + GetDate(); + if(!reason || reason == null || reason == "" || reason == " ") { + message.channel.send({embed:{ + title:cmdtitle, + color:colors[1], + description: `**User kicked**\nUser: ${user}\nReason: __No reason provided.__\nServer: ${message.guild.name}\nAt: ${time} on ${date}.`, + footer:{text:footertxt} + }}); + user.send({embed:{ + title: `TCG Bot | Kicked from server`, + color: colors[3], + description: `You were kicked from the server: ${message.guild.name}.\nAt: ${time} on ${date}.\nAdmin: ${message.author.username}#${message.author.discriminator}\nReason: __No reason provided.__`, + footer:{text:footertxt} + }}) + } else { + message.channel.send({embed:{ + title:cmdtitle, + color:colors[1], + description: `**User kicked**\nUser: ${user}\nReason: ${reason}\nServer: ${message.guild.name}\nAt: ${time} on ${date}.`, + footer:{text:footertxt} + }}); + user.send({embed:{ + title: `TCG Bot | Kicked from server`, + color: colors[3], + description: `You were kicked from the server: ${message.guild.name}.\nAt: ${time} on ${date}.\nAdmin: ${message.author.username}#${message.author.discriminator}\nReason: ${reason}`, + footer:{text:footertxt} + }}); + return; + } + }).catch(err => { + message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n"+err,footertext:{text:footertxt} }}); + }); + +} \ No newline at end of file diff --git a/src/commands/kill.js b/src/commands/kill.js new file mode 100644 index 0000000..174108e --- /dev/null +++ b/src/commands/kill.js @@ -0,0 +1,28 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Killing Machine v1.0"; + +exports.run = (client, message, footertxt) => { + // var + var args = message.content.split(" "); + var target = args[1]; + if(!target) return message.channel.send({embed:{title:cmdtitle,color:colors[3],description:"**ERROR:** You did input who should be killed.",footer:{text:footertxt} }}); + var weapon = args.slice(2).join(" "); + if(!isNaN(target)) { target = "<@!"+target+">"; } + + if(weapon) { + message.channel.send({embed:{ + title:cmdtitle, + color:colors[0], + description:"**" + target + "** has been killed by **<@!" + message.author.id + ">** using **" + weapon + "**.", + footer:{text:footertxt} + }}); + }else{ + message.channel.send({embed:{ + title:cmdtitle, + color:colors[0], + description:"**" + target + "** has been killed by **<@!" + message.author.id + ">** using **their bare hands**.", + footer:{text:footertxt} + }}); + } +}; \ No newline at end of file diff --git a/src/commands/lockdown.js b/src/commands/lockdown.js new file mode 100644 index 0000000..5d1ca41 --- /dev/null +++ b/src/commands/lockdown.js @@ -0,0 +1,56 @@ +//Additional libraries: +const ms = require('ms'); + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Administration > Channel Lockdown"; +const TCG = "222073294419918848"; + +exports.run = (client, message, footertxt, prefix) => { + if (message.guild === null) return message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\n<@!"+message.author.id+">, this command cannot be ran in DMs.", footer:{text:footertxt} }}); + + if (!message.channel.permissionsFor(message.author).has("MANAGE_ROLES")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n<@!"+message.author.id+">, you do not have permission ``MANAGE ROLES``.",footertext:{text:footertxt} }}); + if (!message.channel.permissionsFor(client.user).has("MANAGE_ROLES")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n<@!"+message.author.id+">, I do not have permission ``MANAGE ROLES``.",footertext:{text:footertxt} }}); + + let cont = message.content.split(' '); + if (!client.lockit) client.lockit = []; + let time = cont.slice(1).join(" "); + if(cont[1] == "current") { + if(!client.lockit[message.channel.id]) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n<@!"+message.author.id+">, no lockdown started on this channel (#"+message.channel.name+").",footertext:{text:footertxt} }}); + message.channel.send({embed:{title:cmdtitle, color:colors[0], description:"<@!"+message.author.id+">, time left on #"+message.channel.name+"'s lockdown: "+client.lockit[message.channel.id]+".", footertext:{text:footertxt} }}); + return; + } + let validUnlocks = ['release', 'unlock', 'lift']; + if (!time) return message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: `**ERROR:**\n<@!${message.author.id}>, you must set a duration for the lockdown in either hours, minutes or seconds.`, footer:{text:footertxt} }}); + + if (validUnlocks.includes(time)) { + if(!client.lockit[message.channel.id]) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n<@!"+message.author.id+">, no lockdown started on this channel (#"+message.channel.name+").",footertext:{text:footertxt} }}); + message.channel.overwritePermissions(message.guild.id, { SEND_MESSAGES: null }).then(() => { + message.channel.send({embed:{ title:cmdtitle, color: colors[1], description: `<@!${message.author.id}>,\n:unlock: **|** The lockdown on #${message.channel.name} was lifted.`, footer:{text:footertxt} }}); + clearTimeout(client.lockit[message.channel.id]); + delete client.lockit[message.channel.id]; + }).catch(error => { + message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\n<@!"+message.author.id+">, "+error, footer:{text:footertxt} }}); + console.log(error); + }); + return; + } else { + message.channel.overwritePermissions(message.guild.id, { + SEND_MESSAGES: false + }).then(() => { + message.channel.send({embed:{ title:cmdtitle, color: colors[1], description: `<@!${message.author.id}>,\n:lock: **|** Lockdown has successfully started on #${message.channel.name} for ${ms(ms(time), { long:true })}.`, footer:{text:footertxt} }}).then(() => { + client.lockit[message.channel.id] = setTimeout(() => { + message.channel.overwritePermissions(message.guild.id, { + SEND_MESSAGES: null + }).then(message.channel.send({embed:{ title:cmdtitle, color: colors[1], description: `:unlock: **|** The lockdown on #${message.channel.name} expired and was automatically lifted.`, footer:{text:footertxt} }})).catch(console.error); + delete client.lockit[message.channel.id]; + }, ms(time)); + + }).catch(error => { + message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\n<@!"+message.author.id+">, "+error, footer:{text:footertxt} }}); + console.log(error); + }); + }); + return; + } +} \ No newline at end of file diff --git a/src/commands/numgen.js b/src/commands/numgen.js new file mode 100644 index 0000000..38cc2aa --- /dev/null +++ b/src/commands/numgen.js @@ -0,0 +1,28 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + let args = message.content.split(' '); + + if(!args[1]) { + var num = Math.floor(Math.random() * 10) + 1; + message.channel.send({embed:{title:"TCG Bot | Random Number Generator", color:colors[0], description:"Random number between 1 & 10:\nNumber: "+num, footer:{footertxt} }}); + }else{ + if(isNaN(args[1])) { + ErrorHandler("Invaild number"); + return; + } + var num = Math.floor(Math.random() * args[1]) + 1; + message.channel.send({embed:{title:"TCG Bot | Random Number Generator", color:colors[0], description:"Random number between 1 & "+args[1]+":\nNumber: "+num, footer:{footertxt} }}); + } +}; \ No newline at end of file diff --git a/src/commands/ping.js b/src/commands/ping.js new file mode 100644 index 0000000..881ab5a --- /dev/null +++ b/src/commands/ping.js @@ -0,0 +1,23 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + var responses = ["Well darn, you got me.","Alright. I wanna do that again.","I loooove Ping-Pong!","Try again?","My paddle is getting a bit red. Is that good?","Let me take a break *sips on water* OK, ready again."]; + var APIPing = Math.round(client.ping); + //var APIPing = "15000"; // Testing + if (APIPing == "0") { msg = "YA... right..."; } else + if (APIPing < 0) { msg = "OK, what? Not a positive number! Ahhh!"; } else + if (APIPing > 2000 || APIPing == 2000) { msg = " :snail: Am I even running? Wait, I'm not running now, I'm like snails. Told ya snails-a coming."; } else + if (APIPing > 500 || APIPing == 500) { msg = ":snail: Snails are incoming."; } else + if (APIPing < 500) { msg = ""; } else + if (APIPing < 50 || APIPing == 50) { msg = "WHOA! LIGHTNING FAST... almost."; + } else { msg = "Hmm... unable to create message based on ping."; } + message.channel.send(" :ping_pong: **|** Please hold, I'm trying to position myself for the incoming ball!").then(m => { + m.edit({embed: { + title: "TCG Bot | Ping-Pong", + color: colors[0], + description: `:ping_pong: Pong! ${responses[Math.floor(Math.random() * responses.length)]}\nLatency: ${m.createdTimestamp - message.createdTimestamp}ms.\nAPI Latency: ${APIPing}ms.\n${msg}`, + footer:{text:footertxt} + }}); + }); +}; \ No newline at end of file diff --git a/src/commands/poll.js b/src/commands/poll.js new file mode 100644 index 0000000..2239830 --- /dev/null +++ b/src/commands/poll.js @@ -0,0 +1,77 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + if (message.guild === null) { + ErrorHandler("You cannot run this command in a DM."); + return; + } + var paramsOne = message.content.split(' '); + if(paramsOne[2] == '1m' || paramsOne[2] == '2m' || paramsOne[2] == '3m' || paramsOne[2] == '4m' || paramsOne[2] == '5m' || paramsOne[2] == '6m' || paramsOne[1] == '7m' || paramsOne[1] == '8m' || paramsOne[1] == '9m' || paramsOne[1] == '1h' || paramsOne[1] == '2h' || paramsOne[1] == '3h' || paramsOne[1] == '4h' || paramsOne[1] == '5h' || paramsOne[1] == '6h' || paramsOne[1] == '7h' || paramsOne[1] == '8h' || paramsOne[1] == '9h') { + var choice = paramsTwo[0].substr(9) + } else { + var choice = paramsTwo[0].substr(10) + } + if(!paramsTwo[1]) { + message.channel.send(":error: - You need to specify 2 options!") + return + } + if(!paramsTwo[2]) { + message.channel.send(":error: - You need to specify 2 options!") + return + } + let msg = await message.channel.send("**__Poll has started!__**\n__" + choice + "__\n`Time: " + paramsOne[1] + "`\n\n:one: - **" + paramsTwo[1] + "**\n:two: - **" + paramsTwo[2] + "**") + await msg.react(one) + await msg.react(two) + const reactions = await msg.awaitReactions(reaction => reaction.emoji.name === one || reaction.emoji.name === two, {time: time}); + var resultone = reactions.get(one).count-1 + var resulttwo = reactions.get(two).count-1 + if(isNaN(reactions.get(one).count-1)){ + resultone = 0 + } + if(isNaN(reactions.get(two).count-1)){ + resulttwo = 0 + } + message.channel.send(`__**Poll Results:**__\n\n:one:: ${reactions.get(one).count-1}\n:two:: ${reactions.get(two).count-1}`) + var pruarg = message.content.split(' '); + var messages = "1"; + if(pruarg[2]) { messages = pruarg[2]; } + console.log(`${message.author.username} wanting to delete ${messages} messages.`); + if (!message.channel.permissionsFor(message.author).has("MANAGE_MESSAGES")) { + ErrorHandler("User does not have permission: MANAGE MESSAGES."); + console.log("Sorry, you don't have the permission to execute the command \""+message.content+"\""); + return; + } else if (!message.channel.permissionsFor(client.user).has("MANAGE_MESSAGES")) { + ErrorHandler("Bot does not have permission: MANAGE MESSAGES."); + console.log("Bot doesn't have the permission MANAGE MESSAGES to prune."); + return; + } + message.delete(); + if (message.channel.type == 'text') { + message.channel.fetchMessages() + .then( () => { + message.channel.bulkDelete(messages); + messagesDeleted = messages; // number of messages deleted + + // Logging the number of messages deleted on both the channel and console. + if(messages == "1"){ msgwithornots = "message" } else { var msgwithornots = "messages" } + message.channel.send({embed:{title:"TCG Bot | Prune Successful",color:colors[1],description:`Deletion of messages successful.\nDeleted **${messages}** ${msgwithornots}.`,footer:{text:footertxt} }}) + .then(msg => { setTimeout(function() { msg.delete(0); }, 4000); }); + console.log('Deletion of messages successful. Total messages deleted: '+messagesDeleted); + }).catch(err => { + console.log('Error while doing Bulk Delete'); + console.log(err); + ErrorHandler(err); + }); + } +}; \ No newline at end of file diff --git a/src/commands/prune.js b/src/commands/prune.js new file mode 100644 index 0000000..6bf7999 --- /dev/null +++ b/src/commands/prune.js @@ -0,0 +1,50 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + if (message.guild === null) { + ErrorHandler("You cannot run this command in a DM."); + return; + } + var pruarg = message.content.split(' '); + var messages = "1"; + if(pruarg[1]) { messages = pruarg[1]; } + console.log(`${message.author.username} wanting to delete ${messages} messages.`); + if (!message.channel.permissionsFor(message.author).has("MANAGE_MESSAGES")) { + ErrorHandler("User does not have permission: MANAGE MESSAGES."); + console.log("Sorry, you don't have the permission to execute the command \""+message.content+"\""); + return; + } else if (!message.channel.permissionsFor(client.user).has("MANAGE_MESSAGES")) { + ErrorHandler("Bot does not have permission: MANAGE MESSAGES."); + console.log("Bot doesn't have the permission MANAGE MESSAGES to prune."); + return; + } + message.delete(); + if (message.channel.type == 'text') { + message.channel.fetchMessages() + .then( () => { + message.channel.bulkDelete(messages); + messagesDeleted = messages; // number of messages deleted + + // Logging the number of messages deleted on both the channel and console. + if(messages == "1"){ msgwithornots = "message" } else { var msgwithornots = "messages" } + message.channel.send({embed:{title:"TCG Bot | Prune Successful",color:colors[1],description:`Deletion of messages successful.\nDeleted **${messages}** ${msgwithornots}.`,footer:{text:footertxt} }}) + .then(msg => { setTimeout(function() { msg.delete(0); }, 4000); }); + console.log('Deletion of messages successful. Total messages deleted: '+messagesDeleted); + }).catch(err => { + console.log('Error while doing Bulk Delete'); + console.log(err); + ErrorHandler(err); + }); + } +}; \ No newline at end of file diff --git a/src/commands/quote.js b/src/commands/quote.js new file mode 100644 index 0000000..474f422 --- /dev/null +++ b/src/commands/quote.js @@ -0,0 +1,86 @@ +// ADDITIONAL LIBRARIES: +const fs = require('fs'); + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Quote"; +const TCG = "222073294419918848"; + +exports.run = (client, message, footertxt, prefix) => { + + if(message.content == prefix+"quote") { + QuoteGenNormal(); + } else { + var cont = message.content.split(" "); + let number = cont[1]; + if(!number || isNaN(number)) return message.channel.send({embed:{ title: cmdtitle, color: colors[3], description: "An error has occurred while generating a quote.\nNot a vaild number to get a quote be number", footer:{text:footertxt} }}); + QuoteGen(number); + } + + function randomInt (low, high) { + return Math.floor(Math.random() * (high - low) + low); + } + function QuoteGenNormal() { + if (message.guild === null) { + console.log(`User ${message.author.username} in DMs is running Quote Generator command.`); + } else { + console.log(`User ${message.author.username} in ${message.guild.name} is running Quote Generator command.`); + } + fs.readFile('quotes.txt', 'utf8', function (err,rawData) { + if (err) { + message.channel.send({embed:{ + title: cmdtitle, + color: colors[3], + description: "An error has occurred while generating a quote.\nPlease contact **TheCodingGuy#6697** and give him:"+err, + footer:{text:footertxt} + }}); + throw err; + return; + } + data = rawData.split('\n'); + var quote = data[randomInt(0,data.length)]; + message.channel.send({embed: { + title: "TCG Bot | Quote Generator", + color: colors[0], + description: ""+quote+"", + footer: { + text: footertxt + } + }}); + console.log("Returned: "+quote); + }); + } + + function QuoteGen(num) { + if (message.guild === null) { + console.log(`User ${message.author.username} in DMs is running Quote Generator command.`); + } else { + console.log(`User ${message.author.username} in ${message.guild.name} is running Quote Generator command.`); + } + fs.readFile('quotes.txt', 'utf8', function (err,rawData) { + if (err) { + message.channel.send({embed:{ + title: cmdtitle, + color: colors[3], + description: "An error has occurred while generating a quote.\nPlease contact **TheCodingGuy#6697** and give him:"+err, + footer:{text:footertxt} + }}); + throw err; + return; + } + data = rawData.split('\n'); + var quote = data[Math.floor(num - 1)]; + if(!quote) return message.channel.send({embed:{ title: cmdtitle, color: colors[3], description: "An error has occurred while generating a quote.\nThat quote number was not found. Current number of quotes: "+Math.floor(data.length)+".", footer:{text:footertxt} }}); + message.channel.send({embed: { + title: "TCG Bot | Quote Generator", + color: colors[0], + description: ""+quote+"", + footer: { + text: footertxt + } + }}); + console.log("Returned: "+quote); + }); + } + +} \ No newline at end of file diff --git a/src/commands/reboot.js b/src/commands/reboot.js new file mode 100644 index 0000000..4088092 --- /dev/null +++ b/src/commands/reboot.js @@ -0,0 +1,33 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; +const TCGBot = "438532019924893707"; + +const config = require("../config.json"); +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + console.log(`${message.author.username} is trying to restart the bot, making sure it is the right person or people.`); + if (message.author.id == TCGBot) { + message.channel.send({embed:{title:"TCG Bot | Rebooting...", color:colors[2], description:" **|** One moment...\nRestarting TCG Bot...", footer:{text:footertxt} }}) + .then(msg => { + client.user.setActivity("restarting..."); + console.log("Please wait, restarting...\n\n\n\n\n"); + client.destroy(); + console.log("Please wait, logging in."); + client.login(config.token).then(() => { message.delete(); msg.delete(); message.channel.send({embed:{title:"TCG Bot | Reboot Success", color:colors[1], description:":white_check_mark: **|** I have finished rebooting.",footer:{text:footertxt} }}).then(rmsg => rmsg.delete(5000)); }); + }); + } else { + ErrorHandler("You don't have permission to perform this command."); + console.log(`Failed to reboot. ${message.author.username} is not TheCodingGuy.`); + } +} \ No newline at end of file diff --git a/src/commands/roll.js b/src/commands/roll.js new file mode 100644 index 0000000..d3db8ca --- /dev/null +++ b/src/commands/roll.js @@ -0,0 +1,13 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt, prefix) => { + + var num = Math.floor(Math.random() * 6) + 1; + message.channel.send({embed:{ + title:"TCG Bot | Roll-A-Dice", + color:colors[0], + description:"You rolled a "+num+"/6", + footer:{text:footertxt} + }}); +} \ No newline at end of file diff --git a/src/commands/say.js b/src/commands/say.js new file mode 100644 index 0000000..933da8a --- /dev/null +++ b/src/commands/say.js @@ -0,0 +1,22 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848"; +exports.run = (client, message, footertxt, prefix) => { + + if(message.author.id == TCG) { + let cont = message.content.split(' '); + let id = cont[1]; + let msg = cont.slice(2).join(" "); + if(!msg) return message.channel.send({embed: { title: "TCG Bot | Error while sending your message", color: colors[3], description: "**ERROR:\n**Please supply the message.", footer: { text: footertxt } }}); + client.channels.get(id).send(msg); + } else { + let cont = message.content.split(' '); + let msg = cont.slice(1).join(" "); + if(!msg) return message.channel.send({embed: { title: "TCG Bot | Error while sending your message", color: colors[3], description: "**ERROR:\n**Please supply the message.", footer: { text: footertxt } }}); + + message.channel.send(msg); + message.channel.send({embed:{description:"Said by "+message.author }}); + } + +} \ No newline at end of file diff --git a/src/commands/search.js b/src/commands/search.js new file mode 100644 index 0000000..4f2907f --- /dev/null +++ b/src/commands/search.js @@ -0,0 +1,45 @@ +// Additional libraries: +const Google = require('google'); + +Google.resultsPerPage = 5; + + + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + + var args = message.content.split(" "); + var object = args.slice(1).join(" "); + + // Google stuff + + message.channel.send({embed:{title:"",color:colors[0],description:"Please wait, searching Google for \""+object+"\"...\nIf the search result doesn't appear, an error has occurred." }}).then(msg => { + Google(object, function (err, res) { + msg.delete(); + if(err) console.log(err); + + var fresult = ""; + for (var i = 0; i < res.links.length; ++i) { + var results = res.links[i]; + fresult += results.title+"\n**"+results.href+"**\n"+results.description; + } + if(!fresult || fresult == null) { + message.channel.send({embed:{ + title:"TCG Bot | Google > Results for " + object, + color:colors[3], + description:"No search result found.", + footer:{text:footertxt} + }}); + return; + } + message.channel.send({embed:{ + title:"TCG Bot | Google > Results for "+object, + color:colors[0], + description:`**OK, I found this on the web for ${object}. Take a look:**\n\n${fresult}`, + footer:{text:footertxt} + }}); + }); + }); +} \ No newline at end of file diff --git a/src/commands/serverinfo.js b/src/commands/serverinfo.js new file mode 100644 index 0000000..a3b1804 --- /dev/null +++ b/src/commands/serverinfo.js @@ -0,0 +1,17 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + + if(message.guild == null) return message.channel.send({embed:{title:"TCG Bot | Error", color:colors[3], description:"You cannot use this command in DMs.", footer:{text:footertxt} }}); + + var usercount = message.guild.members.filter(member => !member.user.bot).size; + var botcount = message.guild.memberCount - usercount; + + message.channel.send({embed:{ + title:`TCG Bot | Server Info > Information for ${message.guild.name}`, + color: colors[0], + description:`**Guld name:** ${message.guild.name}\n**Guild ID:** ${message.guild.id}\n**Server icon:** ${message.guild.iconURL}\n**Owner:** ${message.guild.owner}\n**Role count:** ${message.guild.roles.size}\n**Channel count:** ${message.guild.channels.size}\n**Member count:** ${message.guild.memberCount} [**Bots:** ${botcount} **Users:** ${usercount}]\n**Large Server? (more than 250 members):** ${message.guild.large}\n**Region:** ${message.guild.region}\n**Verification Level:** ${message.guild.verificationLevel}\n**Server Created At:** ${message.guild.createdAt}\n**TCG Bot joined at:** ${message.guild.joinedAt}`, + footer:{text:footertxt} + }}); +}; \ No newline at end of file diff --git a/src/commands/setprefix.js b/src/commands/setprefix.js new file mode 100644 index 0000000..cc501fc --- /dev/null +++ b/src/commands/setprefix.js @@ -0,0 +1,15 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + +}; \ No newline at end of file diff --git a/src/commands/shutdown.js b/src/commands/shutdown.js new file mode 100644 index 0000000..525d737 --- /dev/null +++ b/src/commands/shutdown.js @@ -0,0 +1,30 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +const TCG = "222073294419918848"; +const TCGBot = "438532019924893707"; +const fs = require('fs'); + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + console.log(`${message.author.username} is trying to shutdown the bot, making sure it is the right person or people.`); + if (message.author.id = TCGBot) { + message.channel.send({embed:{title:"TCG Bot | Shutting down...", color:colors[2], description:" **|** One moment...\nShutting down TCG Bot...", footer:{text:footertxt} }}) + .then(msg => { + client.user.setActivity("shutting down...").then(() => { setTimeout(function(){message.delete(); msg.delete();},1000); }); + console.log("Please wait, shutting down...\n\n\n\n\n"); + setTimeout(function(){client.destroy(); process.exit(0);},2000); + }); + } else { + ErrorHandler("You don't have permission to perform this command."); + console.log(`Failed to shutdown. ${message.author.username} is not TheCodingGuy.`); + } +} \ No newline at end of file diff --git a/src/commands/sound/end.mp3 b/src/commands/sound/end.mp3 new file mode 100644 index 0000000..02c94e9 Binary files /dev/null and b/src/commands/sound/end.mp3 differ diff --git a/src/commands/sound/start.mp3 b/src/commands/sound/start.mp3 new file mode 100644 index 0000000..d455581 Binary files /dev/null and b/src/commands/sound/start.mp3 differ diff --git a/src/commands/test.js b/src/commands/test.js new file mode 100644 index 0000000..db9f95f --- /dev/null +++ b/src/commands/test.js @@ -0,0 +1,36 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +const TCG = "222073294419918848" + +exports.run = (client, message, footertxt) => { + + function ErrorHandler(Error) { + message.channel.send({embed:{ + title: "TCG Bot | ERROR", + color: colors[3], + description: `**Sorry, but an error has occurred.**\n**ERROR:** ${Error}\n\n**If you believe this is an error that restricts the bot functionality, please report it to TheCodingGuy#6697.**`, + footer:{text: footertxt} + }}); + } + + if(message.author.id == TCG) { + var args = message.content.split(' '); + var ID = args[1]; + var channelname = client.channels.get(ID); + var username = "<@!"+ID+">"; + if(!args) return message.channel.send({embed:{description:`**Testing ID**:\nI think that's a... wait you didn't put an id` }}); + if(!channelname) { + if(ID === "438532019924893707") { + return message.channel.send({embed:{description:`**Testing ID**:\nI think it's a userID, the username is... wait a moment, that's ME! Hi there!` }}); + } else { + return message.channel.send({embed:{description:`**Testing ID**:\nI think it's a userID, the username is: ${username}` }}); + } + return; + } else if(!username) { + return message.channel.send({embed:{description:`**Testing ID**:\nI think it's a channelID, the channel name is: ${channelname}` }}); + } else { + return message.channel.send({embed:{description:`**Testing ID**:\nHmm, this doesn't look like a real ID.` }}); + } + } +}; \ No newline at end of file diff --git a/src/commands/timer.js b/src/commands/timer.js new file mode 100644 index 0000000..64363f4 --- /dev/null +++ b/src/commands/timer.js @@ -0,0 +1,48 @@ +//Additional libraries: +const ms = require('ms'); + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Timer"; + +exports.run = (client, message, footertxt, prefix) => { + + let cont = message.content.split(' '); + if (!client.timeit) client.timeit = []; + let time = cont.slice(1).join(" "); + if(cont[1] == "current") { + if(!client.timeit[message.author.id]) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n<@!"+message.author.id+">, no timer started.",footertext:{text:footertxt} }}); + message.channel.send({embed:{title:cmdtitle, color:colors[0], description:"<@!"+message.author.id+">, time left on "+message.author.username+"'s timer: "+ms(ms(client.timeit[message.author.id]), { long:true })+".", footertext:{text:footertxt} }}); + return; + } + let validStopping = ['stop', 'end']; + if (!time) return message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: `**ERROR:**\n<@!${message.author.id}>, you must set a duration for the timer in either hours, minutes or seconds.`, footer:{text:footertxt} }}); + + if (validStopping.includes(time)) { + if(!client.timeit[message.author.id]) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n<@!"+message.author.id+">, no timer started for you.",footertext:{text:footertxt} }}); + try { + message.channel.send({embed:{ title:cmdtitle, color: colors[1], description: `<@!${message.author.id}>,\n:alarm_clock: **|** The timer has ended.`, footer:{text:footertxt} }}); + clearTimeout(client.timeit[message.author.id]); + delete client.timeit[message.author.id]; + } catch(error) { + message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\n<@!"+message.author.id+">, "+error, footer:{text:footertxt} }}); + console.log(error); + }; + return; + } else { + try { + message.channel.send({embed:{ title:cmdtitle, color: colors[1], description: `<@!${message.author.id}>,\n:clock1: **|** Timer has successfully started for ${ms(ms(time), { long:true })}.`, footer:{text:footertxt} }}).then(() => { + client.timeit[message.author.id] = setTimeout(() => { + message.channel.send(`<@!${message.author.id}>,`); + message.channel.send({embed:{ title:cmdtitle, color: colors[1], description: `:alarm_clock: **|** The timer expired.`, footer:{text:footertxt} }}); + delete client.timeit[message.author.id]; + }, ms(time)); + }); + + } catch(error) { + message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\n<@!"+message.author.id+">, "+error, footer:{text:footertxt} }}); + console.log(error); + }; + return; + } +} \ No newline at end of file diff --git a/src/commands/unban.js b/src/commands/unban.js new file mode 100644 index 0000000..220ac82 --- /dev/null +++ b/src/commands/unban.js @@ -0,0 +1,71 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; +var cmdtitle = "TCG Bot | Administration > Unban"; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + + +exports.run = (client, message, footertxt, prefix) => { + if (message.guild === null) return message.channel.send({embed:{ title:cmdtitle, color: colors[3], description: "**ERROR:**\nCommand cannot be ran in DMs.", footer:{text:footertxt} }}); + + let cont = message.content.split(' '); + let user = cont[1]; + if(isNaN(user)) {message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:** Invaild user to unban (must be a user id).", footer:{text:footertxt} }}); return;} + if (!message.channel.permissionsFor(message.author).has("BAN_MEMBERS")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nYou do not have permission to unban people.",footertext:{text:footertxt} }}); + if (!message.channel.permissionsFor(client.user).has("BAN_MEMBERS")) return message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nI do not have permission to unban people.",footertext:{text:footertxt} }}); + + GetTime(); + GetDate(); + message.guild.fetchBans().then(bans => { + + message.guild.unban(user).then((member) => { + message.channel.send({embed:{ + title:cmdtitle, + color:colors[1], + description: `**User Unbanned**\nUser: <@!${user}>\nServer: ${message.guild.name}\nAt: ${time} on ${date}.`, + footer:{text:footertxt} + }}); + try { user.send({embed:{ + title: `TCG Bot | Banned from server`, + color: colors[1], + description: `You were Unbanned from the server: ${message.guild.name}.\nAt: ${time} on ${date}.\nAdmin: ${message.author.username}#${message.author.discriminator}\n**Please follow the rules and enjoy your stay.**`, + footer:{text:footertxt} + }}); } catch { message.reply(":x: **|** Failed to inform <@!"+user+"> of unban"); } + return; + }).catch(err => { + message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\nUser never banned.",footertext:{text:footertxt} }}); + }); + }).catch(err => { + message.channel.send({embed:{title:cmdtitle, color:colors[3], description:"**ERROR:**\n"+err,footertext:{text:footertxt} }}); + return; + }); + + +} \ No newline at end of file diff --git a/src/commands/uptime.js b/src/commands/uptime.js new file mode 100644 index 0000000..0a1c4e2 --- /dev/null +++ b/src/commands/uptime.js @@ -0,0 +1,18 @@ +exports.run = (client, message, footertxt) => { + + let totalSeconds = (client.uptime / 1000); + let hours = Math.floor(totalSeconds / 3600); + totalSeconds %= 3600; + let minutes = Math.floor(totalSeconds / 60); + let seconds = totalSeconds % 60; + + let uptime = `${hours} hours, ${minutes} minutes and ${Math.round(seconds)} seconds`; + message.channel.send({embed:{ + title: "TCG Bot | Uptime", + color: 65280, + description: "I have online for: "+uptime, + footer:{text:footertxt} + }}); + return; + +} \ No newline at end of file diff --git a/src/commands/userinfo.js b/src/commands/userinfo.js new file mode 100644 index 0000000..8b2ce7e --- /dev/null +++ b/src/commands/userinfo.js @@ -0,0 +1,50 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + + +exports.run = (client, message, footertxt) => { + + + if(message.content == "/userinfo") { + userinfo(message.author); + return; + } else { + var cont = message.content.split(" "); + + if(message.guild == null) return message.channel.send({embed:{title:"TCG Bot | User Info > Error",color:colors[3],description:"**ERROR:** You cannot get userinfo on other users in DMs yet.",footer:{text:footertxt} }}); + var member = message.mentions.members.first() || message.guild.members.get(cont[1]) || message.member; + userinfo(member.user); + return; + } + + + function userinfo(user) { + + // This function allows us to get the userinfo of a user without the repeated coding. + + var userisbot = false; + var userstatus = ""; + var usergame = ""; + if(user.bot) { userisbot = true; } else { userisbot = false; } + if(user.presence.status == "offline") { userstatus = "offline"; } + else { + if(!user.presence.game || user.presence.game == null) { + usergame = ""; + } else { + if(user.presence.game.type == 0) { usergametype = "playing" } + if(user.presence.game.type == 1) { usergametype = "watching" } + if(user.presence.game.type == 2) { usergametype = "listening to" } + usergame = usergametype + " " + user.presence.game.name; + } + userstatus = user.presence.status+ " " + usergame; + } + + + message.channel.send({embed:{ + title:`TCG Bot | User Info > Information for ${user.username}`, + color: colors[0], + description: `**Username:** ${user.username}#${user.discriminator}\n**User ID:** ${user.id}\n**Avatar URL:** ${user.avatarURL}\n**Bot?:** ${userisbot}\n**Status:** ${userstatus}\n**User Created At:** ${user.createdAt}`, + footer:{text:footertxt} + }}); + } +} \ No newline at end of file diff --git a/src/config.json.example b/src/config.json.example new file mode 100644 index 0000000..c80dbd1 --- /dev/null +++ b/src/config.json.example @@ -0,0 +1,4 @@ +{ + "token":"PUT SOMETHING HERE", + "prefix":"brr" +} \ No newline at end of file diff --git a/src/events/guildCreate.js b/src/events/guildCreate.js new file mode 100644 index 0000000..0e630f6 --- /dev/null +++ b/src/events/guildCreate.js @@ -0,0 +1,77 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +var time; +var date; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + +var systemlog = ""; +const TCG = "222073294419918848"; + + +exports.run = (client, guild, footertxt, prefix) => { + GetTime(); + GetDate(); + try { + function syslog(type, msg) { + console.log(`\n[${type}] ${msg}`); + if(type == "WARN" || type == "ERR") { emcolor = colors[3]; } else if(type == "JOIN" || type == "LEAVE") { emcolor = colors[2]; } else { emcolor = colors[0]; } + client.channels.get(systemlog).send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${msg}`, + footer:{text:footertxt} + }}); + client.fetchUser(TCG).then(user => {user.send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${msg}`, + footer:{text:footertxt} + }}); }); + }; + syslog("JOIN", `Added to server: ${guild.name} | Server ID: ${guild.id} | Members: ${guild.memberCount} | At Time: ${time} on ${date}`); + let defaultChannel = ""; + guild.channels.forEach((channel) => { + if(channel.type == "text" && defaultChannel == "") { + if(channel.permissionsFor(guild.me).has("SEND_MESSAGES")) { defaultChannel = channel; } + } + }); + //defaultChannel will be the channel object that it first finds the bot has permissions for + defaultChannel.send({embed: { + title: "TCG Bot | Welcome", + color: colors[1], + description: "**Why hello there. I'm TCG Bot.**\nTCG Bot Help commands: ``"+prefix+" help``\n\n**Thanks for adding me to your server.**\n\n**An error occurred? Contact TheCodingGuy#6697 (Creator of bots)**", + //v1.1 :: description: "__**Hi! I'm TCG Bot.**__\nPrefix: "+prefix+"\nGet TCG Bot Help Commands: "+prefix+" help\n\nThanks for adding me and I'll be here if you need me.\nProblems? **Report to TheCodingGuy#6697**.", + footer: { text: footertxt } + }}); + syslog("JOIN", `Successfully sent welcome message to: ${guild.name} | Server ID: ${guild.id}`); + } catch (err) { syslog("ERR", `An error occurred while trying to send the welcome message to: ${guild.name} | Server ID: ${guild.id}.\nERROR is below:`); syslog("ERR", err);} //Catch the error +} \ No newline at end of file diff --git a/src/events/guildDelete.js b/src/events/guildDelete.js new file mode 100644 index 0000000..628ea18 --- /dev/null +++ b/src/events/guildDelete.js @@ -0,0 +1,61 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +var time; +var date; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + +var systemlog = ""; +const TCG = "222073294419918848"; + +exports.run = (client, message, guild, footertxt) => { + GetTime(); + GetDate(); + + function syslog(type, msg) { + console.log(`\n[${type}] ${msg}`); + if(type == "WARN" || type == "ERR") { emcolor = colors[3]; } else if(type == "JOIN" || type == "LEAVE") { emcolor = colors[2]; } else { emcolor = colors[0]; } + client.channels.get(systemlog).send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${msg}`, + footer:{text:footertxt} + }}); + client.fetchUser(TCG).then(user => {user.send({embed:{ + title: `TCG Bot | ${type}`, + color: emcolor, + description: `${msg}`, + footer:{text:footertxt} + }}); }); + }; + + syslog("REMOVE", `Added to server: ${guild.name} | Server ID: ${guild.id} | At Time: ${time} on ${date}`); +} \ No newline at end of file diff --git a/src/events/messageDelete.js b/src/events/messageDelete.js new file mode 100644 index 0000000..466fe54 --- /dev/null +++ b/src/events/messageDelete.js @@ -0,0 +1,50 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + +var messagelog = ""; + +exports.run = (client, msgdel, footertxt) => { + + GetTime(); + GetDate(); + var message = ``; + if(msgdel.guild == null) { message = `User: @${msgdel.author.username}#${msgdel.author.discriminator}\nMessage: ${msgdel.content}\nDeleted from: DMs to TCG Bot\nTime deleted: ${time} on ${date}`; + } else { message = `User: @${msgdel.author.username}#${msgdel.author.discriminator}\nMessage: ${msgdel.content}\nDeleted from: #${msgdel.channel.name} on ${msgdel.guild}\nTime deleted: ${time} on ${date}`; } + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Message Deleted", + color: colors[3], + description: `${message}`, + footer:{text:footertxt} + }}); + //Created by TCG + +} \ No newline at end of file diff --git a/src/events/messageUpdate.js b/src/events/messageUpdate.js new file mode 100644 index 0000000..6d2975a --- /dev/null +++ b/src/events/messageUpdate.js @@ -0,0 +1,51 @@ +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + +var messagelog = ""; + +exports.run = (client, omsg, nmsg, footertxt) => { + + if(omsg.author.bot) return; + GetTime(); + GetDate(); + var message = ``; + if(omsg.guild == null || omsg.guild == null) { message = `User: @${nmsg.author.username}#${nmsg.author.discriminator}\nOld Message: ${omsg.content}\nNew Message: ${nmsg.content}\nSent in: DMs to TCG Bot\nTime sent: ${time} on ${date}`; + } else { message = `User: @${nmsg.author.username}#${nmsg.author.discriminator}\nOld Message: ${omsg.content}\nNew Message: ${nmsg.content}\nSent in: #${nmsg.channel.name} on ${nmsg.guild}\nTime sent: ${time} on ${date}`; } + client.channels.get(messagelog).send({embed:{ + title: "TCG Bot | Message Update", + color: colors[0], + description: `${message}`, + footer:{text:footertxt} + }}); + //Created by TCG + +} \ No newline at end of file diff --git a/src/old-mk-fight-code.js b/src/old-mk-fight-code.js new file mode 100644 index 0000000..67e65e9 --- /dev/null +++ b/src/old-mk-fight-code.js @@ -0,0 +1,115 @@ + + }else if(message.content == "mk!fight") { + if(playerID.length == 2 && ready == "yes") { //Ensures the game is ACTUALLY started + var damage = Math.floor(Math.random() * 10) + 1; + if(playerID[playerActive] != message.author.id){ + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "You can't fight yet; it's <@!" + playerID[playerActive] + ">'s turn.." }}); + }else if(playerActive == 0){ + player2HP = player2HP - damage; + message.channel.send({ embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "Player 1 has dealt " + damage + " damage to Player 2.\nPlayer 2 now has " + player2HP + " HP left!\n", footer: { text: ""+footertxt+"" } }}); + console.log("Player 1 has dealt " + damage + " damage to Player 2.\nPlayer 2 now has " + player2HP + " HP left!\n"); + if (player2HP < 0 || player2HP == 0) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Uh-oh. Game over:\nPlayer 2 (<@!"+playerID[1]+">) has died. Player 1 (<@!"+playerID[0]+">) has won." }}); + console.log("Uh-oh. Player 2 ("+playerID[1]+") has died. Game is over. Player 1 ("+playerID[0]+") has won!"); + GameOver(); + } + else { + playerActive = 1; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Player 2 (<@!"+playerID[1]+">)'s turn." }}); + } + }else if(playerActive == 1){ + player1HP = player1HP - damage; + message.channel.send({ embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "Player 2 has dealt " + damage + " damage to Player 1.\nPlayer 1 now has " + player1HP + " HP left!\n", footer: { text: ""+footertxt+"" } }}); + console.log("Player 2 has dealt " + damage + " damage to Player 1.\nPlayer 1 now has " + player1HP + " HP left!\n"); + if (player1HP < 0 || player1HP == 0) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Uh-oh. Game over:\nPlayer 1 <@!"+playerID[0]+"> has died. Player 2 (<@!"+playerID[1]+">) has won." }}); + console.log("Uh-oh. Player 1 ("+playerID[0]+") has died. Game is over. Player 2 ("+playerID[1]+") has won!"); + GameOver(); + } + else { + playerActive = 0; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Player 1 (<@!"+playerID[0]+">)'s turn." }}); + } + } + }else{ + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Game has not been started. Please verify all players are in the game and the game was started by \`mk!start\`" }}); + } + }else if(message.content == "mk!fight punch") { + if(playerID.length == 2 && ready == "yes") { //Ensures the game is ACTUALLY started + var damage = Math.floor(Math.random() * 20) + 1; + if(playerID[playerActive] != message.author.id){ + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "You can't fight yet; it's <@!" + playerID[playerActive] + ">'s turn.." }}); + }else if(playerActive == 0 && player2HP < 20) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "To avoid a instant kill, you cannot punch this player, since their HP is below 20.\nPlease run \`mk!fight\` instead.\nIt is still your turn.\nTheir HP: "+player2HP, footer: { text: ""+footertxt+"" } }}); + }else if(playerActive == 0){ + player2HP = player2HP - damage; + message.channel.send({ embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "Player 1 has dealt " + damage + " damage to Player 2 with punch.\nPlayer 2 now has " + player2HP + " HP left!\n", footer: { text: ""+footertxt+"" } }}); + console.log("Player 1 has dealt " + damage + " damage to Player 2 with punch.\nPlayer 2 now has " + player2HP + " HP left!\n"); + if (player2HP < 0 || player2HP == 0) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Uh-oh. Game over:\nPlayer 2 (<@!"+playerID[1]+">) has died. Player 1 (<@!"+playerID[0]+">) has won." }}); + console.log("Uh-oh. Player 2 ("+playerID[1]+") has died. Game is over. Player 1 ("+playerID[0]+") has won!"); + GameOver(); + } + else { + playerActive = 1; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Player 2 (<@!"+playerID[1]+">)'s turn." }}); + } + }else if(playerActive == 1 && player1HP < 20) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "To avoid a instant kill, you cannot punch this player, since their HP is below 20.\nPlease run \`mk!fight\` instead.\nIt is still your turn.\nTheir HP: "+player1HP, footer: { text: ""+footertxt+"" } }}); + }else if(playerActive == 1){ + player1HP = player1HP - damage; + message.channel.send({ embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "Player 2 has dealt " + damage + " damage to Player 1 with punch.\nPlayer 1 now has " + player1HP + " HP left!\n", footer: { text: ""+footertxt+"" } }}); + console.log("Player 2 has dealt " + damage + " damage to Player 1 with punch.\nPlayer 1 now has " + player1HP + " HP left!\n"); + if (player1HP < 0 || player1HP == 0) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Uh-oh. Game over:\nPlayer 1 <@!"+playerID[0]+"> has died. Player 2 (<@!"+playerID[1]+">) has won." }}); + console.log("Uh-oh. Player 1 ("+playerID[0]+") has died. Game is over. Player 2 ("+playerID[1]+") has won!"); + GameOver(); + } + else { + playerActive = 0; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Player 1 (<@!"+playerID[0]+">)'s turn." }}); + } + } + }else{ + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Game has not been started. Please verify all players are in the game and the game was started by \`mk!start\`" }}); + } + }else if(message.content == "mk!fight kick") { + if(playerID.length == 2 && ready == "yes") { //Ensures the game is ACTUALLY started + var damage = Math.floor(Math.random() * 30) + 1; + if(playerID[playerActive] != message.author.id){ + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "You can't fight yet; it's <@!" + playerID[playerActive] + ">'s turn.." }}); + }else if(playerActive == 0 && player2HP < 30) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "To avoid a instant kill, you cannot kick this player, since their HP is below 30.\nPlease run \`mk!fight\` instead.\nIt is still your turn.\nTheir HP: "+player2HP, footer: { text: ""+footertxt+"" } }}); + }else if(playerActive == 0){ + player2HP = player2HP - damage; + message.channel.send({ embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "Player 1 has dealt " + damage + " damage to Player 2 with kick.\nPlayer 2 now has " + player2HP + " HP left!\n", footer: { text: ""+footertxt+"" } }}); + console.log("Player 1 has dealt " + damage + " damage to Player 2 with kick.\nPlayer 2 now has " + player2HP + " HP left!\n"); + if (player2HP < 0 || player2HP == 0) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Uh-oh. Game over:\nPlayer 2 (<@!"+playerID[1]+">) has died. Player 1 (<@!"+playerID[0]+">) has won." }}); + console.log("Uh-oh. Player 2 ("+playerID[1]+") has died. Game is over. Player 1 ("+playerID[0]+") has won!"); + GameOver(); + } + else { + playerActive = 1; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Player 2 (<@!"+playerID[1]+">)'s turn." }}); + } + }else if(playerActive == 1 && player1HP < 30) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "To avoid a instant kill, you cannot kick this player, since their HP is below 30.\nPlease run \`mk!fight\` instead.\nIt is still your turn.\nTheir HP: "+player1HP, footer: { text: ""+footertxt+"" } }}); + }else if(playerActive == 1){ + player1HP = player1HP - damage; + message.channel.send({ embed: { title: "TCG Bot | Mortal Kombat", color: yellow, description: "Player 2 has dealt " + damage + " damage to Player 1 with kick.\nPlayer 1 now has " + player1HP + " HP left!\n", footer: { text: ""+footertxt+"" } }}); + console.log("Player 2 has dealt " + damage + " damage to Player 1 with kick.\nPlayer 1 now has " + player1HP + " HP left!\n"); + if (player1HP < 0 || player1HP == 0) { + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Uh-oh. Game over:\nPlayer 1 <@!"+playerID[0]+"> has died. Player 2 (<@!"+playerID[1]+">) has won." }}); + console.log("Uh-oh. Player 1 ("+playerID[0]+") has died. Game is over. Player 2 ("+playerID[1]+") has won!"); + GameOver(); + } + else { + playerActive = 0; + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: lime, description: "Player 1 (<@!"+playerID[0]+">)'s turn." }}); + } + } + }else{ + message.channel.send({embed: { title: "TCG Bot | Mortal Kombat", color: red, description: "Game has not been started. Please verify all players are in the game and the game was started by \`mk!start\`" }}); + } + } \ No newline at end of file diff --git a/src/package-lock.json b/src/package-lock.json new file mode 100644 index 0000000..5b65cd4 --- /dev/null +++ b/src/package-lock.json @@ -0,0 +1,857 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + } + } + }, + "bignumber.js": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.0.4.tgz", + "integrity": "sha512-LDXpJKVzEx2/OqNbG9mXBNvHuiRL4PzHCGfnANHMJ+fv68Ads3exDVJeGDJws+AoNEuca93bU3q+S0woeUaCdg==" + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "requires": { + "inherits": "2.0.3" + } + }, + "bluebird": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "cheerio": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.19.0.tgz", + "integrity": "sha1-dy5wFfLuKZZQltcepBdbdas1SSU=", + "requires": { + "css-select": "1.0.0", + "dom-serializer": "0.1.0", + "entities": "1.1.1", + "htmlparser2": "3.8.3", + "lodash": "3.10.1" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "css-select": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.0.0.tgz", + "integrity": "sha1-sRIcpRhI3SZOIkTQWM7iVN7rRLA=", + "requires": { + "boolbase": "1.0.0", + "css-what": "1.0.0", + "domutils": "1.4.3", + "nth-check": "1.0.1" + } + }, + "css-what": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-1.0.0.tgz", + "integrity": "sha1-18wt9FGAZm+Z0rFEYmOUaeAPc2w=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "discord.js": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.3.2.tgz", + "integrity": "sha512-Abw9CTMX3Jb47IeRffqx2VNSnXl/OsTdQzhvbw/JnqCyqc2imAocc7pX2HoRmgKd8CgSqsjBFBneusz/E16e6A==", + "requires": { + "long": "4.0.0", + "prism-media": "0.0.2", + "snekfetch": "3.6.4", + "tweetnacl": "1.0.0", + "ws": "4.1.0" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", + "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=", + "requires": { + "domelementtype": "1.3.0" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "ffmpeg-binaries": { + "version": "3.2.2-3", + "resolved": "https://registry.npmjs.org/ffmpeg-binaries/-/ffmpeg-binaries-3.2.2-3.tgz", + "integrity": "sha1-nKM7aM0wTs8Qwz5tz3HiuT637hQ=", + "requires": { + "superagent": "3.8.3", + "tar.gz": "1.0.7" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "formidable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", + "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==" + }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "google": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/google/-/google-2.1.0.tgz", + "integrity": "sha1-Edl8m1QvoqxMOlDLzZwUyC9qgQE=", + "requires": { + "cheerio": "0.19.0", + "request": "2.87.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.3.0", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" + }, + "dependencies": { + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.2" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mout": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/mout/-/mout-0.11.1.tgz", + "integrity": "sha1-ujYR318OWx/7/QEWa48C0fX6K5k=" + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "mysql": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.15.0.tgz", + "integrity": "sha512-C7tjzWtbN5nzkLIV+E8Crnl9bFyc7d3XJcBAvHKEVkjrYjogz3llo22q6s/hw+UcsE4/844pDob9ac+3dVjQSA==", + "requires": { + "bignumber.js": "4.0.4", + "readable-stream": "2.3.3", + "safe-buffer": "5.1.1", + "sqlstring": "2.3.0" + } + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "requires": { + "boolbase": "1.0.0" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "opusscript": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.6.tgz", + "integrity": "sha512-F7nx1SWZCD5Rq2W+5Fx39HlkRkz/5Zqt0LglEB9uHexk8HjedDEiM+u/Y2rBfDFcS/0uQIWu2lJhw+Gjsta+cA==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "prism-media": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.2.tgz", + "integrity": "sha512-L6yc8P5NVG35ivzvfI7bcTYzqFV+K8gTfX9YaJbmIFfMXTs71RMnAupvTQPTCteGsiOy9QcNLkQyWjAafY/hCQ==" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.7.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.2", + "safe-buffer": "5.1.1", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.3.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "snekfetch": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz", + "integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw==" + }, + "sqlstring": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.0.tgz", + "integrity": "sha1-UluKT9Jtb3GqYegipsr5dtMa0qg=" + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.2", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "safer-buffer": "2.1.2", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + } + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "superagent": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "requires": { + "component-emitter": "1.2.1", + "cookiejar": "2.1.2", + "debug": "3.1.0", + "extend": "3.0.1", + "form-data": "2.3.2", + "formidable": "1.2.1", + "methods": "1.1.2", + "mime": "1.6.0", + "qs": "6.5.2", + "readable-stream": "2.3.6" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar.gz": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", + "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", + "requires": { + "bluebird": "2.11.0", + "commander": "2.15.1", + "fstream": "1.0.11", + "mout": "0.11.1", + "tar": "2.2.1" + } + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "ws": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", + "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", + "requires": { + "async-limiter": "1.0.0", + "safe-buffer": "5.1.1" + } + } + } +} diff --git a/src/quotes.txt b/src/quotes.txt new file mode 100644 index 0000000..dac33b5 --- /dev/null +++ b/src/quotes.txt @@ -0,0 +1,60 @@ +#1 - When you reach the end of your rope, tie a knot in it and hang on. +#2 - There is nothing permanent except change. +#3 - Let us sacrifice our today so that our children can have a better tomorrow. +#4 - It is better to be feared than loved, if you cannot be both. +#5 - Do not mind anything that anyone tells you about anyone else. Judge everyone and everything for yourself. +#6 - Learning never tires the mind. +#7 - There is no charm equal to tenderness of heart. +#8 - All that we see or seem is but a dream within a dream. +#9 - Good judgment comes from experience, and a lot of that comes from bad judgment. +#10 - No act of kindness, no matter how small, is ever wasted. +#11 - Work like you don't need the money. Love like you've never been hurt. Dance like nobody's watching. +#12 - It is far better to be alone, than to be in bad company. +#13 - If you cannot do great things, do small things in a great way. +#14 - Independence is happines. +#15 - Keep your face always toward the sunshine - and shadows will fall behind you. +#16 - Failure is just another step to success. +#17 - The journey of a thousand miles begins with one step. +#18 - There is only one corner of the universe you can be certain of improving, and that's your own self. +#19 - Honesty might get you in some trouble, but not as much trouble as lying. +#20 - The best preparation for tomorrow is doing your best today. +#21 - Love another, as another should love you. +#22 - Treat people the way you want to be treated. +#23 - Coming together is a beginning; keeping together is progress; working together is success. +#24 - God gave us the gift of life; it is up to us to give ourselves the gift of living well. +#25 - Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better. +#26 - Change your life today. Don't gamble on the future, act now, without delay. +#27 - There is nothing on this earth more to be prized than true friendship. +#28 - Very little is needed to make a happy life; it is all within yourself, in your way of thinking. +#29 - If opportunity doesn't knock, build a door. +#30 - The way of getting ahead is getting started. +#31 - Always remember that you are absolutely unique. Just like everyone else. +#32 - You are crazy. I'm crazy. Everyone's crazy. That is what makes us unique. +#33 - Problems are not stop signs, they are guidelines. +#34 - If you reach a dead end, turn around and find a different path. You'll reach your goal there. +#35 - Make that one idea your life - think of it, dream of it, live on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone. This is the way to success. +#36 - Life is not a problem to be solved, but a reality to be experienced. +#37 - Life isn't about finding yourself. Life is about creating yourself. +#38 - The past is the past. Today is now. Tomorrow is never promised. Do things today and be successful. +#39 - In trouble times, think of the ones who love you. They love you. You should too. +#40 - Words are words. Actions are for real. Take action instead of saying what you're going to do. +#41 - Don't ever give up. Try again. +#42 - Believe you can do it... and you're half-way there. +#43 - Today you are you! That is truer than true! There is no one alive who is you-er than you! +#44 - In three words I can sum up everything I've learned about life: it goes on. +#45 - Change your thoughts and you change your world. +#46 - Do all things with love. +#47 - Success is just the beginning, failure is not fatal but it is courage to continue that counts. +#48 - It is during our darkest moments that we must focus to see the light. +#49 - Keep love in your heart. A life without it is like a sunless garden when the flowers are dead. +#50 - The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart. +#51 - Feeling down? Things will get better. I promise you that. +#52 - If you ever need help the people on this server (if this was ran on a server) will help you. I bet you! +#53 - There's something I have learned in life: even though someone can say something that they think is right about you, the only person that would know you better is yourself +#54 - Love could be misseen as hate. +#55 - "Once you do something, there's an end result. This is why waking up everyday needs to be done, so you can go do something. Whether it's as simple as helping out someone or leaving a like on a video you... like, good things can come out of you with simple actions. That's doing something. Now go and do something." -kidboo377 +#56 - Things happen for a reason, if you don’t know the reason, find it. You’ll find the reason eventually. +#57 - We've all had those times that we regret. It's best if we learn from those regrets and plan not to produce them again in the future. +#58 - Death is never the answer. Life is like a roller coaster; there are high points that run by slowly, and low points that race on by. You're at the bottom of a hill; tomorrow will be the rise to the top. +#59 - Life is like the cycle of day and night. The day will not always be bright, but when it gets dark, remember, the sun will always return. +#60 - You have the right to an opinion, but your opinion isn't always right - Double-T Netson 2020 \ No newline at end of file diff --git a/src/radio-bot.js b/src/radio-bot.js new file mode 100644 index 0000000..782041b --- /dev/null +++ b/src/radio-bot.js @@ -0,0 +1,68 @@ +//TCG Radio Bot - Created in Discord.JS (https://discord.js.org). Bot created by TheCodingGuy#6697. +const Discord = require("discord.js"); +const client = new Discord.Client(); +const fs = require("fs"); +const config = require("./config.json"); +const prefix = config.prefix; + +const TCG = "222073294419918848"; +var systemlog = ""; + +//colors ===BLUE=======LIME=====YELLOW======RED======== +var colors = [ "3447003", "65280", "16312092", "15158332" ]; + +function syslog(type, message) { + console.log(`\n[${type}] ${message}`); + client.channels.get(systemlog).send(`[${type}] ${message}`); + client.fetchUser(TCG).then(user => {user.send(`[${type}] ${message}`)}); +} + +function GetTime() { + var today=new Date(); + var h=today.getHours(); + var m=today.getMinutes(); + var s=today.getSeconds(); + var ampm = ""; + m = checkTime(m); + s = checkTime(s); + + if (h > 12) { h = h - 12; ampm = " PM"; } + else if (h == 12){ h = 12; ampm = " PM"; } + else if (h < 12){ ampm = " AM"; } + else { ampm = "PM"; }; + if(h==0) { h=12; } + time = h+":"+m+":"+s+ampm; +} +function GetDate(){ + var d = new Date(); + var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; + var month = [d.getMonth()+1]; + var day = d.getDate(); + var year = d.getFullYear(); + date = days[d.getDay()]+" "+month+"/"+day+"/"+year; +} +function checkTime(i) { + if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 + return i; +} + + +client.on('ready', () => { + GetTime(); + GetDate(); + var msg = `=== TCG RADIO STARTUP ===\nBOOTUP: ${time} ${date}`; + syslog("INFO", `${msg}`); + + +}); + +client.on('message', message => { + + if(!message.author.id == TCG) return; + if(message.content.startsWith(prefix + " begin")) { + + } + +}); + +client.login(config.token); \ No newline at end of file diff --git a/src/start.sh b/src/start.sh new file mode 100644 index 0000000..0e5dd40 --- /dev/null +++ b/src/start.sh @@ -0,0 +1,10 @@ +#!/bin/sh +## TCG Bot Start SH Code +while : +do + echo " " + echo "Please wait, starting TCG Bot..." + sudo node bot.js + echo "Bot crashed or smth. Attempting reboot." +done +## TCG Bot Start SH Code \ No newline at end of file