From 62d21dd9054289a7f562963500d73ee1571b7df1 Mon Sep 17 00:00:00 2001 From: Navy Date: Wed, 2 Oct 2024 09:24:11 +0300 Subject: [PATCH 1/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c4fb0f..e9fd58f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new-gbot", - "version": "3.3.0-dev.1", + "version": "3.4.0", "description": "New iteration of GalacticBot", "main": "build/index.js", "type": "module", -- 2.45.2 From 09a72bfc83c3f1d40a67a25f8ffaea94ed131136 Mon Sep 17 00:00:00 2001 From: Navy Date: Mon, 7 Oct 2024 15:14:28 +0300 Subject: [PATCH 2/3] Upgrade deps and linter rules --- .eslintignore | 4 - .eslintrc.json | 50 +- eslint.config.mjs | 291 ++ package.json | 20 +- src/client/DiscordClient.ts | 20 +- src/client/components/RateLimiter.ts | 10 +- src/client/components/Resolver.ts | 2 +- .../commands/administration/Administration.ts | 6 +- .../commands/administration/Import.ts | 40 +- .../commands/administration/Logging.ts | 4 +- .../commands/administration/Moderation.ts | 6 +- .../commands/administration/Modstats.ts | 22 +- .../commands/administration/Permissions.ts | 116 +- .../commands/administration/Settings.ts | 30 +- .../commands/administration/Utility.ts | 4 +- .../components/commands/developer/Botban.ts | 6 +- .../components/commands/developer/Debug.ts | 8 +- .../components/commands/developer/Eval.ts | 12 +- .../components/commands/developer/Stats.ts | 98 +- .../commands/information/Commands.ts | 16 +- .../components/commands/information/Guild.ts | 46 +- .../components/commands/information/Help.ts | 10 +- .../components/commands/information/Info.ts | 52 +- .../commands/information/Privacy.ts | 6 +- .../components/commands/moderation/Ban.ts | 34 +- .../components/commands/moderation/Case.ts | 62 +- .../components/commands/moderation/Dehoist.ts | 12 +- .../components/commands/moderation/Edit.ts | 38 +- .../components/commands/moderation/History.ts | 98 +- .../components/commands/moderation/Kick.ts | 12 +- .../commands/moderation/Lockdown.ts | 22 +- .../commands/moderation/Modtimers.ts | 20 +- .../components/commands/moderation/Mute.ts | 14 +- .../commands/moderation/Nickname.ts | 18 +- .../components/commands/moderation/Note.ts | 20 +- .../components/commands/moderation/Prune.ts | 94 +- .../components/commands/moderation/Resolve.ts | 32 +- .../components/commands/moderation/Roles.ts | 40 +- .../commands/moderation/Slowmode.ts | 26 +- .../components/commands/moderation/Softban.ts | 26 +- .../components/commands/moderation/Staff.ts | 10 +- .../components/commands/moderation/Unban.ts | 18 +- .../commands/moderation/Unlockdown.ts | 18 +- .../components/commands/moderation/Unmute.ts | 14 +- .../commands/moderation/Unresolve.ts | 22 +- .../components/commands/moderation/Vckick.ts | 12 +- .../components/commands/moderation/Warn.ts | 20 +- .../components/commands/utility/Avatar.ts | 40 +- .../components/commands/utility/Grantable.ts | 6 +- .../components/commands/utility/Ping.ts | 4 +- .../components/commands/utility/Poll.ts | 64 +- .../components/commands/utility/Remind.ts | 42 +- .../components/commands/utility/Selfrole.ts | 18 +- src/client/components/inhibitors/Banned.ts | 4 +- .../components/inhibitors/ChannelIgnore.ts | 6 +- .../inhibitors/ClientPermissions.ts | 6 +- src/client/components/inhibitors/Disabled.ts | 4 +- src/client/components/inhibitors/GuildOnly.ts | 4 +- .../components/inhibitors/Permissions.ts | 6 +- .../components/inhibitors/Restricted.ts | 4 +- src/client/components/inhibitors/Throttle.ts | 6 +- .../components/managers/CallbackManager.ts | 6 +- .../components/managers/ModerationManager.ts | 130 +- src/client/components/managers/PollManager.ts | 4 +- .../components/managers/ReminderManager.ts | 16 +- src/client/components/observers/AuditLog.ts | 46 +- .../components/observers/Automoderation.ts | 64 +- .../components/observers/CommandHandler.ts | 28 +- src/client/components/observers/ErrorLog.ts | 20 +- .../components/observers/GuildLogging.ts | 78 +- src/client/components/observers/Metrics.ts | 2 +- .../components/observers/UtilityHook.ts | 2 +- .../settings/administration/Commands.ts | 32 +- .../settings/administration/IgnoreChannels.ts | 34 +- .../settings/administration/Indexing.ts | 26 +- .../settings/administration/PermissionType.ts | 14 +- .../settings/administration/Protection.ts | 42 +- .../settings/administration/Silent.ts | 22 +- .../settings/administration/TextCommands.ts | 28 +- .../settings/logging/DmInfraction.ts | 66 +- .../components/settings/logging/Errors.ts | 40 +- .../components/settings/logging/Members.ts | 52 +- .../components/settings/logging/Messages.ts | 88 +- .../components/settings/logging/Moderation.ts | 78 +- .../components/settings/logging/Nicknames.ts | 30 +- .../components/settings/logging/Voice.ts | 30 +- .../settings/moderation/AutoModeration.ts | 68 +- .../settings/moderation/Grantable.ts | 34 +- .../settings/moderation/InviteFilter.ts | 74 +- .../settings/moderation/LinkFilter.ts | 114 +- .../settings/moderation/MentionFilter.ts | 100 +- .../settings/moderation/ModerationPoints.ts | 104 +- .../components/settings/moderation/Mute.ts | 122 +- .../settings/moderation/Raidprotection.ts | 36 +- .../components/settings/moderation/Staff.ts | 36 +- .../settings/moderation/WordFilter.ts | 110 +- .../settings/moderation/WordWatcher.ts | 62 +- .../components/settings/utility/Autorole.ts | 36 +- .../components/settings/utility/Selfrole.ts | 42 +- .../components/settings/utility/StickyRole.ts | 36 +- .../components/settings/utility/Welcomer.ts | 26 +- .../components/wrappers/GuildWrapper.ts | 14 +- .../components/wrappers/InteractionWrapper.ts | 2 +- .../components/wrappers/InvokerWrapper.ts | 20 +- src/client/infractions/Addrole.ts | 28 +- src/client/infractions/Ban.ts | 30 +- src/client/infractions/Kick.ts | 24 +- src/client/infractions/Lockdown.ts | 42 +- src/client/infractions/Mute.ts | 32 +- src/client/infractions/Nickname.ts | 26 +- src/client/infractions/Note.ts | 24 +- src/client/infractions/Prune.ts | 42 +- src/client/infractions/Removerole.ts | 28 +- src/client/infractions/Slowmode.ts | 28 +- src/client/infractions/Softban.ts | 26 +- src/client/infractions/Unban.ts | 26 +- src/client/infractions/Unlockdown.ts | 28 +- src/client/infractions/Unmute.ts | 30 +- src/client/infractions/Vckick.ts | 24 +- src/client/infractions/Warn.ts | 24 +- src/client/interfaces/CommandError.ts | 4 +- src/client/interfaces/CommandOption.ts | 62 +- src/client/interfaces/Component.ts | 7 +- src/client/interfaces/FilterSetting.ts | 62 +- src/client/interfaces/Infraction.ts | 110 +- src/client/interfaces/Inhibitor.ts | 8 +- src/client/interfaces/Module.ts | 2 +- src/client/interfaces/Observer.ts | 8 +- src/client/interfaces/Setting.ts | 26 +- src/client/interfaces/commands/Command.ts | 20 +- .../interfaces/commands/ModerationCommand.ts | 52 +- .../interfaces/commands/SettingsCommand.ts | 38 +- .../interfaces/commands/SlashCommand.ts | 10 +- src/client/storage/interfaces/MongodbTable.ts | 6 +- src/client/storage/interfaces/Provider.ts | 2 +- .../storage/providers/MariaDBProvider.ts | 6 +- .../storage/providers/MongoDBProvider.ts | 4 +- src/middleware/Controller.ts | 10 +- src/middleware/Metrics.ts | 62 +- src/middleware/Shard.ts | 14 +- src/utilities/BinaryTree.ts | 8 +- src/utilities/FilterUtil.ts | 38 +- src/utilities/InfractionMigrator.ts | 48 +- src/utilities/SettingsMigrator.ts | 44 +- src/utilities/Util.ts | 14 +- tsconfig.json | 2 +- yarn.lock | 2440 ++++++++++++++--- 147 files changed, 4715 insertions(+), 2643 deletions(-) delete mode 100644 .eslintignore create mode 100644 eslint.config.mjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 69d8500..0000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -/api -src/structure/components/settings/.eslintrc.json -src/localization -src/constants \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index af5e324..ac1512a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,14 +1,11 @@ { "parser": "@typescript-eslint/parser", "plugins": [ - "jest", - "@typescript-eslint", - "eslint-plugin-node" + "@typescript-eslint/eslint-plugin" ], "env": { "es6": true, - "node": true, - "jest/globals": true + "node": true }, "extends": [ "eslint:recommended", @@ -16,7 +13,8 @@ ], "globals": { "Atomics": "readonly", - "SharedArrayBuffer": "readonly" + "SharedArrayBuffer": "readonly", + "BigInt": true }, "parserOptions": { "ecmaVersion": 2022, @@ -31,6 +29,8 @@ "arguments": false } }], + "@typescript-eslint/no-shadow": "error", + "@typescript-eslint/no-use-before-define": "error", "accessor-pairs": "warn", "array-callback-return": "warn", "array-bracket-newline": [ @@ -88,7 +88,7 @@ "warn", "never" ], - "eqeqeq": "warn", + "eqeqeq": "error", "func-call-spacing": "warn", "func-name-matching": "warn", "func-names": "warn", @@ -105,7 +105,17 @@ "warn", 4, { - "SwitchCase": 1 + "SwitchCase": 1, + "VariableDeclarator": "first", + "FunctionDeclaration": { + "parameters": "first" + }, + "CallExpression": { + "arguments": "first" + }, + "ArrayExpression": "first", + "ObjectExpression": "first", + "ImportDeclaration": "first" } ], "init-declarations": "warn", @@ -114,14 +124,15 @@ "single" ], "jsx-quotes": [ - "warn", + "error", "prefer-single" ], "key-spacing": [ "warn", { "beforeColon": false, - "afterColon": true + "afterColon": true, + "align": "value" } ], "keyword-spacing": [ @@ -160,7 +171,6 @@ "new-parens": "warn", "no-alert": "warn", "no-array-constructor": "warn", - // "no-bitwise": "warn", "no-buffer-constructor": "warn", "no-caller": "warn", "no-console": "warn", @@ -170,7 +180,7 @@ "no-duplicate-imports": "warn", "no-else-return": "warn", "no-empty-function": "warn", - "no-eq-null": "warn", + "no-eq-null": "off", "no-eval": "warn", "no-extend-native": "warn", "no-extra-bind": "warn", @@ -188,7 +198,15 @@ "no-loop-func": "warn", "no-mixed-requires": "warn", "no-multi-assign": "warn", - "no-multi-spaces": "warn", + "no-multi-spaces": [ + "warn", + { + "ignoreEOLComments": true, + "exceptions": { + "ImportDeclaration": true + } + } + ], "no-multi-str": "warn", "no-multiple-empty-lines": "warn", "no-native-reassign": "warn", @@ -219,8 +237,7 @@ "no-sequences": "warn", "no-setter-return": "warn", "no-spaced-func": "warn", - "@typescript-eslint/no-shadow": "error", - "no-tabs": "warn", + "no-tabs": "error", "no-template-curly-in-string": "error", "no-throw-literal": "warn", "no-trailing-spaces": "warn", @@ -229,7 +246,6 @@ "no-unmodified-loop-condition": "warn", "no-unneeded-ternary": "error", "no-unused-expressions": "warn", - "@typescript-eslint/no-use-before-define": "error", "no-useless-call": "warn", "no-useless-computed-key": "warn", "no-useless-concat": "warn", @@ -237,7 +253,6 @@ "no-useless-rename": "warn", "no-useless-return": "warn", "no-var": "warn", - // "no-void": "warn", "no-whitespace-before-property": "error", "nonblock-statement-body-position": [ "warn", @@ -260,6 +275,7 @@ "warn", "before" ], + "padding-line-between-statements": "warn", "padded-blocks": [ "warn", { diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..9dacbc3 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,291 @@ +import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin"; +import globals from "globals"; +import tsParser from "@typescript-eslint/parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [{ + ignores: [ + "api", + "src/structure/components/settings/.eslintrc.json", + "src/localization", + "src/constants", + 'eslint.config.mjs' + ], +}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), { + plugins: { + "@typescript-eslint": typescriptEslintEslintPlugin, + }, + + languageOptions: { + globals: { + ...globals.node, + Atomics: "readonly", + SharedArrayBuffer: "readonly", + BigInt: true, + }, + + parser: tsParser, + ecmaVersion: 2022, + sourceType: "module", + + parserOptions: { + project: "./tsconfig.json", + }, + }, + + rules: { + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-non-null-assertion": "off", + + "@typescript-eslint/no-misused-promises": ["error", { + checksVoidReturn: { + arguments: false, + }, + }], + + "@typescript-eslint/no-shadow": "error", + "@typescript-eslint/no-use-before-define": "error", + "accessor-pairs": "warn", + "array-callback-return": "warn", + "array-bracket-newline": ["warn", "consistent"], + + "array-bracket-spacing": ["warn", "always", { + objectsInArrays: false, + arraysInArrays: false, + }], + + "arrow-spacing": "warn", + "block-scoped-var": "warn", + "block-spacing": ["warn", "always"], + "brace-style": ["warn", "allman"], + "callback-return": "warn", + camelcase: "warn", + "comma-dangle": ["warn", "only-multiline"], + + "comma-spacing": ["warn", { + after: true, + before: false, + }], + + "comma-style": "warn", + "computed-property-spacing": ["warn", "never"], + "consistent-this": "warn", + + "dot-notation": ["warn", { + allowKeywords: true, + }], + + "dot-location": ["error", "property"], + "eol-last": ["warn", "never"], + eqeqeq: "error", + "func-call-spacing": "warn", + "func-name-matching": "warn", + "func-names": "warn", + "func-style": "warn", + "function-paren-newline": "warn", + "generator-star-spacing": "warn", + "grouped-accessor-pairs": "warn", + "guard-for-in": "warn", + "handle-callback-err": "warn", + "id-blacklist": "warn", + "id-match": "warn", + "implicit-arrow-linebreak": "warn", + + indent: ["warn", 4, { + SwitchCase: 1, + VariableDeclarator: "first", + + FunctionDeclaration: { + parameters: "first", + }, + + CallExpression: { + arguments: "first", + }, + + ArrayExpression: "first", + ObjectExpression: "first", + ImportDeclaration: "first", + }], + + "init-declarations": "warn", + quotes: ["error", "single"], + "jsx-quotes": ["error", "prefer-single"], + + "key-spacing": ["warn", { + beforeColon: false, + afterColon: true, + align: "value", + }], + + "keyword-spacing": ["warn", { + after: true, + before: true, + }], + + "linebreak-style": ["error", "unix"], + "lines-around-comment": "warn", + "lines-around-directive": "warn", + "max-classes-per-file": "warn", + "max-nested-callbacks": "warn", + + "max-len": ["warn", { + code: 140, + ignoreComments: true, + ignoreStrings: true, + ignoreTemplateLiterals: true, + ignoreRegExpLiterals: true, + }], + + "max-lines-per-function": ["warn", 140], + "max-depth": ["warn", 3], + "new-parens": "warn", + "no-alert": "warn", + "no-array-constructor": "warn", + "no-buffer-constructor": "warn", + "no-caller": "warn", + "no-console": "warn", + "no-constant-binary-expression": "error", + "no-div-regex": "warn", + "no-dupe-else-if": "warn", + "no-duplicate-imports": "warn", + "no-else-return": "warn", + "no-empty-function": "warn", + "no-eq-null": "off", + "no-eval": "warn", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-label": "warn", + "no-floating-decimal": "warn", + "no-implicit-coercion": "warn", + "no-implicit-globals": "warn", + "no-implied-eval": "error", + "no-import-assign": "warn", + "no-invalid-this": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-lone-blocks": "warn", + "no-lonely-if": "warn", + "no-loop-func": "warn", + "no-mixed-requires": "warn", + "no-multi-assign": "warn", + + "no-multi-spaces": ["warn", { + ignoreEOLComments: true, + + exceptions: { + ImportDeclaration: true, + }, + }], + + "no-multi-str": "warn", + "no-multiple-empty-lines": "warn", + "no-native-reassign": "warn", + "no-negated-in-lhs": "warn", + "no-negated-condition": "error", + "no-nested-ternary": "warn", + "no-new": "warn", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-require": "warn", + "no-new-wrappers": "warn", + "no-octal-escape": "warn", + "no-path-concat": "warn", + "no-process-exit": "warn", + "no-proto": "warn", + "no-restricted-globals": "warn", + "no-restricted-imports": "warn", + "no-restricted-modules": "warn", + "no-restricted-properties": "warn", + "no-restricted-syntax": "warn", + "no-return-assign": ["warn", "except-parens"], + "no-return-await": "warn", + "no-script-url": "warn", + "no-self-compare": "warn", + "no-sequences": "warn", + "no-setter-return": "warn", + "no-spaced-func": "warn", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-throw-literal": "warn", + "no-trailing-spaces": "warn", + "no-undef-init": "error", + "no-undefined": "error", + "no-unmodified-loop-condition": "warn", + "no-unneeded-ternary": "error", + "no-unused-expressions": "warn", + "no-useless-call": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-useless-rename": "warn", + "no-useless-return": "warn", + "no-var": "warn", + "no-whitespace-before-property": "error", + "nonblock-statement-body-position": ["warn", "below"], + "object-curly-spacing": ["warn", "always"], + + "object-property-newline": ["warn", { + allowAllPropertiesOnSameLine: true, + }], + + "object-shorthand": "warn", + "one-var-declaration-per-line": "warn", + "operator-assignment": "warn", + "operator-linebreak": ["warn", "before"], + "padding-line-between-statements": "warn", + + "padded-blocks": ["warn", { + switches: "never", + }, { + allowSingleLineBlocks: true, + }], + + "prefer-arrow-callback": "warn", + "prefer-const": "warn", + "prefer-destructuring": "warn", + "prefer-exponentiation-operator": "warn", + "prefer-numeric-literals": "warn", + "prefer-object-spread": "error", + "prefer-promise-reject-errors": "warn", + "prefer-regex-literals": "warn", + "prefer-rest-params": "warn", + "prefer-spread": "warn", + "require-unicode-regexp": "warn", + "rest-spread-spacing": "warn", + semi: "error", + "semi-spacing": "warn", + "semi-style": ["warn", "last"], + "space-before-blocks": "warn", + "space-before-function-paren": ["error", "always"], + "space-in-parens": ["warn", "never"], + "spaced-comment": ["warn", "always"], + strict: "warn", + "switch-colon-spacing": "warn", + "symbol-description": "warn", + "template-curly-spacing": ["warn", "never"], + "template-tag-spacing": "warn", + "unicode-bom": ["warn", "never"], + "vars-on-top": "warn", + "wrap-iife": "warn", + "wrap-regex": "error", + "yield-star-spacing": "warn", + yoda: ["warn", "never"], + + "no-warning-comments": [1, { + terms: ["todo", "fixme"], + location: "anywhere", + }], + }, +}]; \ No newline at end of file diff --git a/package.json b/package.json index e9fd58f..ed87524 100644 --- a/package.json +++ b/package.json @@ -29,11 +29,11 @@ "@discordjs/rest": "^1.7.1", "@navy.gif/logger": "^2.5.4", "@navy.gif/timestring": "^6.0.6", - "@types/node": "^18.15.11", + "@types/node": "^22.7.4", "bufferutil": "^4.0.8", "chalk": "^5.3.0", "common-tags": "^1.8.2", - "discord.js": "^14.14.1", + "discord.js": "^14.16.3", "dotenv": "^16.3.1", "escape-string-regexp": "4.0.0", "humanize-duration": "^3.28.0", @@ -43,21 +43,29 @@ "node-fetch": "^3.3.1", "object-hash": "^3.0.0", "similarity": "^1.2.1", - "typescript": "^5.3.2", + "typescript": "^5.6.2", "utf-8-validate": "^6.0.3", "zlib-sync": "^0.1.9" }, "devDependencies": { + "@babel/core": "^7.25.7", + "@babel/preset-env": "^7.25.7", + "@babel/preset-typescript": "^7.25.7", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.12.0", + "@types/babel__core": "^7", + "@types/babel__preset-env": "^7", "@types/common-tags": "^1.8.1", "@types/humanize-duration": "^3.27.1", "@types/mysql": "^2.15.21", "@types/object-hash": "^3.0.2", "@types/similarity": "^1.2.1", - "@typescript-eslint/eslint-plugin": "^5.58.0", - "@typescript-eslint/parser": "^5.58.0", - "eslint": "^8.42.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", + "eslint": "^9.12.0", "eslint-plugin-jest": "^27.2.1", "eslint-plugin-node": "^11.1.0", + "globals": "^15.10.0", "jest": "^28.0.2", "nodemon": "^2.0.7" }, diff --git a/src/client/DiscordClient.ts b/src/client/DiscordClient.ts index 5f8e019..712fbf5 100644 --- a/src/client/DiscordClient.ts +++ b/src/client/DiscordClient.ts @@ -17,7 +17,6 @@ import { Client, Collection, - DataResolver, ActivityType, Partials, Invite, @@ -25,6 +24,7 @@ import { InviteResolvable, ClientFetchInviteOptions, Channel, + resolveInviteCode, } from 'discord.js'; import chalk from 'chalk'; import { inspect } from 'node:util'; @@ -98,10 +98,10 @@ const Constants: { } } = { ComponentTypes: { - LOAD: 'loaded', - UNLOAD: 'unloaded', - RELOAD: 'reloaded', - ENABLE: 'enabled', + LOAD: 'loaded', + UNLOAD: 'unloaded', + RELOAD: 'reloaded', + ENABLE: 'enabled', DISABLE: 'disabled' } }; @@ -112,6 +112,7 @@ type PendingPromise = { reject: (error?: Error) => void } +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging declare interface DiscordClient extends Client { on(event: K, listener: EventHook): this } @@ -125,6 +126,7 @@ declare interface DiscordClient extends Client { * @typedef {DiscordClient} * @extends {Client} */ +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging class DiscordClient extends Client { #logger: Logger; @@ -155,7 +157,7 @@ class DiscordClient extends Client #options: ClientOptions; #defaultConfig: { [key: string]: unknown }; - #activityInterval?: NodeJS.Timer; + #activityInterval?: NodeJS.Timeout; #permissionCheck?: Permissions; constructor (options: ClientOptions) @@ -235,7 +237,7 @@ class DiscordClient extends Client this.#logger.error(`Unhandled rejection:\n${err?.stack || err}`); }); - // eslint-disable-next-line @typescript-eslint/no-misused-promises + process.on('message', this.#handleMessage.bind(this)); process.on('SIGINT', () => this.logger.info('Received SIGINT')); process.on('SIGTERM', () => this.logger.info('Received SIGTERM')); @@ -454,7 +456,7 @@ class DiscordClient extends Client this.#eventHooker.hook('componentUpdate', ({ component, type }: {component: Component, type: string}) => { - this.#logger.info(`Component ${chalk.bold(component.resolveable)} was ${chalk.bold(Constants.ComponentTypes[type])}.`); // eslint-disable-line no-use-before-define + this.#logger.info(`Component ${chalk.bold(component.resolveable)} was ${chalk.bold(Constants.ComponentTypes[type])}.`); }); this.#eventHooker.hook('guildCreate', (guild: Guild) => @@ -601,7 +603,7 @@ class DiscordClient extends Client async fetchInvite (invite: InviteResolvable, opts?: ClientFetchInviteOptions) { - const code = DataResolver.resolveInviteCode(invite); + const code = resolveInviteCode(invite); const existing = this.#invites.get(code); if (existing && (!existing.expiresTimestamp || existing.expiresTimestamp > Date.now())) return existing; diff --git a/src/client/components/RateLimiter.ts b/src/client/components/RateLimiter.ts index a2417b7..6f64084 100644 --- a/src/client/components/RateLimiter.ts +++ b/src/client/components/RateLimiter.ts @@ -109,9 +109,9 @@ class RateLimiter return; const resolves = [], - rejects = [], - queue = [ ...this.#deleteQueue[channel.id] ], - deleteThese = []; + rejects = [], + queue = [ ...this.#deleteQueue[channel.id] ], + deleteThese = []; const lastDelete = this.#lastDelete[channel.id]; const now = Math.floor(Date.now() / 1000); @@ -198,8 +198,8 @@ class RateLimiter return; const resolves = [], - rejects = [], - queue = [ ...this.#sendQueue[channel.id] ]; + rejects = [], + queue = [ ...this.#sendQueue[channel.id] ]; let sendThis = '', temp = ''; diff --git a/src/client/components/Resolver.ts b/src/client/components/Resolver.ts index 60541e6..303d8d1 100644 --- a/src/client/components/Resolver.ts +++ b/src/client/components/Resolver.ts @@ -74,7 +74,7 @@ class Resolver const string = name.toLowerCase(); const components = this.#client.registry .filter((c) => type === 'any' ? [ 'command', 'setting' ].includes(c.type) : c.type === type) - .filter(exact ? filterExact(string) : filterInexact(string)); // eslint-disable-line no-use-before-define + .filter(exact ? filterExact(string) : filterInexact(string)); return components.size > 0 ? [ ...components.values() ] : []; } diff --git a/src/client/components/commands/administration/Administration.ts b/src/client/components/commands/administration/Administration.ts index 52374cc..2d3c65e 100644 --- a/src/client/components/commands/administration/Administration.ts +++ b/src/client/components/commands/administration/Administration.ts @@ -22,10 +22,10 @@ class AdministrationModule extends SettingsCommand constructor (client: DiscordClient) { super(client, { - name: 'administration', - aliases: [ 'admin' ], + name: 'administration', + aliases: [ 'admin' ], description: 'Configure the administrative settings', - moduleName: 'administration' + moduleName: 'administration' }); } } diff --git a/src/client/components/commands/administration/Import.ts b/src/client/components/commands/administration/Import.ts index 8d3be66..c883956 100644 --- a/src/client/components/commands/administration/Import.ts +++ b/src/client/components/commands/administration/Import.ts @@ -42,33 +42,33 @@ class ImportCommand extends SlashCommand importChoices.push({ name: 'qa', value: 'qa' }); super(client, { - name: 'import', - description: 'Import old settings & modlogs', - moduleName: 'administration', - guildOnly: true, + name: 'import', + description: 'Import old settings & modlogs', + moduleName: 'administration', + guildOnly: true, memberPermissions: [ 'Administrator' ], - options: [{ - name: [ 'settings' ], - type: CommandOptionType.SUB_COMMAND, // 'SUB_COMMAND', + options: [{ + name: [ 'settings' ], + type: CommandOptionType.SUB_COMMAND, // 'SUB_COMMAND', options: [{ - name: 'version', + name: 'version', description: 'Which version do you want to import from', - choices: importChoices + choices: importChoices }] }, { - name: 'modlogs', - type: CommandOptionType.SUB_COMMAND, + name: 'modlogs', + type: CommandOptionType.SUB_COMMAND, options: [{ - name: 'version', + name: 'version', description: 'Which version do you want to import from', - choices: importChoices + choices: importChoices }, { - name: 'overwrite', - description: 'Whether any existing logs should be overwritten by the imports. By default new ones are bumped', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'overwrite', + description: 'Whether any existing logs should be overwritten by the imports. By default new ones are bumped', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }] }], clientPermissions: [ 'ManageWebhooks' ] @@ -111,7 +111,7 @@ class ImportCommand extends SlashCommand if (!MONGODB_QA_HOST || !MONGODB_PASSWORD || !MONGODB_USERNAME) throw new Error('Missing credentials'); const migrator = new InfractionMigrator(this.client, guild, { - host: MONGODB_QA_HOST, + host: MONGODB_QA_HOST, username: MONGODB_USERNAME, password: MONGODB_PASSWORD, database: dbs[version], @@ -166,7 +166,7 @@ class ImportCommand extends SlashCommand if (!MONGODB_QA_HOST || !MONGODB_PASSWORD || !MONGODB_USERNAME) throw new Error('Missing credentials'); const migrator = new SettingsMigrator(this.client, guild, { - host: MONGODB_QA_HOST, + host: MONGODB_QA_HOST, username: MONGODB_USERNAME, password: MONGODB_PASSWORD, database: dbs[version], // Default to v3 diff --git a/src/client/components/commands/administration/Logging.ts b/src/client/components/commands/administration/Logging.ts index 877921f..7e0ec40 100644 --- a/src/client/components/commands/administration/Logging.ts +++ b/src/client/components/commands/administration/Logging.ts @@ -22,9 +22,9 @@ class LoggingModule extends SettingsCommand constructor (client: DiscordClient) { super(client, { - name: 'logging', + name: 'logging', description: 'Configure the logging settings', - moduleName: 'administration' + moduleName: 'administration' }); } } diff --git a/src/client/components/commands/administration/Moderation.ts b/src/client/components/commands/administration/Moderation.ts index 8bf5d28..a06c04d 100644 --- a/src/client/components/commands/administration/Moderation.ts +++ b/src/client/components/commands/administration/Moderation.ts @@ -22,10 +22,10 @@ class ModerationModule extends SettingsCommand constructor (client: DiscordClient) { super(client, { - name: 'moderation', - aliases: [ 'mod' ], + name: 'moderation', + aliases: [ 'mod' ], description: 'Configure the moderation settings', - moduleName: 'administration' + moduleName: 'administration' }); } } diff --git a/src/client/components/commands/administration/Modstats.ts b/src/client/components/commands/administration/Modstats.ts index f9734b2..890bd0d 100644 --- a/src/client/components/commands/administration/Modstats.ts +++ b/src/client/components/commands/administration/Modstats.ts @@ -26,18 +26,18 @@ class ModstatsCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'modstats', - description: 'Aggregate moderation statistics', - moduleName: 'administration', - guildOnly: true, + name: 'modstats', + description: 'Aggregate moderation statistics', + moduleName: 'administration', + guildOnly: true, memberPermissions: [ 'ManageGuild' ], clientPermissions: [ 'AttachFiles' ], - options: [ + options: [ { - name: [ 'after', 'before' ], + name: [ 'after', 'before' ], description: [ 'Count actions AFTER this date', 'Count actions BEFORE this date, can also be "now"' ], - type: CommandOptionType.DATE, - dependsOn: [ 'before', 'after' ] + type: CommandOptionType.DATE, + dependsOn: [ 'before', 'after' ] } ] }); @@ -54,10 +54,10 @@ class ModstatsCommand extends SlashCommand data: { [key: string]: { name: string, [key: string]: number | string } } } = { totals: {}, - time: { - gathered: now, + time: { + gathered: now, rangeStart: 0, - rangeEnd: now + rangeEnd: now }, data: {} }; diff --git a/src/client/components/commands/administration/Permissions.ts b/src/client/components/commands/administration/Permissions.ts index 6660358..ec94423 100644 --- a/src/client/components/commands/administration/Permissions.ts +++ b/src/client/components/commands/administration/Permissions.ts @@ -38,100 +38,100 @@ class PermissionsCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'permissions', - description: 'Manage permissions for users and roles', - moduleName: 'administration', - guildOnly: true, + name: 'permissions', + description: 'Manage permissions for users and roles', + moduleName: 'administration', + guildOnly: true, memberPermissions: [ 'ManageGuild' ], - options: [ + options: [ { - name: [ 'grant', 'revoke' ], + name: [ 'grant', 'revoke' ], description: [ 'Grant the user or role permissions', 'Revoke permissions from the user or role' ], - type: CommandOptionType.SUB_COMMAND, + type: CommandOptionType.SUB_COMMAND, options: [ { - name: 'channel', + name: 'channel', description: 'The channel(s) in which this permission is granted to user or role', - type: CommandOptionType.TEXT_CHANNELS, - dependsOn: [ 'permission' ], - flag: true + type: CommandOptionType.TEXT_CHANNELS, + dependsOn: [ 'permission' ], + flag: true }, { - name: 'role', + name: 'role', description: 'The role(s) to which this permission is granted to', - type: CommandOptionType.ROLES, - dependsOn: [ 'permission' ] + type: CommandOptionType.ROLES, + dependsOn: [ 'permission' ] }, { - name: 'member', + name: 'member', description: 'The member(s) to which this permission is granted to', - type: CommandOptionType.MEMBERS, - dependsOn: [ 'permission' ] + type: CommandOptionType.MEMBERS, + dependsOn: [ 'permission' ] }, { - name: 'permission', - description: 'Which permission(s) to grant', - type: CommandOptionType.STRING, - dependsOn: [ 'member', 'role' ], + name: 'permission', + description: 'Which permission(s) to grant', + type: CommandOptionType.STRING, + dependsOn: [ 'member', 'role' ], dependsOnMode: 'OR' } ] }, { - name: 'list', + name: 'list', description: 'Display a list of permissions, either available or granted', - type: CommandOptionType.SUB_COMMAND + type: CommandOptionType.SUB_COMMAND }, { - name: 'reset', + name: 'reset', description: 'Reset permissions', - type: CommandOptionType.SUB_COMMAND, - options: [ + type: CommandOptionType.SUB_COMMAND, + options: [ { - name: 'channel', + name: 'channel', description: 'The channel(s) to reset', - type: CommandOptionType.CHANNELS, - flag: true + type: CommandOptionType.CHANNELS, + flag: true }, { - name: 'role', + name: 'role', description: 'The role(s) to reset', - type: CommandOptionType.ROLES, + type: CommandOptionType.ROLES, }, { - name: 'member', + name: 'member', description: 'The member(s) to reset', - type: CommandOptionType.MEMBERS, + type: CommandOptionType.MEMBERS, } ] }, { - name: 'show', + name: 'show', description: 'Display granted permissions', - type: CommandOptionType.SUB_COMMAND, - options: [ + type: CommandOptionType.SUB_COMMAND, + options: [ { - name: 'channel', + name: 'channel', description: 'Which permissions are granted in the channel, can be combined with role or member', - type: CommandOptionType.TEXT_CHANNEL, + type: CommandOptionType.TEXT_CHANNEL, }, { - name: 'role', + name: 'role', description: 'Permissions that the role has (takes precedence over member if both are given)', - type: CommandOptionType.ROLE, + type: CommandOptionType.ROLE, }, { - name: 'member', + name: 'member', description: 'Permissions that the member has', - type: CommandOptionType.MEMBER, + type: CommandOptionType.MEMBER, }, { - name: 'permission', + name: 'permission', description: 'Which roles or members have the permission', - type: CommandOptionType.STRING, + type: CommandOptionType.STRING, } ] } @@ -241,9 +241,9 @@ class PermissionsCommand extends SlashCommand return { index: 'COMMAND_PERMISSIONS_DB_ERROR', emoji: 'failure' }; const response: ReplyOptions = { - index: `COMMAND_PERMISSIONS_SUCCESS_${subcommand.name.toUpperCase()}`, + index: `COMMAND_PERMISSIONS_SUCCESS_${subcommand.name.toUpperCase()}`, params: { - targets: targets.map((target) => (target as GuildMember).user?.tag || (target as Role).name).join('**, **'), + targets: targets.map((target) => (target as GuildMember).user?.tag || (target as Role).name).join('**, **'), permissions: parsed.join('`, `') }, emoji: 'success', @@ -251,9 +251,9 @@ class PermissionsCommand extends SlashCommand if (subcommand.name === 'grant' && adminWarning) response.embeds = [{ - title: `${Emojis.warning} Warning`, + title: `${Emojis.warning} Warning`, description: guild.format('COMMAND_PERMISSIONS_WARNING'), - color: 0xffe15c + color: 0xffe15c }]; return response; @@ -294,10 +294,10 @@ class PermissionsCommand extends SlashCommand if (!success) return { index: 'COMMAND_PERMISSIONS_DB_ERROR', emoji: 'failure' }; return { - index: 'COMMAND_PERMISSIONS_RESET', + index: 'COMMAND_PERMISSIONS_RESET', params: { for: targets.length ? invoker.format('COMMAND_PERMISSIONS_RESET_FOR', { targets: targets.map((target) => (target as GuildMember).user?.tag || (target as Role).name).join('**, **') }) : '', - in: channel ? invoker.format('COMMAND_PERMISSIONS_RESET_IN', { channels: channel.asChannels.join(', ') }) : '' + in: channel ? invoker.format('COMMAND_PERMISSIONS_RESET_IN', { channels: channel.asChannels.join(', ') }) : '' }, emoji: 'success' }; @@ -321,14 +321,14 @@ class PermissionsCommand extends SlashCommand if (targetPerms) { fields.push({ - name: invoker.format('COMMAND_PERMISSIONS_GLOBAL_PERMS'), + name: invoker.format('COMMAND_PERMISSIONS_GLOBAL_PERMS'), value: `\`${targetPerms.global.join('`, `')}\`` }); const channels = channel ? channel.asChannels : await guild.resolveChannels(Object.keys(targetPerms.channels)); for (const ch of channels) { fields.push({ - name: `#${ch.name}`, + name: `#${ch.name}`, value: `\`${targetPerms.channels[ch.id].join('`, `')}\`` }); } @@ -336,7 +336,7 @@ class PermissionsCommand extends SlashCommand else { fields.push({ - name: (target as Role).name || (target as GuildMember).user.tag, + name: (target as Role).name || (target as GuildMember).user.tag, value: guild.format('COMMAND_PERMISSIONS_NO_PERMS') }); } @@ -359,7 +359,7 @@ class PermissionsCommand extends SlashCommand if (!t) t = await guild.resolveRole(targetId); fields.push({ - name: `${(t as User).tag ?? (t as Role).name ?? targetId}`, + name: `${(t as User).tag ?? (t as Role).name ?? targetId}`, value: `\`${perms.channels[ch].join('`, `')}\`` }); } @@ -413,12 +413,12 @@ class PermissionsCommand extends SlashCommand } if (users.length) fields.push({ - name: 'User permissions', + name: 'User permissions', value: users.join(', ') }); if (roles.length) fields.push({ - name: 'Role permissions', + name: 'Role permissions', value: roles.join(', ') }); } @@ -476,8 +476,8 @@ class PermissionsCommand extends SlashCommand const embed: APIEmbed = { // eslint-disable-next-line no-undefined description: target ? invoker.format('COMMAND_PERMISSIONS_DESC', { target: (target as GuildMember).user?.tag || (target as Role).name || 'any', forin: invoker.format('FOR_IN_TOGGLE', { toggle: (target as GuildBasedChannel).type === undefined }, { code: true }) }) : '', - title: invoker.format('COMMAND_PERMISSIONS_SHOW_TITLE'), - fields: [ ] + title: invoker.format('COMMAND_PERMISSIONS_SHOW_TITLE'), + fields: [ ] }; if (fields.length) diff --git a/src/client/components/commands/administration/Settings.ts b/src/client/components/commands/administration/Settings.ts index 1abacc3..e3969c7 100644 --- a/src/client/components/commands/administration/Settings.ts +++ b/src/client/components/commands/administration/Settings.ts @@ -27,23 +27,23 @@ class SettingsCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'settings', - moduleName: 'administration', + name: 'settings', + moduleName: 'administration', description: 'View settings', - options: [ + options: [ // Probably add reset options here too { - name: 'list', + name: 'list', description: 'List available settings', - type: CommandOptionType.SUB_COMMAND + type: CommandOptionType.SUB_COMMAND }, { - name: 'current', + name: 'current', description: 'Display ALL current configurations (big embed)', - type: CommandOptionType.SUB_COMMAND + type: CommandOptionType.SUB_COMMAND }, { - name: 'export', + name: 'export', description: 'Display ALL current configurations (big embed)', - type: CommandOptionType.SUB_COMMAND + type: CommandOptionType.SUB_COMMAND } ], memberPermissions: [ 'ManageGuild' ] @@ -74,16 +74,16 @@ class SettingsCommand extends SlashCommand }, {} as {[key: string]: string[]}); const embed: APIEmbed = { - title: 'Settings', + title: 'Settings', description: invoker.format('SETTINGS_LIST'), - fields: [] + fields: [] }; const entries = Object.entries(modules); for (const [ module, values ] of entries) embed.fields!.push({ - name: Util.capitalise(module), - value: `\`${values.join('`\n`')}\``, + name: Util.capitalise(module), + value: `\`${values.join('`\n`')}\``, inline: true }); @@ -105,7 +105,7 @@ class SettingsCommand extends SlashCommand if (!settingFields.length) continue; let _field = { - name: `**__${setting.name.toUpperCase()}__**`, + name: `**__${setting.name.toUpperCase()}__**`, value: '' }; for (const field of settingFields) @@ -117,7 +117,7 @@ class SettingsCommand extends SlashCommand { fields.push(_field); _field = { - name: ZeroWidthChar, + name: ZeroWidthChar, value: '' }; } diff --git a/src/client/components/commands/administration/Utility.ts b/src/client/components/commands/administration/Utility.ts index b601204..d943763 100644 --- a/src/client/components/commands/administration/Utility.ts +++ b/src/client/components/commands/administration/Utility.ts @@ -22,9 +22,9 @@ class UtilityModule extends SettingsCommand constructor (client: DiscordClient) { super(client, { - name: 'utility', + name: 'utility', description: 'Configure the utility settings', - moduleName: 'administration' + moduleName: 'administration' }); } diff --git a/src/client/components/commands/developer/Botban.ts b/src/client/components/commands/developer/Botban.ts index 9dc6d55..9c1883d 100644 --- a/src/client/components/commands/developer/Botban.ts +++ b/src/client/components/commands/developer/Botban.ts @@ -25,11 +25,11 @@ class BotbanCommand extends Command constructor (client: DiscordClient) { super(client, { - name: 'botban', - aliases: [ 'bban' ], + name: 'botban', + aliases: [ 'bban' ], restricted: true, moduleName: 'developer', - options: [ + options: [ { name: 'users', type: CommandOptionType.USERS }, { name: 'guild', type: CommandOptionType.STRING }, { name: 'unban', type: CommandOptionType.BOOLEAN, flag: true, defaultValue: true, valueOptional: true } diff --git a/src/client/components/commands/developer/Debug.ts b/src/client/components/commands/developer/Debug.ts index 24a3f55..90c1c36 100644 --- a/src/client/components/commands/developer/Debug.ts +++ b/src/client/components/commands/developer/Debug.ts @@ -24,13 +24,13 @@ class DebugCommand extends Command constructor (client: DiscordClient) { super(client, { - name: 'debug', + name: 'debug', restricted: true, moduleName: 'developer', - options: [ + options: [ { - name: [ 'enable', 'disable' ], - type: CommandOptionType.SUB_COMMAND, + name: [ 'enable', 'disable' ], + type: CommandOptionType.SUB_COMMAND, options: [ { name: 'guild', required: true }, ] diff --git a/src/client/components/commands/developer/Eval.ts b/src/client/components/commands/developer/Eval.ts index c1d70ed..299685b 100644 --- a/src/client/components/commands/developer/Eval.ts +++ b/src/client/components/commands/developer/Eval.ts @@ -31,13 +31,13 @@ class EvalCommand extends Command constructor (client: DiscordClient) { super(client, { - name: 'eval', - aliases: [ 'e', 'evaluate' ], + name: 'eval', + aliases: [ 'e', 'evaluate' ], restricted: true, moduleName: 'developer', - options: [ + options: [ { name: 'code', required: true }, - { name: 'async', flag: true, valueOptional: true, defaultValue: true, type: CommandOptionType.BOOLEAN } + { name: 'async', aliases: [ 'a' ], flag: true, valueOptional: true, defaultValue: true, type: CommandOptionType.BOOLEAN } ] }); } @@ -75,7 +75,7 @@ class EvalCommand extends Command } response = { content: `Evaluation was successful.\`\`\`js\n${hide?.asBool ? '' : evaled}\`\`\``, - emoji: 'success' + emoji: 'success' }; } catch (err) @@ -88,7 +88,7 @@ class EvalCommand extends Command msg = `${msg.substring(0, 1900)}...`; response = { content: `Evaluation failed.\`\`\`js\n${hide?.asBool ? '' : msg}\`\`\``, - emoji: 'failure' + emoji: 'failure' }; } diff --git a/src/client/components/commands/developer/Stats.ts b/src/client/components/commands/developer/Stats.ts index d5e7098..5e3d06a 100644 --- a/src/client/components/commands/developer/Stats.ts +++ b/src/client/components/commands/developer/Stats.ts @@ -27,15 +27,15 @@ class StatsCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'stats', - moduleName: 'developer', - aliases: [ ], - description: 'Statistics about the bot', + name: 'stats', + moduleName: 'developer', + aliases: [ ], + description: 'Statistics about the bot', // restricted: true, - options: [ ], + options: [ ], clientPermissions: [ 'SendMessages', 'EmbedLinks' ], - showUsage: false, - archivable: false + showUsage: false, + archivable: false }); } @@ -51,11 +51,11 @@ class StatsCommand extends SlashCommand const evalFunc = (client: Client) => { return { - users: client.users.cache.size, - guilds: client.guilds.cache.size, + users: client.users.cache.size, + guilds: client.guilds.cache.size, channels: client.channels.cache.size, - memory: Math.floor(process.memoryUsage().heapUsed / 1024 / 1024), - uptime: client.uptime + memory: Math.floor(process.memoryUsage().heapUsed / 1024 / 1024), + uptime: client.uptime }; }; @@ -75,19 +75,19 @@ class StatsCommand extends SlashCommand // Manager values const mainValues = { - uptime: Util.humanise(Math.floor(managerResult.uptime / 1000)), - memory: managerResult.memory, - shards: shard.count, + uptime: Util.humanise(Math.floor(managerResult.uptime / 1000)), + memory: managerResult.memory, + shards: shard.count, library: version }; // Current shard const shardValues = { cachedUsers: this.client.users.cache.size, - guilds: this.client.guilds.cache.size, - channels: this.client.channels.cache.size, - uptime: Util.humanise(Math.floor(this.client.uptime! / 1000)), - memory: Math.floor(process.memoryUsage().heapUsed / 1024 / 1024) + guilds: this.client.guilds.cache.size, + channels: this.client.channels.cache.size, + uptime: Util.humanise(Math.floor(this.client.uptime! / 1000)), + memory: Math.floor(process.memoryUsage().heapUsed / 1024 / 1024) }; // Compile shard data @@ -115,13 +115,13 @@ class StatsCommand extends SlashCommand { return owners.map((o) => o.tag).join(', '); }), - cpu: CPU[0].model, - cores: CPU.length, - memoryUsed: (memoryTotal - memoryFree).toFixed(2), + cpu: CPU[0].model, + cores: CPU.length, + memoryUsed: (memoryTotal - memoryFree).toFixed(2), memoryTotal: memoryTotal.toFixed(2), - osType: os.type(), - uptime: Util.humanise(os.uptime()), - hostname: os.hostname() + osType: os.type(), + uptime: Util.humanise(os.uptime()), + hostname: os.hostname() }; // Command statistics - probably expand this further @@ -130,12 +130,12 @@ class StatsCommand extends SlashCommand const client = c as DiscordClient; const { commands } = client.registry; const values: {[key: string]: number} = { - invokes: commands.reduce((acc, cmd) => acc + cmd.invokes.success + cmd.invokes.fail, 0), - success: commands.reduce((acc, cmd) => acc + cmd.invokes.success, 0), - fail: commands.reduce((acc, cmd) => acc + cmd.invokes.fail, 0), + invokes: commands.reduce((acc, cmd) => acc + cmd.invokes.success + cmd.invokes.fail, 0), + success: commands.reduce((acc, cmd) => acc + cmd.invokes.success, 0), + fail: commands.reduce((acc, cmd) => acc + cmd.invokes.fail, 0), successExecTime: Math.round(commands.reduce((acc, cmd) => acc + cmd.invokes.successTime, 0) / commands.size), - failExecTime: Math.round(commands.reduce((acc, cmd) => acc + cmd.invokes.failTime, 0) / commands.size), - avgTime: 0 + failExecTime: Math.round(commands.reduce((acc, cmd) => acc + cmd.invokes.failTime, 0) / commands.size), + avgTime: 0 }; values.avgTime = Math.round((values.successExecTime * values.success + values.failExecTime * values.fail) / values.invokes); return values; @@ -159,29 +159,29 @@ class StatsCommand extends SlashCommand const embed = { title: invoker.format('COMMAND_STATS_TITLE', { - client: this.client.user!.tag, + client: this.client.user!.tag, version: this.client.version }), description: invoker.format('COMMAND_STATS_SYSTEM_VALUE', sysInfo), - fields: [ + fields: [ { - name: invoker.format('COMMAND_STATS_MAIN'), - value: invoker.format('COMMAND_STATS_MAIN_VALUE', mainValues), + name: invoker.format('COMMAND_STATS_MAIN'), + value: invoker.format('COMMAND_STATS_MAIN_VALUE', mainValues), inline: true }, { - name: invoker.format('COMMAND_STATS_CURRENT_SHARD', { shard: this.client.shardId }), - value: invoker.format('COMMAND_STATS_CURRENT_SHARDS_VALUE', shardValues), + name: invoker.format('COMMAND_STATS_CURRENT_SHARD', { shard: this.client.shardId }), + value: invoker.format('COMMAND_STATS_CURRENT_SHARDS_VALUE', shardValues), inline: true }, { - name: invoker.format('COMMAND_STATS_TOTAL'), - value: invoker.format('COMMAND_STATS_TOTAL_VALUE', totalValues), + name: invoker.format('COMMAND_STATS_TOTAL'), + value: invoker.format('COMMAND_STATS_TOTAL_VALUE', totalValues), inline: true }, { - name: invoker.format('COMMAND_STATS_COMMANDS'), - value: invoker.format('COMMAND_STATS_COMMANDS_VALUE', commandValues), + name: invoker.format('COMMAND_STATS_COMMANDS'), + value: invoker.format('COMMAND_STATS_COMMANDS_VALUE', commandValues), inline: true } ] @@ -192,16 +192,16 @@ class StatsCommand extends SlashCommand // Mongo DB const stats = await this.client.mongodb.stats(); const dbStats = { - db: stats.db, + db: stats.db, collections: stats.collections, - objects: stats.objects, - avgObjSize: (stats.avgObjSize / 1024 / 1024).toFixed(1), - totalSize: (stats.dataSize / 1024 / 1024 / 1024).toFixed(2) + objects: stats.objects, + avgObjSize: (stats.avgObjSize / 1024 / 1024).toFixed(1), + totalSize: (stats.dataSize / 1024 / 1024 / 1024).toFixed(2) }; embed.fields.push({ - name: invoker.format('COMMAND_STATS_MONGODB'), - value: invoker.format('COMMAND_STATS_MONGODB_VALUE', dbStats), + name: invoker.format('COMMAND_STATS_MONGODB'), + value: invoker.format('COMMAND_STATS_MONGODB_VALUE', dbStats), inline: true }); @@ -210,7 +210,7 @@ class StatsCommand extends SlashCommand { let msg = 0, mem = 0; - // eslint-disable-next-line no-return-assign + client.channels.cache.forEach((c) => { msg += (c as TextChannel).messages?.cache.size || 0; @@ -221,7 +221,7 @@ class StatsCommand extends SlashCommand }); return { cachedMessages: msg, - cachedMembers: mem + cachedMembers: mem } as {[key: string]: number}; }; const result = await shard.broadcastEval(evalFunc2).catch((error) => this.client.logger.error(error.stack)); @@ -241,8 +241,8 @@ class StatsCommand extends SlashCommand other.messageAvg = Math.floor(other.cachedMessages / shard.count); embed.fields.push({ - name: invoker.format('COMMAND_STATS_CACHE'), - value: invoker.format('COMMAND_STATS_CACHE_VALUE', other), + name: invoker.format('COMMAND_STATS_CACHE'), + value: invoker.format('COMMAND_STATS_CACHE_VALUE', other), inline: true }); } diff --git a/src/client/components/commands/information/Commands.ts b/src/client/components/commands/information/Commands.ts index 31876f7..b8afabe 100644 --- a/src/client/components/commands/information/Commands.ts +++ b/src/client/components/commands/information/Commands.ts @@ -30,12 +30,12 @@ class Commands extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'commands', - moduleName: 'information', + name: 'commands', + moduleName: 'information', description: 'List commands', - options: [{ - name: [ 'module' ], - type: CommandOptionType.MODULE, + options: [{ + name: [ 'module' ], + type: CommandOptionType.MODULE, description: [ 'List commands from a specific module' ] }], memberPermissions: [], @@ -72,15 +72,15 @@ class Commands extends SlashCommand } const embed: APIEmbed = { - title: invoker.format('COMMAND_COMMANDS_TITLE'), + title: invoker.format('COMMAND_COMMANDS_TITLE'), fields: [], footer: { text: `• ${amt} commands` } }; for (const [ mod, cmds ] of Object.entries(modules).sort(([ , a ], [ , b ]) => a.length - b.length)) { embed.fields!.push({ - name: Util.capitalise(mod), - value: cmds.join('\n'), + name: Util.capitalise(mod), + value: cmds.join('\n'), inline: true }); } diff --git a/src/client/components/commands/information/Guild.ts b/src/client/components/commands/information/Guild.ts index b356255..3787586 100644 --- a/src/client/components/commands/information/Guild.ts +++ b/src/client/components/commands/information/Guild.ts @@ -24,10 +24,10 @@ class GuildCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'server', + name: 'server', description: 'Display server related information', - guildOnly: true, - moduleName: 'information' + guildOnly: true, + moduleName: 'information' }); } @@ -46,11 +46,11 @@ class GuildCommand extends SlashCommand privateThread = 0; const createdAt = ` ()`, - description = guild.description || wrapper._settings.indexing.description || invoker.format('COMMAND_GUILD_NODESC'), - maxMembers = guild.maximumMembers ?? 'N/A', - maxPresences = guild.maximumPresences ?? 'N/A', - approxPresences = guild.approximatePresenceCount ?? 'N/A', - { memberCount } = guild; + description = guild.description || wrapper._settings.indexing.description || invoker.format('COMMAND_GUILD_NODESC'), + maxMembers = guild.maximumMembers ?? 'N/A', + maxPresences = guild.maximumPresences ?? 'N/A', + approxPresences = guild.approximatePresenceCount ?? 'N/A', + { memberCount } = guild; for (const channel of guild.channels.cache.values()) { @@ -73,19 +73,19 @@ class GuildCommand extends SlashCommand const embed = { description: invoker.format('COMMAND_GUILD_TEMPLATE', { - name: guild.name, + name: guild.name, description, - owner: guild.ownerId, - id: guild.id, - shard: guild.shardId, + owner: guild.ownerId, + id: guild.id, + shard: guild.shardId, createdAt, // region: guild.region, boosters: guild.premiumSubscriptionCount ?? 0, - tier: guild.premiumTier + tier: guild.premiumTier }), fields: [ { - name: invoker.format('COMMAND_GUILD_MEMBERS_NAME'), + name: invoker.format('COMMAND_GUILD_MEMBERS_NAME'), value: invoker.format('COMMAND_GUILD_MEMBERS', { memberCount, maxMembers, @@ -95,26 +95,26 @@ class GuildCommand extends SlashCommand inline: true }, { - name: invoker.format('COMMAND_GUILD_CHANNELS_NAME'), + name: invoker.format('COMMAND_GUILD_CHANNELS_NAME'), value: invoker.format('COMMAND_GUILD_CHANNELS', { vc, tc, cat, - publicThread: publicThread > 0 ? invoker.format('COMMAND_GUILD_PUBLIC_THREAD', { publicThread }) : '', + publicThread: publicThread > 0 ? invoker.format('COMMAND_GUILD_PUBLIC_THREAD', { publicThread }) : '', privateThread: privateThread > 0 ? invoker.format('COMMAND_GUILD_PRIVATE_THREAD') : '', - news: news > 0 ? invoker.format('COMMAND_GUILD_NEWS', { news }) : '', - newsThread: newsThread > 0 ? invoker.format('COMMAND_GUILD_NEWS_THREAD', { newsThread }) : '', + news: news > 0 ? invoker.format('COMMAND_GUILD_NEWS', { news }) : '', + newsThread: newsThread > 0 ? invoker.format('COMMAND_GUILD_NEWS_THREAD', { newsThread }) : '', totalChannels }), inline: true }, { - name: invoker.format('COMMAND_GUILD_OTHER_NAME'), + name: invoker.format('COMMAND_GUILD_OTHER_NAME'), value: invoker.format('COMMAND_GUILD_OTHER', { - roleCount: guild.roles.cache.size, - emojiCount: guild.emojis.cache.filter((e) => !e.animated).size, + roleCount: guild.roles.cache.size, + emojiCount: guild.emojis.cache.filter((e) => !e.animated).size, gifEmojiCount: guild.emojis.cache.filter((e) => e.animated).size, - emojiTotal: 50 + 50 * guild.premiumTier + emojiTotal: 50 + 50 * guild.premiumTier }), inline: true } @@ -129,7 +129,7 @@ class GuildCommand extends SlashCommand if (guild.features.length) embed.fields.push({ - name: invoker.format('COMMAND_GUILD_FEATURES_NAME'), + name: invoker.format('COMMAND_GUILD_FEATURES_NAME'), value: invoker.format('COMMAND_GUILD_FEATURES', { features: guild.features.join(', ') }), diff --git a/src/client/components/commands/information/Help.ts b/src/client/components/commands/information/Help.ts index a285a8b..6b959ea 100644 --- a/src/client/components/commands/information/Help.ts +++ b/src/client/components/commands/information/Help.ts @@ -25,14 +25,14 @@ class HelpCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'help', + name: 'help', description: 'Display command/setting usage & general bot help', - moduleName: 'information', - options: [ + moduleName: 'information', + options: [ { - name: 'component', + name: 'component', description: 'The command or setting to display', - type: CommandOptionType.COMPONENT + type: CommandOptionType.COMPONENT } ] }); diff --git a/src/client/components/commands/information/Info.ts b/src/client/components/commands/information/Info.ts index 7c838f5..09e86bc 100644 --- a/src/client/components/commands/information/Info.ts +++ b/src/client/components/commands/information/Info.ts @@ -29,17 +29,17 @@ const Constants: { } } = { Badges: { - Staff: Emojis['discord-staff'], - Partner: Emojis['discord-partner'], - Hypesquad: Emojis['hypesquad-events'], - BugHunterLevel1: Emojis['bughunter'], // eslint-disable-line dot-notation - BugHunterLevel2: Emojis['bughunter-gold'], + Staff: Emojis['discord-staff'], + Partner: Emojis['discord-partner'], + Hypesquad: Emojis['hypesquad-events'], + BugHunterLevel1: Emojis['bughunter'], // eslint-disable-line dot-notation + BugHunterLevel2: Emojis['bughunter-gold'], HypeSquadOnlineHouse1: Emojis['hypesquad-bravery'], HypeSquadOnlineHouse2: Emojis['hypesquad-brilliance'], HypeSquadOnlineHouse3: Emojis['hypesquad-balance'], PremiumEarlySupporter: Emojis['early-supporter'], - VerifiedDeveloper: Emojis['bot-developer'], - CertifiedModerator: Emojis['certified-moderator'] + VerifiedDeveloper: Emojis['bot-developer'], + CertifiedModerator: Emojis['certified-moderator'] } }; @@ -48,13 +48,13 @@ class InformationCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'info', + name: 'info', description: 'Display information about a discord structure', - moduleName: 'information', - options: [ + moduleName: 'information', + options: [ { - name: [ 'user', 'role', 'channel' ], - type: [ CommandOptionType.USER, CommandOptionType.ROLE, CommandOptionType.CHANNEL ], + name: [ 'user', 'role', 'channel' ], + type: [ CommandOptionType.USER, CommandOptionType.ROLE, CommandOptionType.CHANNEL ], description: [ 'The user to look up', 'The role to look up', 'The channel to look up' ] } ] @@ -109,12 +109,12 @@ class InformationCommand extends SlashCommand }, ''); const userField = { - name: invoker.format('COMMAND_INFO_USER_DATA_NAME'), + name: invoker.format('COMMAND_INFO_USER_DATA_NAME'), value: invoker.format('COMMAND_INFO_USER_DATA', { - id: user.id, - bot: user.bot ? ` ${Emojis.bot}` : '', + id: user.id, + bot: user.bot ? ` ${Emojis.bot}` : '', created: ` ()`, - status: member?.presence?.status || 'N/A', + status: member?.presence?.status || 'N/A', // globalActivity: user.lastMessage ? user.lastMessage.createdAt.toDateString() : 'N/A' }), inline: true @@ -131,18 +131,18 @@ class InformationCommand extends SlashCommand if (activities.length) response.fields!.push({ - name: invoker.format('COMMAND_INFO_USER_ACTIVITIES'), - value: activity, + name: invoker.format('COMMAND_INFO_USER_ACTIVITIES'), + value: activity, inline: true }); if (member) { const memberField = { - name: invoker.format('COMMAND_INFO_MEMBER_NAME'), + name: invoker.format('COMMAND_INFO_MEMBER_NAME'), value: invoker.format('COMMAND_INFO_MEMBER', { nickname: member.nickname ? member.nickname : 'N/A', - joined: member.joinedTimestamp ? ` ()` : 'N/A', + joined: member.joinedTimestamp ? ` ()` : 'N/A', // serverActivity: member.lastMessage ? member.lastMessage.createdAt.toDateString() : 'N/A' }) }; @@ -176,11 +176,11 @@ class InformationCommand extends SlashCommand const _members = await guild.members.fetch(); const members = _members.filter((member) => member.roles.cache.has(role.id)); const embed: APIEmbed = { - title: role.name, + title: role.name, description: invoker.format('COMMAND_INFO_ROLE', { created: ` ()`, // `${role.createdAt.toDateString()} (${Util.timeAgo(role.createdTimestamp / 1000)})`, members: members.size, - colour: role.hexColor + colour: role.hexColor }), footer: { text: invoker.format('COMMAND_INFO_ROLE_ID', { id: role.id }) @@ -209,10 +209,10 @@ class InformationCommand extends SlashCommand throw new CommandError(invoker, { index: 'ERR_MISSING_PERMISSIONS' }); const embed = { - title: channel.name, + title: channel.name, description: invoker.format('COMMAND_INFO_CHANNEL_BASE', { created: channel.createdTimestamp ? ` ()` : 'N/A', - type: channel.type + type: channel.type }), footer: { text: invoker.format('COMMAND_INFO_CHANNEL_ID', { id: channel.id }) @@ -225,7 +225,7 @@ class InformationCommand extends SlashCommand const messages = ch.messages.cache; const now = Date.now(); const rates = { - '5': messages.filter((msg) => msg.createdTimestamp > now - 5 * 60 * 1000).size, + '5': messages.filter((msg) => msg.createdTimestamp > now - 5 * 60 * 1000).size, '10': messages.filter((msg) => msg.createdTimestamp > now - 10 * 60 * 1000).size, '30': messages.filter((msg) => msg.createdTimestamp > now - 30 * 60 * 1000).size }; @@ -236,7 +236,7 @@ class InformationCommand extends SlashCommand ({ threads } = result); } const activeThreads = threads?.filter((thread) => !thread.archived).size ?? 0, - archivedThreads = threads?.filter((thread) => thread.archived).size ?? 0; + archivedThreads = threads?.filter((thread) => thread.archived).size ?? 0; embed.description += '\n' + invoker.format('COMMAND_INFO_CHANNEL_ADDON', { ...rates, activeThreads, diff --git a/src/client/components/commands/information/Privacy.ts b/src/client/components/commands/information/Privacy.ts index af558a5..197e132 100644 --- a/src/client/components/commands/information/Privacy.ts +++ b/src/client/components/commands/information/Privacy.ts @@ -24,16 +24,16 @@ class PrivacyCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'privacy', + name: 'privacy', description: 'The bot\'s privacy policy', - moduleName: 'information' + moduleName: 'information' }); } async execute (invoker: InvokerWrapper) { return new EmbedBuilder({ - title: invoker.format('COMMAND_PRIVACY_TITLE'), + title: invoker.format('COMMAND_PRIVACY_TITLE'), description: invoker.format('COMMAND_PRIVACY_POLICY') }); diff --git a/src/client/components/commands/moderation/Ban.ts b/src/client/components/commands/moderation/Ban.ts index b99c9bc..3891770 100644 --- a/src/client/components/commands/moderation/Ban.ts +++ b/src/client/components/commands/moderation/Ban.ts @@ -26,34 +26,34 @@ class BanCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'ban', + name: 'ban', description: 'Ban users', - moduleName: 'moderation', - options: [ + moduleName: 'moderation', + options: [ { - name: 'duration', + name: 'duration', description: 'How long the user should be banned for', - type: CommandOptionType.TIME + type: CommandOptionType.TIME }, { - name: 'days', - type: CommandOptionType.INTEGER, + name: 'days', + type: CommandOptionType.INTEGER, description: 'How many days worth of messages to prune', - minimum: 1, - maximum: 7, - flag: true + minimum: 1, + maximum: 7, + flag: true }, { - name: 'users', - type: CommandOptionType.USERS, + name: 'users', + type: CommandOptionType.USERS, description: 'Target users', - required: true, - strict: true + required: true, + strict: true } ], - showUsage: true, - guildOnly: true, + showUsage: true, + guildOnly: true, memberPermissions: [ 'BanMembers' ], clientPermissions: [ 'BanMembers' ], - skipOptions: [ 'prune' ] + skipOptions: [ 'prune' ] }); } diff --git a/src/client/components/commands/moderation/Case.ts b/src/client/components/commands/moderation/Case.ts index 9a3919e..e78f8b7 100644 --- a/src/client/components/commands/moderation/Case.ts +++ b/src/client/components/commands/moderation/Case.ts @@ -29,31 +29,31 @@ class CaseCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'case', + name: 'case', description: 'View case details', - moduleName: 'moderation', - options: [{ - name: 'id', - type: CommandOptionType.INTEGER, + moduleName: 'moderation', + options: [{ + name: 'id', + type: CommandOptionType.INTEGER, description: 'Case ID', - minimum: 0, - required: true + minimum: 0, + required: true }, { - name: [ 'raw', 'verbose', 'changes', 'delete' ], // - type: CommandOptionType.BOOLEAN, + name: [ 'raw', 'verbose', 'changes', 'delete' ], // + type: CommandOptionType.BOOLEAN, description: [ 'Print out raw infraction data in JSON form', 'Print out more detailed information about the case', 'List changes to the case', 'Delete the case' ], - dependsOn: [ 'id' ], - flag: true, + dependsOn: [ 'id' ], + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }], - guildOnly: true, - showUsage: true, + guildOnly: true, + showUsage: true, clientPermissions: [ 'ManageMessages' ], memberPermissions: [ 'ManageMessages' ] }); @@ -103,20 +103,20 @@ class CaseCommand extends SlashCommand } const { json } = infraction; let description = invoker.format(index, { - uniqueID: infraction.id, - type: infraction.type, - date: ``, - unix: Math.floor(infraction.timestamp / 1000), - relativeTime: ``, + uniqueID: infraction.id, + type: infraction.type, + date: ``, + unix: Math.floor(infraction.timestamp / 1000), + relativeTime: ``, relativeTimeSeconds: Math.floor((Date.now() - infraction.timestamp) / 1000), - target: infraction.targetType === 'USER' ? invoker.format(targetUserIndex, { target: (target as User).tag, targetID: target!.id }) : invoker.format(targetChannelIndex, { target: (target as GuildChannel).name, targetID: target!.id }), - staff: staff?.tag??'N/A', - staffID: staff?.id??'N/A', - nrChanges: json.changes?.length || 0, - changes: json.changes?.map((change) => change.type).join(', ') || 'N/A', - guild: guild.id, - channel: json.channel, - message: json.message + target: infraction.targetType === 'USER' ? invoker.format(targetUserIndex, { target: (target as User).tag, targetID: target!.id }) : invoker.format(targetChannelIndex, { target: (target as GuildChannel).name, targetID: target!.id }), + staff: staff?.tag??'N/A', + staffID: staff?.id??'N/A', + nrChanges: json.changes?.length || 0, + changes: json.changes?.map((change) => change.type).join(', ') || 'N/A', + guild: guild.id, + channel: json.channel, + message: json.message }); if (infraction.data?.seconds) @@ -129,7 +129,7 @@ class CaseCommand extends SlashCommand if (guild._settings.modpoints.enabled) description += '\n' + invoker.format('COMMAND_CASE_MODPOINTS', { - points: infraction.points, + points: infraction.points, expires: json.expiration ? `` : false }); @@ -159,10 +159,10 @@ class CaseCommand extends SlashCommand const staff = await this.client.resolver.resolveUser(change.staff); const field = { - name: change.type, + name: change.type, value: invoker.format('COMMAND_CASE_CHANGE_BASE', { - staff: staff?.tag??'N/A', - date: new Date(change.timestamp).toUTCString(), + staff: staff?.tag??'N/A', + date: new Date(change.timestamp).toUTCString(), timeAgo: `` }) }; diff --git a/src/client/components/commands/moderation/Dehoist.ts b/src/client/components/commands/moderation/Dehoist.ts index 713c0b9..5122128 100644 --- a/src/client/components/commands/moderation/Dehoist.ts +++ b/src/client/components/commands/moderation/Dehoist.ts @@ -27,13 +27,13 @@ class DehoistCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'dehoist', - description: 'Removes hoisting characters from users\' display names', - moduleName: 'moderation', - options: [ ], + name: 'dehoist', + description: 'Removes hoisting characters from users\' display names', + moduleName: 'moderation', + options: [ ], memberPermissions: [ 'ManageNicknames' ], clientPermissions: [ 'ManageNicknames' ], - guildOnly: true + guildOnly: true }); } @@ -48,7 +48,7 @@ class DehoistCommand extends ModerationCommand return this.client.moderation.handleInfraction(Nickname, invoker, { targets: wrappers.filter(Boolean) as MemberWrapper[], args, - data: { + data: { dehoist: true } }); diff --git a/src/client/components/commands/moderation/Edit.ts b/src/client/components/commands/moderation/Edit.ts index bd98705..a2112f3 100644 --- a/src/client/components/commands/moderation/Edit.ts +++ b/src/client/components/commands/moderation/Edit.ts @@ -29,32 +29,32 @@ class EditCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'edit', - description: 'Edit case data', - moduleName: 'moderation', - showUsage: true, - guildOnly: true, + name: 'edit', + description: 'Edit case data', + moduleName: 'moderation', + showUsage: true, + guildOnly: true, memberPermissions: [ 'ManageMessages' ], - options: [{ - name: 'case', - type: CommandOptionType.INTEGER, + options: [{ + name: 'case', + type: CommandOptionType.INTEGER, description: 'Case ID (Integer)', - required: true, - minimum: 0 + required: true, + minimum: 0 }, { - name: 'reason', + name: 'reason', description: 'Give "long" as a reason to instead enter through a prompt to bypass length limit', - type: CommandOptionType.STRING, + type: CommandOptionType.STRING, }, { - name: 'points', - type: CommandOptionType.INTEGER, + name: 'points', + type: CommandOptionType.INTEGER, description: 'New point value for case', - minimum: 0, - maximum: 100, - flag: true + minimum: 0, + maximum: 100, + flag: true }, { - name: [ 'expiration', 'duration' ], - type: CommandOptionType.TIME, + name: [ 'expiration', 'duration' ], + type: CommandOptionType.TIME, description: [ 'New expiration for points, starts from the time the infraction was issued', 'Duration if the infraction is timed' diff --git a/src/client/components/commands/moderation/History.ts b/src/client/components/commands/moderation/History.ts index e67a6f5..b3dddc9 100644 --- a/src/client/components/commands/moderation/History.ts +++ b/src/client/components/commands/moderation/History.ts @@ -26,8 +26,8 @@ import { APIEmbed, AttachmentBuilder, GuildChannel, User } from 'discord.js'; import { Filter } from 'mongodb'; const Constants = { - PageSize: 10, - MaxCharacters: 256, + PageSize: 10, + MaxCharacters: 256, MaxCharactersVerbose: 128 // Displays more information in the field, decreases characters. }; @@ -36,65 +36,65 @@ class HistoryCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'history', - description: 'List past infractions', - moduleName: 'moderation', + name: 'history', + description: 'List past infractions', + moduleName: 'moderation', memberPermissions: [ 'ManageMessages' ], clientPermissions: [ 'EmbedLinks' ], - guildOnly: true, - options: [{ - name: [ 'before', 'after' ], - type: CommandOptionType.DATE, + guildOnly: true, + options: [{ + name: [ 'before', 'after' ], + type: CommandOptionType.DATE, description: 'Filter by a date, must be in YYYY/MM/DD or YYYY-MM-DD format', - flag: true + flag: true }, { - name: [ 'verbose', 'oldest', 'export', 'private' ], + name: [ 'verbose', 'oldest', 'export', 'private' ], description: [ 'Show more infromation about the listed infractions', 'Show oldest infraction first', 'Export the list of infractions', 'DM the command response' ], - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'type', + name: 'type', description: 'Filter infractions by type', - choices: Infractions.map((inf) => + choices: Infractions.map((inf) => { return { name: inf.toLowerCase(), value: inf }; }), flag: true }, { - name: 'pagesize', - description: 'Amount of infractions to list per page', - type: CommandOptionType.INTEGER, - flag: true, - maximum: 25, - minimum: 1, + name: 'pagesize', + description: 'Amount of infractions to list per page', + type: CommandOptionType.INTEGER, + flag: true, + maximum: 25, + minimum: 1, defaultValue: 10 }, { - name: 'page', + name: 'page', description: 'Page to select', - type: CommandOptionType.INTEGER, - minimum: 1, - flag: true, + type: CommandOptionType.INTEGER, + minimum: 1, + flag: true, }, { - name: 'user', + name: 'user', description: 'User whose infractions to query, overrides channel if both are given', - type: CommandOptionType.USER + type: CommandOptionType.USER }, { - name: 'moderator', + name: 'moderator', description: 'Query by moderator', - type: CommandOptionType.USER, - flag: true + type: CommandOptionType.USER, + flag: true }, { - name: 'channel', + name: 'channel', description: 'Infractions done on channels, e.g. slowmode, lockdown', - type: CommandOptionType.TEXT_CHANNEL, - flag: true + type: CommandOptionType.TEXT_CHANNEL, + flag: true }] }); } @@ -104,7 +104,7 @@ class HistoryCommand extends SlashCommand { const guild = invoker.guild!; const { user, moderator, channel, before, after, verbose, oldest, - export: exp, private: priv, type: infType, pagesize, page } = opts; + export: exp, private: priv, type: infType, pagesize, page } = opts; if (exp?.asString) return this._exportLogs(invoker, user?.asUser, priv?.asBool); @@ -145,15 +145,15 @@ class HistoryCommand extends SlashCommand _page = maxPage; const results = await infractions.find(query, { projection: { _id: 0 }, - sort: { timestamp: oldest?.asString ? 1 : -1 }, - skip: (_page - 1) * pageSize, - limit: pageSize + sort: { timestamp: oldest?.asString ? 1 : -1 }, + skip: (_page - 1) * pageSize, + limit: pageSize }); const me = await guild.resolveMember(this.client.user!); const embed: APIEmbed = { author: { - name: 'Infraction History', + name: 'Infraction History', icon_url: guild.iconURL() ?? '' // eslint-disable-line camelcase }, fields: [], @@ -168,12 +168,12 @@ class HistoryCommand extends SlashCommand const [ result ] = await infractions.aggregate([{ $match: { ...query, - $or: [{ expiration: { $gt: Date.now() } }, { expiration: null }, { expiration: 0 }], + $or: [{ expiration: { $gt: Date.now() } }, { expiration: null }, { expiration: 0 }], resolved: false } }, { $group: { - _id: null, + _id: null, points: { $sum: '$points' } @@ -217,7 +217,7 @@ class HistoryCommand extends SlashCommand { string += `\n${guild.format('INFRACTION_DESCRIPTIONROLES', { plural: infraction.data.roleIds.length === 1 ? '' : 's', - roles: priv ? infraction.data.roleNames!.join(', ') : infraction.data.roleIds.map((r) => `<@&${r}>`).join(' ') + roles: priv ? infraction.data.roleNames!.join(', ') : infraction.data.roleIds.map((r) => `<@&${r}>`).join(' ') })}`; } @@ -237,8 +237,8 @@ class HistoryCommand extends SlashCommand string += `\n${ZeroWidthChar}`; // Space out cases (as long as its not at the end) embed.fields!.push({ - name: `__**${infraction.type} \`[case-${infraction.case}]\`** *(${moment(infraction.timestamp).fromNow()})*__`, - value: string, + name: `__**${infraction.type} \`[case-${infraction.case}]\`** *(${moment(infraction.timestamp).fromNow()})*__`, + value: string, inline: true }); if (results.length <= 16 && i > 0 && i % 2 === 1) @@ -271,7 +271,7 @@ class HistoryCommand extends SlashCommand }), emoji: 'success', embed, - dm: Boolean(priv?.asString) + dm: Boolean(priv?.asString) }; } catch (e) @@ -284,7 +284,7 @@ class HistoryCommand extends SlashCommand { const guild = invoker.guild!; const member = await invoker.memberWrapper().catch(() => null); - if (!member || !member.isAdmin()) + if (!member || !(await member.isAdmin())) return { emoji: 'failure', index: 'COMMAND_HISTORY_NO_EXPORT_PERMS' }; const query: { guild: string, target?: string } = { guild: guild.id @@ -298,10 +298,10 @@ class HistoryCommand extends SlashCommand const premium = priv ? '0' : guild.premiumTier; if (bytes > UploadLimit[premium] * 1024 * 1024) return { - index: 'COMMAND_HISTORY_FAILEXPORT', + index: 'COMMAND_HISTORY_FAILEXPORT', params: { amount: bytes, - max: UploadLimit[premium] * 1024 * 1024 + max: UploadLimit[premium] * 1024 * 1024 } }; @@ -309,7 +309,7 @@ class HistoryCommand extends SlashCommand index: 'COMMAND_HISTORY_SUCCESSEXPORT', files: [ attachment ], emoji: 'success', - dm: priv + dm: priv }; } } diff --git a/src/client/components/commands/moderation/Kick.ts b/src/client/components/commands/moderation/Kick.ts index 47c4c3d..981fe1d 100644 --- a/src/client/components/commands/moderation/Kick.ts +++ b/src/client/components/commands/moderation/Kick.ts @@ -26,12 +26,12 @@ class KickCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'kick', - description: 'Kick people.', - moduleName: 'moderation', - options: [], - guildOnly: true, - showUsage: true, + name: 'kick', + description: 'Kick people.', + moduleName: 'moderation', + options: [], + guildOnly: true, + showUsage: true, memberPermissions: [ 'KickMembers' ], clientPermissions: [ 'KickMembers' ], }); diff --git a/src/client/components/commands/moderation/Lockdown.ts b/src/client/components/commands/moderation/Lockdown.ts index 844a5b0..b59f5a0 100644 --- a/src/client/components/commands/moderation/Lockdown.ts +++ b/src/client/components/commands/moderation/Lockdown.ts @@ -26,24 +26,24 @@ class LockdownCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'lockdown', + name: 'lockdown', description: 'Lock channels', - moduleName: 'moderation', - options: [{ - name: 'duration', + moduleName: 'moderation', + options: [{ + name: 'duration', description: 'How long the lockdown should last', - type: CommandOptionType.TIME + type: CommandOptionType.TIME }, { - name: 'channels', - type: CommandOptionType.CHANNELS, + name: 'channels', + type: CommandOptionType.CHANNELS, description: 'The channels to lock', - required: true + required: true }], - guildOnly: true, - showUsage: true, + guildOnly: true, + showUsage: true, memberPermissions: [ 'ManageChannels' ], clientPermissions: [ 'ManageChannels', 'ManageRoles' ], - skipOptions: [ 'users', 'points', 'expiration', 'force', 'silent' ] + skipOptions: [ 'users', 'points', 'expiration', 'force', 'silent' ] }); } diff --git a/src/client/components/commands/moderation/Modtimers.ts b/src/client/components/commands/moderation/Modtimers.ts index 5ba8703..194ad91 100644 --- a/src/client/components/commands/moderation/Modtimers.ts +++ b/src/client/components/commands/moderation/Modtimers.ts @@ -24,12 +24,12 @@ class ModtimersCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'modtimers', - description: 'List active timed infractions', - moduleName: 'moderation', + name: 'modtimers', + description: 'List active timed infractions', + moduleName: 'moderation', memberPermissions: [ 'ManageMessages' ], clientPermissions: [ 'EmbedLinks' ], - guildOnly: true + guildOnly: true }); } @@ -47,13 +47,13 @@ class ModtimersCommand extends SlashCommand const target = (infraction.targetType === 'USER' ? await guild.resolveUser(infraction.target) : await guild.resolveChannel(infraction.target))!; const moderator = (await guild.resolveUser(infraction.executor))!; fields.push({ - name: `Case ${infraction.case}`, + name: `Case ${infraction.case}`, value: guild.format('COMMAND_MODTIMERS_DESC', { - target: `${(target as User).tag || (target as GuildBasedChannel).name} (${target.id})`, + target: `${(target as User).tag || (target as GuildBasedChannel).name} (${target.id})`, moderator: `${moderator.tag} (${moderator.id})`, - issued: Math.floor(infraction.timestamp / 1000), - ends: Math.floor((infraction.timestamp + infraction.duration) / 1000), - reason: infraction.reason + issued: Math.floor(infraction.timestamp / 1000), + ends: Math.floor((infraction.timestamp + infraction.duration) / 1000), + reason: infraction.reason }) }); if (fields.length === 25) @@ -63,7 +63,7 @@ class ModtimersCommand extends SlashCommand } const embed = { - title: guild.format('COMMAND_MODTIMERS_TITLE'), + title: guild.format('COMMAND_MODTIMERS_TITLE'), fields, footer: { text: `• ${callbacks.length} infraction${callbacks.length > 1 ? 's' : ''}` diff --git a/src/client/components/commands/moderation/Mute.ts b/src/client/components/commands/moderation/Mute.ts index 92e3609..60f10c8 100644 --- a/src/client/components/commands/moderation/Mute.ts +++ b/src/client/components/commands/moderation/Mute.ts @@ -27,16 +27,16 @@ class MuteCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'mute', + name: 'mute', description: 'Silence people.', - moduleName: 'moderation', - options: [{ - name: 'duration', + moduleName: 'moderation', + options: [{ + name: 'duration', description: 'How long the mute should last', - type: CommandOptionType.TIME + type: CommandOptionType.TIME }], - guildOnly: true, - showUsage: true, + guildOnly: true, + showUsage: true, memberPermissions: [ 'ModerateMembers' ], // clientPermissions: ['ModerateMembers', 'ManageRoles'] // Mute client permissions are handled in the infraction.verify due to being able to use both timeout and role based mutes diff --git a/src/client/components/commands/moderation/Nickname.ts b/src/client/components/commands/moderation/Nickname.ts index 6348220..2a0eacf 100644 --- a/src/client/components/commands/moderation/Nickname.ts +++ b/src/client/components/commands/moderation/Nickname.ts @@ -27,19 +27,19 @@ class NicknameCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'nickname', + name: 'nickname', description: 'Change users\'s nickname', - moduleName: 'moderation', - options: [{ - name: 'name', + moduleName: 'moderation', + options: [{ + name: 'name', description: 'The new nickname to give', - type: CommandOptionType.STRING, - required: true, - flag: true + type: CommandOptionType.STRING, + required: true, + flag: true }], memberPermissions: [ 'ManageNicknames' ], clientPermissions: [ 'ManageNicknames' ], - guildOnly: true + guildOnly: true }); } @@ -54,7 +54,7 @@ class NicknameCommand extends ModerationCommand return this.client.moderation.handleInfraction(Nickname, invoker, { targets: wrappers.filter(Boolean) as MemberWrapper[], args, - data: { + data: { name: name?.asString } }); diff --git a/src/client/components/commands/moderation/Note.ts b/src/client/components/commands/moderation/Note.ts index 906031e..1da26c1 100644 --- a/src/client/components/commands/moderation/Note.ts +++ b/src/client/components/commands/moderation/Note.ts @@ -26,18 +26,18 @@ class NoteCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'note', - description: 'Add notes to users', - moduleName: 'moderation', - showUsage: true, - guildOnly: true, + name: 'note', + description: 'Add notes to users', + moduleName: 'moderation', + showUsage: true, + guildOnly: true, memberPermissions: [ 'ManageMessages' ], - options: [{ - name: 'users', - type: CommandOptionType.USERS, + options: [{ + name: 'users', + type: CommandOptionType.USERS, description: 'Target users', - required: true, - strict: true + required: true, + strict: true }] }); } diff --git a/src/client/components/commands/moderation/Prune.ts b/src/client/components/commands/moderation/Prune.ts index 6bcf299..41be17a 100644 --- a/src/client/components/commands/moderation/Prune.ts +++ b/src/client/components/commands/moderation/Prune.ts @@ -22,124 +22,124 @@ import { ModerationCommand } from '../../../interfaces/index.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; const flag = true, - valueOptional = true, - defaultValue = true; + valueOptional = true, + defaultValue = true; class PruneCommand extends ModerationCommand { - // eslint-disable-next-line max-lines-per-function + constructor (client: DiscordClient) { super(client, { - name: 'prune', + name: 'prune', description: 'Prune messages', - moduleName: 'moderation', - options: [ + moduleName: 'moderation', + options: [ { - name: 'channels', - type: CommandOptionType.TEXT_CHANNELS, + name: 'channels', + type: CommandOptionType.TEXT_CHANNELS, description: 'The channels to prune' }, { - name: 'users', - type: CommandOptionType.USERS, + name: 'users', + type: CommandOptionType.USERS, description: 'Users to prune messages from', - strict: true + strict: true }, { - name: 'amount', - type: CommandOptionType.INTEGER, + name: 'amount', + type: CommandOptionType.INTEGER, description: 'Amount of messages to prune', - minimum: 1, - maximum: 500 + minimum: 1, + maximum: 500 }, { - name: 'silent', - type: CommandOptionType.BOOLEAN, + name: 'silent', + type: CommandOptionType.BOOLEAN, description: 'Prune quietly', flag, valueOptional, defaultValue }, { - name: 'bots', - type: CommandOptionType.BOOLEAN, + name: 'bots', + type: CommandOptionType.BOOLEAN, description: 'Prune messages from bots', flag, valueOptional, defaultValue }, { - name: 'humans', - type: CommandOptionType.BOOLEAN, + name: 'humans', + type: CommandOptionType.BOOLEAN, description: 'Prune messages from humans', flag, valueOptional, defaultValue }, { - name: 'contains', - type: CommandOptionType.STRING, + name: 'contains', + type: CommandOptionType.STRING, description: 'Text to look for messages by', flag }, { - name: 'startswith', - type: CommandOptionType.STRING, + name: 'startswith', + type: CommandOptionType.STRING, description: 'Text the messages to delete start with', flag }, { - name: 'endswith', - type: CommandOptionType.STRING, + name: 'endswith', + type: CommandOptionType.STRING, description: 'Text the messages to delete end with', flag }, { - name: 'text', - type: CommandOptionType.BOOLEAN, + name: 'text', + type: CommandOptionType.BOOLEAN, description: 'Only delete messages containing text', flag, valueOptional, defaultValue }, { - name: 'invites', - type: CommandOptionType.BOOLEAN, + name: 'invites', + type: CommandOptionType.BOOLEAN, description: 'Delete messages containing invites', flag, valueOptional, defaultValue }, { - name: 'links', - type: CommandOptionType.BOOLEAN, + name: 'links', + type: CommandOptionType.BOOLEAN, description: 'Delete messages containing links', flag, valueOptional, defaultValue }, { - name: 'emojis', - type: CommandOptionType.BOOLEAN, + name: 'emojis', + type: CommandOptionType.BOOLEAN, description: 'Prune messages cotaining emojis', flag, valueOptional, defaultValue }, { - name: 'after', - type: CommandOptionType.STRING, + name: 'after', + type: CommandOptionType.STRING, description: 'ID of message after which to start deleting', flag }, { - name: 'before', - type: CommandOptionType.STRING, + name: 'before', + type: CommandOptionType.STRING, description: 'ID of message before which to start deleting', flag }, { - name: 'logic', + name: 'logic', // type: '', - choices: [{ name: 'AND', value: 'AND' }, { name: 'OR', value: 'OR' }], + choices: [{ name: 'AND', value: 'AND' }, { name: 'OR', value: 'OR' }], description: 'Logic type to use for combining options', flag }, { - name: 'reason', - type: CommandOptionType.STRING, + name: 'reason', + type: CommandOptionType.STRING, description: 'Infraction reason' } ], - overrideOptions: true, - guildOnly: true, - showUsage: true, + overrideOptions: true, + guildOnly: true, + showUsage: true, memberPermissions: [ 'ManageChannels' ], clientPermissions: [ 'ManageMessages' ], }); @@ -157,7 +157,7 @@ class PruneCommand extends ModerationCommand // const wrappers = await Promise.all(channels.asChannels.map(channel => this.client.getChannelWrapper(channel))); return this.client.moderation.handleInfraction(Prune, invoker, { targets: channels?.asChannels as TextChannel[] || [ invoker.channel ], - data: { + data: { amount: amount?.asNumber ?? 100 }, args diff --git a/src/client/components/commands/moderation/Resolve.ts b/src/client/components/commands/moderation/Resolve.ts index 4e8d83c..51f3666 100644 --- a/src/client/components/commands/moderation/Resolve.ts +++ b/src/client/components/commands/moderation/Resolve.ts @@ -25,28 +25,28 @@ class ResolveCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'resolve', - description: 'Resolve infraction(s)', - moduleName: 'moderation', + name: 'resolve', + description: 'Resolve infraction(s)', + moduleName: 'moderation', memberPermissions: [ 'ManageGuild' ], - guildOnly: true, - options: [{ - name: 'case', - type: CommandOptionType.INTEGER, + guildOnly: true, + options: [{ + name: 'case', + type: CommandOptionType.INTEGER, description: 'Case ID (Integer)', - required: true, - minimum: 0 + required: true, + minimum: 0 }, { - name: 'reason', + name: 'reason', description: 'Reason for resolving case', - type: CommandOptionType.STRING + type: CommandOptionType.STRING }, { - name: 'notify', - description: 'Attempt to notify the user about the resolve, may not always be possible', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'notify', + description: 'Attempt to notify the user about the resolve, may not always be possible', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }] // Potentially add another option to enable a range of cases }); } diff --git a/src/client/components/commands/moderation/Roles.ts b/src/client/components/commands/moderation/Roles.ts index b2c67bb..afc3f15 100644 --- a/src/client/components/commands/moderation/Roles.ts +++ b/src/client/components/commands/moderation/Roles.ts @@ -27,36 +27,36 @@ class AddroleCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'roles', + name: 'roles', description: 'Manage user roles', - moduleName: 'moderation', - guildOnly: true, - options: [ + moduleName: 'moderation', + guildOnly: true, + options: [ { - name: [ 'add', 'remove' ], + name: [ 'add', 'remove' ], description: [ 'Add roles to user', 'Remove roles from a user' ], - type: CommandOptionType.SUB_COMMAND, - options: [{ - name: 'roles', + type: CommandOptionType.SUB_COMMAND, + options: [{ + name: 'roles', description: 'Which roles to add/take', - type: CommandOptionType.ROLES, - required: true + type: CommandOptionType.ROLES, + required: true }, { - name: 'users', - type: CommandOptionType.MEMBERS, + name: 'users', + type: CommandOptionType.MEMBERS, description: 'Who to give to/take from', - required: true, - strict: true + required: true, + strict: true }, { - name: 'duration', - type: CommandOptionType.TIME, + name: 'duration', + type: CommandOptionType.TIME, description: 'For how long the role should be given/taken.' }] }, ], memberPermissions: [ 'ManageRoles' ], clientPermissions: [ 'ManageRoles' ], - skipOptions: [ 'points', 'expiration', 'force', 'prune' ] + skipOptions: [ 'points', 'expiration', 'force', 'prune' ] }); } @@ -73,10 +73,10 @@ class AddroleCommand extends ModerationCommand return this.client.moderation.handleInfraction(Infraction, invoker, { targets: wrappers.filter(Boolean) as MemberWrapper[], args, - data: { - roleIds: roles.asRoles.map((r) => r.id), + data: { + roleIds: roles.asRoles.map((r) => r.id), roleNames: roles.asRoles.map((r) => r.name), - roles: roles.asString + roles: roles.asString } }); } diff --git a/src/client/components/commands/moderation/Slowmode.ts b/src/client/components/commands/moderation/Slowmode.ts index 4dc3509..d6eccb4 100644 --- a/src/client/components/commands/moderation/Slowmode.ts +++ b/src/client/components/commands/moderation/Slowmode.ts @@ -26,25 +26,25 @@ class SlowmodeCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'slowmode', - description: 'Change slowmode in channel', - moduleName: 'moderation', - showUsage: true, - guildOnly: true, + name: 'slowmode', + description: 'Change slowmode in channel', + moduleName: 'moderation', + showUsage: true, + guildOnly: true, memberPermissions: [ 'ManageChannels' ], clientPermissions: [ 'ManageChannels' ], - options: [ + options: [ { - name: 'channels', + name: 'channels', description: 'Channels to alter slowmode in, if omitted will use ', - type: CommandOptionType.TEXT_CHANNELS + type: CommandOptionType.TEXT_CHANNELS }, { - name: 'limit', + name: 'limit', description: 'How long between messages', - type: CommandOptionType.TIME, - required: true, - maximum: 21600 + type: CommandOptionType.TIME, + required: true, + maximum: 21600 } ], skipOptions: [ 'users', 'force', 'expiration', 'points', 'silent' ] @@ -56,7 +56,7 @@ class SlowmodeCommand extends ModerationCommand { return this.client.moderation.handleInfraction(Slowmode, invoker, { targets: channels?.asChannels as TextChannel[] || [ invoker.channel ], - args: { + args: { silent: silent ?? { asBool: true } as CommandOption, ...args }, diff --git a/src/client/components/commands/moderation/Softban.ts b/src/client/components/commands/moderation/Softban.ts index 327748b..ff3a9cd 100644 --- a/src/client/components/commands/moderation/Softban.ts +++ b/src/client/components/commands/moderation/Softban.ts @@ -27,26 +27,26 @@ class SoftbanCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'softban', - moduleName: 'moderation', - description: 'Remove member from server and purge messages', + name: 'softban', + moduleName: 'moderation', + description: 'Remove member from server and purge messages', memberPermissions: [ 'KickMembers' ], clientPermissions: [ 'KickMembers' ], - options: [{ - name: 'days', - type: CommandOptionType.INTEGER, + options: [{ + name: 'days', + type: CommandOptionType.INTEGER, description: 'How many days worth of messages to remove', - minimum: 1, - maximum: 7 + minimum: 1, + maximum: 7 }, { - name: 'users', - type: CommandOptionType.USERS, + name: 'users', + type: CommandOptionType.USERS, description: 'Target users', - required: true, - strict: true + required: true, + strict: true }], skipOptions: [ 'prune' ], - guildOnly: true + guildOnly: true }); } diff --git a/src/client/components/commands/moderation/Staff.ts b/src/client/components/commands/moderation/Staff.ts index e0e3009..a3aee1c 100644 --- a/src/client/components/commands/moderation/Staff.ts +++ b/src/client/components/commands/moderation/Staff.ts @@ -23,10 +23,10 @@ class StaffCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'staff', - description: 'Summon staff', - moduleName: 'moderation', - guildOnly: true, + name: 'staff', + description: 'Summon staff', + moduleName: 'moderation', + guildOnly: true, clientPermissions: [ 'MentionEveryone', 'EmbedLinks' ] }); } @@ -51,7 +51,7 @@ class StaffCommand extends SlashCommand // if(!role) return invoker.editReply({ index: 'COMMAND_STAFF_ERROR', emoji: 'failure' }); return channel.send({ - content: guild.format('COMMAND_STAFF_SUMMON', { author: author.tag, role: staff.role }), + content: guild.format('COMMAND_STAFF_SUMMON', { author: author.tag, role: staff.role }), allowedMentions: { parse: [ 'roles' ] } // roles: [staff.role], }); diff --git a/src/client/components/commands/moderation/Unban.ts b/src/client/components/commands/moderation/Unban.ts index 95322f5..ef10f72 100644 --- a/src/client/components/commands/moderation/Unban.ts +++ b/src/client/components/commands/moderation/Unban.ts @@ -26,21 +26,21 @@ class UnbanCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'unban', - moduleName: 'moderation', - description: 'Lift a ban', + name: 'unban', + moduleName: 'moderation', + description: 'Lift a ban', memberPermissions: [ 'BanMembers' ], clientPermissions: [ 'BanMembers' ], - options: [{ - name: 'users', - type: CommandOptionType.USERS, + options: [{ + name: 'users', + type: CommandOptionType.USERS, description: 'Target users', - required: true, - strict: true + required: true, + strict: true }], // overrideOptions: true, skipOptions: [ 'points', 'expiration', 'prune', 'force' ], - guildOnly: true + guildOnly: true }); } diff --git a/src/client/components/commands/moderation/Unlockdown.ts b/src/client/components/commands/moderation/Unlockdown.ts index bb48896..4cb72e1 100644 --- a/src/client/components/commands/moderation/Unlockdown.ts +++ b/src/client/components/commands/moderation/Unlockdown.ts @@ -27,20 +27,20 @@ class UnlockdownCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'unlockdown', + name: 'unlockdown', description: 'Lock channels', - moduleName: 'moderation', - options: [{ - name: 'channels', - type: CommandOptionType.CHANNELS, + moduleName: 'moderation', + options: [{ + name: 'channels', + type: CommandOptionType.CHANNELS, description: 'The channels to unlock', - required: true + required: true }], - guildOnly: true, - showUsage: true, + guildOnly: true, + showUsage: true, memberPermissions: [ 'ManageChannels' ], clientPermissions: [ 'ManageChannels', 'ManageRoles' ], - skipOptions: [ 'users', 'points', 'expiration', 'force', 'silent', 'prune' ] + skipOptions: [ 'users', 'points', 'expiration', 'force', 'silent', 'prune' ] }); } diff --git a/src/client/components/commands/moderation/Unmute.ts b/src/client/components/commands/moderation/Unmute.ts index 47681dd..ec1075f 100644 --- a/src/client/components/commands/moderation/Unmute.ts +++ b/src/client/components/commands/moderation/Unmute.ts @@ -26,15 +26,15 @@ class UnmuteCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'unmute', - description: 'Silence people.', - moduleName: 'moderation', - options: [], - guildOnly: true, - showUsage: true, + name: 'unmute', + description: 'Silence people.', + moduleName: 'moderation', + options: [], + guildOnly: true, + showUsage: true, memberPermissions: [ 'ModerateMembers' ], // clientPermissions: ['ManageRoles', 'ModerateMembers'], - skipOptions: [ 'points', 'expiration', 'prune', 'force' ] + skipOptions: [ 'points', 'expiration', 'prune', 'force' ] }); } diff --git a/src/client/components/commands/moderation/Unresolve.ts b/src/client/components/commands/moderation/Unresolve.ts index 46ebc4a..523965b 100644 --- a/src/client/components/commands/moderation/Unresolve.ts +++ b/src/client/components/commands/moderation/Unresolve.ts @@ -38,21 +38,21 @@ class UnresolveCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'unresolve', - description: 'Unresolve infraction(s). Does not re-apply the infraction\'s action.', - moduleName: 'moderation', + name: 'unresolve', + description: 'Unresolve infraction(s). Does not re-apply the infraction\'s action.', + moduleName: 'moderation', memberPermissions: [ 'ManageGuild' ], - guildOnly: true, - options: [{ - name: 'case', - type: CommandOptionType.INTEGER, + guildOnly: true, + options: [{ + name: 'case', + type: CommandOptionType.INTEGER, description: 'Case ID (Integer)', - required: true, - minimum: 0 + required: true, + minimum: 0 }, { - name: 'reason', + name: 'reason', description: 'Reason for unresolving case', - type: CommandOptionType.STRING + type: CommandOptionType.STRING }] // Potentially add another option to enable a range of cases }); } diff --git a/src/client/components/commands/moderation/Vckick.ts b/src/client/components/commands/moderation/Vckick.ts index 8e188c1..5365286 100644 --- a/src/client/components/commands/moderation/Vckick.ts +++ b/src/client/components/commands/moderation/Vckick.ts @@ -26,12 +26,12 @@ class VcKickCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'vckick', - description: 'Kick people from a VC.', - moduleName: 'moderation', - options: [], - guildOnly: true, - showUsage: true, + name: 'vckick', + description: 'Kick people from a VC.', + moduleName: 'moderation', + options: [], + guildOnly: true, + showUsage: true, memberPermissions: [ 'MoveMembers' ], clientPermissions: [ 'MoveMembers' ], }); diff --git a/src/client/components/commands/moderation/Warn.ts b/src/client/components/commands/moderation/Warn.ts index 5382b0f..63a3586 100644 --- a/src/client/components/commands/moderation/Warn.ts +++ b/src/client/components/commands/moderation/Warn.ts @@ -26,19 +26,19 @@ class WarnCommand extends ModerationCommand constructor (client: DiscordClient) { super(client, { - name: 'warn', - description: 'Warn users', - moduleName: 'moderation', - showUsage: true, - guildOnly: true, + name: 'warn', + description: 'Warn users', + moduleName: 'moderation', + showUsage: true, + guildOnly: true, memberPermissions: [ 'ModerateMembers' ], - options: [ + options: [ { - name: 'users', - type: CommandOptionType.MEMBERS, + name: 'users', + type: CommandOptionType.MEMBERS, description: 'Target users', - required: true, - strict: true + required: true, + strict: true } ] }); diff --git a/src/client/components/commands/utility/Avatar.ts b/src/client/components/commands/utility/Avatar.ts index 0d2f8f0..d9aa648 100644 --- a/src/client/components/commands/utility/Avatar.ts +++ b/src/client/components/commands/utility/Avatar.ts @@ -25,43 +25,43 @@ class AvatarCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'avatar', + name: 'avatar', description: 'Retrieve user avatar', - moduleName: 'utility', - options: [{ - name: 'size', + moduleName: 'utility', + options: [{ + name: 'size', description: 'The width/height value', // type: 'INTEGER', - choices: [ 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 ].map((i) => + choices: [ 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 ].map((i) => { return { name: `${i}`, value: `${i}` }; }), flag: true }, { - name: 'format', + name: 'format', description: 'Image format', // type: 'STRING' - choices: [ 'webp', 'png', 'jpeg', 'jpg', 'gif' ].map((i) => + choices: [ 'webp', 'png', 'jpeg', 'jpg', 'gif' ].map((i) => { return { name: i, value: i }; }), flag: true }, { - name: 'user', + name: 'user', description: 'Use this for the user\'s global avatar', - type: CommandOptionType.USER + type: CommandOptionType.USER }, { - name: 'member', + name: 'member', description: 'Use this for the user\'s server avatar', - type: CommandOptionType.MEMBER, - flag: true + type: CommandOptionType.MEMBER, + flag: true }, { - name: 'banner', - type: CommandOptionType.BOOLEAN, - description: 'Fetch the user\'s banner', - flag: true, + name: 'banner', + type: CommandOptionType.BOOLEAN, + description: 'Fetch the user\'s banner', + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }] }); } @@ -93,10 +93,10 @@ class AvatarCommand extends SlashCommand return { embed: { - title: (target as User).tag ?? (target as GuildMember).user.tag, + title: (target as User).tag ?? (target as GuildMember).user.tag, description: `[**Link**](${imageUrl})`, - image: { url: imageUrl! }, - footer: { text: `• Format: .${formatOpt} | Size: ${size}` } + image: { url: imageUrl! }, + footer: { text: `• Format: .${formatOpt} | Size: ${size}` } } }; } diff --git a/src/client/components/commands/utility/Grantable.ts b/src/client/components/commands/utility/Grantable.ts index 43755c6..587f4a4 100644 --- a/src/client/components/commands/utility/Grantable.ts +++ b/src/client/components/commands/utility/Grantable.ts @@ -23,10 +23,10 @@ class GrantablesCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'grantable', - moduleName: 'utility', + name: 'grantable', + moduleName: 'utility', description: 'Display grantable roles', - guildOnly: true + guildOnly: true }); } diff --git a/src/client/components/commands/utility/Ping.ts b/src/client/components/commands/utility/Ping.ts index e43fb34..a1e7e50 100644 --- a/src/client/components/commands/utility/Ping.ts +++ b/src/client/components/commands/utility/Ping.ts @@ -26,9 +26,9 @@ class PingCommand extends SlashCommand { super(client, { - name: 'ping', + name: 'ping', description: 'Ping? Pong!', - moduleName: 'utility', + moduleName: 'utility', }); } diff --git a/src/client/components/commands/utility/Poll.ts b/src/client/components/commands/utility/Poll.ts index 74fd90f..4b4f64f 100644 --- a/src/client/components/commands/utility/Poll.ts +++ b/src/client/components/commands/utility/Poll.ts @@ -28,28 +28,28 @@ class PollCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'poll', + name: 'poll', description: 'Manage your polls', - moduleName: 'utility', - options: [{ - name: [ 'create' ], - type: CommandOptionType.SUB_COMMAND, + moduleName: 'utility', + options: [{ + name: [ 'create' ], + type: CommandOptionType.SUB_COMMAND, description: 'Create a poll through a series of prompts', - options: [{ - name: 'choices', + options: [{ + name: 'choices', description: 'How many choices?', - type: CommandOptionType.INTEGER, - minimum: 1, - maximum: 10, - required: true + type: CommandOptionType.INTEGER, + minimum: 1, + maximum: 10, + required: true }, { - name: 'channel', + name: 'channel', description: 'Which channel to run the poll in', - type: CommandOptionType.TEXT_CHANNEL, + type: CommandOptionType.TEXT_CHANNEL, }, { - name: 'duration', + name: 'duration', description: 'How long the poll lasts', - type: CommandOptionType.TIME + type: CommandOptionType.TIME // }, { // name: 'multichoice', // description: 'Whether you can choose multiple choices', @@ -57,13 +57,13 @@ class PollCommand extends SlashCommand }] // Decided against enforcing single choice polls due to the difficulties in enforcing that with reactions // If I ever decide to change these to be button based, then this'd be viable }, { - name: [ 'delete', 'end' ], + name: [ 'delete', 'end' ], description: [ 'Delete an active poll', 'End an ongoing poll' ], - type: CommandOptionType.SUB_COMMAND, - options: [{ - name: 'message', + type: CommandOptionType.SUB_COMMAND, + options: [{ + name: 'message', description: 'The message ID of the poll you want to end/delete, only works for timed polls', - required: true + required: true }] }], guildOnly: true, @@ -102,13 +102,13 @@ class PollCommand extends SlashCommand await invoker.editReply({ index: 'COMMAND_POLL_STARTING' }); const embed = { - title: guild.format('COMMAND_POLL_TITLE', { user: author.tag }), + title: guild.format('COMMAND_POLL_TITLE', { user: author.tag }), description: guild.format('COMMAND_POLL_DESCRIPTION', { - multi: guild.format('COMMAND_POLL_MULTI', { multichoice: multichoice?.asBool && questions.length > 1 || false }, { code: true }), + multi: guild.format('COMMAND_POLL_MULTI', { multichoice: multichoice?.asBool && questions.length > 1 || false }, { code: true }), duration: duration ? guild.format('COMMAND_POLL_DURATION', { time: Util.humanise(duration.asNumber), duration: Math.floor(Date.now() / 1000) + duration.asNumber }) : guild.format('COMMAND_POLL_INFINITE') }), - fields: questions, - color: EmbedDefaultColor, + fields: questions, + color: EmbedDefaultColor, timestamp: new Date().toISOString() }; @@ -128,13 +128,13 @@ class PollCommand extends SlashCommand } const poll: PollData = { - questions: questions.map(q => q.value), - duration: (duration?.asNumber ?? 0), + questions: questions.map(q => q.value), + duration: (duration?.asNumber ?? 0), multiChoice: multichoice?.asBool && questions.length > 1 || false, - user: author.id, - channel: targetChannel.id, - startedIn: invoker.channel!.id, - message: pollMsg.id + user: author.id, + channel: targetChannel.id, + startedIn: invoker.channel!.id, + message: pollMsg.id }; if (duration) @@ -149,8 +149,8 @@ class PollCommand extends SlashCommand for (let i = 0; i < choices; i++) { const response = await invoker.promptMessage({ - content: guild.format(`COMMAND_POLL_QUESTION${choices === 1 ? '' : 'S'}`, { number: i + 1 }) + '\n' + guild.format('COMMAND_POLL_ADDENDUM'), - time: 90, + content: guild.format(`COMMAND_POLL_QUESTION${choices === 1 ? '' : 'S'}`, { number: i + 1 }) + '\n' + guild.format('COMMAND_POLL_ADDENDUM'), + time: 90, editReply: invoker.replied }); if (!response || !response.content) diff --git a/src/client/components/commands/utility/Remind.ts b/src/client/components/commands/utility/Remind.ts index f5f92a4..16d6982 100644 --- a/src/client/components/commands/utility/Remind.ts +++ b/src/client/components/commands/utility/Remind.ts @@ -30,28 +30,28 @@ class RemindCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'remind', + name: 'remind', description: 'Set a reminder for yourself', - moduleName: 'utility', - options: [{ - name: 'create', + moduleName: 'utility', + options: [{ + name: 'create', description: 'Create a new reminder', - type: CommandOptionType.SUB_COMMAND, - options: [{ - name: 'in', + type: CommandOptionType.SUB_COMMAND, + options: [{ + name: 'in', description: 'In how long to trigger reminder', - type: CommandOptionType.TIME, - required: true + type: CommandOptionType.TIME, + required: true }, { - name: 'reminder', + name: 'reminder', description: 'Text to remind you with', - required: true + required: true }], showUsage: true }, { - name: [ 'delete', 'list' ], + name: [ 'delete', 'list' ], description: [ 'Delete an existing reminder', 'List your reminders' ], - type: CommandOptionType.SUB_COMMAND, + type: CommandOptionType.SUB_COMMAND, }], // showUsage: true // guildOnly: true @@ -73,10 +73,10 @@ class RemindCommand extends SlashCommand return { index: 'COMMAND_REMIND_INVALID_TIME' }; const text = guild ? await guild.filterText(member!, reminder.asString) : reminder.asString; await this.client.reminders.create({ - time: time.asNumber, + time: time.asNumber, reminder: text, - user: author.id, - channel: channel.id + user: author.id, + channel: channel.id }, guild?.guild); return { index: 'COMMAND_REMIND_CONFIRM', params: { reminder: text, time: Util.humanise(time.asNumber) } }; } @@ -114,19 +114,19 @@ class RemindCommand extends SlashCommand _remindersEmbed (reminders: CallbackInfo[], guild?: GuildWrapper | null) { const embed: APIEmbed = { - title: (guild ? guild : this.client).format('COMMAND_REMINDERS_TITLE'), + title: (guild ? guild : this.client).format('COMMAND_REMINDERS_TITLE'), fields: [] }; let index = 0; for (const data of reminders) { embed.fields!.push({ - name: `${++index}`, + name: `${++index}`, value: (guild ? guild : this.client).format('COMMAND_REMIND_ENTRY', { reminder: data.payload.reminder, - channel: data.payload.channel, - created: Math.floor(data.created/1000), - time: Math.floor((data.created + data.payload.time)/1000) + channel: data.payload.channel, + created: Math.floor(data.created/1000), + time: Math.floor((data.created + data.payload.time)/1000) }) }); } diff --git a/src/client/components/commands/utility/Selfrole.ts b/src/client/components/commands/utility/Selfrole.ts index 3aa9d40..31dbb5e 100644 --- a/src/client/components/commands/utility/Selfrole.ts +++ b/src/client/components/commands/utility/Selfrole.ts @@ -26,18 +26,18 @@ class SelfroleCommand extends SlashCommand constructor (client: DiscordClient) { super(client, { - name: 'selfrole', + name: 'selfrole', description: 'Manage your selfroles', - moduleName: 'utility', - guildOnly: true, - options: [{ - name: [ 'add', 'remove' ], - type: CommandOptionType.SUB_COMMAND, + moduleName: 'utility', + guildOnly: true, + options: [{ + name: [ 'add', 'remove' ], + type: CommandOptionType.SUB_COMMAND, options: [{ - name: 'roles', - type: CommandOptionType.ROLES, + name: 'roles', + type: CommandOptionType.ROLES, description: 'Roles to give/take', - required: true + required: true }] }, { name: [ 'list', 'clear' ], diff --git a/src/client/components/inhibitors/Banned.ts b/src/client/components/inhibitors/Banned.ts index 3a271f2..395069d 100644 --- a/src/client/components/inhibitors/Banned.ts +++ b/src/client/components/inhibitors/Banned.ts @@ -25,9 +25,9 @@ class Banned extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'banned', + name: 'banned', priority: 10, - silent: true + silent: true }); } diff --git a/src/client/components/inhibitors/ChannelIgnore.ts b/src/client/components/inhibitors/ChannelIgnore.ts index e0b66d5..383268d 100644 --- a/src/client/components/inhibitors/ChannelIgnore.ts +++ b/src/client/components/inhibitors/ChannelIgnore.ts @@ -23,10 +23,10 @@ class ChannelIgnore extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'channelIgnore', + name: 'channelIgnore', priority: 8, - guild: true, - silent: true + guild: true, + silent: true }); } diff --git a/src/client/components/inhibitors/ClientPermissions.ts b/src/client/components/inhibitors/ClientPermissions.ts index 4c64de9..7c98e6b 100644 --- a/src/client/components/inhibitors/ClientPermissions.ts +++ b/src/client/components/inhibitors/ClientPermissions.ts @@ -24,10 +24,10 @@ class ClientPermissions extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'clientPermissions', + name: 'clientPermissions', priority: 9, - guarded: true, - guild: true + guarded: true, + guild: true }); } diff --git a/src/client/components/inhibitors/Disabled.ts b/src/client/components/inhibitors/Disabled.ts index fe1b143..ac1cb85 100644 --- a/src/client/components/inhibitors/Disabled.ts +++ b/src/client/components/inhibitors/Disabled.ts @@ -23,9 +23,9 @@ class Disabled extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'disabled', + name: 'disabled', priority: 4, - silent: true + silent: true }); } diff --git a/src/client/components/inhibitors/GuildOnly.ts b/src/client/components/inhibitors/GuildOnly.ts index fd634f7..bd1a0df 100644 --- a/src/client/components/inhibitors/GuildOnly.ts +++ b/src/client/components/inhibitors/GuildOnly.ts @@ -23,9 +23,9 @@ class GuildOnly extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'guildOnly', + name: 'guildOnly', priority: 2, - guarded: true + guarded: true }); } diff --git a/src/client/components/inhibitors/Permissions.ts b/src/client/components/inhibitors/Permissions.ts index 9224e50..f886590 100644 --- a/src/client/components/inhibitors/Permissions.ts +++ b/src/client/components/inhibitors/Permissions.ts @@ -27,10 +27,10 @@ class Permissions extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'permissions', + name: 'permissions', priority: 5, - guarded: true, - guild: true + guarded: true, + guild: true }); } diff --git a/src/client/components/inhibitors/Restricted.ts b/src/client/components/inhibitors/Restricted.ts index 596b8e9..c745c17 100644 --- a/src/client/components/inhibitors/Restricted.ts +++ b/src/client/components/inhibitors/Restricted.ts @@ -23,9 +23,9 @@ class Restricted extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'restricted', + name: 'restricted', priority: 3, - guarded: true + guarded: true }); } diff --git a/src/client/components/inhibitors/Throttle.ts b/src/client/components/inhibitors/Throttle.ts index e611114..7f89112 100644 --- a/src/client/components/inhibitors/Throttle.ts +++ b/src/client/components/inhibitors/Throttle.ts @@ -23,7 +23,7 @@ class Throttle extends Inhibitor constructor (client: DiscordClient) { super(client, { - name: 'throttle', + name: 'throttle', priority: 1 }); } @@ -56,8 +56,8 @@ class Throttle extends Inhibitor if (!throttle) { throttle = { - start: Date.now(), - usages: 0, + start: Date.now(), + usages: 0, timeout: setTimeout(() => { command.throttles.delete(invoker.author.id); diff --git a/src/client/components/managers/CallbackManager.ts b/src/client/components/managers/CallbackManager.ts index 383aa2d..f1d5d28 100644 --- a/src/client/components/managers/CallbackManager.ts +++ b/src/client/components/managers/CallbackManager.ts @@ -62,7 +62,7 @@ class CallbackManager implements Initialisable #clients: Collection; #logger: LoggerClient; #ready: boolean; - #interval!: NodeJS.Timer; + #interval!: NodeJS.Timeout; /** * Creates an instance of CallbackManager. @@ -125,7 +125,7 @@ class CallbackManager implements Initialisable { const guildIds = [ ...this.#client.guilds.cache.keys() ]; const query: Filter> = { - _id: { $nin: [ ...this.#timeouts.keys() ] }, + _id: { $nin: [ ...this.#timeouts.keys() ] }, expiresAt: { $lte: Date.now() + DAY } }; @@ -177,7 +177,7 @@ class CallbackManager implements Initialisable const created = Date.now(); const data: CallbackInfo = { created, - _id: createData.id ?? Util.createUUID(), + _id: createData.id ?? Util.createUUID(), client: clientName, ...createData }; diff --git a/src/client/components/managers/ModerationManager.ts b/src/client/components/managers/ModerationManager.ts index 964981b..df1f19d 100644 --- a/src/client/components/managers/ModerationManager.ts +++ b/src/client/components/managers/ModerationManager.ts @@ -116,27 +116,27 @@ const Constant: { [key: string]: number } } = { - MaxTargets: 10, // 10+(10*premium-tier), theoretical max = 40 + MaxTargets: 10, // 10+(10*premium-tier), theoretical max = 40 Infractions: { - WARN: Warn, - UNMUTE: Unmute, - MUTE: Mute, - KICK: Kick, - SOFTBAN: Softban, - UNBAN: Unban, - BAN: Ban, - ADDROLE: Addrole, + WARN: Warn, + UNMUTE: Unmute, + MUTE: Mute, + KICK: Kick, + SOFTBAN: Softban, + UNBAN: Unban, + BAN: Ban, + ADDROLE: Addrole, REMOVEROLE: Removerole, - LOCKDOWN: Lockdown, + LOCKDOWN: Lockdown, UNLOCKDOWN: Unlockdown, - NOTE: Note + NOTE: Note }, Hierarchy: { - WARN: 0, - MUTE: 1, - KICK: 2, + WARN: 0, + MUTE: 1, + KICK: 2, SOFTBAN: 3, - BAN: 4 + BAN: 4 } }; @@ -210,10 +210,10 @@ class ModerationManager implements Initialisable, CallbackClient return; this.#client.callbacks.registerClient(this); const filter = { - duration: { $gt: 0 }, - guild: { $in: this.#client.guilds.cache.map((g) => g.id) }, + duration: { $gt: 0 }, + guild: { $in: this.#client.guilds.cache.map((g) => g.id) }, _callbacked: false, - resolved: false + resolved: false }; const results = await this.#client.mongodb.infractions.find(filter); @@ -261,15 +261,15 @@ class ModerationManager implements Initialisable, CallbackClient { const response = await this._handleTarget(Infraction, target, { invoker, - guild: invoker.guild!, - channel: invoker.channel as GuildTextBasedChannel, + guild: invoker.guild!, + channel: invoker.channel as GuildTextBasedChannel, executor, - arguments: args, - points: args.points?.asNumber, + arguments: args, + points: args.points?.asNumber, expiration: args.expiration && args.expiration?.getValue() * 1000, - reason: args.reason?.asString, - duration: args.duration && args.duration.asNumber * 1000, - data: { ...info.data }, + reason: args.reason?.asString, + duration: args.duration && args.duration.asNumber * 1000, + data: { ...info.data }, force, silent }); @@ -318,9 +318,9 @@ class ModerationManager implements Initialisable, CallbackClient else { successes[type] = { - targets: [ Util.isUserStruct(target) ? target.tag : target!.name ], + targets: [ Util.isUserStruct(target) ? target.tag : target!.name ], infractions: [ response.infraction ], - escalation: response.escalation + escalation: response.escalation }; } } @@ -332,10 +332,10 @@ class ModerationManager implements Initialisable, CallbackClient else if (response.error) { fails[type] = { - targets: [ Util.isUserStruct(target) ? target.tag : target!.name ], + targets: [ Util.isUserStruct(target) ? target.tag : target!.name ], infractions: [ response.infraction ], - reason: response.reason, - formatted: response.formatted + reason: response.reason, + formatted: response.formatted }; } } @@ -358,8 +358,8 @@ class ModerationManager implements Initialisable, CallbackClient const str = `${data.escalation ? Emojis.escalated : Emojis.success} ${invoker.format('INFRACTION_SUCCESS', { infraction: dictionary.past, targetType: `${targetType.toLowerCase()}${data.targets.length === 1 ? '' : 's'}`, - target: data.targets.map((t) => `**${Util.escapeMarkdown(t)}**`).join(' '), - text: ` ${reason.length > 120 + target: data.targets.map((t) => `**${Util.escapeMarkdown(t)}**`).join(' '), + text: ` ${reason.length > 120 ? `for: \`${reason.substring(0, 117)}...\`` : `for: \`${reason}\``}`, case: data.infractions.map(inf => inf.case).join('`, `') @@ -378,8 +378,8 @@ class ModerationManager implements Initialisable, CallbackClient const str = `${Emojis.failure} ${invoker.format('INFRACTION_FAIL', { infraction: dictionary.present, targetType: `${targetType.toLowerCase()}${data.targets.length === 1 ? '' : 's'}`, - target: data.targets.map((t) => `**${Util.escapeMarkdown(t)}**`).join(', '), - reason: data.formatted ? data.reason : invoker.format(data.reason) + target: data.targets.map((t) => `**${Util.escapeMarkdown(t)}**`).join(', '), + reason: data.formatted ? data.reason : invoker.format(data.reason) })}`; if (!('escalation' in data) && !success) string = `${str}\n${string}`; @@ -443,7 +443,7 @@ class ModerationManager implements Initialisable, CallbackClient if (reason) for (const [ phrase, amount ] of Object.entries(modpoints.associations)) { - // eslint-disable-next-line max-depth + if (reason.toLowerCase().includes(phrase)) { points = amount; @@ -499,7 +499,7 @@ class ModerationManager implements Initialisable, CallbackClient if (result) { return { - error: false, + error: false, escalation: result as { type: InfractionType, threshold: number, length: number }, infraction }; @@ -525,17 +525,17 @@ class ModerationManager implements Initialisable, CallbackClient const infraction = new Infraction(this.#client, this.#logger, { target, type, - invoker: info.invoker || null, + invoker: info.invoker || null, arguments: info.arguments, - guild: info.guild, - channel: info.channel, - executor: info.executor, - reason: info.reason, - duration: info.duration, - data: info.data, + guild: info.guild, + channel: info.channel, + executor: info.executor, + reason: info.reason, + duration: info.duration, + data: info.data, points, expiration, - silent: info.silent + silent: info.silent }); let response = await verify(infraction); @@ -548,18 +548,18 @@ class ModerationManager implements Initialisable, CallbackClient const escalationClass = Constant.Infractions[response.escalation.type] as typeof InfractionClass; const escalationInfraction = new escalationClass(this.#client, this.#logger, { target, - invoker: info.invoker || null, + invoker: info.invoker || null, arguments: info.arguments, - type: escalationClass.Type, - guild: info.guild, - channel: info.channel, - executor: info.executor, - reason: stripIndents`${reason}`, // *${wrapper.format('INFRACTION_AUTOMODESCALATION')}* - duration: response.escalation.length && response.escalation.length * 1000, // info.duration, - data: info.data, + type: escalationClass.Type, + guild: info.guild, + channel: info.channel, + executor: info.executor, + reason: stripIndents`${reason}`, // *${wrapper.format('INFRACTION_AUTOMODESCALATION')}* + duration: response.escalation.length && response.escalation.length * 1000, // info.duration, + data: info.data, points, expiration, - silent: info.silent + silent: info.silent }); response = await verify(escalationInfraction, true); } @@ -625,7 +625,7 @@ class ModerationManager implements Initialisable, CallbackClient { target = guild.channels.resolve(infraction.target!); if (!target?.isTextBased()) - throw new Error('Invalid channel'); + throw new Error(`[inf: ${infraction.id}] Invalid channel: ${infraction.target}`); } if (target) @@ -633,14 +633,14 @@ class ModerationManager implements Initialisable, CallbackClient const executor = await guild.memberWrapper(infraction.executor!).catch(() => null) ?? await guild.memberWrapper(guild.me!); const channel = guild.channels.resolve(infraction.channel!); if (channel && !channel.isTextBased()) - throw new Error('Bad channel ' + inspect(infraction)); + throw new Error(`[inf: ${infraction.id}] Bad channel: ${infraction.channel}`); if (!executor) - throw new Error('Missing executor'); + throw new Error(`[inf: ${infraction.id}] Missing executor ${infraction.executor}`); try { const result = await new undoClass(this.#client, this.#logger, { - type: undoClass.Type, - reason: `AUTO-${Constants.InfractionOpposites[infraction.type]} from Case ${infraction.case}`, + type: undoClass.Type, + reason: `AUTO-${Constants.InfractionOpposites[infraction.type]} from Case ${infraction.case}`, channel, hyperlink: infraction.modLogMessage && infraction.modLogChannel ? `https://discord.com/channels/${infraction.guild}/${infraction.modLogChannel}/${infraction.modLogMessage}` : null, @@ -655,7 +655,7 @@ class ModerationManager implements Initialisable, CallbackClient catch (err) { const error = err as Error; - this.#logger.error(`Error when resolving infraction:\n${error.stack || error}`); + this.#logger.error(`[inf: ${infraction.id}] Error when resolving infraction:\n${error.stack || error}`); } } else @@ -683,9 +683,9 @@ class ModerationManager implements Initialisable, CallbackClient this.#logger.debug(`Creating infraction callback for ${infraction.id} (${infraction.type}), expiring in ${Util.humanise(duration / 1000)}`); const callbackData: CallbackCreateInfo = { expiresAt, - id: infraction.id, + id: infraction.id, payload: infraction, - guild: infraction.guild + guild: infraction.guild }; await this.#client.callbacks.createCallback(this, callbackData); } @@ -779,14 +779,14 @@ class ModerationManager implements Initialisable, CallbackClient { const [ result ] = await this.#client.mongodb.infractions.aggregate([{ $match: { - target: user.id, - guild: guild.id, + target: user.id, + guild: guild.id, resolved: false, - $or: [{ expiration: { $gt: Date.now() } }, { expiration: 0 }, { expiration: null }], + $or: [{ expiration: { $gt: Date.now() } }, { expiration: 0 }, { expiration: null }], } }, { $group: { - _id: null, + _id: null, points: { $sum: '$points' } diff --git a/src/client/components/managers/PollManager.ts b/src/client/components/managers/PollManager.ts index 7b27655..d805feb 100644 --- a/src/client/components/managers/PollManager.ts +++ b/src/client/components/managers/PollManager.ts @@ -39,7 +39,7 @@ class PollManager implements CallbackClient const now = Date.now(); await this.callbacks.createCallback(this, { expiresAt: now + duration * 1000, - payload: { ...opts, duration }, + payload: { ...opts, duration }, guild }); } @@ -102,7 +102,7 @@ class PollManager implements CallbackClient embed.description = guild.format('COMMAND_POLL_END', { results }); await msg.edit({ embeds: [ embed ] }); - if (startChannel && startChannel.isTextBased()) + if (startChannel && startChannel.isSendable()) await startChannel.send(guild.format('COMMAND_POLL_NOTIFY_STARTER', { user, channel })); } await this.callbacks.removeCallback(id); diff --git a/src/client/components/managers/ReminderManager.ts b/src/client/components/managers/ReminderManager.ts index 878cf97..07399b8 100644 --- a/src/client/components/managers/ReminderManager.ts +++ b/src/client/components/managers/ReminderManager.ts @@ -45,8 +45,8 @@ class ReminderManager implements CallbackClient const now = Date.now(); await this.callbacks.createCallback(this, { expiresAt: now + time * 1000, - guild: guild?.id, - payload: { user, channel, reminder } + guild: guild?.id, + payload: { user, channel, reminder } }); } @@ -65,20 +65,22 @@ class ReminderManager implements CallbackClient let channel = await this.#client.resolveChannel(channelId); if (channel && channel.partial) channel = await channel.fetch().catch(() => null); - if (!channel || !channel.isTextBased()) + if (!channel || !channel.isTextBased() || !channel.isSendable()) return; const payload = { content: '', - embeds: [{ - title: this.format('GENERAL_REMINDER_TITLE'), + embeds: [{ + title: this.format('GENERAL_REMINDER_TITLE'), description: reminder, - color: EmbedDefaultColor + color: EmbedDefaultColor }] }; if (!channel.isDMBased()) payload.content = `<@${user}>`; - await channel.send(payload); + + // No way of determining if we can send a message in DMs + await channel.send(payload).catch(() => null); } } diff --git a/src/client/components/observers/AuditLog.ts b/src/client/components/observers/AuditLog.ts index 4eaf5eb..796ebd9 100644 --- a/src/client/components/observers/AuditLog.ts +++ b/src/client/components/observers/AuditLog.ts @@ -26,7 +26,7 @@ class AuditLogObserver extends Observer constructor (client: DiscordClient) { super(client, { - name: 'auditLog', + name: 'auditLog', priority: 2, disabled: false }); @@ -50,12 +50,12 @@ class AuditLogObserver extends Observer const userWrapper = await this.client.getUserWrapper(user); const executor = await this.client.getUserWrapper(audit.executor!); new Infraction(this.client, this.logger, { - type: 'BAN', + type: 'BAN', targetType: 'USER', guild, - target: userWrapper!, - executor: executor!, - reason: `${audit.reason || 'N/A'}\n*This action was performed without the bot.*` + target: userWrapper!, + executor: executor!, + reason: `${audit.reason || 'N/A'}\n*This action was performed without the bot.*` }).handle(); } @@ -70,12 +70,12 @@ class AuditLogObserver extends Observer const userWrapper = await this.client.getUserWrapper(user); const executor = await this.client.getUserWrapper(audit.executor!); new Infraction(this.client, this.logger, { - type: 'UNBAN', + type: 'UNBAN', targetType: 'USER', - guild: wrapper, - target: userWrapper!, - executor: executor!, - reason: '*This action was performed without the bot.*' + guild: wrapper, + target: userWrapper!, + executor: executor!, + reason: '*This action was performed without the bot.*' }).handle(); } @@ -91,12 +91,12 @@ class AuditLogObserver extends Observer const userWrapper = await this.client.getUserWrapper(member); const executor = await this.client.getUserWrapper(audit.executor!); new Infraction(this.client, this.logger, { - type: 'KICK', + type: 'KICK', targetType: 'USER', - guild: wrapper, - target: userWrapper!, - executor: executor!, - reason: `${audit.reason || 'N/A'}\n*This action was performed without the bot.*` + guild: wrapper, + target: userWrapper!, + executor: executor!, + reason: `${audit.reason || 'N/A'}\n*This action was performed without the bot.*` }).handle(); } @@ -160,11 +160,11 @@ class AuditLogObserver extends Observer new Infraction(this.client, this.logger, { type, targetType: 'USER', - guild: wrapper, - target: newMember.user, - executor: userWrapper!, + guild: wrapper, + target: newMember.user, + executor: userWrapper!, duration, - reason: wrapper.format('O_AUDITLOG_AUTOLOG') + (entry.reason ? '\n' + entry.reason : '') + reason: wrapper.format('O_AUDITLOG_AUTOLOG') + (entry.reason ? '\n' + entry.reason : '') }).handle(); } @@ -206,10 +206,10 @@ class AuditLogObserver extends Observer new Infraction(this.client, this.logger, { type, targetType: 'USER', - guild: wrapper, - target: newMember.user, - executor: userWrapper!, - reason: wrapper.format('O_AUDITLOG_AUTOLOG') + (audit.reason ? '\n' + audit.reason : '') + guild: wrapper, + target: newMember.user, + executor: userWrapper!, + reason: wrapper.format('O_AUDITLOG_AUTOLOG') + (audit.reason ? '\n' + audit.reason : '') }).handle(); } diff --git a/src/client/components/observers/Automoderation.ts b/src/client/components/observers/Automoderation.ts index 38a9991..9aa9771 100644 --- a/src/client/components/observers/Automoderation.ts +++ b/src/client/components/observers/Automoderation.ts @@ -40,22 +40,22 @@ const CONSTANTS: { Permissions: {[key: string]: PermissionsString} } = { Infractions: { - WARN: Warn, - MUTE: Mute, - KICK: Kick, + WARN: Warn, + MUTE: Mute, + KICK: Kick, SOFTBAN: Softban, - BAN: Ban + BAN: Ban }, ButtonStyles: { BAN: ButtonStyle.Danger, }, Permissions: { - WARN: 'KickMembers', - MUTE: 'ModerateMembers', - KICK: 'KickMembers', + WARN: 'KickMembers', + MUTE: 'ModerateMembers', + KICK: 'KickMembers', SOFTBAN: 'KickMembers', - BAN: 'BanMembers', - DELETE: 'ManageMessages' + BAN: 'BanMembers', + DELETE: 'ManageMessages' } }; @@ -68,7 +68,7 @@ export default class AutoModeration extends Observer implements Initialisable constructor (client: DiscordClient) { super(client, { - name: 'autoModeration', + name: 'autoModeration', priority: 1, disabled: false }); @@ -89,10 +89,10 @@ export default class AutoModeration extends Observer implements Initialisable this.executing = {}; this.regex = { - invite: /((discord\s*\.?\s*gg\s*)|discord(app)?\.com\/invite)\/\s?(?[a-z0-9]+)/iu, + invite: /((discord\s*\.?\s*gg\s*)|discord(app)?\.com\/invite)\/\s?(?[a-z0-9]+)/iu, linkRegG: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{1,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/[^()\s]*)?/iug, - linkReg: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{1,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/[^()\s]*)?/iu, - mention: /<@!?(?[0-9]{18,22})>/u, + linkReg: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{1,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/[^()\s]*)?/iu, + mention: /<@!?(?[0-9]{18,22})>/u, mentionG: /<@!?(?[0-9]{18,22})>/gu, }; @@ -153,13 +153,13 @@ export default class AutoModeration extends Observer implements Initialisable channel, executor, reason, - duration: action.duration ? action.duration * 1000 : null, - points: action.points, + duration: action.duration ? action.duration * 1000 : null, + points: action.points, expiration: action.expiration, - silent: false, - force: false, - prune: action.prune, - data: { + silent: false, + force: false, + prune: action.prune, + data: { automoderation: filterResult } }).catch(this.logger.error.bind(this.logger)); @@ -371,21 +371,21 @@ export default class AutoModeration extends Observer implements Initialisable const context = channel.messages.cache.sort((m1, m2) => m2.createdTimestamp - m1.createdTimestamp).first(5); const embed: APIEmbed = { - title: `⚠️ Word trigger in **#${channel.name}**`, + title: `⚠️ Word trigger in **#${channel.name}**`, description: stripIndents` **[Jump to message](${msg.url})** `, // ** User:** <@${ author.id }> - color: 15120384, + color: 15120384, fields: context.reverse().reduce((acc, val) => { const text = val.content.length ? Util.escapeMarkdown(val.content).replace(match as string, '**__$&__**') : '**NO CONTENT**'; acc.push({ - name: `${val.author.tag} (${val.author.id}) - ${val.id}`, + name: `${val.author.tag} (${val.author.id}) - ${val.id}`, value: text.length < 1024 ? text : text.substring(0, 1013) + '...' }); if (text.length > 1024) acc.push({ - name: ZeroWidthChar, + name: ZeroWidthChar, value: '...' + text.substring(1013, 2034) }); return acc; @@ -396,11 +396,11 @@ export default class AutoModeration extends Observer implements Initialisable for (const action of actions) { components.push({ - type: ComponentType.Button, + type: ComponentType.Button, label: action.type, - // eslint-disable-next-line camelcase + customId: `WORDWATCHER_${action.trigger}`, - style: CONSTANTS.ButtonStyles[action.type] || ButtonStyle.Primary + style: CONSTANTS.ButtonStyles[action.type] || ButtonStyle.Primary }); } @@ -409,7 +409,7 @@ export default class AutoModeration extends Observer implements Initialisable components }] : null; const opts: MessageCreateOptions = { - embeds: [ embed ], + embeds: [ embed ], components: [] }; if (actionRow) @@ -422,9 +422,9 @@ export default class AutoModeration extends Observer implements Initialisable // Only insert if actions are defined if (actionRow && sent) await this.client.storageManager.mongodb.wordwatcher.insertOne({ - message: sent.id, - target: msg.id, - channel: msg.channel.id, + message: sent.id, + target: msg.id, + channel: msg.channel.id, timestamp: Date.now() }); } @@ -740,9 +740,9 @@ export default class AutoModeration extends Observer implements Initialisable [ action ] = actions; msg.filtered = { - match: match[0], + match: match[0], matcher: 'invites', - filter: 'invite' + filter: 'invite' }; if (!action) return this.client.rateLimiter.queueDelete(channel, msg).catch(() => null); // msg.delete(); diff --git a/src/client/components/observers/CommandHandler.ts b/src/client/components/observers/CommandHandler.ts index 83fc918..94a12cc 100644 --- a/src/client/components/observers/CommandHandler.ts +++ b/src/client/components/observers/CommandHandler.ts @@ -50,9 +50,9 @@ class CommandHandler extends Observer constructor (client: DiscordClient) { super(client, { - name: 'commandHandler', + name: 'commandHandler', priority: 10, - guarded: true + guarded: true }); this.hooks = [ @@ -131,8 +131,8 @@ class CommandHandler extends Observer if (!command) return invoker.reply({ - content: invoker.format('O_COMMANDHANDLER_COMMANDNOTSYNCED'), - emoji: 'failure', + content: invoker.format('O_COMMANDHANDLER_COMMANDNOTSYNCED'), + emoji: 'failure', ephemeral: true }); @@ -218,7 +218,7 @@ class CommandHandler extends Observer return invoker.reply({ content, - emoji: 'failure', + emoji: 'failure', ephemeral: true }); } @@ -257,7 +257,7 @@ class CommandHandler extends Observer let response = null; if (this.client.developmentMode && !this.client.developers.includes(invoker.user.id)) return invoker.reply({ - content: 'The bot is temporarily unavailable.', + content: 'The bot is temporarily unavailable.', ephemeral: true }); @@ -661,25 +661,25 @@ class CommandHandler extends Observer command: () => { return { - embeds: [ (info.error as CommandError).embed ], + embeds: [ (info.error as CommandError).embed ], ephemeral: !invoker.replied }; }, commandHandler: () => { return { - content: invoker.format('O_COMMANDHANDLER_ERROR'), - emoji: 'failure', - ephemeral: !invoker.replied, + content: invoker.format('O_COMMANDHANDLER_ERROR'), + emoji: 'failure', + ephemeral: !invoker.replied, components: [ { - type: ComponentType.ActionRow, + type: ComponentType.ActionRow, components: [ { label: 'Support', - type: ComponentType.Button, + type: ComponentType.Button, style: ButtonStyle.Link, - url: this.client.supportInvite + url: this.client.supportInvite } ] } @@ -689,7 +689,7 @@ class CommandHandler extends Observer inhibitor: () => { return { - content: `${invoker.format(info.inhibitor!.index, { command: invoker.command.resolveable, ...info.params })}\n**\`${info.inhibitor!.resolveable}\`**`, + content: `${invoker.format(info.inhibitor!.index, { command: invoker.command.resolveable, ...info.params })}\n**\`${info.inhibitor!.resolveable}\`**`, ephemeral: !invoker.replied }; } diff --git a/src/client/components/observers/ErrorLog.ts b/src/client/components/observers/ErrorLog.ts index fa1acce..af887df 100644 --- a/src/client/components/observers/ErrorLog.ts +++ b/src/client/components/observers/ErrorLog.ts @@ -23,7 +23,7 @@ import GuildWrapper from '../wrappers/GuildWrapper.js'; import UserWrapper from '../wrappers/UserWrapper.js'; const COLOURS = { - fatal: 16711680, + fatal: 16711680, warning: 15120384 }; @@ -32,7 +32,7 @@ class ErrorLog extends Observer constructor (client: DiscordClient) { super(client, { - name: 'errorLogger', + name: 'errorLogger', priority: 10, disabled: false }); @@ -81,15 +81,15 @@ class ErrorLog extends Observer // if (!channel) return; const str = `${guild.format('AUTOMOD_ERROR', { - channel: infraction.channel!.id, - target: `${(target as UserWrapper).tag} (${target!.id})`, + channel: infraction.channel!.id, + target: `${(target as UserWrapper).tag} (${target!.id})`, type, infractionReason: infraction.reason, - reason: guild.format(`${reason}_AUTOMOD`) + reason: guild.format(`${reason}_AUTOMOD`) })}`; const embed = { description: str, - color: COLOURS[fatal ? 'fatal' : 'warning'] + color: COLOURS[fatal ? 'fatal' : 'warning'] }; // this.client.rateLimiter.limitSend(channel, { @@ -115,7 +115,7 @@ class ErrorLog extends Observer const str = `${guild.format(`WORDWATCHER_${warning ? 'WARN' : 'ERROR'}`)}\n${message}`; const embed = { description: str, - color: COLOURS[warning ? 'warning' : 'fatal'] + color: COLOURS[warning ? 'warning' : 'fatal'] }; // this.client.rateLimiter.limitSend(channel, { @@ -154,7 +154,7 @@ class ErrorLog extends Observer { const embed = { description: `${guild.format('LINKFILTER_WARN_TITLE')}\n\n${message}`, - color: COLOURS.warning + color: COLOURS.warning }; this.post(guild, embed, 'linkFilterWarn'); } @@ -163,8 +163,8 @@ class ErrorLog extends Observer { const embed = { description: guild.format('FILTER_MISSING_PERMISSIONS', { - filter: Util.capitalise(filter), - channel: channel.name, + filter: Util.capitalise(filter), + channel: channel.name, permissions: permissions.join(', ') }) }; diff --git a/src/client/components/observers/GuildLogging.ts b/src/client/components/observers/GuildLogging.ts index c5d7727..3d1784c 100644 --- a/src/client/components/observers/GuildLogging.ts +++ b/src/client/components/observers/GuildLogging.ts @@ -26,25 +26,25 @@ import { stripIndents } from 'common-tags'; import moment from 'moment'; import { inspect } from 'util'; -/* eslint-disable no-labels */ + const CONSTANTS: { COLORS: { [key: string]: number }, IMAGES: { PREMIUM_LIMIT: number, UPLOAD_LIMIT: { [key: string]: number }, MB_DIVIDER: number }, WEEK: number } = { COLORS: { - RED: 16711680, // message delete - YELLOW: 15120384, // message edit - LIGHT_BLUE: 11337726, // message pin - BLUE: 479397, - THREAD_DELETE: 16711680, // red - THREAD_CREATE: 4245310, // green - THREAD_ARCHIVE: 16550915, // Orange + RED: 16711680, // message delete + YELLOW: 15120384, // message edit + LIGHT_BLUE: 11337726, // message pin + BLUE: 479397, + THREAD_DELETE: 16711680, // red + THREAD_CREATE: 4245310, // green + THREAD_ARCHIVE: 16550915, // Orange THREAD_UNARCHIVE: 4615101 // blue }, IMAGES: { PREMIUM_LIMIT: 2, - UPLOAD_LIMIT: { + UPLOAD_LIMIT: { '0': 8, '1': 8, '2': 50, @@ -66,7 +66,7 @@ class GuildLogger extends Observer constructor (client: DiscordClient) { super(client, { - name: 'guildLogger', + name: 'guildLogger', priority: 3, disabled: false }); @@ -87,7 +87,7 @@ class GuildLogger extends Observer if (!process.env.MODERATION_WEHBHOOK_ID || !process.env.MODERATION_WEHBHOOK_TOKEN) throw Util.fatal('Missing attachment webhook credentials'); this.#attachmentWebhook = new WebhookClient({ - id: process.env.MODERATION_WEHBHOOK_ID, + id: process.env.MODERATION_WEHBHOOK_ID, token: process.env.MODERATION_WEHBHOOK_TOKEN }); @@ -178,10 +178,10 @@ class GuildLogger extends Observer if (parentId && !parent) parent = await guild.resolveChannel(parentId); const embed = { - title: guild.format('MSGLOG_THREAD_TITLE', { action: guild.format('THREAD_SWITCH', { type }, { code: true }), channel: parent?.name || 'Missing parent' }), + title: guild.format('MSGLOG_THREAD_TITLE', { action: guild.format('THREAD_SWITCH', { type }, { code: true }), channel: parent?.name || 'Missing parent' }), description: guild.format(`MSGLOG_THREAD_DESC_${type}`, { owner: owner.tag, actor: actor?.tag || 'System', name: thread.name, id: thread.id }), - footer: { text: guild.format('MSGLOG_THREAD_FOOTER', { ownerId: owner.id, channelId: parent?.id || 'Missing parent', threadId: thread.id }) }, - color: CONSTANTS.COLORS[`THREAD_${type}`] + footer: { text: guild.format('MSGLOG_THREAD_FOOTER', { ownerId: owner.id, channelId: parent?.id || 'Missing parent', threadId: thread.id }) }, + color: CONSTANTS.COLORS[`THREAD_${type}`] }; if (thread.locked) @@ -247,7 +247,7 @@ class GuildLogger extends Observer const fields = []; let field = { - name: ZeroWidthChar, + name: ZeroWidthChar, value: '' }; for (const word of words) @@ -267,11 +267,11 @@ class GuildLogger extends Observer fields.push(field); const embed: APIEmbed = { - title: wrapper.format('MSGLOG_DELETE_TITLE', { channel: channel.name, author: Util.escapeMarkdown(author.tag) }), + title: wrapper.format('MSGLOG_DELETE_TITLE', { channel: channel.name, author: Util.escapeMarkdown(author.tag) }), // description: Util.escapeMarkdown(content)?.replace(/\\n/gu, ' ') || wrapper.format('MSGLOG_NOCONTENT'), description: content?.length ? '' : wrapper.format('MSGLOG_NOCONTENT'), - color: CONSTANTS.COLORS.RED, - footer: { + color: CONSTANTS.COLORS.RED, + footer: { text: wrapper.format('MSGLOG_DELETE_FOOTER', { msgID: id, userID: author.id }) }, timestamp: message.createdAt.toISOString(), @@ -291,7 +291,7 @@ class GuildLogger extends Observer : wrapper.format('MSGLOG_REPLY_NOCONTENT'); embed.fields!.push({ - name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }), + name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }), value: wrapper.format('MSGLOG_REPLY_VALUE', { content, link: referenced.url @@ -304,7 +304,7 @@ class GuildLogger extends Observer { const filter = message.filtered.filter!.toUpperCase(); const filteredField = { - name: wrapper.format('MSGLOG_FILTERED'), + name: wrapper.format('MSGLOG_FILTERED'), value: wrapper.format( `MSGLOG_FILTERED_VALUE_${filter}`, { ...message.filtered } @@ -572,15 +572,15 @@ class GuildLogger extends Observer // TODO figure out how to do messages longer than 2k if (content && content.length > cutOff) fields.push({ - name: ZeroWidthChar, + name: ZeroWidthChar, value: content.substring(cutOff, cutOff*2) }); // TODO Links can be long, figure out a way to ensure a field here doesn't exceed the limit if (uploaded.length) fields.push({ - name: wrapper.format('BULK_DELETE_ATTACHMENTS'), - value: uploaded.join('\n'), + name: wrapper.format('BULK_DELETE_ATTACHMENTS'), + value: uploaded.join('\n'), _attachment: true }); } @@ -590,7 +590,7 @@ class GuildLogger extends Observer const embeds: ExtendedAPIEmbed[] = []; const embed: ExtendedAPIEmbed = { // title gets set later fields: [], - color: CONSTANTS.COLORS.RED + color: CONSTANTS.COLORS.RED }; let length = 0; // Embed total length fields.reduce((_embed, field) => @@ -705,13 +705,13 @@ class GuildLogger extends Observer title: wrapper.format( 'MSGLOG_PINNED_TITLE', { - author: Util.escapeMarkdown(author.tag), + author: Util.escapeMarkdown(author.tag), channel: channel.name, - pinned: wrapper.format('PIN_TOGGLE', { toggle: newMessage.pinned }, { code: true }) + pinned: wrapper.format('PIN_TOGGLE', { toggle: newMessage.pinned }, { code: true }) } ), description: wrapper.format('MSGLOG_EDIT_JUMP', { guild: guild.id, channel: channel.id, message: oldMessage.id }), - color: CONSTANTS.COLORS.LIGHT_BLUE + color: CONSTANTS.COLORS.LIGHT_BLUE }; if (oldMessage.content.length) @@ -731,22 +731,22 @@ class GuildLogger extends Observer // name: oldMessage.format('MSGLOG_EDIT_TITLE', { author: Util.escapeMarkdown(author.tag), channel: channel.name }), // icon_url: oldMessage.author.displayAvatarURL({ size: 32 }) // eslint-disable-line camelcase // }, - title: wrapper.format('MSGLOG_EDIT_TITLE', { author: Util.escapeMarkdown(author.tag), channel: channel.name }), + title: wrapper.format('MSGLOG_EDIT_TITLE', { author: Util.escapeMarkdown(author.tag), channel: channel.name }), footer: { text: wrapper.format('MSGLOG_EDIT_FOOTER', { msgID: oldMessage.id, userID: author.id }) }, description: wrapper.format('MSGLOG_EDIT_JUMP', { guild: guild.id, channel: channel.id, message: oldMessage.id }), - color: CONSTANTS.COLORS.YELLOW, - timestamp: oldMessage.createdAt.toISOString(), - fields: [] + color: CONSTANTS.COLORS.YELLOW, + timestamp: oldMessage.createdAt.toISOString(), + fields: [] }; const oldCon = oldMessage.content, - newCon = newMessage.content; + newCon = newMessage.content; const oldWords = oldCon.split(' '); const newWords = newCon.split(' '); let field = { - name: ZeroWidthChar, + name: ZeroWidthChar, value: '' }; @@ -797,7 +797,7 @@ class GuildLogger extends Observer : referenced.content : wrapper.format('MSGLOG_REPLY_NOCONTENT'); embed.fields!.push({ - name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }), + name: wrapper.format('MSGLOG_REPLY', { tag: referenced.author.tag, id: referenced.author.id }), value: wrapper.format('MSGLOG_REPLY_VALUE', { content, link: referenced.url @@ -839,9 +839,9 @@ class GuildLogger extends Observer let index = null; const langParams = { - nickname: member.nickname ? `\`(${member.nickname})\`` : '', - tag: Util.escapeMarkdown(member.user.tag), - id: member.id, + nickname: member.nickname ? `\`(${member.nickname})\`` : '', + tag: Util.escapeMarkdown(member.user.tag), + id: member.id, oldChannel: oldState.channel?.name, newChannel: newState.channel?.name }; @@ -946,9 +946,9 @@ class GuildLogger extends Observer const newNick = newMember.nickname || newMember.user.username; const embed = { - title: wrapper.format('NICKLOG_TITLE', { user: Util.escapeMarkdown(user.tag) }), + title: wrapper.format('NICKLOG_TITLE', { user: Util.escapeMarkdown(user.tag) }), description: wrapper.format('NICKLOG_DESCRIPTION', { oldNick, newNick }), - footer: { + footer: { text: wrapper.format('NICKLOG_FOOTER', { id: user.id }) }, color: CONSTANTS.COLORS.BLUE diff --git a/src/client/components/observers/Metrics.ts b/src/client/components/observers/Metrics.ts index 711362a..26e0083 100644 --- a/src/client/components/observers/Metrics.ts +++ b/src/client/components/observers/Metrics.ts @@ -24,7 +24,7 @@ class Metrics extends Observer constructor (client: DiscordClient) { super(client, { - name: 'metrics', + name: 'metrics', priority: 10, disabled: false }); diff --git a/src/client/components/observers/UtilityHook.ts b/src/client/components/observers/UtilityHook.ts index 72436bf..9f1669b 100644 --- a/src/client/components/observers/UtilityHook.ts +++ b/src/client/components/observers/UtilityHook.ts @@ -27,7 +27,7 @@ class UtilityHook extends Observer constructor (client: DiscordClient) { super(client, { - name: 'utility', + name: 'utility', priority: 3, disabled: false }); diff --git a/src/client/components/settings/administration/Commands.ts b/src/client/components/settings/administration/Commands.ts index 938ea7a..10a6332 100644 --- a/src/client/components/settings/administration/Commands.ts +++ b/src/client/components/settings/administration/Commands.ts @@ -25,34 +25,34 @@ class CommandsSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'commands', - aliases: [ 'cmd' ], - moduleName: 'administration', + name: 'commands', + aliases: [ 'cmd' ], + moduleName: 'administration', description: 'Manage commands', - display: 'Commands', - default: { + display: 'Commands', + default: { disabled: [], - custom: {} + custom: {} }, definitions: { disabled: { ARRAY: 'COMMAND' }, - custom: { OBJECT: 'CUSTOM_COMMAND' } + custom: { OBJECT: 'CUSTOM_COMMAND' } }, - commandType: CommandOptionType.SUB_COMMAND_GROUP, + commandType: CommandOptionType.SUB_COMMAND_GROUP, commandOptions: [{ - name: [ 'enable', 'disable' ], + name: [ 'enable', 'disable' ], description: [ 'Enable commands', 'Disable commands' ], - type: CommandOptionType.SUB_COMMAND, - options: [{ - name: 'commands', + type: CommandOptionType.SUB_COMMAND, + options: [{ + name: 'commands', description: 'The command to enable/disable', - type: CommandOptionType.COMMANDS, - required: true + type: CommandOptionType.COMMANDS, + required: true }] }, { - name: 'list', + name: 'list', description: 'List disabled commands', - type: CommandOptionType.SUB_COMMAND + type: CommandOptionType.SUB_COMMAND }] }); } diff --git a/src/client/components/settings/administration/IgnoreChannels.ts b/src/client/components/settings/administration/IgnoreChannels.ts index f1f48eb..8cb98da 100644 --- a/src/client/components/settings/administration/IgnoreChannels.ts +++ b/src/client/components/settings/administration/IgnoreChannels.ts @@ -27,34 +27,34 @@ class IgnoreSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'ignore', - moduleName: 'administration', + name: 'ignore', + moduleName: 'administration', description: 'Have the bot ignore commands in given channels', - display: 'Ignore Channels', - default: { + display: 'Ignore Channels', + default: { channels: [], - bypass: [] + bypass: [] }, definitions: { channels: { ARRAY: 'GUILD_TEXT' }, - bypass: { ARRAY: 'GUILD_ROLE' } + bypass: { ARRAY: 'GUILD_ROLE' } }, commandOptions: [ { - name: 'list', + name: 'list', description: 'List to act on', - type: CommandOptionType.STRING, - choices: [ + type: CommandOptionType.STRING, + choices: [ { name: 'channels', value: 'channels' }, { name: 'bypass', value: 'bypass' } ], dependsOn: [ 'method' ]// , valueAsAlias: true, flag: true }, { - name: 'method', + name: 'method', description: 'Method of modifying', - type: CommandOptionType.STRING, - choices: [ + type: CommandOptionType.STRING, + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -74,7 +74,7 @@ class IgnoreSetting extends Setting return this.list(setting[list!.asString], invoker, list?.asString); const promptResponse = await this._prompt(invoker, { - index: `SETTING_PROMPT_${method!.asString.toUpperCase()}`, + index: `SETTING_PROMPT_${method!.asString.toUpperCase()}`, params: { list: list?.asString } }); if (promptResponse.error) @@ -96,9 +96,9 @@ class IgnoreSetting extends Setting return { index: 'SETTING_NO_CHANGE' }; return { - index: `SETTING_SUCCESS_${method?.asString.toUpperCase()}`, + index: `SETTING_SUCCESS_${method?.asString.toUpperCase()}`, params: { - updated: list!.asString, + updated: list!.asString, modified: (values as {id: string, name: string}[]).filter((o) => modified.includes(o.id)).map((o) => o.name).join('__, __') } }; @@ -110,11 +110,11 @@ class IgnoreSetting extends Setting const setting = settings[this.name] as IgnoreSettings; return [ { - name: 'GENERAL_CHANNELS', + name: 'GENERAL_CHANNELS', value: setting.channels.map((c) => `<#${c}>`).join(', ') || '**N/A**' }, { - name: 'GENERAL_BYPASS', + name: 'GENERAL_BYPASS', value: setting.bypass.map((r) => `<@&${r}>`).join(', ') || '**N/A**' } ]; diff --git a/src/client/components/settings/administration/Indexing.ts b/src/client/components/settings/administration/Indexing.ts index 9cbea35..22f0916 100644 --- a/src/client/components/settings/administration/Indexing.ts +++ b/src/client/components/settings/administration/Indexing.ts @@ -27,25 +27,25 @@ class IndexSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'indexing', - moduleName: 'administration', + name: 'indexing', + moduleName: 'administration', description: 'Configure guild indexing for the dashboard', - display: 'Indexing', - default: { - enabled: false, + display: 'Indexing', + default: { + enabled: false, description: null }, commandOptions: [ { - name: 'enabled', - description: 'Toggle enable state', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle enable state', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'description', + name: 'description', description: 'A description ' } ] @@ -66,14 +66,14 @@ class IndexSetting extends Setting const setting = guild._settings[this.name] as IndexingSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_DESCRIPTION', + name: 'GENERAL_DESCRIPTION', value: setting.description || '**N/A**' } ]; diff --git a/src/client/components/settings/administration/PermissionType.ts b/src/client/components/settings/administration/PermissionType.ts index 436553e..dde3222 100644 --- a/src/client/components/settings/administration/PermissionType.ts +++ b/src/client/components/settings/administration/PermissionType.ts @@ -26,11 +26,11 @@ class Permissions extends Setting constructor (client: DiscordClient) { super(client, { - name: 'permissions', + name: 'permissions', description: 'Change between discord and bot based permissions', - moduleName: 'administration', - display: 'Permission Type', - default: { + moduleName: 'administration', + display: 'Permission Type', + default: { type: 'discord' }, definitions: { @@ -38,9 +38,9 @@ class Permissions extends Setting }, commandOptions: [ { - name: 'type', + name: 'type', description: 'Where to read permissions from', - choices: [ + choices: [ { name: 'discord', value: 'discord' }, { name: 'both', value: 'both' }, { name: 'grant', value: 'grant' } @@ -62,7 +62,7 @@ class Permissions extends Setting const setting = guild._settings[this.name] as PermissionSettings; return [ { - name: 'SETTING_PERMISSION_TYPE_FIELD', + name: 'SETTING_PERMISSION_TYPE_FIELD', value: '`' + setting.type + '`' } ]; diff --git a/src/client/components/settings/administration/Protection.ts b/src/client/components/settings/administration/Protection.ts index 414ff0b..585f093 100644 --- a/src/client/components/settings/administration/Protection.ts +++ b/src/client/components/settings/administration/Protection.ts @@ -27,34 +27,34 @@ class ProtectionSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'protection', + name: 'protection', description: 'Select which roles are immune from moderation', - moduleName: 'administration', - display: 'Protection', - default: { - type: 'position', - roles: [], + moduleName: 'administration', + display: 'Protection', + default: { + type: 'position', + roles: [], enabled: false }, definitions: { - type: { STRING: [ 'role', 'position' ] }, - roles: { ARRAY: 'GUILD_ROLE' }, + type: { STRING: [ 'role', 'position' ] }, + roles: { ARRAY: 'GUILD_ROLE' }, enabled: 'BOOLEAN' }, commandOptions: [ { - name: 'type', + name: 'type', description: 'Select protection type', - choices: [ + choices: [ { name: 'role', value: 'role' }, { name: 'position', value: 'position' } ], dependsOn: [] }, { - name: 'roles', + name: 'roles', description: 'Method of modifying', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -64,9 +64,9 @@ class ProtectionSetting extends Setting dependsOn: [] }, { - name: 'enabled', + name: 'enabled', description: 'Whether setting is active or not', - type: CommandOptionType.BOOLEAN + type: CommandOptionType.BOOLEAN } ] }); @@ -75,7 +75,7 @@ class ProtectionSetting extends Setting async execute (invoker: InvokerWrapper, opts: CommandParams, setting: ProtectionSettings) { const { type, roles, enabled } = opts, - langParams: FormatParams = {}; + langParams: FormatParams = {}; let index = 'SETTING_SUCCESS_ALT'; if (type) @@ -89,7 +89,7 @@ class ProtectionSetting extends Setting if (roles) { const response = await this._prompt(invoker, { - index: `SETTING_PROMPT_${roles.asString.toUpperCase()}`, + index: `SETTING_PROMPT_${roles.asString.toUpperCase()}`, params: { list: 'roles' } }); if (response.error) @@ -122,19 +122,19 @@ class ProtectionSetting extends Setting const setting = guild._settings[this.name] as ProtectionSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_TYPE', - value: `\`${setting.type}\``, + name: 'GENERAL_TYPE', + value: `\`${setting.type}\``, inline: true }, { - name: 'GENERAL_ROLES', - value: setting.roles.length ? setting.roles.map((r) => `<@&${r}>`).join(' ') : '**N/A**', + name: 'GENERAL_ROLES', + value: setting.roles.length ? setting.roles.map((r) => `<@&${r}>`).join(' ') : '**N/A**', inline: true } ]; diff --git a/src/client/components/settings/administration/Silent.ts b/src/client/components/settings/administration/Silent.ts index 560efb6..334b970 100644 --- a/src/client/components/settings/administration/Silent.ts +++ b/src/client/components/settings/administration/Silent.ts @@ -26,11 +26,11 @@ class SilentSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'silent', + name: 'silent', description: 'Toggle between normal and ephemeral (only the executor sees the response) moderation responses', - moduleName: 'administration', - display: 'Silent', - default: { + moduleName: 'administration', + display: 'Silent', + default: { enabled: false }, definitions: { @@ -38,12 +38,12 @@ class SilentSetting extends Setting }, commandOptions: [ { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle state' + defaultValue: true, + name: 'enabled', + description: 'Toggle state' } ] }); @@ -66,8 +66,8 @@ class SilentSetting extends Setting const setting = guild._settings[this.name] as SilenceSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true } ]; diff --git a/src/client/components/settings/administration/TextCommands.ts b/src/client/components/settings/administration/TextCommands.ts index 35d8e42..ea1c537 100644 --- a/src/client/components/settings/administration/TextCommands.ts +++ b/src/client/components/settings/administration/TextCommands.ts @@ -26,25 +26,25 @@ class TextCommands extends Setting constructor (client: DiscordClient) { super(client, { - name: 'textcommands', - display: 'Text Commands', + name: 'textcommands', + display: 'Text Commands', description: 'Message based commands configuration', - moduleName: 'administration', - default: { + moduleName: 'administration', + default: { enabled: false, - prefix: '-' + prefix: '-' }, commandOptions: [ { - name: 'enabled', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - description: 'Toggle enable state' + defaultValue: true, + description: 'Toggle enable state' }, { - name: 'prefix', + name: 'prefix', description: 'Prefix to use' } ] @@ -64,14 +64,14 @@ class TextCommands extends Setting { const setting = guild._settings[this.name] as TextCommandsSettings; return [{ - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_PREFIX', - value: setting.prefix, + name: 'GENERAL_PREFIX', + value: setting.prefix, inline: true }]; } diff --git a/src/client/components/settings/logging/DmInfraction.ts b/src/client/components/settings/logging/DmInfraction.ts index b0d4534..ec31f84 100644 --- a/src/client/components/settings/logging/DmInfraction.ts +++ b/src/client/components/settings/logging/DmInfraction.ts @@ -45,12 +45,12 @@ class DmInfraction extends Setting constructor (client: DiscordClient) { super(client, { - name: 'dminfraction', + name: 'dminfraction', description: 'Configure what the bot DMs users upon moderation if anything', - display: 'DM Infractions', - moduleName: 'logging', - default: { - enabled: false, + display: 'DM Infractions', + moduleName: 'logging', + default: { + enabled: false, infractions: [ 'WARN', 'MUTE', @@ -71,9 +71,9 @@ class DmInfraction extends Setting anonymous: false }, definitions: { - enabled: 'BOOLEAN', + enabled: 'BOOLEAN', infractions: { ARRAY: Infractions }, - messages: { + messages: { OBJECT: { kvPairs: Infractions.map((inf) => [ inf, 'STRING' ]) } @@ -81,26 +81,26 @@ class DmInfraction extends Setting }, commandOptions: [ { - name: 'message', + name: 'message', description: 'Set the message for an infraction type', - type: CommandOptionType.STRING, - dependsOn: [ 'infraction' ] + type: CommandOptionType.STRING, + dependsOn: [ 'infraction' ] }, { - name: 'infraction', + name: 'infraction', description: 'Choose the infraction for which to modify the message', - type: CommandOptionType.STRING, - choices: Infractions.map((inf) => + type: CommandOptionType.STRING, + choices: Infractions.map((inf) => { return { name: inf, value: inf }; }), dependsOn: [ 'message' ] }, { - name: 'infractions', + name: 'infractions', description: 'Modify the list of infractions that are sent', - type: CommandOptionType.STRING, - choices: [ + type: CommandOptionType.STRING, + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -108,20 +108,20 @@ class DmInfraction extends Setting ] }, { - name: 'enabled', - description: 'Enable or disable the sending of infractions in DMs', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Enable or disable the sending of infractions in DMs', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'anonymous', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'anonymous', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - description: 'Whether who issued the infraction is shown in moderation logs' + defaultValue: true, + description: 'Whether who issued the infraction is shown in moderation logs' } ] }); @@ -130,7 +130,7 @@ class DmInfraction extends Setting async execute (invoker: InvokerWrapper, opts: CommandParams, setting: DMInfractionSettings) { const { enabled, infractions, infraction, message, anonymous } = opts, - langParams: FormatParams = {}; + langParams: FormatParams = {}; let index = 'SETTING_SUCCESS_ALT'; if (enabled) @@ -184,21 +184,21 @@ class DmInfraction extends Setting const setting = guild._settings[this.name] as DMInfractionSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_ANONYMOUS', - value: guild.format('GENERAL_STATE', { bool: setting.anonymous }, { code: true }), + name: 'GENERAL_ANONYMOUS', + value: guild.format('GENERAL_STATE', { bool: setting.anonymous }, { code: true }), inline: true }, { - name: 'GENERAL_INFRACTIONS', + name: 'GENERAL_INFRACTIONS', value: setting.infractions.join(', ') }, { - name: 'GENERAL_MESSAGES', + name: 'GENERAL_MESSAGES', value: Object.entries(setting.messages).map(([ key, val ]) => `**${key}**: ${val}`).join('\n') } ]; diff --git a/src/client/components/settings/logging/Errors.ts b/src/client/components/settings/logging/Errors.ts index 984eaa5..01e7318 100644 --- a/src/client/components/settings/logging/Errors.ts +++ b/src/client/components/settings/logging/Errors.ts @@ -29,32 +29,32 @@ class MessageLog extends Setting // Primarily meant for output when automated actions error out // (i.e. automod runs into issues that the user can rectify) super(client, { - name: 'errors', - moduleName: 'logging', - description: 'Have the bot send error messages in the server for configuration errors', - display: 'Error Logging', + name: 'errors', + moduleName: 'logging', + description: 'Have the bot send error messages in the server for configuration errors', + display: 'Error Logging', clientPermissions: [ 'ManageWebhooks' ], - default: { + default: { channel: null, - types: [] + types: [] }, definitions: { channel: 'GUILD_TEXT', - types: { ARRAY: 'ERROR_TYPES' } // TODO: Error types + types: { ARRAY: 'ERROR_TYPES' } // TODO: Error types }, commandOptions: [ { - name: 'channel', + name: 'channel', description: 'Channel in which to output logs', - type: CommandOptionType.TEXT_CHANNEL + type: CommandOptionType.TEXT_CHANNEL }, { - name: 'enabled', - description: 'Toggle logging on or off', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle logging on or off', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true } ] }); @@ -72,8 +72,8 @@ class MessageLog extends Setting const missingPerms = perms?.missing([ 'ViewChannel', 'EmbedLinks', 'SendMessages' ]); if (!missingPerms || missingPerms.length) return { - error: true, - index: 'ERR_CHANNEL_PERMS', + error: true, + index: 'ERR_CHANNEL_PERMS', params: { channel: channel.name, perms: missingPerms?.join(', ') } }; setting.channel = channel.id; @@ -86,13 +86,13 @@ class MessageLog extends Setting const setting = guild._settings[this.name] as ErrorLogSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: Boolean(setting.channel) }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: Boolean(setting.channel) }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: setting.channel ? `<#${setting.channel}>` : '**N/A**', + name: 'GENERAL_CHANNEL', + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true } ]; diff --git a/src/client/components/settings/logging/Members.ts b/src/client/components/settings/logging/Members.ts index 8c3d0b3..d6ad3ef 100644 --- a/src/client/components/settings/logging/Members.ts +++ b/src/client/components/settings/logging/Members.ts @@ -26,46 +26,46 @@ class MemberLog extends Setting constructor (client: DiscordClient) { super(client, { - name: 'members', + name: 'members', description: 'Define where new joins and leaves are logged', - display: 'Member Logging', - moduleName: 'logging', - default: { + display: 'Member Logging', + moduleName: 'logging', + default: { channel: null, - join: '{mention} joined the server.', - leave: '**{tag}** ({id}) left the server.', + join: '{mention} joined the server.', + leave: '**{tag}** ({id}) left the server.', enabled: false }, definitions: { channel: 'GUILD_TEXT', - join: 'STRING', - leave: 'STRING' + join: 'STRING', + leave: 'STRING' }, commandOptions: [ { - name: 'enabled', - description: 'Enable/disable member logs', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Enable/disable member logs', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'channel', + name: 'channel', description: 'Select the log output channel', - type: CommandOptionType.TEXT_CHANNEL + type: CommandOptionType.TEXT_CHANNEL }, { - name: 'join', + name: 'join', description: 'Set the join message', - type: CommandOptionType.STRING, - flag: true + type: CommandOptionType.STRING, + flag: true }, { - name: 'leave', + name: 'leave', description: 'Set the leave message', - type: CommandOptionType.STRING, - flag: true + type: CommandOptionType.STRING, + flag: true } ] }); @@ -89,21 +89,21 @@ class MemberLog extends Setting const setting = guild._settings[this.name] as MemberLogSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: setting.channel ? `<#${setting.channel}>` : '**N/A**', + name: 'GENERAL_CHANNEL', + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true }, { - name: 'SETTING_MEMBERLOG_JOIN', + name: 'SETTING_MEMBERLOG_JOIN', value: setting.join ? `\`${setting.join}\`` : '**N/A**', }, { - name: 'SETTING_MEMBERLOG_LEAVE', + name: 'SETTING_MEMBERLOG_LEAVE', value: setting.leave ? `\`${setting.leave}\`` : '**N/A**', } ]; diff --git a/src/client/components/settings/logging/Messages.ts b/src/client/components/settings/logging/Messages.ts index 9c79131..3b35a97 100644 --- a/src/client/components/settings/logging/Messages.ts +++ b/src/client/components/settings/logging/Messages.ts @@ -29,62 +29,62 @@ class MessageLog extends Setting constructor (client: DiscordClient) { super(client, { - name: 'messages', - moduleName: 'logging', - description: 'Configure where messages are logged', - display: 'Message Logging', + name: 'messages', + moduleName: 'logging', + description: 'Configure where messages are logged', + display: 'Message Logging', clientPermissions: [ 'ManageWebhooks' ], - default: { - channel: null, - ignore: [], - bypass: [], + default: { + channel: null, + ignore: [], + bypass: [], attachments: false, - webhook: null, - enabled: false + webhook: null, + enabled: false }, definitions: { - channel: 'GUILD_TEXT', - bypass: { ARRAY: 'GUILD_ROLE' }, - ignore: { ARRAY: 'GUILD_TEXT' }, + channel: 'GUILD_TEXT', + bypass: { ARRAY: 'GUILD_ROLE' }, + ignore: { ARRAY: 'GUILD_TEXT' }, attachments: 'BOOLEAN' }, commandOptions: [ { - name: 'channel', + name: 'channel', description: 'Channel in which to output logs', - type: CommandOptionType.TEXT_CHANNEL + type: CommandOptionType.TEXT_CHANNEL }, { - name: 'enabled', - description: 'Toggle logging on or off', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle logging on or off', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'attachments', - description: 'Whether to log attachments. PREMIUM TIER 1', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'attachments', + description: 'Whether to log attachments. PREMIUM TIER 1', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'list', + name: 'list', description: 'Select which list to modify', - type: CommandOptionType.STRING, - choices: [ + type: CommandOptionType.STRING, + choices: [ { name: 'bypass', value: 'bypass' }, { name: 'ignore', value: 'ignore' }, ], dependsOn: [ 'method' ] }, { - name: 'method', + name: 'method', description: 'Select which modification method to use', - type: CommandOptionType.STRING, - choices: [ + type: CommandOptionType.STRING, + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -118,8 +118,8 @@ class MessageLog extends Setting const missingPerms = perms?.missing([ 'ViewChannel', 'EmbedLinks', 'SendMessages', 'ManageWebhooks' ]); if (!missingPerms || missingPerms.length) return { - error: true, - index: 'ERR_CHANNEL_PERMS', + error: true, + index: 'ERR_CHANNEL_PERMS', params: { channel: channel.name, perms: missingPerms?.join(', ') ?? 'ALL' } }; @@ -135,7 +135,7 @@ class MessageLog extends Setting else { hook = await channel.createWebhook({ - name: 'Galactic Bot message logs', + name: 'Galactic Bot message logs', reason: 'Message logs webhook.' }); // avatar: './util/GBotTest.png', await guild.updateWebhook(this.name, hook); @@ -193,28 +193,28 @@ class MessageLog extends Setting const setting = guild._settings[this.name] as MessagesSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: setting.channel ? `<#${setting.channel}>` : '**N/A**', + name: 'GENERAL_CHANNEL', + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true }, { - name: 'ATTACHMENT_LOGS', - value: guild.format('GENERAL_STATE', { bool: Boolean(setting.attachments) }, { code: true }), + name: 'ATTACHMENT_LOGS', + value: guild.format('GENERAL_STATE', { bool: Boolean(setting.attachments) }, { code: true }), inline: true }, { - name: 'GENERAL_BYPASS', - value: setting.bypass.map((r) => `<@&${r}>`).join(', ') || '**N/A**', + name: 'GENERAL_BYPASS', + value: setting.bypass.map((r) => `<@&${r}>`).join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_IGNORED', - value: setting.ignore.map((c) => `<#${c}>`).join(', ') || '**N/A**', + name: 'GENERAL_IGNORED', + value: setting.ignore.map((c) => `<#${c}>`).join(', ') || '**N/A**', inline: true } ]; diff --git a/src/client/components/settings/logging/Moderation.ts b/src/client/components/settings/logging/Moderation.ts index c663ab3..892daf9 100644 --- a/src/client/components/settings/logging/Moderation.ts +++ b/src/client/components/settings/logging/Moderation.ts @@ -50,50 +50,50 @@ class ModerationLog extends Setting constructor (client: DiscordClient) { super(client, { - name: 'moderation', + name: 'moderation', description: 'Configure where and which infractions are logged', - display: 'Moderation Logging', - moduleName: 'logging', - default: { - channel: null, + display: 'Moderation Logging', + moduleName: 'logging', + default: { + channel: null, infractions: Infractions, - anonymous: false, - enabled: false, - autoLog: true, + anonymous: false, + enabled: false, + autoLog: true, }, definitions: { - channel: 'GUILD_TEXT', + channel: 'GUILD_TEXT', infractions: { ARRAY: Infractions } }, commandOptions: [ { - name: 'enabled', - description: 'Enable/disable infraction logging', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Enable/disable infraction logging', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'autolog', - description: 'Enable/disable automatic logging of non-bot actions', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'autolog', + description: 'Enable/disable automatic logging of non-bot actions', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'channel', + name: 'channel', description: 'Logging channel', - type: CommandOptionType.TEXT_CHANNEL + type: CommandOptionType.TEXT_CHANNEL }, { - name: 'infractions', + name: 'infractions', description: 'Modify the list of infractions that are sent', - type: CommandOptionType.STRING, - choices: [ + type: CommandOptionType.STRING, + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -101,12 +101,12 @@ class ModerationLog extends Setting ] }, { - name: 'anonymous', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'anonymous', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - description: 'Whether who issued the infraction is shown in moderation logs' + defaultValue: true, + description: 'Whether who issued the infraction is shown in moderation logs' } ] }); @@ -115,7 +115,7 @@ class ModerationLog extends Setting async execute (invoker: InvokerWrapper, opts: CommandParams, setting: ModerationSettings) { const { channel, infractions, anonymous, enabled, autolog } = opts, - langParams: FormatParams = {}; + langParams: FormatParams = {}; let index = 'SETTING_SUCCESS_ALT'; if (enabled) @@ -180,23 +180,23 @@ class ModerationLog extends Setting const setting = guild._settings[this.name] as ModerationSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_ANONYMOUS', - value: guild.format('GENERAL_STATE', { bool: setting.anonymous }, { code: true }), + name: 'GENERAL_ANONYMOUS', + value: guild.format('GENERAL_STATE', { bool: setting.anonymous }, { code: true }), inline: true }, { - name: 'GENERAL_AUTOLOG', - value: guild.format('GENERAL_STATE', { bool: setting.autolog }, { code: true }), + name: 'GENERAL_AUTOLOG', + value: guild.format('GENERAL_STATE', { bool: setting.autolog }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: `<#${setting.channel}>`, + name: 'GENERAL_CHANNEL', + value: `<#${setting.channel}>`, inline: true }, { - name: 'GENERAL_INFRACTIONS', + name: 'GENERAL_INFRACTIONS', value: setting.infractions.join(', ') } ]; diff --git a/src/client/components/settings/logging/Nicknames.ts b/src/client/components/settings/logging/Nicknames.ts index 67023ff..13384aa 100644 --- a/src/client/components/settings/logging/Nicknames.ts +++ b/src/client/components/settings/logging/Nicknames.ts @@ -26,11 +26,11 @@ class Nicknames extends Setting constructor (client: DiscordClient) { super(client, { - name: 'nicknames', + name: 'nicknames', description: 'Configure where nicknames are logged', - display: 'Nickname Logging', - moduleName: 'logging', - default: { + display: 'Nickname Logging', + moduleName: 'logging', + default: { channel: null, enabled: false }, @@ -39,16 +39,16 @@ class Nicknames extends Setting }, commandOptions: [ { - name: 'enabled', - description: 'Toggle logging on or off', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle logging on or off', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'channel', - type: CommandOptionType.TEXT_CHANNEL, + name: 'channel', + type: CommandOptionType.TEXT_CHANNEL, description: 'Set the channel for nickname logging' } ] @@ -69,13 +69,13 @@ class Nicknames extends Setting const setting = guild._settings[this.name] as NicknameLogSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: setting.channel ? `<#${setting.channel}>` : '**N/A**', + name: 'GENERAL_CHANNEL', + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true } ]; diff --git a/src/client/components/settings/logging/Voice.ts b/src/client/components/settings/logging/Voice.ts index 1fe8316..7379ef7 100644 --- a/src/client/components/settings/logging/Voice.ts +++ b/src/client/components/settings/logging/Voice.ts @@ -26,11 +26,11 @@ class Voice extends Setting constructor (client: DiscordClient) { super(client, { - name: 'voice', + name: 'voice', description: 'Configure logging of joining and leaving voice channels', - display: 'Voice Channel Logging', - moduleName: 'logging', - default: { + display: 'Voice Channel Logging', + moduleName: 'logging', + default: { channel: null, enabled: false }, @@ -39,16 +39,16 @@ class Voice extends Setting }, commandOptions: [ { - name: 'enabled', - description: 'Toggle logging on or off', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle logging on or off', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'channel', - type: CommandOptionType.TEXT_CHANNEL, + name: 'channel', + type: CommandOptionType.TEXT_CHANNEL, description: 'Set the channel for voice join/leave logging' } ] @@ -69,13 +69,13 @@ class Voice extends Setting const setting = guild._settings[this.name] as VoiceSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: setting.channel ? `<#${setting.channel}>` : '**N/A**', + name: 'GENERAL_CHANNEL', + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true } ]; diff --git a/src/client/components/settings/moderation/AutoModeration.ts b/src/client/components/settings/moderation/AutoModeration.ts index 5900ab8..e6e1a43 100644 --- a/src/client/components/settings/moderation/AutoModeration.ts +++ b/src/client/components/settings/moderation/AutoModeration.ts @@ -38,21 +38,21 @@ class Automod extends Setting constructor (client: DiscordClient) { super(client, { - name: 'automod', + name: 'automod', description: 'Define automatic infraction escalation', - display: 'Automod', - moduleName: 'moderation', - default: { - enabled: false, + display: 'Automod', + moduleName: 'moderation', + default: { + enabled: false, usePrevious: false, - thresholds: { + thresholds: { } }, definitions: { - enabled: 'BOOLEAN', + enabled: 'BOOLEAN', usePrevious: 'BOOLEAN', - thresholds: { + thresholds: { OBJECT: { kvPairs: [[ 'length', 'INTEGER' ], [ 'type', Infractions ]] } @@ -60,44 +60,44 @@ class Automod extends Setting }, commandOptions: [ { - name: 'enabled', - description: 'Toggle state', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle state', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'useprevious', - description: 'Use the previously passed threshold if the point total lands between two thresholds', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'useprevious', + description: 'Use the previously passed threshold if the point total lands between two thresholds', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'threshold', - description: 'The threshold at which to issue an infraction', - type: CommandOptionType.INTEGER, - minimum: 0, - maximum: 100, - dependsOn: [ 'infraction', 'length' ], + name: 'threshold', + description: 'The threshold at which to issue an infraction', + type: CommandOptionType.INTEGER, + minimum: 0, + maximum: 100, + dependsOn: [ 'infraction', 'length' ], dependsOnMode: 'OR' }, { - name: 'infraction', + name: 'infraction', description: 'The type of infraction to issue', - choices: Infractions.map((inf) => + choices: Infractions.map((inf) => { return { name: inf, value: inf }; }), dependsOn: [ 'threshold' ] }, { - name: 'length', + name: 'length', description: 'The duration for a tempban or a mute', - type: CommandOptionType.TIME, - dependsOn: [ 'threshold' ] + type: CommandOptionType.TIME, + dependsOn: [ 'threshold' ] } ] }); @@ -129,17 +129,17 @@ class Automod extends Setting const setting = guild._settings[this.name] as AutomodSettings; return [ { - name: 'GENERAL_STATUS', - value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), + name: 'GENERAL_STATUS', + value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'SETTING_AUTOMOD_USEPREV', - value: guild.format('GENERAL_STATE', { bool: setting.usePrevious }, { code: true }), + name: 'SETTING_AUTOMOD_USEPREV', + value: guild.format('GENERAL_STATE', { bool: setting.usePrevious }, { code: true }), inline: true }, { - name: 'SETTING_AUTOMOD_THRESHOLDS', + name: 'SETTING_AUTOMOD_THRESHOLDS', value: Object.entries(setting.thresholds).reduce((acc, [ points, action ]) => { acc.push(`**${points}:** \`${action.type}\`${action.length ? ', ' + Util.humanise(action.length) : ''}`); diff --git a/src/client/components/settings/moderation/Grantable.ts b/src/client/components/settings/moderation/Grantable.ts index 556e984..3b687e0 100644 --- a/src/client/components/settings/moderation/Grantable.ts +++ b/src/client/components/settings/moderation/Grantable.ts @@ -27,31 +27,31 @@ class Grantable extends Setting constructor (client: DiscordClient) { super(client, { - name: 'grantable', + name: 'grantable', description: 'Congifure which roles are grantable and removable through the /roles add|remove command', - display: 'Grantable Roles', - moduleName: 'moderation', - default: { - roles: [], + display: 'Grantable Roles', + moduleName: 'moderation', + default: { + roles: [], enabled: false }, definitions: { - roles: { ARRAY: 'GUILD_ROLE' }, + roles: { ARRAY: 'GUILD_ROLE' }, enabled: 'BOOLEAN' }, commandOptions: [ { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle state' + defaultValue: true, + name: 'enabled', + description: 'Toggle state' }, { - name: 'roles', + name: 'roles', description: '', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -66,7 +66,7 @@ class Grantable extends Setting async execute (invoker: InvokerWrapper, opts: CommandParams, setting: GrantableSettings) { const { enabled, roles } = opts, - langParams: FormatParams = {}; + langParams: FormatParams = {}; let index = 'SETTING_SUCCESS_ALT'; if (enabled) @@ -78,7 +78,7 @@ class Grantable extends Setting if (roles) { const response = await this._prompt(invoker, { - index: `SETTING_PROMPT_${roles.asString.toUpperCase()}`, + index: `SETTING_PROMPT_${roles.asString.toUpperCase()}`, params: { list: 'roles' } }); if (response.error) @@ -112,11 +112,11 @@ class Grantable extends Setting const setting = guild._settings[this.name] as GrantableSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), }, { - name: 'GENERAL_ROLES', + name: 'GENERAL_ROLES', value: setting.roles.map((id) => `<@&${id}>`).join(', ') || '**N/A**' } ]; diff --git a/src/client/components/settings/moderation/InviteFilter.ts b/src/client/components/settings/moderation/InviteFilter.ts index 9cc8d28..9c7bb19 100644 --- a/src/client/components/settings/moderation/InviteFilter.ts +++ b/src/client/components/settings/moderation/InviteFilter.ts @@ -28,17 +28,17 @@ class InviteFilterSetting extends FilterSetting constructor (client: DiscordClient) { super(client, { - name: 'invitefilter', + name: 'invitefilter', description: 'Allow or disallow invite sending', - moduleName: 'moderation', - display: 'Invite Filter', - default: { - enabled: false, - silent: false, + moduleName: 'moderation', + display: 'Invite Filter', + default: { + enabled: false, + silent: false, whitelist: [], - ignore: [], - bypass: [], - actions: [ // Link certain words to actions with or without points ex fuck: { action: 'MUTE', points: null, force: false, duration: 300 } + ignore: [], + bypass: [], + actions: [ // Link certain words to actions with or without points ex fuck: { action: 'MUTE', points: null, force: false, duration: 300 } // { // action: 'MUTE', // points: 10, @@ -50,18 +50,18 @@ class InviteFilterSetting extends FilterSetting ], }, definitions: { - enabled: 'BOOLEAN', - silent: 'BOOLEAN', + enabled: 'BOOLEAN', + silent: 'BOOLEAN', whitelist: { ARRAY: 'STRING' }, - ignore: { ARRAY: 'GUILD_CHANNEL' }, - bypass: { ARRAY: 'GUILD_ROLE' }, - actions: { ARRAY: 'ACTION' } + ignore: { ARRAY: 'GUILD_CHANNEL' }, + bypass: { ARRAY: 'GUILD_ROLE' }, + actions: { ARRAY: 'ACTION' } }, commandOptions: [ { - name: 'method', + name: 'method', description: 'Select which modification method to use', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -72,9 +72,9 @@ class InviteFilterSetting extends FilterSetting dependsOn: [ 'list' ] }, { - name: 'list', + name: 'list', description: 'Select which list to modify', - choices: [ + choices: [ { name: 'whitelist', value: 'whitelist' }, { name: 'bypass', value: 'bypass' }, { name: 'ignore', value: 'ignore' }, @@ -83,20 +83,20 @@ class InviteFilterSetting extends FilterSetting dependsOn: [ 'method' ] }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'silent', - description: 'Toggle silent operation' + defaultValue: true, + name: 'silent', + description: 'Toggle silent operation' } ] }); @@ -186,14 +186,14 @@ class InviteFilterSetting extends FilterSetting const setting = guild._settings[this.name] as InviteFilterSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_SILENT', + name: 'GENERAL_SILENT', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.silent) }, { code: true }), @@ -201,22 +201,22 @@ class InviteFilterSetting extends FilterSetting }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true }, { - name: 'SETTING_FILTER_WHITELIST', - value: setting.whitelist.join(', ') || '**N/A**', + name: 'SETTING_FILTER_WHITELIST', + value: setting.whitelist.join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_IGNORED', - value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', + name: 'GENERAL_IGNORED', + value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_BYPASS', - value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', + name: 'GENERAL_BYPASS', + value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', inline: true }, { - name: 'SETTING_FILTER_ACTIONS', + name: 'SETTING_FILTER_ACTIONS', value: setting.actions.reduce((acc, val) => { let str = `**${val.type}**`; diff --git a/src/client/components/settings/moderation/LinkFilter.ts b/src/client/components/settings/moderation/LinkFilter.ts index 534fbf3..d432eff 100644 --- a/src/client/components/settings/moderation/LinkFilter.ts +++ b/src/client/components/settings/moderation/LinkFilter.ts @@ -28,20 +28,20 @@ class LinkFilterSetting extends FilterSetting constructor (client: DiscordClient) { super(client, { - name: 'linkfilter', + name: 'linkfilter', description: 'Filter messages for links', - moduleName: 'moderation', - display: 'Link Filter', - default: { + moduleName: 'moderation', + display: 'Link Filter', + default: { whitelistMode: false, - enabled: false, - silent: false, - blacklist: [], - greylist: [], - whitelist: [], - ignore: [], - bypass: [], - actions: [ // Link certain words to actions with or without points ex fuck: { action: 'MUTE', points: null, force: false, duration: 300 } + enabled: false, + silent: false, + blacklist: [], + greylist: [], + whitelist: [], + ignore: [], + bypass: [], + actions: [ // Link certain words to actions with or without points ex fuck: { action: 'MUTE', points: null, force: false, duration: 300 } // { // action: 'MUTE', // points: 10, @@ -54,20 +54,20 @@ class LinkFilterSetting extends FilterSetting }, definitions: { whitelistMode: 'BOOLEAN', - enabled: 'BOOLEAN', - silent: 'BOOLEAN', - blacklist: { ARRAY: 'STRING' }, - greylist: { ARRAY: 'STRING' }, - whitelist: { ARRAY: 'STRING' }, - ignore: { ARRAY: 'GUILD_CHANNEL' }, - bypass: { ARRAY: 'GUILD_ROLE' }, - actions: { ARRAY: 'ACTION' } + enabled: 'BOOLEAN', + silent: 'BOOLEAN', + blacklist: { ARRAY: 'STRING' }, + greylist: { ARRAY: 'STRING' }, + whitelist: { ARRAY: 'STRING' }, + ignore: { ARRAY: 'GUILD_CHANNEL' }, + bypass: { ARRAY: 'GUILD_ROLE' }, + actions: { ARRAY: 'ACTION' } }, commandOptions: [ { - name: 'method', + name: 'method', description: 'Select which modification method to use', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -78,9 +78,9 @@ class LinkFilterSetting extends FilterSetting dependsOn: [ 'list' ] }, { - name: 'list', + name: 'list', description: 'Select which list to modify', - choices: [ + choices: [ { name: 'blacklist', value: 'blacklist' }, { name: 'greylist', value: 'greylist' }, { name: 'whitelist', value: 'whitelist' }, @@ -92,28 +92,28 @@ class LinkFilterSetting extends FilterSetting dependsOn: [ 'method' ] }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'whitelist', - description: 'Toggle whitelist mode' + defaultValue: true, + name: 'whitelist', + description: 'Toggle whitelist mode' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'silent', - description: 'Toggle silent operation' + defaultValue: true, + name: 'silent', + description: 'Toggle silent operation' } ] }); @@ -166,7 +166,7 @@ class LinkFilterSetting extends FilterSetting } const words = Util.parseQuotes(content).map(([ word ]) => word), - invalid = []; + invalid = []; let params = []; const { guild } = invoker; @@ -224,7 +224,7 @@ class LinkFilterSetting extends FilterSetting { if (actions.find((ac) => ac.trigger === 'generic')) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTIONS_EXISTING', { trigger: 'generic' }) }; actions.push(actionObject); @@ -234,7 +234,7 @@ class LinkFilterSetting extends FilterSetting await response.delete(); if ([ 'cancel', 'abort', 'exit' ].includes(response.content.toLowerCase())) return { - error: true, + error: true, content: invoker.format('ERR_CANCEL') }; @@ -254,7 +254,7 @@ class LinkFilterSetting extends FilterSetting const existing = actions.find((ac) => ac.trigger === first); if (existing) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTIONS_EXISTING', { trigger: first }) }; actionObject.trigger = first; @@ -291,53 +291,53 @@ class LinkFilterSetting extends FilterSetting const setting = guild._settings[this.name] as LinkfilterSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_SILENT', + name: 'GENERAL_SILENT', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.silent) }, { code: true }), inline: true }, { - name: 'SETTING_FILTER_WHITELISTMODE', + name: 'SETTING_FILTER_WHITELISTMODE', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.whitelistMode) }, { code: true }), inline: true }, { - name: 'SETTING_FILTER_WHITELIST', - value: setting.whitelist.join(', ') || '**N/A**', + name: 'SETTING_FILTER_WHITELIST', + value: setting.whitelist.join(', ') || '**N/A**', inline: true }, { - name: 'SETTING_FILTER_GREYLIST', - value: setting.greylist.join(', ') || '**N/A**', + name: 'SETTING_FILTER_GREYLIST', + value: setting.greylist.join(', ') || '**N/A**', inline: true }, { - name: 'SETTING_FILTER_BLACKLIST', - value: setting.blacklist.join(', ') || '**N/A**', + name: 'SETTING_FILTER_BLACKLIST', + value: setting.blacklist.join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_IGNORED', - value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', + name: 'GENERAL_IGNORED', + value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_BYPASS', - value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', + name: 'GENERAL_BYPASS', + value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', inline: true }, { - name: 'SETTING_FILTER_ACTIONS', + name: 'SETTING_FILTER_ACTIONS', value: setting.actions.reduce((acc, val) => { let str = `**${val.type}**`; diff --git a/src/client/components/settings/moderation/MentionFilter.ts b/src/client/components/settings/moderation/MentionFilter.ts index d382ecb..d1c43a1 100644 --- a/src/client/components/settings/moderation/MentionFilter.ts +++ b/src/client/components/settings/moderation/MentionFilter.ts @@ -28,62 +28,62 @@ class MentionFilter extends FilterSetting constructor (client: DiscordClient) { super(client, { - name: 'mentionfilter', + name: 'mentionfilter', description: 'Configure mention filtering', - display: 'Mention Filter', - moduleName: 'moderation', - default: { + display: 'Mention Filter', + moduleName: 'moderation', + default: { enabled: false, - silent: false, - unique: true, - limit: 4, + silent: false, + unique: true, + limit: 4, actions: [], - bypass: [], - ignore: [] + bypass: [], + ignore: [] }, definitions: { enabled: 'BOOLEAN', - silent: 'BOOLEAN', - unique: 'BOOLEAN', - limit: 'INTEGER', + silent: 'BOOLEAN', + unique: 'BOOLEAN', + limit: 'INTEGER', actions: { ARRAY: 'ACTION' }, - bypass: { ARRAY: 'GUILD_ROLE' }, - ignore: { ARRAY: 'GUILD_TEXT' } + bypass: { ARRAY: 'GUILD_ROLE' }, + ignore: { ARRAY: 'GUILD_TEXT' } }, commandOptions: [ { - name: 'enabled', - description: 'Toggle state', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle state', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'silent', - description: 'Whether the bot will respond in chat', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'silent', + description: 'Whether the bot will respond in chat', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'unique', - description: 'Mentions for the same user count as one', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'unique', + description: 'Mentions for the same user count as one', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'limit', + name: 'limit', description: 'How many mentions are allowed in a message', - type: CommandOptionType.INTEGER + type: CommandOptionType.INTEGER }, { - name: 'method', + name: 'method', description: 'Select which modification method to use', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -94,9 +94,9 @@ class MentionFilter extends FilterSetting dependsOn: [ 'list' ] }, { - name: 'list', + name: 'list', description: 'Select which list to modify', - choices: [ + choices: [ { name: 'bypass', value: 'bypass' }, { name: 'ignore', value: 'ignore' }, { name: 'actions', value: 'actions' }, @@ -156,8 +156,8 @@ class MentionFilter extends FilterSetting // eslint-disable-next-line no-undefined if (!params.length && ![ enabled, silent, unique, limit ].some((o) => o !== undefined)) return { - error: true, - index: 'RESOLVE_FAIL', + error: true, + index: 'RESOLVE_FAIL', params: { type: list.value === 'bypass' ? 'roles' : 'channels' } }; const { modified } = this[method.asString](setting[list.asString], params.map((o) => o.id)); @@ -178,7 +178,7 @@ class MentionFilter extends FilterSetting { if (actions.find((ac) => ac.trigger === 'generic')) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTIONS_EXISTING', { trigger: 'generic' }) }; actions.push(actionObject); @@ -189,7 +189,7 @@ class MentionFilter extends FilterSetting await response.delete(); if ([ 'cancel', 'abort', 'exit' ].includes(response.content.toLowerCase())) return { - error: true, + error: true, content: invoker.format('ERR_CANCEL') }; @@ -202,7 +202,7 @@ class MentionFilter extends FilterSetting const existing = actions.find((ac) => ac.trigger === first); if (existing) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTIONS_EXISTING', { trigger: first }) }; actionObject.trigger = first; @@ -226,43 +226,43 @@ class MentionFilter extends FilterSetting const setting = guild._settings[this.name] as MentionFilterSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_SILENT', + name: 'GENERAL_SILENT', value: guild.format('GENERAL_STATE', { bool: setting.silent }, { code: true }), inline: true }, { - name: 'GENERAL_UNIQUE', + name: 'GENERAL_UNIQUE', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.unique) }, { code: true }), inline: true }, { - name: 'GENERAL_LIMIT', - value: `${setting.limit}`, + name: 'GENERAL_LIMIT', + value: `${setting.limit}`, inline: true }, { - name: 'GENERAL_IGNORED', - value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', + name: 'GENERAL_IGNORED', + value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', inline: false }, { - name: 'GENERAL_BYPASS', - value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', + name: 'GENERAL_BYPASS', + value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', inline: false }, { - name: 'SETTING_FILTER_ACTIONS', + name: 'SETTING_FILTER_ACTIONS', value: setting.actions.reduce((acc, val) => { let str = `**${val.type}**`; diff --git a/src/client/components/settings/moderation/ModerationPoints.ts b/src/client/components/settings/moderation/ModerationPoints.ts index 546598b..9cff8ce 100644 --- a/src/client/components/settings/moderation/ModerationPoints.ts +++ b/src/client/components/settings/moderation/ModerationPoints.ts @@ -30,82 +30,82 @@ class ModerationPoints extends Setting constructor (client: DiscordClient) { super(client, { - name: 'modpoints', - display: 'Moderation Points', + name: 'modpoints', + display: 'Moderation Points', description: 'Configure severity values for infractions, used by automod', - moduleName: 'moderation', - default: { + moduleName: 'moderation', + default: { enabled: false, - points: { - WARN: 0, - MUTE: 0, - KICK: 0, + points: { + WARN: 0, + MUTE: 0, + KICK: 0, SOFTBAN: 0, - BAN: 0, - VCMUTE: 0, - VCKICK: 0, - VCBAN: 0 + BAN: 0, + VCMUTE: 0, + VCKICK: 0, + VCBAN: 0 }, expirations: { - WARN: 0, - KICK: 0, - MUTE: 0, + WARN: 0, + KICK: 0, + MUTE: 0, SOFTBAN: 0, - BAN: 0, - VCMUTE: 0, - VCKICK: 0, - VCBAN: 0 + BAN: 0, + VCMUTE: 0, + VCKICK: 0, + VCBAN: 0 }, associations: {}, - multiplier: false + multiplier: false }, commandOptions: [ { - name: 'points', - description: 'Point value', - type: CommandOptionType.INTEGER, - dependsOn: [ 'associate', 'infraction' ], + name: 'points', + description: 'Point value', + type: CommandOptionType.INTEGER, + dependsOn: [ 'associate', 'infraction' ], dependsOnMode: 'OR', - minimum: 0, - maximum: 100 + minimum: 0, + maximum: 100 }, { - name: 'expire', + name: 'expire', description: 'How long the points are counted for', - type: CommandOptionType.TIME, - dependsOn: [ 'infraction' ] + type: CommandOptionType.TIME, + dependsOn: [ 'infraction' ] }, { - name: 'infraction', + name: 'infraction', description: 'Type of infraction', - choices: INFRACTIONS.map((inf) => + choices: INFRACTIONS.map((inf) => { return { name: inf, value: inf }; }), - dependsOn: [ 'points', 'expire' ], + dependsOn: [ 'points', 'expire' ], dependsOnMode: 'OR' }, { - name: 'enabled', - description: 'Toggle on or off', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Toggle on or off', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'multiplier', - description: 'Use points as a multiplier for the expiration', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'multiplier', + description: 'Use points as a multiplier for the expiration', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'associate', + name: 'associate', description: 'Associate a word within a reason to a point value', - dependsOn: [ 'points' ], - flag: true + dependsOn: [ 'points' ], + flag: true }, ] }); @@ -133,14 +133,14 @@ class ModerationPoints extends Setting const setting = guild._settings[this.name] as ModerationPointsSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'SETTING_MODPOINTS_MULTIPLIER', + name: 'SETTING_MODPOINTS_MULTIPLIER', value: guild.format('GENERAL_STATE', { bool: setting.multiplier }, { code: true }), @@ -148,18 +148,18 @@ class ModerationPoints extends Setting }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true }, { - name: 'SETTING_MODPOINTS_DEFAULT_POINTS', - value: Object.entries(setting.points).map(([ type, pts ]) => `**${type}**: \`${pts}\``).join('\n'), + name: 'SETTING_MODPOINTS_DEFAULT_POINTS', + value: Object.entries(setting.points).map(([ type, pts ]) => `**${type}**: \`${pts}\``).join('\n'), inline: true }, { - name: 'SETTING_MODPOINTS_DEFAULT_EXPIRATIONS', - value: Object.entries(setting.expirations).map(([ type, time ]) => `**${type}**: \`${time > 0 ? Util.humanise(Math.floor(time/1000)) : 'Disabled'}\``).join('\n'), + name: 'SETTING_MODPOINTS_DEFAULT_EXPIRATIONS', + value: Object.entries(setting.expirations).map(([ type, time ]) => `**${type}**: \`${time > 0 ? Util.humanise(Math.floor(time/1000)) : 'Disabled'}\``).join('\n'), inline: true }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true }, { - name: 'SETTING_MODPOINTS_ASSOCIATIONS', + name: 'SETTING_MODPOINTS_ASSOCIATIONS', value: Object.entries(setting.associations).map(([ type, pts ]) => `**${type}**: \`${pts}\``).join('\n') || '**N/A**' }, ]; diff --git a/src/client/components/settings/moderation/Mute.ts b/src/client/components/settings/moderation/Mute.ts index c3f6d8f..f79f0e9 100644 --- a/src/client/components/settings/moderation/Mute.ts +++ b/src/client/components/settings/moderation/Mute.ts @@ -50,7 +50,7 @@ type CreateRoleResult = { const addField = (array: Issue[], type: string) => { const field = { - name: type === 'text' ? 'Text Channels' : 'Voice Channels', + name: type === 'text' ? 'Text Channels' : 'Voice Channels', value: '' }; const sorted = array.sort((a, b) => (a.position ?? 0) - (b.position ?? 0)); @@ -74,68 +74,68 @@ class MuteSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'mute', + name: 'mute', description: 'Assign or create a mute role oan configure mute options.', - moduleName: 'moderation', - display: 'Mute', - emoji: { + moduleName: 'moderation', + display: 'Mute', + emoji: { name: 'muted', - id: '853709118988353556' + id: '853709118988353556' }, default: { - type: 3, // Default to using timeouts - role: null, - default: 3600, // 1h + type: 3, // Default to using timeouts + role: null, + default: 3600, // 1h permanent: false }, definitions: { - type: { INTEGER: [ 0, 1, 2 ] }, - role: 'GUILD_ROLE', - default: 'INTEGER', + type: { INTEGER: [ 0, 1, 2 ] }, + role: 'GUILD_ROLE', + default: 'INTEGER', permanent: 'BOOLEAN' }, commandOptions: [ { - type: CommandOptionType.STRING, - flag: true, - name: 'create', + type: CommandOptionType.STRING, + flag: true, + name: 'create', description: 'Create a mute role, mutually exclusive with role' }, { - type: CommandOptionType.ROLE, - name: 'role', + type: CommandOptionType.ROLE, + name: 'role', description: 'Select the role to use for mutes, mutually exclusive with create' }, { - type: CommandOptionType.TIME, - flag: true, - name: 'default', + type: CommandOptionType.TIME, + flag: true, + name: 'default', description: 'Set the default duration for mutes' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'permanent', - description: 'Whether to allow permanent mutes or fall back to default mute duration' + defaultValue: true, + name: 'permanent', + description: 'Whether to allow permanent mutes or fall back to default mute duration' }, { - type: CommandOptionType.INTEGER, - flag: true, - name: 'type', + type: CommandOptionType.INTEGER, + flag: true, + name: 'type', description: 'Select the type of mute behaviour', - choices: [{ - name: 'Type 0 (Append role)', + choices: [{ + name: 'Type 0 (Append role)', value: 0 }, { - name: 'Type 1 (Replace roles)', + name: 'Type 1 (Replace roles)', value: 1 }, { - name: 'Type 2 (Remove all roles)', + name: 'Type 2 (Remove all roles)', value: 2 }, { - name: 'Type 3 (Use Discord timeouts)', + name: 'Type 3 (Use Discord timeouts)', value: 3 }] } @@ -150,7 +150,7 @@ class MuteSetting extends Setting return { success: false, index: 'SETTING_MUTE_EXCLUSIVE' }; const response: SettingResult = { error: false }, - updated = []; + updated = []; let created = false, updatedPermissions = false, roleName = null, @@ -179,9 +179,9 @@ class MuteSetting extends Setting author: { name: `${Emojis.warning} Warning` }, - color: 0xffe15c, + color: 0xffe15c, description: invoker.format('SETTING_MUTE_CREATESUCCESSWARNING'), - fields: [] + fields: [] }; const textIssues = issues.filter((i) => i.type === ChannelType.GuildText); @@ -223,7 +223,7 @@ class MuteSetting extends Setting if (_create) response.content += '\n' + invoker.format(`SETTING_MUTE_CREATESUCCESS${created ? 'ALT' : ''}`, { permissions: invoker.format(`SETTING_MUTE_${updatedPermissions ? '' : 'UN'}GENERATEDPERMISSIONS`), - role: roleName! + role: roleName! }); if (setting.type === 3 && setting.permanent) @@ -246,8 +246,8 @@ class MuteSetting extends Setting try { role = await guild.roles.create({ - name: n, - reason: super.reason(user), + name: n, + reason: super.reason(user), permissions: 0n }); } @@ -281,24 +281,24 @@ class MuteSetting extends Setting const prompt = await invoker.promptInteraction({ content: invoker.format(`SETTING_MUTE_ROLEPROMPT${existing.managed ? '_MANAGED' : ''}`, { name: existing.name, - id: existing.id + id: existing.id }), - emoji: 'loading', + emoji: 'loading', components: [ { - type: ComponentType.ActionRow, + type: ComponentType.ActionRow, components: [ { - type: ComponentType.Button, - label: 'Yes', + type: ComponentType.Button, + label: 'Yes', customId: 'yes', - style: 3 + style: 3 }, { - type: ComponentType.Button, - label: 'No', + type: ComponentType.Button, + label: 'No', customId: 'no', - style: 4 + style: 4 } ] } @@ -359,17 +359,17 @@ class MuteSetting extends Setting continue; const permissionRole = await this.client.resolver.resolveRole(permission.id, true, guild); - // eslint-disable-next-line no-bitwise, max-depth + // eslint-disable-next-line max-depth if (!permissionRole) continue; // eslint-disable-next-line max-depth if ((permission.allow.bitfield & configuration.bitwise) === configuration.bitwise) issues.push({ - role: permissionRole.name, + role: permissionRole.name, permissions: Object.keys(configuration.permissions), - channel: channel.name, - type: channel.type, - position: permissionRole.rawPosition + channel: channel.name, + type: channel.type, + position: permissionRole.rawPosition }); } updatedPermissions = true; @@ -398,24 +398,24 @@ class MuteSetting extends Setting const setting = guild._settings[this.name] as MuteSettings; return [ { - name: 'SETTING_MUTE_ROLE', - value: setting.role ? `<@&${setting.role}>` : '**N/A**', + name: 'SETTING_MUTE_ROLE', + value: setting.role ? `<@&${setting.role}>` : '**N/A**', inline: true }, { - name: 'SETTING_MUTE_TYPE', - value: `\`${setting.type || 0}\``, + name: 'SETTING_MUTE_TYPE', + value: `\`${setting.type || 0}\``, inline: true }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true }, { - name: 'SETTING_MUTE_PERMANENT', - value: guild.format('GENERAL_STATE', { bool: setting.permanent }, { code: true }), + name: 'SETTING_MUTE_PERMANENT', + value: guild.format('GENERAL_STATE', { bool: setting.permanent }, { code: true }), inline: true }, { - name: 'SETTING_MUTE_DEFAULT', - value: setting.default ? Util.humanise(setting.default) : '**N/A**', + name: 'SETTING_MUTE_DEFAULT', + value: setting.default ? Util.humanise(setting.default) : '**N/A**', inline: true }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true } diff --git a/src/client/components/settings/moderation/Raidprotection.ts b/src/client/components/settings/moderation/Raidprotection.ts index b4ff7ba..7fa0881 100644 --- a/src/client/components/settings/moderation/Raidprotection.ts +++ b/src/client/components/settings/moderation/Raidprotection.ts @@ -26,33 +26,33 @@ class RaidprotectionSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'raidprotection', - display: 'Raid Protection', + name: 'raidprotection', + display: 'Raid Protection', description: 'Prevent users meeting certain criteria from joining', - moduleName: 'moderation', - default: { - enabled: false, - age: 0, + moduleName: 'moderation', + default: { + enabled: false, + age: 0, pfpCheck: false }, commandOptions: [ { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'pfpcheck', - description: 'Whether to check for a default profile picture' + defaultValue: true, + name: 'pfpcheck', + description: 'Whether to check for a default profile picture' }, { - type: CommandOptionType.TIME, - name: 'age', + type: CommandOptionType.TIME, + name: 'age', description: 'Threshold for the account age' } ] diff --git a/src/client/components/settings/moderation/Staff.ts b/src/client/components/settings/moderation/Staff.ts index 11155b4..a43173e 100644 --- a/src/client/components/settings/moderation/Staff.ts +++ b/src/client/components/settings/moderation/Staff.ts @@ -26,29 +26,29 @@ class StaffSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'staff', + name: 'staff', description: 'Configure the role that is used for the staff commmand', - moduleName: 'moderation', - display: 'Staff', - default: { - rule: null, - role: null, + moduleName: 'moderation', + display: 'Staff', + default: { + rule: null, + role: null, enabled: false }, commandOptions: [{ - name: 'role', + name: 'role', description: 'The role used to mention staff', - type: CommandOptionType.ROLE + type: CommandOptionType.ROLE }, { - name: 'rule', + name: 'rule', description: 'The text displayed in the staff command to inform of proper use, use "long" to give a longer text' }, { - name: 'enabled', - description: 'Whether the staff command is in use', - type: CommandOptionType.BOOLEAN, - flag: true, + name: 'enabled', + description: 'Whether the staff command is in use', + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true + defaultValue: true }] }); } @@ -80,17 +80,17 @@ class StaffSetting extends Setting const setting = guild._settings[this.name] as StaffSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }), inline: true }, { - name: 'GENERAL_ROLE', - value: setting.role ? `<@&${setting.role}>` : '**N/A**', + name: 'GENERAL_ROLE', + value: setting.role ? `<@&${setting.role}>` : '**N/A**', inline: true }, { - name: 'SETTING_STAFF_RULE_FIELD', + name: 'SETTING_STAFF_RULE_FIELD', value: setting.rule || '**N/A**' } ]; diff --git a/src/client/components/settings/moderation/WordFilter.ts b/src/client/components/settings/moderation/WordFilter.ts index 1081a5a..ded3cc7 100644 --- a/src/client/components/settings/moderation/WordFilter.ts +++ b/src/client/components/settings/moderation/WordFilter.ts @@ -29,20 +29,20 @@ class WordFilterSetting extends FilterSetting constructor (client: DiscordClient) { super(client, { - name: 'wordfilter', + name: 'wordfilter', description: 'Filter messages for disallowed words or phrases', - moduleName: 'moderation', - display: 'Word Filter', - default: { - enabled: false, - silent: false, - explicit: [], - fuzzy: [], - regex: [], + moduleName: 'moderation', + display: 'Word Filter', + default: { + enabled: false, + silent: false, + explicit: [], + fuzzy: [], + regex: [], whitelist: [], - ignore: [], - bypass: [], - actions: [ // Link certain words to actions with or without points ex fuck: { action: 'MUTE', points: null, force: false, duration: 300 } + ignore: [], + bypass: [], + actions: [ // Link certain words to actions with or without points ex fuck: { action: 'MUTE', points: null, force: false, duration: 300 } // { // action: 'MUTE', // points: 10, @@ -54,21 +54,21 @@ class WordFilterSetting extends FilterSetting ], }, definitions: { - enabled: 'BOOLEAN', - silent: 'BOOLEAN', - explicit: { ARRAY: 'STRING' }, - fuzzy: { ARRAY: 'STRING' }, - regex: { ARRAY: 'STRING' }, + enabled: 'BOOLEAN', + silent: 'BOOLEAN', + explicit: { ARRAY: 'STRING' }, + fuzzy: { ARRAY: 'STRING' }, + regex: { ARRAY: 'STRING' }, whitelist: { ARRAY: 'STRING' }, - ignore: { ARRAY: 'GUILD_CHANNEL' }, - bypass: { ARRAY: 'GUILD_ROLE' }, - actions: { ARRAY: 'ACTION' } + ignore: { ARRAY: 'GUILD_CHANNEL' }, + bypass: { ARRAY: 'GUILD_ROLE' }, + actions: { ARRAY: 'ACTION' } }, commandOptions: [ { - name: 'method', + name: 'method', description: 'Select which modification method to use', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -79,9 +79,9 @@ class WordFilterSetting extends FilterSetting dependsOn: [ 'list' ] }, { - name: 'list', + name: 'list', description: 'Select which list to modify', - choices: [ + choices: [ { name: 'explicit', value: 'explicit' }, { name: 'fuzzy', value: 'fuzzy' }, { name: 'regex', value: 'regex' }, @@ -94,20 +94,20 @@ class WordFilterSetting extends FilterSetting dependsOn: [ 'method' ] }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'silent', - description: 'Toggle silent operation' + defaultValue: true, + name: 'silent', + description: 'Toggle silent operation' } ] }); @@ -154,7 +154,7 @@ class WordFilterSetting extends FilterSetting } const words = Util.parseQuotes(content).map(([ word ]) => word), - invalid = []; + invalid = []; let index = `SETTING_SUCCESS_${method.toUpperCase()}`, params = []; @@ -219,9 +219,9 @@ class WordFilterSetting extends FilterSetting return { index, params: { - updated: list, + updated: list, modified: params.filter((o) => modified.includes(o.id)).map((o) => o.name).join('__, __'), - invalid: invalid.join('`, `') + invalid: invalid.join('`, `') } }; } @@ -239,7 +239,7 @@ class WordFilterSetting extends FilterSetting { if (actions.find((ac) => ac.trigger === 'generic')) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTIONS_EXISTING', { trigger: 'generic' }) }; actions.push(actionObject); @@ -249,7 +249,7 @@ class WordFilterSetting extends FilterSetting await response.delete(); if ([ 'cancel', 'abort', 'exit' ].includes(response.content.toLowerCase())) return { - error: true, + error: true, content: invoker.format('ERR_CANCEL') }; @@ -268,7 +268,7 @@ class WordFilterSetting extends FilterSetting const existing = actions.find((ac) => ac.trigger === first); if (existing) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTIONS_EXISTING', { trigger: first }) }; actionObject.trigger = first; @@ -309,14 +309,14 @@ class WordFilterSetting extends FilterSetting const setting = guild._settings[this.name] as WordFilterSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_SILENT', + name: 'GENERAL_SILENT', value: guild.format('GENERAL_STATE', { bool: setting.silent }, { code: true }), @@ -324,37 +324,37 @@ class WordFilterSetting extends FilterSetting }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true }, { - name: 'SETTING_WORDFILTER_EXPLICIT', - value: setting.explicit.length ? '||' + setting.explicit.join(', ') + '||' : '**N/A**', + name: 'SETTING_WORDFILTER_EXPLICIT', + value: setting.explicit.length ? '||' + setting.explicit.join(', ') + '||' : '**N/A**', inline: true }, { - name: 'SETTING_WORDFILTER_FUZZY', - value: setting.fuzzy?.length ? '||' + setting.fuzzy.join(', ') + '||' : '**N/A**', + name: 'SETTING_WORDFILTER_FUZZY', + value: setting.fuzzy?.length ? '||' + setting.fuzzy.join(', ') + '||' : '**N/A**', inline: true }, { - name: 'SETTING_WORDFILTER_REGEX', - value: setting.regex?.length ? '`' + setting.regex.join('`\n`') + '`' : '**N/A**', + name: 'SETTING_WORDFILTER_REGEX', + value: setting.regex?.length ? '`' + setting.regex.join('`\n`') + '`' : '**N/A**', inline: true }, { - name: 'SETTING_FILTER_WHITELIST', - value: setting.whitelist.join(', ') || '**N/A**', + name: 'SETTING_FILTER_WHITELIST', + value: setting.whitelist.join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_IGNORED', - value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', + name: 'GENERAL_IGNORED', + value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_BYPASS', - value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', + name: 'GENERAL_BYPASS', + value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', inline: true }, { - name: 'SETTING_FILTER_ACTIONS', + name: 'SETTING_FILTER_ACTIONS', value: setting.actions.reduce((acc, val) => { let str = `**${val.type}**`; diff --git a/src/client/components/settings/moderation/WordWatcher.ts b/src/client/components/settings/moderation/WordWatcher.ts index d83e7dc..ffbcf41 100644 --- a/src/client/components/settings/moderation/WordWatcher.ts +++ b/src/client/components/settings/moderation/WordWatcher.ts @@ -28,24 +28,24 @@ class WordWatcher extends FilterSetting constructor (client: DiscordClient) { super(client, { - name: 'wordwatcher', - display: 'Word Watcher', + name: 'wordwatcher', + display: 'Word Watcher', description: 'Flag messages for potentially offensive content instead of deleting automatically', - moduleName: 'moderation', - default: { + moduleName: 'moderation', + default: { enabled: false, channel: null, - words: [], - regex: [], - ignore: [], - bypass: [], + words: [], + regex: [], + ignore: [], + bypass: [], actions: [] }, commandOptions: [ { - name: 'method', + name: 'method', description: 'Select which modification method to use', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -56,9 +56,9 @@ class WordWatcher extends FilterSetting dependsOn: [ 'list' ] }, { - name: 'list', + name: 'list', description: 'Select which list to modify', - choices: [ + choices: [ { name: 'regex', value: 'regex' }, { name: 'words', value: 'words' }, { name: 'bypass', value: 'bypass' }, @@ -68,16 +68,16 @@ class WordWatcher extends FilterSetting dependsOn: [ 'method' ] }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' }, { - name: 'channel', - type: CommandOptionType.TEXT_CHANNEL, + name: 'channel', + type: CommandOptionType.TEXT_CHANNEL, description: 'Where to output flagged messages', } ] @@ -115,7 +115,7 @@ class WordWatcher extends FilterSetting return { index: 'SETTING_NO_CHANGE' }; const words = Util.parseQuotes(content).map(([ word ]) => word), - invalid = []; + invalid = []; let index = `SETTING_SUCCESS_${method.asString.toUpperCase()}`, params = []; @@ -167,7 +167,7 @@ class WordWatcher extends FilterSetting return { index, params: { - updated: list.asString, + updated: list.asString, modified: params .filter(o => modified.includes(o.id || o)) .map(o => o.name || o) @@ -195,30 +195,30 @@ class WordWatcher extends FilterSetting const setting = guild._settings[this.name] as WordWatcherSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: Boolean(setting.channel) }, { code: true }), inline: true }, { - name: 'GENERAL_CHANNEL', - value: setting.channel ? `<#${setting.channel}>` : '**N/A**', + name: 'GENERAL_CHANNEL', + value: setting.channel ? `<#${setting.channel}>` : '**N/A**', inline: true }, { name: ZeroWidthChar, value: ZeroWidthChar, inline: true }, { - name: 'GENERAL_IGNORED', - value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', + name: 'GENERAL_IGNORED', + value: setting.ignore.map((channel) => `<#${channel}>`).join(', ') || '**N/A**', inline: true }, { - name: 'GENERAL_BYPASS', - value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', + name: 'GENERAL_BYPASS', + value: setting.bypass.map((role) => `<@&${role}>`).join(', ') || '**N/A**', inline: true }, { - name: 'SETTING_FILTER_ACTIONS', + name: 'SETTING_FILTER_ACTIONS', value: setting.actions.reduce((acc, val) => { let str = `**${val.type}**`; @@ -237,10 +237,10 @@ class WordWatcher extends FilterSetting return acc; }, [] as string[]).join('\n') || '**N/A**' }, { - name: 'SETTING_REGEX', + name: 'SETTING_REGEX', value: setting.regex.length ? `\`${setting.regex.join('`, `')}\`` : '**N/A**' }, { - name: 'SETTING_WORDS', + name: 'SETTING_WORDS', value: setting.words.length ? `\`${setting.words.join('`, `')}\`` : '**N/A**' } ]; diff --git a/src/client/components/settings/utility/Autorole.ts b/src/client/components/settings/utility/Autorole.ts index 0be2dd0..5af20a7 100644 --- a/src/client/components/settings/utility/Autorole.ts +++ b/src/client/components/settings/utility/Autorole.ts @@ -27,24 +27,24 @@ class Autorole extends Setting constructor (client: DiscordClient) { super(client, { - name: 'autorole', + name: 'autorole', description: 'Configure roles that are automatically given to new members', - moduleName: 'utility', - display: 'Auto Role', - default: { - roles: [], + moduleName: 'utility', + display: 'Auto Role', + default: { + roles: [], enabled: false }, definitions: { - roles: { ARRAY: 'GUILD_ROLE' }, + roles: { ARRAY: 'GUILD_ROLE' }, enabled: 'BOOLEAN' }, commandOptions: [ { - type: CommandOptionType.STRING, - name: 'roles', + type: CommandOptionType.STRING, + name: 'roles', description: 'Modification method for roles', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -54,12 +54,12 @@ class Autorole extends Setting ] }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' } ] }); @@ -101,9 +101,9 @@ class Autorole extends Setting const { modified } = this[method](setting.roles, params.map((o) => o.id)); if (modified.length) return { - index: `SETTING_SUCCESS_${method.toUpperCase()}`, + index: `SETTING_SUCCESS_${method.toUpperCase()}`, params: { - updated: 'roles', + updated: 'roles', modified: params.filter((o) => modified.includes(o.id)).map((o) => o.name).join('__, __') } }; @@ -116,14 +116,14 @@ class Autorole extends Setting const setting = guild._settings[this.name] as AutoroleSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_ROLES', + name: 'GENERAL_ROLES', value: setting.roles.map((role) => `<@&${role}>`).join(' ') || '**N/A**' } ]; diff --git a/src/client/components/settings/utility/Selfrole.ts b/src/client/components/settings/utility/Selfrole.ts index c99dc7b..91d8078 100644 --- a/src/client/components/settings/utility/Selfrole.ts +++ b/src/client/components/settings/utility/Selfrole.ts @@ -28,20 +28,20 @@ class SelfroleSetting extends Setting constructor (client: DiscordClient) { super(client, { - name: 'selfrole', + name: 'selfrole', description: 'Configure roles that users can assign to themselves', - moduleName: 'utility', - display: 'Self Role', - default: { - roles: [], + moduleName: 'utility', + display: 'Self Role', + default: { + roles: [], message: null, channel: null, - text: null + text: null }, commandOptions: [{ - name: 'roles', + name: 'roles', description: 'Modify roles users can give themselves', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -49,11 +49,11 @@ class SelfroleSetting extends Setting { name: 'list', value: 'list' } ], }, { - name: 'channel', + name: 'channel', description: 'Optional channel to output message for selecting roles', - type: CommandOptionType.TEXT_CHANNEL + type: CommandOptionType.TEXT_CHANNEL }, { - name: 'text', + name: 'text', description: 'Optional text to display above the select menu' }] }); @@ -71,7 +71,7 @@ class SelfroleSetting extends Setting if (roles) { const promptResponse = await this._prompt(invoker, { - index: `SETTING_PROMPT_${roles.asString.toUpperCase()}`, + index: `SETTING_PROMPT_${roles.asString.toUpperCase()}`, params: { list: 'roles' } }); if (promptResponse.error) @@ -119,26 +119,26 @@ class SelfroleSetting extends Setting return { error: true, index: 'ERR_CHANNEL_PERMS', params: { perms: missing.join('`, `'), channel: newChannel.name } }; const resolvedRoles = await guild.resolveRoles(setting.roles); const selectMenu: StringSelectMenuComponentData = { - type: ComponentType.StringSelect, - customId: 'selfrole-select', + type: ComponentType.StringSelect, + customId: 'selfrole-select', maxValues: resolvedRoles.length, - options: resolvedRoles.map((r) => + options: resolvedRoles.map((r) => { return { label: r.name, value: r.id }; }) }; const button: ButtonComponentData = { - type: ComponentType.Button, + type: ComponentType.Button, customId: 'selfrole-clear', - label: 'Clear', - style: ButtonStyle.Primary, - emoji: Emojis.failure + label: 'Clear', + style: ButtonStyle.Primary, + emoji: Emojis.failure }; const components = [{ - type: ComponentType.ActionRow, + type: ComponentType.ActionRow, components: [ selectMenu ] }, { - type: ComponentType.ActionRow, + type: ComponentType.ActionRow, components: [ button ] }]; const payload: MessageCreateOptions & MessageEditOptions = { diff --git a/src/client/components/settings/utility/StickyRole.ts b/src/client/components/settings/utility/StickyRole.ts index 3a94e62..b02be32 100644 --- a/src/client/components/settings/utility/StickyRole.ts +++ b/src/client/components/settings/utility/StickyRole.ts @@ -28,24 +28,24 @@ class Autorole extends Setting constructor (client: DiscordClient) { super(client, { - name: 'stickyrole', + name: 'stickyrole', description: 'Configure roles that the bot will reassign on rejoin', - moduleName: 'utility', - display: 'Sticky Role', - default: { - roles: [], + moduleName: 'utility', + display: 'Sticky Role', + default: { + roles: [], enabled: false }, definitions: { - roles: { ARRAY: 'GUILD_ROLE' }, + roles: { ARRAY: 'GUILD_ROLE' }, enabled: 'BOOLEAN' }, commandOptions: [ { - type: CommandOptionType.STRING, - name: 'roles', + type: CommandOptionType.STRING, + name: 'roles', description: 'Modification method for roles', - choices: [ + choices: [ { name: 'add', value: 'add' }, { name: 'remove', value: 'remove' }, { name: 'set', value: 'set' }, @@ -55,12 +55,12 @@ class Autorole extends Setting ] }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' } ], premium: 1 @@ -105,9 +105,9 @@ class Autorole extends Setting const { modified } = this[method](setting.roles, params.map((o) => o.id)); if (modified.length) return { - index: `SETTING_SUCCESS_${method.toUpperCase()}`, + index: `SETTING_SUCCESS_${method.toUpperCase()}`, params: { - updated: 'roles', + updated: 'roles', modified: params.filter((o) => modified.includes(o.id)).map((o) => o.name).join('__, __') } }; @@ -123,14 +123,14 @@ class Autorole extends Setting const setting = guild._settings[this.name] as StickyRoleSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_ROLES', + name: 'GENERAL_ROLES', value: setting.roles.map((role) => `<@&${role}>`).join(' ') || '**N/A**' } ]; diff --git a/src/client/components/settings/utility/Welcomer.ts b/src/client/components/settings/utility/Welcomer.ts index a2ff181..f14c282 100644 --- a/src/client/components/settings/utility/Welcomer.ts +++ b/src/client/components/settings/utility/Welcomer.ts @@ -27,11 +27,11 @@ class Autorole extends Setting constructor (client: DiscordClient) { super(client, { - name: 'welcomer', + name: 'welcomer', description: 'Configure what message if any to send to new members', - moduleName: 'utility', - display: 'Welcomer', - default: { + moduleName: 'utility', + display: 'Welcomer', + default: { message: null, enabled: false }, @@ -41,17 +41,17 @@ class Autorole extends Setting }, commandOptions: [ { - type: CommandOptionType.STRING, - name: 'message', + type: CommandOptionType.STRING, + name: 'message', description: 'Set the welcome message' }, { - type: CommandOptionType.BOOLEAN, - flag: true, + type: CommandOptionType.BOOLEAN, + flag: true, valueOptional: true, - defaultValue: true, - name: 'enabled', - description: 'Toggle enable state' + defaultValue: true, + name: 'enabled', + description: 'Toggle enable state' } ] }); @@ -74,14 +74,14 @@ class Autorole extends Setting const setting = guild._settings[this.name] as WelcomerSettings; return [ { - name: 'GENERAL_STATUS', + name: 'GENERAL_STATUS', value: guild.format('GENERAL_STATE', { bool: setting.enabled }, { code: true }), inline: true }, { - name: 'GENERAL_MESSAGE', + name: 'GENERAL_MESSAGE', value: setting.message || '**N/A**' } ]; diff --git a/src/client/components/wrappers/GuildWrapper.ts b/src/client/components/wrappers/GuildWrapper.ts index 3516acf..2f091fe 100644 --- a/src/client/components/wrappers/GuildWrapper.ts +++ b/src/client/components/wrappers/GuildWrapper.ts @@ -123,7 +123,7 @@ class GuildWrapper delete data[key]; } data.settings = settings as GuildSettings; - data._version = configVersion;// '3.slash.2'; + data._version = '3.slash.2'; await this.#client.mongodb.guilds.deleteOne({ guildId: this.id }); await this.#client.mongodb.guilds.updateOne({ guildId: this.id }, { $set: data }); } @@ -131,7 +131,7 @@ class GuildWrapper { data.id = data.guildId as string; delete data.guildId; - data._version = configVersion; // 3.slash.3 + data._version = '3.slash.3'; await this.#client.mongodb.guilds.updateOne({ _id: data._id as ObjectId }, { $set: data }); } this.#data = data; @@ -565,17 +565,17 @@ class GuildWrapper json.channels = this.guild.channels.cache.map((channel) => { return { - id: channel.id, - type: channel.type, - name: channel.name, + id: channel.id, + type: channel.type, + name: channel.name, parent: channel.parentId }; }); json.roles = this.guild.roles.cache.map((role) => { return { - id: role.id, - name: role.name, + id: role.id, + name: role.name, position: role.position }; }); diff --git a/src/client/components/wrappers/InteractionWrapper.ts b/src/client/components/wrappers/InteractionWrapper.ts index a2d99d7..ffdff9c 100644 --- a/src/client/components/wrappers/InteractionWrapper.ts +++ b/src/client/components/wrappers/InteractionWrapper.ts @@ -290,7 +290,7 @@ class InteractionWrapper * @private * @param options interaction.options.data */ - #options (options: CommandInteractionOption[] = []): CommandInteractionOption[] + #options (options: readonly CommandInteractionOption[] = []): readonly CommandInteractionOption[] { if (!options?.length) return []; diff --git a/src/client/components/wrappers/InvokerWrapper.ts b/src/client/components/wrappers/InvokerWrapper.ts index a916b9b..341b9cd 100644 --- a/src/client/components/wrappers/InvokerWrapper.ts +++ b/src/client/components/wrappers/InvokerWrapper.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -import { EmbedBuilder, ComponentType, Message, InteractionResponse, InteractionDeferReplyOptions, If, GuildMember, Interaction } from 'discord.js'; +import { EmbedBuilder, ComponentType, Message, InteractionResponse, InteractionDeferReplyOptions, If, GuildMember, Interaction, SendableChannels } from 'discord.js'; import { Emojis, Constants } from '../../../constants/index.js'; import MessageWrapper from './MessageWrapper.js'; import DiscordClient from '../../DiscordClient.js'; @@ -84,9 +84,11 @@ class InvokerWrapper @@ -183,8 +185,8 @@ class InvokerWrapper - { // eslint-disable-line handle-callback-err + { return null; }); } @@ -224,10 +226,10 @@ class InvokerWrapper { message?.createMessageComponentCollector({ - time: time * 1000, + time: time * 1000, componentType: opts.componentType || ComponentType.Button, // typeof opts.componentType === 'undefined' ? - max: 1, - filter: (i) => i.user.id === this.user.id + max: 1, + filter: (i) => i.user.id === this.user.id }) .on('collect', resolve) .on('end', (collected) => diff --git a/src/client/infractions/Addrole.ts b/src/client/infractions/Addrole.ts index b7290bf..30791ff 100644 --- a/src/client/infractions/Addrole.ts +++ b/src/client/infractions/Addrole.ts @@ -46,20 +46,20 @@ class AddroleInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - guild: opts.guild, - channel: opts.channel, - invoker: opts.invoker, - target: opts.target.user, - executor: opts.executor.user, - reason: opts.reason, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - points: opts.points, + type: opts.type, + guild: opts.guild, + channel: opts.channel, + invoker: opts.invoker, + target: opts.target.user, + executor: opts.executor.user, + reason: opts.reason, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (!(opts.target instanceof MemberWrapper)) @@ -137,7 +137,7 @@ class AddroleInfraction extends Infraction { return `\n${this.guild.format('INFRACTION_DESCRIPTIONROLES', { plural: this.data.roleIds!.length === 1 ? '' : 's', - roles: dm ? this.data.roleNames!.join(', ') : this.data.roleIds!.map((r) => `<@&${r}>`).join(' ') + roles: dm ? this.data.roleNames!.join(', ') : this.data.roleIds!.map((r) => `<@&${r}>`).join(' ') })}`; } diff --git a/src/client/infractions/Ban.ts b/src/client/infractions/Ban.ts index ff9304e..d655105 100644 --- a/src/client/infractions/Ban.ts +++ b/src/client/infractions/Ban.ts @@ -40,20 +40,20 @@ class BanInfraction extends Infraction else super(client, logger, { targetType: 'USER', - type: opts.type, - guild: opts.guild, - channel: opts.channel, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - points: opts.points, + type: opts.type, + guild: opts.guild, + channel: opts.channel, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); } @@ -75,7 +75,7 @@ class BanInfraction extends Infraction try { await this.guild.members.ban(this.target!.id, { - reason: this._reason, + reason: this._reason, deleteMessageSeconds: days * 24 * 60 * 60 }); } @@ -118,7 +118,7 @@ class BanInfraction extends Infraction const inf = await this.client.mongodb.infractions.findOne({ type: this.type, guild: this.guild.id, target: this.targetId! }, { - sort: { timestamp: -1 }, + sort: { timestamp: -1 }, projection: { id: 1 } }); // Don't unban unless the resolved case is the same one that banned them diff --git a/src/client/infractions/Kick.ts b/src/client/infractions/Kick.ts index 689d30a..95ab6a7 100644 --- a/src/client/infractions/Kick.ts +++ b/src/client/infractions/Kick.ts @@ -44,19 +44,19 @@ class KickInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (!(opts.target instanceof MemberWrapper)) diff --git a/src/client/infractions/Lockdown.ts b/src/client/infractions/Lockdown.ts index c43f90e..8a00e95 100644 --- a/src/client/infractions/Lockdown.ts +++ b/src/client/infractions/Lockdown.ts @@ -42,22 +42,22 @@ class LockdownInfraction extends Infraction else super(client, logger, { targetType: 'CHANNEL', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - data: opts.data, - hyperlink: opts.hyperlink + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + data: opts.data, + hyperlink: opts.hyperlink }); } - // eslint-disable-next-line max-lines-per-function + async execute () { const existing = await this.client.moderation.findLatestInfraction('LOCKDOWN', this.target!); @@ -86,7 +86,7 @@ class LockdownInfraction extends Infraction // console.log(`Doing ${permission.id} (${roleOrMember.name || roleOrMember.tag}): ${permission.type}`); this.data.oldPermissions[permission.id] = { - type: permission.type, + type: permission.type, permissions: { SendMessages: null, AddReactions: null @@ -119,10 +119,10 @@ class LockdownInfraction extends Infraction denied.push('AddReactions'); newOverwrites.push({ - id: permission.id, + id: permission.id, allow: allowed, - deny: denied, - type: permission.type + deny: denied, + type: permission.type }); // try { // await permissions.edit(permission.id, { @@ -142,14 +142,14 @@ class LockdownInfraction extends Infraction if (!this.data.oldPermissions[everyoneRole.id]) { this.data.oldPermissions[everyoneRole.id] = { - type: OverwriteType.Role, + type: OverwriteType.Role, permissions: { SendMessages: null, AddReactions: null } }; newOverwrites.push({ - id: everyoneRole.id, + id: everyoneRole.id, deny: [ 'SendMessages', 'AddReactions' ], type: OverwriteType.Role }); @@ -177,9 +177,9 @@ class LockdownInfraction extends Infraction } else newOverwrites.push({ - id: this.client.user!.id, + id: this.client.user!.id, allow: [ 'SendMessages' ], - type: OverwriteType.Member + type: OverwriteType.Member }); await permissions.set(newOverwrites, this._reason); diff --git a/src/client/infractions/Mute.ts b/src/client/infractions/Mute.ts index 4b9c91d..efb4e30 100644 --- a/src/client/infractions/Mute.ts +++ b/src/client/infractions/Mute.ts @@ -46,20 +46,20 @@ class MuteInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (!(opts.target instanceof MemberWrapper)) @@ -155,8 +155,8 @@ class MuteInfraction extends Infraction this.data = { removedRoles: removed?.map((r) => r.id), - muteType: setting.type, - muteRole: role?.id || null + muteType: setting.type, + muteRole: role?.id || null }; // Info will be saved in database and into the callback when resolved. // const callback = this.client.moderation.callbacks.filter((c) => c.infraction.type === 'MUTE' @@ -217,7 +217,7 @@ class MuteInfraction extends Infraction const inf = await this.client.mongodb.infractions.findOne({ type: this.type, guild: this.guild.id, target: this.targetId! }, { - sort: { timestamp: -1 }, + sort: { timestamp: -1 }, projection: { id: 1 } }); if (!inf) diff --git a/src/client/infractions/Nickname.ts b/src/client/infractions/Nickname.ts index 7f21505..d0c38e5 100644 --- a/src/client/infractions/Nickname.ts +++ b/src/client/infractions/Nickname.ts @@ -25,7 +25,7 @@ import Util from '../../utilities/Util.js'; import { KillItWithFire } from '../../constants/index.js'; const Constants = { - Characters: [ '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '=', '+', '"', '\'', '`', '\\', '/', '[', ']', '>', '<', '.' ], + Characters: [ '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '=', '+', '"', '\'', '`', '\\', '/', '[', ']', '>', '<', '.' ], RandomNames: [ 'Ashly Armistead', 'Jenifer James', 'Eleonora Espinosa', 'Eleanore Ellerbee', 'Marguerite Means', 'Lore Lazar', 'Cherilyn Calero', 'Olevia Olvera', 'Herman Horvat', 'Elvin Elfrink', 'Jennine Julian', 'Pei Plude', 'Kenisha Kirts', 'Sherly Starbird', 'Lashanda Louder', 'Elizabeth Eakle', 'Lyda Leard', 'Penelope Petri', 'Kimi Kissel', 'Crista Crowe', 'Mallory Mehta', 'Bettina Bregman', 'Marcie Moran', 'James Jiles', 'Clifton Capshaw', 'Cher Curlee', 'Brigid Bonier', 'Lana Lehman', 'Carletta Chalker', 'Valene Viator', 'Eugena Eder', 'Samatha Shivers', 'Hoyt Hard', 'Karena King', 'Tiffani Trott', 'Joye Jeremiah', 'Emely Espino', 'Rowena Rowan', 'Gillian Godbey', 'Hailey Huggard', 'Lillian Lander', 'Shani Szabo', 'Liberty Lamorte', 'Tomika Thrift', 'Garrett Grogan', 'Vallie Valazquez', 'Shin Secor', 'Deangelo Divito', 'Kacy Kimball', 'Norris Northway', 'Evelia Ernest', 'Horacio Huey', 'Christen Cyr', 'Jada Janus', 'Vanita Valero', 'Abdul Addario', 'Daniell Dingle', 'Tangela Trull', 'Jeanmarie Jimenez', 'Georgia Gourlay', 'Valery Vergara', 'Chasidy Conrad', 'Marlena Malin', 'Kristeen Kesselman', 'Jo Jeffries', 'Terina Tworek', 'Geri Gilbert', 'Phuong Pratte', 'Juanita Jess', 'Audrea Ammon', 'Shakita Stalter', 'Rosamond Reese', 'Shani Solorio', 'Archie Augustyn', 'Bridgett Behrman', 'Susann Schmaltz', 'Edgardo Engman', 'Valerie Vice', 'Cheyenne Claeys', 'Kristina Kastner', 'Lanita Labrum', 'Kai Knick', 'Lucien Lee', 'Tameika Turley', 'Octavia Obermiller', 'Kia Kravitz', 'Justina Jury', 'Cortney Coppa', 'Johnathan Joshi', 'Arden Alphin', 'Francis Feinberg', 'Sal Suits', 'Myles Marden', 'Emmitt Engelmann', 'Tara Tibbits', 'Su Sprowl', 'Isadora Ingrassia', 'Janell Jarrard', 'Kenyatta Kenley', 'Mabelle Mccrady' ] }; @@ -51,19 +51,19 @@ class NicknameInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - arguments: opts.arguments, - channel: opts.channel, - silent: opts.silent, - points: opts.points, + type: opts.type, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + arguments: opts.arguments, + channel: opts.channel, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink, - invoker: opts.invoker + data: opts.data, + hyperlink: opts.hyperlink, + invoker: opts.invoker }); if (!(opts.target instanceof MemberWrapper)) diff --git a/src/client/infractions/Note.ts b/src/client/infractions/Note.ts index 018b87f..31ec985 100644 --- a/src/client/infractions/Note.ts +++ b/src/client/infractions/Note.ts @@ -41,19 +41,19 @@ class NoteInfraction extends Infraction else super(client, logger, { targetType: 'USER', - arguments: opts.arguments, - type: opts.type, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - silent: opts.silent, - points: opts.points, + arguments: opts.arguments, + type: opts.type, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink, - invoker: opts.invoker + data: opts.data, + hyperlink: opts.hyperlink, + invoker: opts.invoker }); } diff --git a/src/client/infractions/Prune.ts b/src/client/infractions/Prune.ts index e2f9a5e..beeef96 100644 --- a/src/client/infractions/Prune.ts +++ b/src/client/infractions/Prune.ts @@ -20,7 +20,7 @@ import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; import { InfractionTargetType, InfractionType } from '../../../@types/Client.js'; import { PruneData } from '../../../@types/Infractions.js'; -import { BaseChannel, DMChannel, GuildTextBasedChannel, Message, PartialDMChannel, Snowflake, TextBasedChannel } from 'discord.js'; +import { BaseChannel, DMChannel, GuildTextBasedChannel, Message, PartialDMChannel, PartialGroupDMChannel, Snowflake, TextBasedChannel } from 'discord.js'; import { Collection } from '@discordjs/collection'; @@ -47,19 +47,19 @@ class PruneInfraction extends Infraction { super(client, logger, { targetType: 'CHANNEL', - type: opts.type, - invoker: opts.invoker, - arguments: opts.arguments, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - silent: opts.silent, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + arguments: opts.arguments, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (this.target instanceof BaseChannel && !this.target.isTextBased()) @@ -117,7 +117,7 @@ class PruneInfraction extends Infraction { const error = err as Error; this.logger.error(error.stack ?? error.message); - } // eslint-disable-line no-empty + } if (msgs.length > 0) { @@ -145,7 +145,7 @@ class PruneInfraction extends Infraction && (a.emojis ? (/?|:\w{2,32}:/u).test(m.content) : true) // does not support unicode emojis... might want to support? idk && (a.text ? m.content.length > 0 : true) && (a.invites ? (/discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/iu).test(m.content) : true) - // eslint-disable-next-line max-len + && (a.links ? (/(https?:\/\/)?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})\.([a-z0-9-]{2,63})\.?([a-z0-9-]{2,63})?/giu).test(m.content) : true) && (a.reactions ? m.reactions.cache.size > 0 : true) && (a.images ? m.attachments.some((a) => a.height && a.width) : true) @@ -161,7 +161,7 @@ class PruneInfraction extends Infraction || (a.endswith ? m.content.toLowerCase().endsWith(a.endswith.asString.toLowerCase()) : false) || (a.text?.asString ? m.content.length > 0 : false) || (a.invites?.asString ? (/discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/iu).test(m.content) : false) - // eslint-disable-next-line max-len + || (a.links?.asString ? (/(https?:\/\/)?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})\.([a-z0-9-]{2,63})\.?([a-z0-9-]{2,63})?/giu).test(m.content) : false) || (a.emojis?.asString ? (/?|:\w{2,32}:/u).test(m.content) : false) // does not support unicode emojis... might want to support? idk || (a.reactions?.asString ? m.reactions.cache.size > 0 : false) @@ -178,7 +178,7 @@ class PruneInfraction extends Infraction && (a.endswith ? !m.content.toLowerCase().endsWith(a.endswith.asString.toLowerCase()) : true) && (a.text ? m.content.length === 0 : true) && (a.invites ? !(/discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/iu).test(m.content) : true) - // eslint-disable-next-line max-len + && (a.links ? !(/(https?:\/\/)?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})\.([a-z0-9-]{2,63})\.?([a-z0-9-]{2,63})?/giu).test(m.content) : true) && (a.emojis ? !(/?|:\w{2,32}:/u).test(m.content) : true) // does not support unicode emojis... might want to support? idk && (a.reactions ? m.reactions.cache.size === 0 : true) @@ -195,7 +195,7 @@ class PruneInfraction extends Infraction || (a.endswith ? !m.content.toLowerCase().endsWith(a.endswith.asString.toLowerCase()) : false) || (a.text ? m.content.length === 0 : false) || (a.invites ? !(/discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/iu).test(m.content) : false) - // eslint-disable-next-line max-len + || (a.links ? !(/(https?:\/\/)?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})\.([a-z0-9-]{2,63})\.?([a-z0-9-]{2,63})?/giu).test(m.content) : false) || (a.emojis ? !(/?|:\w{2,32}:/u).test(m.content) : false) // does not support unicode emojis... might want to support? idk || (a.reactions ? m.reactions.cache.size === 0 : false) @@ -234,10 +234,10 @@ class PruneInfraction extends Infraction const fetch = async (lastMessage: Snowflake, amt: number) => { const messages = await msgMgr.fetch({ - limit: amt > 100 ? 100 : amt, + limit: amt > 100 ? 100 : amt, before: lastMessage, after, - cache: true // So deleted messages get logged + cache: true // So deleted messages get logged }); fetched = fetched.concat(messages); @@ -260,7 +260,7 @@ class PruneInfraction extends Infraction async verify () { const me = await this.guild.resolveMember(this.client.user!); - const channel = this.target as Exclude; + const channel = this.target as Exclude; const perms = channel.permissionsFor(me!); if (perms.missing([ 'ViewChannel', 'ReadMessageHistory' ]).length) return this._fail('C_PRUNE_MISSING_ACCESS'); diff --git a/src/client/infractions/Removerole.ts b/src/client/infractions/Removerole.ts index 02c97b6..26c4428 100644 --- a/src/client/infractions/Removerole.ts +++ b/src/client/infractions/Removerole.ts @@ -44,20 +44,20 @@ class RemoveroleInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (!(opts.target instanceof MemberWrapper)) @@ -124,7 +124,7 @@ class RemoveroleInfraction extends Infraction { return `\n${this.guild.format('INFRACTION_DESCRIPTIONROLES', { plural: this.data.roleIds!.length === 1 ? '' : 's', - roles: dm ? this.data.roleNames!.join(', ') : this.data.roleIds!.map((r) => `<@&${r}>`).join(' ') + roles: dm ? this.data.roleNames!.join(', ') : this.data.roleIds!.map((r) => `<@&${r}>`).join(' ') })}`; } diff --git a/src/client/infractions/Slowmode.ts b/src/client/infractions/Slowmode.ts index 82b118e..645b78f 100644 --- a/src/client/infractions/Slowmode.ts +++ b/src/client/infractions/Slowmode.ts @@ -41,20 +41,20 @@ class SlowmodeInfraction extends Infraction else super(client, logger, { targetType: SlowmodeInfraction.TargetType, - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); } @@ -68,7 +68,7 @@ class SlowmodeInfraction extends Infraction { channel.edit({ rateLimitPerUser: this.data.seconds, - reason: this._reason + reason: this._reason }); } catch (e) diff --git a/src/client/infractions/Softban.ts b/src/client/infractions/Softban.ts index 3822ac5..8596669 100644 --- a/src/client/infractions/Softban.ts +++ b/src/client/infractions/Softban.ts @@ -42,19 +42,19 @@ class SoftbanInfraction extends Infraction else super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target instanceof MemberWrapper ? opts.target.user : opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target instanceof MemberWrapper ? opts.target.user : opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); } @@ -67,7 +67,7 @@ class SoftbanInfraction extends Infraction try { await this.guild.members.ban(this.target!.id, { - reason: this._reason, + reason: this._reason, deleteMessageSeconds: days * 24 * 60 * 60 }); await this.guild.members.unban(this.target!.id, this._reason); diff --git a/src/client/infractions/Unban.ts b/src/client/infractions/Unban.ts index e3d0127..a809a13 100644 --- a/src/client/infractions/Unban.ts +++ b/src/client/infractions/Unban.ts @@ -40,20 +40,20 @@ class UnbanInfraction extends Infraction else super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - hyperlink: opts.hyperlink, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + hyperlink: opts.hyperlink, + points: opts.points, expiration: opts.expiration, - data: opts.data + data: opts.data }); } diff --git a/src/client/infractions/Unlockdown.ts b/src/client/infractions/Unlockdown.ts index 74fcb44..54026ed 100644 --- a/src/client/infractions/Unlockdown.ts +++ b/src/client/infractions/Unlockdown.ts @@ -40,17 +40,17 @@ class UnlockdownInfraction extends Infraction else super(client, logger, { targetType: 'CHANNEL', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - data: opts.data, - hyperlink: opts.hyperlink + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + data: opts.data, + hyperlink: opts.hyperlink }); } @@ -110,10 +110,10 @@ class UnlockdownInfraction extends Infraction } newOverwrites.push({ - id: permission.id, + id: permission.id, allow: allowed, - deny: denied, - type: permission.type + deny: denied, + type: permission.type }); } diff --git a/src/client/infractions/Unmute.ts b/src/client/infractions/Unmute.ts index bda0ebc..f483396 100644 --- a/src/client/infractions/Unmute.ts +++ b/src/client/infractions/Unmute.ts @@ -44,20 +44,20 @@ class UnmuteInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - duration: opts.duration, - hyperlink: opts.hyperlink, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + duration: opts.duration, + hyperlink: opts.hyperlink, + points: opts.points, expiration: opts.expiration, - data: opts.data + data: opts.data }); if (!(opts.target instanceof MemberWrapper)) @@ -66,14 +66,14 @@ class UnmuteInfraction extends Infraction } } - // eslint-disable-next-line max-lines-per-function + async execute () { let removedRoles: Snowflake[] | null = [], muteType = null, role = null; const settings = await this.guild.settings(), - now = Date.now(); + now = Date.now(); let callback = null; if (Object.keys(this.data).length) diff --git a/src/client/infractions/Vckick.ts b/src/client/infractions/Vckick.ts index d1b0f1e..bb2caf2 100644 --- a/src/client/infractions/Vckick.ts +++ b/src/client/infractions/Vckick.ts @@ -44,19 +44,19 @@ class VckickInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - arguments: opts.arguments, - silent: opts.silent, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + arguments: opts.arguments, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (!(opts.target instanceof MemberWrapper)) diff --git a/src/client/infractions/Warn.ts b/src/client/infractions/Warn.ts index aef70f0..1552216 100644 --- a/src/client/infractions/Warn.ts +++ b/src/client/infractions/Warn.ts @@ -43,19 +43,19 @@ class WarnInfraction extends Infraction { super(client, logger, { targetType: 'USER', - type: opts.type, - invoker: opts.invoker, - arguments: opts.arguments, - executor: opts.executor.user, - target: opts.target.user, - reason: opts.reason, - guild: opts.guild, - channel: opts.channel, - silent: opts.silent, - points: opts.points, + type: opts.type, + invoker: opts.invoker, + arguments: opts.arguments, + executor: opts.executor.user, + target: opts.target.user, + reason: opts.reason, + guild: opts.guild, + channel: opts.channel, + silent: opts.silent, + points: opts.points, expiration: opts.expiration, - data: opts.data, - hyperlink: opts.hyperlink + data: opts.data, + hyperlink: opts.hyperlink }); if (!(opts.target instanceof MemberWrapper)) diff --git a/src/client/interfaces/CommandError.ts b/src/client/interfaces/CommandError.ts index b4c73dd..ce7599f 100644 --- a/src/client/interfaces/CommandError.ts +++ b/src/client/interfaces/CommandError.ts @@ -66,9 +66,9 @@ class CommandError extends Error get embed () { return { - title: this.#invoker.format('O_COMMANDHANDLER_COMMAND_ERROR'), + title: this.#invoker.format('O_COMMANDHANDLER_COMMAND_ERROR'), description: this.reason, - color: 15120384 + color: 15120384 }; } diff --git a/src/client/interfaces/CommandOption.ts b/src/client/interfaces/CommandOption.ts index 8a3ab7d..2c72caa 100644 --- a/src/client/interfaces/CommandOption.ts +++ b/src/client/interfaces/CommandOption.ts @@ -27,18 +27,18 @@ import Module from './Module.js'; const PointsReg = /^([-+]?[0-9]+) ?(points|point|pts|pt|p)$/iu; const ChannelType: {[key: string]: number} = { - GuildText: 0, - DM: 1, - GuildVoice: 2, - GroupDM: 3, - GuildCategory: 4, - GuildAnnouncement: 5, + GuildText: 0, + DM: 1, + GuildVoice: 2, + GroupDM: 3, + GuildCategory: 4, + GuildAnnouncement: 5, AnnouncementThread: 10, - PublicThread: 11, - PrivateThread: 12, - GuildStageVoice: 13, - GuildDirectory: 14, - GuildForum: 15 + PublicThread: 11, + PrivateThread: 12, + GuildStageVoice: 13, + GuildDirectory: 14, + GuildForum: 15 }; class CommandOption @@ -172,9 +172,9 @@ class CommandOption this.#options.push(new CommandOption({ ...opts, - client: this.#client, + client: this.#client, name, - type: _type, + type: _type, description: desc, dependsOn, })); @@ -336,7 +336,7 @@ class CommandOption ROLES: async () => { const roles = [], - removed = []; + removed = []; if (!this.#rawValue) throw new Error('No rawValue supplied'); if (!this.#guild) @@ -361,7 +361,7 @@ class CommandOption MEMBERS: async () => { const members = [], - removed = []; + removed = []; if (!this.#rawValue) throw new Error('No rawValue supplied'); if (!this.#guild) @@ -386,7 +386,7 @@ class CommandOption USERS: async () => { const users = [], - removed = []; + removed = []; if (!this.#rawValue) throw new Error('No rawValue supplied'); if (!(this.#rawValue instanceof Array)) @@ -409,7 +409,7 @@ class CommandOption CHANNELS: async () => { const channels = [], - removed = []; + removed = []; if (!this.#rawValue) throw new Error('No rawValue supplied'); if (!this.#guild) @@ -434,7 +434,7 @@ class CommandOption TEXT_CHANNELS: async () => { const channels = [], - removed = []; + removed = []; if (!this.#rawValue) throw new Error('No rawValue supplied'); if (!this.#guild) @@ -459,7 +459,7 @@ class CommandOption VOICE_CHANNELS: async () => { const channels = [], - removed = []; + removed = []; if (!this.#rawValue) throw new Error('No rawValue supplied'); if (!this.#guild) @@ -518,7 +518,7 @@ class CommandOption throw new Error('Invalid rawValue'); const strings = this.#rawValue; const components: Component[] = [], - removed = []; + removed = []; for (const str of strings) { const [ component ] = this.client.resolver.components(str, 'any'); @@ -553,7 +553,7 @@ class CommandOption throw new Error('Invalid rawValue'); const strings = this.#rawValue; const commands: Command[] = [], - removed = []; + removed = []; for (const str of strings) { const [ command ] = this.client.resolver.components(str, 'command'); @@ -972,8 +972,8 @@ class CommandOption get raw (): RawCommandOption { return { - name: this.#name, - type: this.#type, + name: this.#name, + type: this.#type, options: this.#options.map((opt) => opt.raw) }; } @@ -1000,16 +1000,16 @@ class CommandOption if (!type) throw new Error('Invalid command type: ' + type); return { - name: this.#name, - description: this.#description, + name: this.#name, + description: this.#description, type, - required: this.#required, - choices: this.#choices, - options: this.#options.map((o) => o.shape as CommandOptionShape), - min_value: this.#minimum, - max_value: this.#maximum, + required: this.#required, + choices: this.#choices, + options: this.#options.map((o) => o.shape as CommandOptionShape), + min_value: this.#minimum, + max_value: this.#maximum, channel_types: ChannelType[cmdType] ? [ ChannelType[this.#type] ] : null, - autocomplete: this.#autocomplete + autocomplete: this.#autocomplete }; } diff --git a/src/client/interfaces/Component.ts b/src/client/interfaces/Component.ts index 7432640..ed3f71a 100644 --- a/src/client/interfaces/Component.ts +++ b/src/client/interfaces/Component.ts @@ -123,13 +123,13 @@ abstract class Component this.client.emit('componentUpdate', { component: this, - type: 'UNLOAD' + type: 'UNLOAD' }); return { error: false }; } - reload (bypass = false) + async reload (bypass = false) { if (this.#guarded && !bypass) return { error: true, code: 'GUARDED' }; @@ -143,7 +143,8 @@ abstract class Component { cached = require.cache[this.#directory]; delete require.cache[this.#directory]; - newModule = require(this.#directory); + // newModule = require(this.#directory); + newModule = (await import(this.#directory)).default; if (typeof newModule === 'function') { diff --git a/src/client/interfaces/FilterSetting.ts b/src/client/interfaces/FilterSetting.ts index 8bd8c9f..409eb08 100644 --- a/src/client/interfaces/FilterSetting.ts +++ b/src/client/interfaces/FilterSetting.ts @@ -41,7 +41,7 @@ abstract class FilterSetting extends Setting { if (actions.length >= 5 && _wordWatcher) return { - error: true, + error: true, content: invoker.format('SETTING_WORDWATCHER_ACTION_LIMIT') }; result = await this._createAction(invoker, actions, { _wordWatcher }); @@ -83,12 +83,12 @@ abstract class FilterSetting extends Setting return { index, params: { - type: action.type, + type: action.type, duration: action.duration ? Util.humanise(action.duration) : 'INF', - points: action.points || invoker.format('ON_OFF_TOGGLE', { toggle: false }, { code: true }), - force: invoker.format('ON_OFF_TOGGLE', { toggle: action.force }, { code: true }), - prune: invoker.format('ON_OFF_TOGGLE', { toggle: action.prune }, { code: true }), - trigger: action.trigger instanceof Array ? '||' + action.trigger.join(', ') + '||' : '`' + action.trigger + '`' + points: action.points || invoker.format('ON_OFF_TOGGLE', { toggle: false }, { code: true }), + force: invoker.format('ON_OFF_TOGGLE', { toggle: action.force }, { code: true }), + prune: invoker.format('ON_OFF_TOGGLE', { toggle: action.prune }, { code: true }), + trigger: action.trigger instanceof Array ? '||' + action.trigger.join(', ') + '||' : '`' + action.trigger + '`' } }; } @@ -106,9 +106,9 @@ abstract class FilterSetting extends Setting valid.push('DELETE'); // Used for wordwatcher quick actions to just delete the flagged message let promptResponse = await this._prompt(invoker, { - index: 'SETTING_FILTER_ACTION_ADD_START', + index: 'SETTING_FILTER_ACTION_ADD_START', params: { - valid: valid.join('`, `'), + valid: valid.join('`, `'), wordwatcher: _wordWatcher ? invoker.format('SETTING_WORDWATCHER_ACTION_ADD_START', { amount: actions.length }) : '' } }); @@ -124,7 +124,7 @@ abstract class FilterSetting extends Setting || (!validInfractions.includes(infType)) && ![ 'del', 'delete' ].includes(action))) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_INVALID_INFRACTION', { valid: validInfractions.join('`, `') }) }; if (!infType && [ 'del', 'delete' ].includes(action)) @@ -251,7 +251,7 @@ abstract class FilterSetting extends Setting return { content: invoker.format('SETTING_FILTER_NOACTIONS') }; return { content: invoker.format('SETTING_FILTER_CURRENT_ACTIONS'), - embeds: [ this._createActionEmbed(invoker, actions) ] + embeds: [ this._createActionEmbed(invoker, actions) ] }; } @@ -275,7 +275,7 @@ abstract class FilterSetting extends Setting const { content } = promptResponse; if ([ 'cancel', 'abort', 'exit' ].includes(content)) return { - error: true, + error: true, content: invoker.format('ERR_CANCEL') }; @@ -307,9 +307,9 @@ abstract class FilterSetting extends Setting // Which property do you want to edit? const properties = Object.keys(action); promptResponse = await this._prompt(invoker, { - index: 'SETTING_FILTER_ACTION_EDIT_SELECT', + index: 'SETTING_FILTER_ACTION_EDIT_SELECT', params: { properties: properties.join('`, `') }, - embed: null + embed: null }); if (promptResponse.error) return promptResponse; @@ -317,7 +317,7 @@ abstract class FilterSetting extends Setting const prop = promptResponse.content; if (!properties.includes(prop)) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_BADPROP') }; @@ -334,7 +334,7 @@ abstract class FilterSetting extends Setting else if ([ 'force', 'prune' ].includes(prop)) return this._editBool(invoker, actions, action, prop); return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_BADPROP') }; } @@ -351,7 +351,7 @@ abstract class FilterSetting extends Setting const settings = await invoker.guild?.settings(); if (!settings!.modpoints?.enabled) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_POINTS_DISABLED') }; @@ -380,7 +380,7 @@ abstract class FilterSetting extends Setting const bool = resolver.resolveBoolean(content); if (bool === null) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_BOOL_INVALID') }; @@ -394,7 +394,7 @@ abstract class FilterSetting extends Setting const settings = await invoker.guild?.settings(); if (!settings!.modpoints?.enabled) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_POINTS_DISABLED') }; @@ -406,7 +406,7 @@ abstract class FilterSetting extends Setting const reg = /(\d{1,3})\s?(points?|pts?|p)?/iu; if (!reg.test(content)) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_POINTS_FAIL') }; @@ -429,9 +429,9 @@ abstract class FilterSetting extends Setting : Promise { const promptResponse = await this._prompt(invoker, { - index: 'SETTING_FILTER_ACTION_EDIT_TYPE', + index: 'SETTING_FILTER_ACTION_EDIT_TYPE', params: { valid: validInfractions.join('`, `') }, - time: 120 + time: 120 }); if (promptResponse.error) @@ -440,7 +440,7 @@ abstract class FilterSetting extends Setting const content = promptResponse.content!; if (!validInfractions.includes(content.toUpperCase())) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_INVALID_TYPE') }; @@ -457,7 +457,7 @@ abstract class FilterSetting extends Setting { if (![ 'MUTE', 'BAN' ].includes(action.type)) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_DURATION_ERR', { action: action.type }) }; @@ -476,7 +476,7 @@ abstract class FilterSetting extends Setting const time = resolver.resolveTime(content); if (!time) return { - error: true, + error: true, content: invoker.format('SETTING_FILTER_ACTION_EDIT_DURATION_ERR2') }; action.duration = time; @@ -491,13 +491,13 @@ abstract class FilterSetting extends Setting fields: actions.map((action) => { return { - name: `**[${actions.indexOf(action)}]** ${action.type}`, + name: `**[${actions.indexOf(action)}]** ${action.type}`, value: invoker.format('SETTING_FILTER_ACTION_PROPERTIES', { duration: action.duration ? Util.humanise(action.duration) : 'INF', - points: action.points || invoker.format('GENERAL_STATE', { bool: false }, { code: true }), - prune: invoker.format('GENERAL_STATE', { bool: action.prune }, { code: true }), - force: invoker.format('GENERAL_STATE', { bool: action.force }, { code: true }), - trigger: action.trigger instanceof Array ? action.trigger.join(', ') : '`' + action.trigger + '`' + points: action.points || invoker.format('GENERAL_STATE', { bool: false }, { code: true }), + prune: invoker.format('GENERAL_STATE', { bool: action.prune }, { code: true }), + force: invoker.format('GENERAL_STATE', { bool: action.force }, { code: true }), + trigger: action.trigger instanceof Array ? action.trigger.join(', ') : '`' + action.trigger + '`' }), inline: true }; @@ -506,8 +506,8 @@ abstract class FilterSetting extends Setting }; if (embed.fields.length % 3 !== 2) embed.fields.push({ - name: ZeroWidthChar, - value: ZeroWidthChar, + name: ZeroWidthChar, + value: ZeroWidthChar, inline: true }); return embed; diff --git a/src/client/interfaces/Infraction.ts b/src/client/interfaces/Infraction.ts index 295d858..6ae1d82 100644 --- a/src/client/interfaces/Infraction.ts +++ b/src/client/interfaces/Infraction.ts @@ -48,7 +48,7 @@ const { } = Consts; const Constants = { - MaxCharacters: 1024, // Max embed description is 2048 characters, however some of those description characters are going to usernames, types, filler text, etc. + MaxCharacters: 1024, // Max embed description is 2048 characters, however some of those description characters are going to usernames, types, filler text, etc. RemovedInfractions: [ 'BAN', 'SOFTBAN', 'KICK' ] }; @@ -254,7 +254,7 @@ class Infraction { const logMessage = await this.#target.send({ content: message, - embeds: [ await this.#embed(true) ] + embeds: [ await this.#embed(true) ] }).catch(() => null); this.#dmLogMessageId = logMessage?.id ?? null; } @@ -315,8 +315,8 @@ class Infraction // icon_url: this.targetIcon // eslint-disable-line camelcase }, timestamp: new Date(this.#timestamp).toISOString(), - color: this.color, - footer: { + color: this.color, + footer: { text: `》 Case ${this.#case}` }, fields: [] @@ -329,9 +329,9 @@ class Infraction const settings = await this.#guild.settings(); const anonymous = dm ? settings.dminfraction.anonymous : settings.moderation.anonymous || false; description += `${this.#guild.format('INFRACTION_DESCRIPTION', { - type: this.dictionary.past.toUpperCase(), + type: this.dictionary.past.toUpperCase(), moderator: `${Util.escapeMarkdown(anonymous ? this.#client.user!.tag : (this.#executor?.tag || 'Unknown'))}`, - reason: Util.escapeMarkdown(this.#reason.length > Constants.MaxCharacters + reason: Util.escapeMarkdown(this.#reason.length > Constants.MaxCharacters ? `${this.#reason.substring(0, Constants.MaxCharacters - 3)}...` : this.#reason, { italic: false, underline: false, strikethrough: false }), // resolved: this.resolved ? this.guild.format('INFRACTION_RESOLVED') : '' @@ -345,8 +345,8 @@ class Infraction if (this.#points && this.#points > 0) { description += `\n${this.#guild.format('INFRACTION_DESCRIPTIONPOINTS', { - points: this.#points, - total: this.#totalPoints || 0, + points: this.#points, + total: this.#totalPoints || 0, expires: this.#expiration ? `` : this.#guild.format('INFRACTION_NO_EXPIRATION') })}`; } @@ -362,7 +362,7 @@ class Infraction { const resolveReason = this.#changes.sort((a, b) => b.timestamp - a.timestamp).find((change) => change.type === 'RESOLVE'); embed.fields!.push({ - name: this.#guild.format('INFRACTION_RESOLVE_REASON'), + name: this.#guild.format('INFRACTION_RESOLVE_REASON'), value: resolveReason?.reason || this.#guild.format('INFRACTION_RESOLVE_NO_REASON') }); } @@ -535,31 +535,31 @@ class Infraction get json (): InfractionJSON { return { - id: this.id, - guild: this.#guildId!, - channel: this.#channelId!, - channelName: this.#channel?.name ?? 'Unknown', - message: this.#messageId!, - executor: this.#executorId!, - executorTag: this.#executor?.tag ?? 'Unknown', - target: this.#targetId!, - targetTag: Util.isUserStruct(this.#target) ? this.#target.tag : this.#target?.name ?? 'Unknown', - targetType: this.#targetType, - type: this.#type!, - case: this.#case!, - timestamp: this.#timestamp, - duration: this.#duration!, - callback: this.callback, - reason: this.#reason, - data: this.#data, - flags: this.#flags, - points: this.#points!, - expiration: this.#expiration!, + id: this.id, + guild: this.#guildId!, + channel: this.#channelId!, + channelName: this.#channel?.name ?? 'Unknown', + message: this.#messageId!, + executor: this.#executorId!, + executorTag: this.#executor?.tag ?? 'Unknown', + target: this.#targetId!, + targetTag: Util.isUserStruct(this.#target) ? this.#target.tag : this.#target?.name ?? 'Unknown', + targetType: this.#targetType, + type: this.#type!, + case: this.#case!, + timestamp: this.#timestamp, + duration: this.#duration!, + callback: this.callback, + reason: this.#reason, + data: this.#data, + flags: this.#flags, + points: this.#points!, + expiration: this.#expiration!, modLogMessage: this.#modLogMessageId!, modLogChannel: this.#modLogId!, - dmLogMessage: this.#dmLogMessageId!, - resolved: this.#resolved, - changes: this.#changes, + dmLogMessage: this.#dmLogMessageId!, + resolved: this.#resolved, + changes: this.#changes, // _callbacked: this.#callbacked || false }; } @@ -589,7 +589,7 @@ class Infraction protected get _reason () { - // eslint-disable-next-line max-len + let str = `[${this.#type}][targetId:${this.#target?.id}] Executed by ${this.#executor?.tag} (${this.#executor?.id}) because: ${this.#reason}`; if (str.length > 512) str = `${this.#reason.substring(0, 509)}...`; @@ -620,7 +620,7 @@ class Infraction protected _succeed (): InfractionSuccess { return { - error: false, + error: false, infraction: this }; } @@ -628,10 +628,10 @@ class Infraction protected _fail (message: string, fatal: boolean | null = false, formatted = false): InfractionFail { return { - error: true, + error: true, infraction: this, - reason: message, - fatal: fatal ?? false, + reason: message, + fatal: fatal ?? false, formatted }; } @@ -708,10 +708,10 @@ class Infraction { this.#errorCheck(); const log: InfractionChange = { - reason: this.#reason, - staff: typeof staff === 'string' ? staff : staff.id, + reason: this.#reason, + staff: typeof staff === 'string' ? staff : staff.id, timestamp: Date.now(), - type: 'REASON' + type: 'REASON' }; this.#reason = reason; this.#changes.push(log); @@ -726,10 +726,10 @@ class Infraction if (!settings.modpoints.enabled) return { error: true, index: 'INFRACTION_EDIT_MODPOINTS_NOT_ON' }; const log: InfractionChange = { - points: this.#points, - staff: typeof staff === 'string' ? staff : staff.id, + points: this.#points, + staff: typeof staff === 'string' ? staff : staff.id, timestamp: Date.now(), - type: 'POINTS' + type: 'POINTS' }; const diff = points - (this.#points ?? 0); this.#points = points; @@ -755,9 +755,9 @@ class Infraction if (typeof this.#points !== 'number') return { error: true, index: 'INFRACTION_EDIT_EXPIRATION_MISSING_POINTS' }; const log: InfractionChange = { - type: 'EXPIRATION', - staff: typeof staff === 'string' ? staff : staff.id, - timestamp: Date.now(), + type: 'EXPIRATION', + staff: typeof staff === 'string' ? staff : staff.id, + timestamp: Date.now(), expiration: this.#expiration ? this.#expiration - this.#timestamp : null }; this.#expiration = expiration + this.#timestamp; @@ -785,10 +785,10 @@ class Infraction return { error: true, index: 'INFRACTION_EDIT_DURATION_NOTTIMED' }; const now = Date.now(); const log: InfractionChange = { - type: 'DURATION', - staff: typeof staff === 'string' ? staff : staff.id, + type: 'DURATION', + staff: typeof staff === 'string' ? staff : staff.id, timestamp: now, - duration: this.#duration + duration: this.#duration }; const member = this.#targetId ? await this.#guild.memberWrapper(this.#targetId).catch(() => null) : null; // const callback = await member.getCallback(this.type, true); @@ -813,8 +813,8 @@ class Infraction : Promise { this.#changes.push({ - type: 'RESOLVE', - staff: typeof staff === 'string' ? staff : staff.id, + type: 'RESOLVE', + staff: typeof staff === 'string' ? staff : staff.id, timestamp: Date.now(), reason }); @@ -828,8 +828,8 @@ class Infraction async unresolve (staff: UserResolveable, reason: string) { this.#changes.push({ - type: 'UNRESOLVE', - staff: typeof staff === 'string' ? staff : staff.id, + type: 'UNRESOLVE', + staff: typeof staff === 'string' ? staff : staff.id, timestamp: Date.now(), reason }); @@ -853,8 +853,8 @@ class Infraction const InfClass = this.#client.moderation.infractionClasses[data.type] as typeof Infraction; const infraction = new InfClass(this.#client, this.#logger, { fetched: true, - guild: this.#guild, - case: this.#case! + guild: this.#guild, + case: this.#case! }); await infraction.#patch(data); return infraction; diff --git a/src/client/interfaces/Inhibitor.ts b/src/client/interfaces/Inhibitor.ts index a238074..39cdd73 100644 --- a/src/client/interfaces/Inhibitor.ts +++ b/src/client/interfaces/Inhibitor.ts @@ -45,10 +45,10 @@ abstract class Inhibitor extends Component throw Util.fatal(new Error('Missing name property')); super(client, { - id: opts.name, - type: 'inhibitor', - guarded: opts.guarded, - disabled: opts.disabled, + id: opts.name, + type: 'inhibitor', + guarded: opts.guarded, + disabled: opts.disabled, moduleName: opts.moduleName }); diff --git a/src/client/interfaces/Module.ts b/src/client/interfaces/Module.ts index dace393..f39f511 100644 --- a/src/client/interfaces/Module.ts +++ b/src/client/interfaces/Module.ts @@ -31,7 +31,7 @@ class Module extends Component throw Util.fatal(new Error('Missing module options')); super(manager, { - id: opts.name, + id: opts.name, type: 'module' }); diff --git a/src/client/interfaces/Observer.ts b/src/client/interfaces/Observer.ts index 2aa8123..4e95ebf 100644 --- a/src/client/interfaces/Observer.ts +++ b/src/client/interfaces/Observer.ts @@ -44,10 +44,10 @@ class Observer extends Component throw Util.fatal(new Error('Missing name')); super(client, { - id: options.name, - type: 'observer', - guarded: options.guarded, - disabled: options.disabled, + id: options.name, + type: 'observer', + guarded: options.guarded, + disabled: options.disabled, moduleName: options.moduleName }); diff --git a/src/client/interfaces/Setting.ts b/src/client/interfaces/Setting.ts index 983267b..bbaa38e 100644 --- a/src/client/interfaces/Setting.ts +++ b/src/client/interfaces/Setting.ts @@ -87,10 +87,10 @@ abstract class Setting extends Component throw new Error(`Missing default for ${options.name}`); super(client, { - id: options.name, - type: 'setting', - disabled: options.disabled, - guarded: options.guarded, + id: options.name, + type: 'setting', + disabled: options.disabled, + guarded: options.guarded, moduleName: options.moduleName }); @@ -200,21 +200,21 @@ abstract class Setting extends Component } // , verbose = false -- unsure if this is a necessary argument anymore - // eslint-disable-next-line @typescript-eslint/no-unused-vars + usageEmbed (guild: GuildWrapper, _verbose: boolean | null = false, subcommand: CommandOption | null = null) { const fields = []; if (this.#commandOptions.some(opt => !(opt instanceof CommandOption))) throw new Error('Command options not initialised'); let options = this.#commandOptions as CommandOption[]; - // eslint-disable-next-line prefer-destructuring + if (subcommand) ({ options } = subcommand); if (options.length) { fields.push({ - name: `》 ${guild.format('GENERAL_OPTIONS')}`, + name: `》 ${guild.format('GENERAL_OPTIONS')}`, value: options.map((opt) => opt.usage(guild, true)).map((f) => f.value).join('\n\n') }); } @@ -296,7 +296,7 @@ abstract class Setting extends Component await response.delete().catch(() => null); if ([ 'cancel', 'abort', 'exit' ].includes(content)) return { - error: true, + error: true, content: invoker.format('ERR_CANCEL') }; else if (!content.length) @@ -309,7 +309,7 @@ abstract class Setting extends Component add T}> (list: T[] = [], params: T[] = [], caseSensitive = false): SettingModifyResult { const modified = [], - skipped = []; + skipped = []; for (const param of params) { @@ -330,7 +330,7 @@ abstract class Setting extends Component remove T}> (list: T[] = [], params: T[] = [], caseSensitive = false): SettingModifyResult { const modified = [], - skipped = []; + skipped = []; for (const param of params) { @@ -376,9 +376,9 @@ abstract class Setting extends Component ignore: ChannelResolverFunction, channels: ChannelResolverFunction } = { - bypass: resolver.resolveRole.bind(resolver), - roles: resolver.resolveRole.bind(resolver), - ignore: resolver.resolveChannel.bind(resolver), + bypass: resolver.resolveRole.bind(resolver), + roles: resolver.resolveRole.bind(resolver), + ignore: resolver.resolveChannel.bind(resolver), channels: resolver.resolveChannel.bind(resolver) }; diff --git a/src/client/interfaces/commands/Command.ts b/src/client/interfaces/commands/Command.ts index c60976a..fa5b532 100644 --- a/src/client/interfaces/commands/Command.ts +++ b/src/client/interfaces/commands/Command.ts @@ -93,10 +93,10 @@ abstract class Command extends Component throw Util.fatal(new Error('Missing name')); super(client, { - id: options.name, - type: 'command', - disabled: options.disabled, - guarded: options.guarded, + id: options.name, + type: 'command', + disabled: options.disabled, + guarded: options.guarded, moduleName: options.moduleName }); @@ -121,10 +121,10 @@ abstract class Command extends Component this.#memberPermissions = options.memberPermissions || []; // .map(Util.pascalConverter); this.#invokes = { - success: 0, + success: 0, successTime: 0, - fail: 0, - failTime: 0 + fail: 0, + failTime: 0 }; this.#options = []; @@ -298,7 +298,7 @@ abstract class Command extends Component else required = [ this.resolveable, ...this.memberPermissions ]; fields.push({ - name: `》 ${format('GENERAL_PERMISSIONS')}`, + name: `》 ${format('GENERAL_PERMISSIONS')}`, value: `\`${required.join('`, `')}\`` }); } @@ -413,9 +413,9 @@ abstract class Command extends Component this.#options.push(new CommandOption({ ...opts, name, - type: _type, + type: _type, description: desc, - client: this.client + client: this.client })); } } diff --git a/src/client/interfaces/commands/ModerationCommand.ts b/src/client/interfaces/commands/ModerationCommand.ts index 46136a4..b2bba67 100644 --- a/src/client/interfaces/commands/ModerationCommand.ts +++ b/src/client/interfaces/commands/ModerationCommand.ts @@ -38,48 +38,48 @@ abstract class ModerationCommand extends SlashCommand const flag = true; let baseOptions: CommandOptionParams[] = [ { - name: 'users', - type: CommandOptionType.MEMBERS, + name: 'users', + type: CommandOptionType.MEMBERS, description: 'Target users', - required: true, - strict: true + required: true, + strict: true }, { - name: 'points', - type: CommandOptionType.POINTS, + name: 'points', + type: CommandOptionType.POINTS, description: 'The amount of points to assign to the infraction', - minimum: 0, - maximum: 100 + minimum: 0, + maximum: 100 }, { - name: 'expiration', - type: CommandOptionType.TIME, + name: 'expiration', + type: CommandOptionType.TIME, description: 'How long until the points expire', flag }, { - name: 'prune', - type: CommandOptionType.INTEGER, - description: 'How many messages to prune', - minimum: 2, - maximum: 100, + name: 'prune', + type: CommandOptionType.INTEGER, + description: 'How many messages to prune', + minimum: 2, + maximum: 100, flag, valueOptional: true, - defaultValue: 100 + defaultValue: 100 }, { - name: 'force', - type: CommandOptionType.BOOLEAN, - description: 'Whether to override automod', + name: 'force', + type: CommandOptionType.BOOLEAN, + description: 'Whether to override automod', flag, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'silent', - type: CommandOptionType.BOOLEAN, - description: 'Whether the user should receive the infraction', + name: 'silent', + type: CommandOptionType.BOOLEAN, + description: 'Whether the user should receive the infraction', flag, valueOptional: true, - defaultValue: true + defaultValue: true }, { - name: 'reason', - type: CommandOptionType.STRING, + name: 'reason', + type: CommandOptionType.STRING, description: 'Infraction reason' } ]; diff --git a/src/client/interfaces/commands/SettingsCommand.ts b/src/client/interfaces/commands/SettingsCommand.ts index 865535a..42473dd 100644 --- a/src/client/interfaces/commands/SettingsCommand.ts +++ b/src/client/interfaces/commands/SettingsCommand.ts @@ -38,12 +38,12 @@ class SettingsCommand extends SlashCommand { super(client, { ...opts, - guildOnly: true, + guildOnly: true, memberPermissions: [ 'ManageGuild' ], - options: [ + options: [ { - type: CommandOptionType.SUB_COMMAND, - name: 'list', + type: CommandOptionType.SUB_COMMAND, + name: 'list', description: 'List available settings' } ] @@ -63,12 +63,12 @@ class SettingsCommand extends SlashCommand try { const subCommand = new CommandOption({ - name: setting.name, - aliases: setting.aliases, + name: setting.name, + aliases: setting.aliases, description: setting.description, - type: setting.commandType, // 'SUB_COMMAND', - options: setting.commandOptions, - client: this.client + type: setting.commandType, // 'SUB_COMMAND', + options: setting.commandOptions, + client: this.client }); this.options.push(subCommand); // Overwrite the setting options with the built CommandOption structures @@ -100,8 +100,8 @@ class SettingsCommand extends SlashCommand const missing = me?.permissions.missing(setting.clientPermissions) || []; if (missing.length) return invoker.reply({ - emoji: 'failure', - index: 'SETTING_MISSING_CLIENTPERMISSIONS', + emoji: 'failure', + index: 'SETTING_MISSING_CLIENTPERMISSIONS', params: { permissions: missing.map((m) => `\`${PermissionNames[m]}\``).join(', ') } }); } @@ -138,15 +138,15 @@ class SettingsCommand extends SlashCommand const error = err as Error; this.client.logger.error(`Error during setting execution:\n${error.stack || err}`); await invoker.editReply({ - index: 'SETTINGS_ERROR', + index: 'SETTINGS_ERROR', params: { resolveable: setting.resolveable }, - emoji: 'failure' + emoji: 'failure' }); } if (!invoker.replied) await invoker.reply({ - index: 'SETTINGS_NO_REPLY', + index: 'SETTINGS_NO_REPLY', params: { resolveable: setting.resolveable } }); } @@ -166,15 +166,15 @@ class SettingsCommand extends SlashCommand const { guild } = invoker; const embed: APIEmbed = { - title: 'Settings', + title: 'Settings', description: guild.format('SETTINGS_LIST'), - fields: [] + fields: [] }; const entries = Object.entries(modules); for (const [ module, values ] of entries) embed.fields!.push({ - name: Util.capitalise(module), - value: `\`${values.join('`\n`')}\``, + name: Util.capitalise(module), + value: `\`${values.join('`\n`')}\``, inline: true }); @@ -186,7 +186,7 @@ class SettingsCommand extends SlashCommand const { guild, subcommand } = invoker; const embed = setting.usageEmbed(guild, null, this.subcommand(subcommand!.name)); const dataFields = await setting.fields(guild); - // eslint-disable-next-line no-return-assign + dataFields.forEach((field, index) => { if (!field.name.length) diff --git a/src/client/interfaces/commands/SlashCommand.ts b/src/client/interfaces/commands/SlashCommand.ts index 5747a72..4bf6827 100644 --- a/src/client/interfaces/commands/SlashCommand.ts +++ b/src/client/interfaces/commands/SlashCommand.ts @@ -72,13 +72,13 @@ abstract class SlashCommand extends Command get shape () { return { - name: this.name, - description: this.description, - type: this.#type, - options: this.options.map((o) => o.shape), + name: this.name, + description: this.description, + type: this.#type, + options: this.options.map((o) => o.shape), // defaultPermission: this.defaultPermission, // eslint-disable-next-line camelcase - dm_permission: !this.guildOnly, + dm_permission: !this.guildOnly, // eslint-disable-next-line camelcase default_member_permissions: this.memberPermissions.length // This may need to be changed in the future, for now too lazy to go through all the commands changing the resolveables -- changed in d.js v14 diff --git a/src/client/storage/interfaces/MongodbTable.ts b/src/client/storage/interfaces/MongodbTable.ts index 0fc9ed5..505032a 100644 --- a/src/client/storage/interfaces/MongodbTable.ts +++ b/src/client/storage/interfaces/MongodbTable.ts @@ -153,9 +153,9 @@ class MongodbTable extends Table { const doc: Document = { $collStats: { - latencyStats: { histograms }, - storageStats: { scale }, - count: {}, + latencyStats: { histograms }, + storageStats: { scale }, + count: {}, queryExecStats: {} } }; diff --git a/src/client/storage/interfaces/Provider.ts b/src/client/storage/interfaces/Provider.ts index f3531d6..79e741f 100644 --- a/src/client/storage/interfaces/Provider.ts +++ b/src/client/storage/interfaces/Provider.ts @@ -127,7 +127,7 @@ abstract class Provider implements Initialisable // Defines quick access getter for the table Object.defineProperty(this, table.name, { enumerable: true, - get: () => + get: () => { return this.#tables[table.name]; } diff --git a/src/client/storage/providers/MariaDBProvider.ts b/src/client/storage/providers/MariaDBProvider.ts index 15b681c..3ee71e5 100644 --- a/src/client/storage/providers/MariaDBProvider.ts +++ b/src/client/storage/providers/MariaDBProvider.ts @@ -42,7 +42,7 @@ class MariaDBProvider extends Provider constructor (client: DiscordClient, config: MariaDBOptions) { super(client, { - name: MariaDBProvider.name, + name: MariaDBProvider.name, tables: config.tables, }); @@ -57,8 +57,8 @@ class MariaDBProvider extends Provider { this.#credentials.push({ host, - user: MARIADB_USER, - port: parseInt(MARIADB_PORT), + user: MARIADB_USER, + port: parseInt(MARIADB_PORT), password: MARIADB_PASS, database: MARIADB_DB }); diff --git a/src/client/storage/providers/MongoDBProvider.ts b/src/client/storage/providers/MongoDBProvider.ts index f0fdcaf..f8fb981 100644 --- a/src/client/storage/providers/MongoDBProvider.ts +++ b/src/client/storage/providers/MongoDBProvider.ts @@ -35,12 +35,12 @@ class MongoDBProvider extends Provider constructor (client: DiscordClient, config: MongoDBOptions) { super(client, { - name: MongoDBProvider.name, + name: MongoDBProvider.name, tables: config.tables }); const { MONGODB_HOST, MONGODB_PORT, MONGODB_USER, MONGODB_PASS, - MONGODB_DATABASE, MONGODB_AUTH_SOURCE, MONGODB_URI } = process.env; + MONGODB_DATABASE, MONGODB_AUTH_SOURCE, MONGODB_URI } = process.env; if ((!MONGODB_HOST || !MONGODB_PORT || !MONGODB_DATABASE) && !MONGODB_URI) throw new Error('Missing host, port and database OR a connection string'); diff --git a/src/middleware/Controller.ts b/src/middleware/Controller.ts index ec4902a..4e57276 100644 --- a/src/middleware/Controller.ts +++ b/src/middleware/Controller.ts @@ -95,13 +95,13 @@ class Controller extends EventEmitter options.discord.storage = options.storage; options.discord.version = version; this.#shardingOptions = { - path: clientPath, + path: clientPath, totalShards, shardList, respawn, - shardArgs: [], + shardArgs: [], execArgv, - token: process.env.DISCORD_TOKEN, + token: process.env.DISCORD_TOKEN, clientOptions: options.discord, }; @@ -298,7 +298,7 @@ class Controller extends EventEmitter return shard.send(response); } - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type broadcastEval (script: string | Function, options: BroadcastEvalOptions = {}) { if (typeof script !== 'function') @@ -350,7 +350,7 @@ class Controller extends EventEmitter const promises: Promise[] = [ shard.respawn({ delay: respawnDelay, timeout }) ]; if (++s < this.#shards.size && shardDelay > 0) promises.push(Util.delayFor(shardDelay)); - await Promise.all(promises); // eslint-disable-line no-await-in-loop + await Promise.all(promises); } return this.#shards; } diff --git a/src/middleware/Metrics.ts b/src/middleware/Metrics.ts index d7104c7..c7fbcf2 100644 --- a/src/middleware/Metrics.ts +++ b/src/middleware/Metrics.ts @@ -18,7 +18,7 @@ import BaseClient from './Controller.js'; import os from 'node:os'; import Shard from './Shard.js'; import { IPCMessage } from '../../@types/Shared.js'; -import djs, { GuildMessageManager } from 'discord.js'; +import { GuildMessageManager, version } from 'discord.js'; import DiscordClient from '../client/DiscordClient.js'; class Metrics @@ -34,32 +34,32 @@ class Metrics async aggregateStatistics (shard: Shard, message: IPCMessage) { const CPU = os.cpus(), - freeMemory = os.freemem(), - totalMemory = os.totalmem(), - systemData = { - cpu: CPU[0].model.trim(), - threads: CPU.length, - memory: { - used: totalMemory - freeMemory, - total: totalMemory - }, - osType: os.type(), - uptime: os.uptime(), - hostname: os.hostname() - }, - clientData = { - library: { - name: 'Discord.js', - version: djs.version - }, - shardData: await this.shardMetrics() - }, - managerData = { - version: this.#manager.version, - memory: process.memoryUsage().heapUsed, // Bytes - uptime: Math.floor((Date.now() - this.#manager.readyAt) / 1000), - managedShards: this.#manager.shards.size - }; + freeMemory = os.freemem(), + totalMemory = os.totalmem(), + systemData = { + cpu: CPU[0].model.trim(), + threads: CPU.length, + memory: { + used: totalMemory - freeMemory, + total: totalMemory + }, + osType: os.type(), + uptime: os.uptime(), + hostname: os.hostname() + }, + clientData = { + library: { + name: 'Discord.js', + version + }, + shardData: await this.shardMetrics() + }, + managerData = { + version: this.#manager.version, + memory: process.memoryUsage().heapUsed, // Bytes + uptime: Math.floor((Date.now() - this.#manager.readyAt) / 1000), + managedShards: this.#manager.shards.size + }; const data = { systemData, @@ -87,11 +87,11 @@ class Metrics amt += guild.members.cache.size; return amt; }, 0), - users: client.users.cache.size, - guilds: client.guilds.cache.size, + users: client.users.cache.size, + guilds: client.guilds.cache.size, channels: client.channels.cache.size, - uptime: Math.floor(client.uptime! / 1000), - memory: process.memoryUsage().heapUsed + uptime: Math.floor(client.uptime! / 1000), + memory: process.memoryUsage().heapUsed }; }; diff --git a/src/middleware/Shard.ts b/src/middleware/Shard.ts index 7aeb234..d8979e7 100644 --- a/src/middleware/Shard.ts +++ b/src/middleware/Shard.ts @@ -72,12 +72,12 @@ class Shard extends EventEmitter this.#env = { ...process.env, - SHARDING_MANAGER: true, // IMPORTANT, SHARD IPC WILL BREAK IF MISSING + SHARDING_MANAGER: true, // IMPORTANT, SHARD IPC WILL BREAK IF MISSING SHARDING_MANAGER_MODE: 'process', // IMPORTANT, SHARD IPC WILL BREAK IF MISSING - SHARDS: this.#id, - SHARD_ID: this.#id, - SHARD_COUNT: options.totalShards, - DISCORD_TOKEN: options.token + SHARDS: this.#id, + SHARD_ID: this.#id, + SHARD_COUNT: options.totalShards, + DISCORD_TOKEN: options.token }; if (!options.clientOptions?.libraryOptions) throw new Error('Missing library options, must provide intents'); @@ -126,7 +126,7 @@ class Shard extends EventEmitter this.#process = childProcess .fork(path.resolve(this.#file), this.#args, { - env: this.#env as NodeJS.ProcessEnv, + env: this.#env as NodeJS.ProcessEnv, execArgv: this.#execArgv }) .on('message', this.#handleMessage.bind(this)) @@ -312,7 +312,7 @@ class Shard extends EventEmitter return promise; } - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type eval (script: string | Function, context?: object): Promise { // Stringify the script if it's a Function diff --git a/src/utilities/BinaryTree.ts b/src/utilities/BinaryTree.ts index 1fda5a1..a6f2d7a 100644 --- a/src/utilities/BinaryTree.ts +++ b/src/utilities/BinaryTree.ts @@ -186,10 +186,10 @@ class BinaryTree this.#root = null; else - if (this.#curr === this.#parent.left) - this.#parent.left = null; - else - this.#parent.right = null; + if (this.#curr === this.#parent.left) + this.#parent.left = null; + else + this.#parent.right = null; } else { diff --git a/src/utilities/FilterUtil.ts b/src/utilities/FilterUtil.ts index 1aec39a..fea2b21 100644 --- a/src/utilities/FilterUtil.ts +++ b/src/utilities/FilterUtil.ts @@ -54,7 +54,7 @@ class FilterUtility '7': '⑺|➐|➆|❼|⓻|⑦|₇|⁷|𝟩|𝟟|7|𝟕|𝟳|𝟽', '8': '⑻|➑|➇|❽|⓼|⑧|₈|⁸|𝟪|𝟠|8|𝟖|𝟴|𝟾', '9': '⑼|➒|➈|❾|⓽|⑨|₉|⁹|𝟫|𝟡|9|𝟗|𝟵|𝟿', - a: [ + a: [ 'ム|a|A|@|🇦|🅰|🅐|🄰|𝞪|𝞐|𝝰|𝝖|𝜶|𝜜|𝛼|𝛢|𝛂|𝚨|𝚊|𝙰|𝙖|𝘼|𝘢|𝘈|𝗮|𝗔|𝖺|𝖠|𝖆|𝕬|𝕒|𝔸|𝔞|𝔄|𝓪|𝓐|𝒶|𝒜|𝒂|𝑨|𝑎', '𝐴|𝐚|𝐀|𐊠|ꭺ|ꓯ|ꓮ|ꋬ|卂|Ɐ|ⓐ|Ⓐ|⒜|⍺|∆|∀|₳|ₐ|ᾼ|Ὰ|Ᾱ|Ᾰ|ᾷ|ᾶ|ᾴ|ᾳ|ᾲ|ᾱ|ᾰ|ᾏ|ᾎ|ᾍ|ᾌ|ᾋ|ᾊ|ᾉ|ᾈ|ᾇ|ᾆ|ᾅ|ᾄ|ᾃ|ᾂ|ᾁ', 'ᾀ|ὰ|ἇ|ἆ|ἅ|ἄ|ἃ|ἂ|ἁ|ἀ|ặ|Ặ|ẵ|Ẵ|ẳ|Ẳ|ằ|Ằ|ắ|Ắ|ậ|Ậ|ẫ|Ẫ|ẩ|Ẩ|ầ|Ầ|ấ|Ấ|ả|Ả|ạ|Ạ|ẚ|ḁ|Ḁ|ᵃ|ᴬ|ᴀ|ᗩ|ᗅ|ᗄ|Ꮧ|Ꭿ', @@ -189,10 +189,10 @@ class FilterUtility static get REGEX () { return { - invite: /((discord\s?\.\s?gg\s?\/)|(discord(app)?\s?\.\s?com\/invite\/))(\s*?[a-z0-9]+)/giu, - link: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/\S*)?/iu, - linkG: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/\S*)?/iug, - emoji: //giu, + invite: /((discord\s?\.\s?gg\s?\/)|(discord(app)?\s?\.\s?com\/invite\/))(\s*?[a-z0-9]+)/giu, + link: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/\S*)?/iu, + linkG: /(https?:\/\/(www\.)?)?(?([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/\S*)?/iug, + emoji: //giu, letters: Array.from(Object.entries(this.REPLACED_CHARS_PATTERNS)) .reduce((obj, [ key, val ]) => { @@ -284,10 +284,10 @@ class FilterUtility { // this.logger.debug(`\nMessage matched with "${word}" in the explicit list.\nFull content: ${words.join(' ')}`); return { - match: word, + match: word, matched: true, matcher: 'explicit', - type: 'explicit', + type: 'explicit', word }; } @@ -337,12 +337,12 @@ class FilterUtility } // log += `\nMessage matched with "${reg}" in the regex list.\nMatch: ${match[0]}, Full word: ${fullWord}\nFull content: ${content}`; return { - match: fullWord, + match: fullWord, matched: true, - word: match[1].toLowerCase(), + word: match[1].toLowerCase(), matcher: `Regex: __${reg}__`, - type: 'regex', - raw: match[0] + type: 'regex', + raw: match[0] }; } @@ -376,11 +376,11 @@ class FilterUtility continue; // log += `\nMessage matched with "${_word}" in fuzzy.\nMatched word: ${word}\nFull content: ${content}\nSimilarity: ${sim}\nThreshold: ${threshold}`; return { - match: word, + match: word, matched: true, - word: _word, + word: _word, matcher: `fuzzy [\`${_word}\`, \`${sim}\`, \`${threshold}\`]`, - type: 'fuzzy', + type: 'fuzzy', threshold, sim }; @@ -394,11 +394,11 @@ class FilterUtility continue; // log += `\nMessage matched with "${_word}" in fuzzy.\nMatched word: ${text}\nFull content: ${content}\nSimilarity: ${sim}\nThreshold: ${threshold}`; return { - match: text, - matched: true, - word: _word, - matcher: `fuzzy [\`${_word}\`, \`${sim}\`, \`${th}\`]`, - type: 'fuzzy', + match: text, + matched: true, + word: _word, + matcher: `fuzzy [\`${_word}\`, \`${sim}\`, \`${th}\`]`, + type: 'fuzzy', sim, threshold: th }; diff --git a/src/utilities/InfractionMigrator.ts b/src/utilities/InfractionMigrator.ts index 061a9ff..abca4ef 100644 --- a/src/utilities/InfractionMigrator.ts +++ b/src/utilities/InfractionMigrator.ts @@ -159,32 +159,32 @@ class InfractionMigrator get infractionBase (): Nullable { return { - id: null, - guild: null, - channel: null, - channelName: null, - message: null, - executor: null, - executorTag: null, - target: null, - targetTag: null, - targetType: 'USER', - type: null, - case: null, - timestamp: null, - duration: null, - callback: null, - reason: null, - data: null, - flags: null, - points: null, - expiration: null, + id: null, + guild: null, + channel: null, + channelName: null, + message: null, + executor: null, + executorTag: null, + target: null, + targetTag: null, + targetType: 'USER', + type: null, + case: null, + timestamp: null, + duration: null, + callback: null, + reason: null, + data: null, + flags: null, + points: null, + expiration: null, modLogMessage: null, - dmLogMessage: null, + dmLogMessage: null, modLogChannel: null, - resolved: null, - changes: null, - _callbacked: true + resolved: null, + changes: null, + _callbacked: true }; } } diff --git a/src/utilities/SettingsMigrator.ts b/src/utilities/SettingsMigrator.ts index 848acd8..1bc3678 100644 --- a/src/utilities/SettingsMigrator.ts +++ b/src/utilities/SettingsMigrator.ts @@ -222,7 +222,7 @@ class SettingsMigrator get permissiongResolveables () { return { - 'module:moderation': [ 'mod', 'moderation', 'moderator', 'category:moderation' ], + 'module:moderation': [ 'mod', 'moderation', 'moderator', 'category:moderation' ], 'module:administration': [ 'admin', 'administrator', 'administration', 'category:administration' ] }; } @@ -239,35 +239,35 @@ class SettingsMigrator // console.log(result); // most of these should be mostly 1:1 apart from the names that changed const settings = { - modpoints: result.moderationPoints, + modpoints: result.moderationPoints, moderation: result.moderationLog, - mute: result.mute, - automod: result.autoModeration, + mute: result.mute, + automod: result.autoModeration, protection: result.protection, - ignore: result.ignoreChannels ? { + ignore: result.ignoreChannels ? { ...result.ignoreChannels, - bypass: result.ignoreChannels.roleBypass, + bypass: result.ignoreChannels.roleBypass, enabled: undefined } : undefined, - wordfilter: result.wordFilter, - linkfilter: result.linkFilter ? { ...result.linkFilter, greylist: [], mode: undefined } : undefined, - messages: result.messageLog ? { ...result.messageLog, enabled: Boolean(result.messageLog.channel) } : undefined, - wordwatcher: result.wordwatcher ? { ...result.wordWatcher, regex: [] } : undefined, - invitefilter: result.inviteFilter, - permissions: { type: result.permissionType || 'discord' }, - premium: result.premium, + wordfilter: result.wordFilter, + linkfilter: result.linkFilter ? { ...result.linkFilter, greylist: [], mode: undefined } : undefined, + messages: result.messageLog ? { ...result.messageLog, enabled: Boolean(result.messageLog.channel) } : undefined, + wordwatcher: result.wordwatcher ? { ...result.wordWatcher, regex: [] } : undefined, + invitefilter: result.inviteFilter, + permissions: { type: result.permissionType || 'discord' }, + premium: result.premium, mentionfilter: result.mentionFilter ? { ...result.mentionFilter, limit: result.mentionFilter.mentions, mentions: undefined } : undefined, dminfraction: result.dmInfraction, - silent: { enabled: result.silent || false }, - members: result.memberLog, - nicknames: result.nicknameLog, - voice: result.voiceLog, - grantable: result.grantable, - autorole: result.autorole, - stickyrole: result.stickyrole ? { ...result.stickyrole, enabled: Boolean(result.stickyrole.roles.length) } : undefined, - welcomer: result.welcomer, - commands: { disabled: result.disabledCommands, custom: {} }, + silent: { enabled: result.silent || false }, + members: result.memberLog, + nicknames: result.nicknameLog, + voice: result.voiceLog, + grantable: result.grantable, + autorole: result.autorole, + stickyrole: result.stickyrole ? { ...result.stickyrole, enabled: Boolean(result.stickyrole.roles.length) } : undefined, + welcomer: result.welcomer, + commands: { disabled: result.disabledCommands, custom: {} }, textcommands: { prefix: result.prefix, enabled: false } }; return settings; diff --git a/src/utilities/Util.ts b/src/utilities/Util.ts index 33c49ce..4803b1c 100644 --- a/src/utilities/Util.ts +++ b/src/utilities/Util.ts @@ -38,10 +38,10 @@ const Constants: { QuotePairs: StringIndexable } = { QuotePairs: { - '"': '"', // regular double + '"': '"', // regular double '\'': '\'', // regular single - '‘': '’', // smart single - '“': '”' // smart double + '‘': '’', // smart single + '“': '”' // smart double } }; @@ -369,7 +369,7 @@ class Util word = ''; const words: [string, boolean][] = [], - chars = string.split(''); + chars = string.split(''); chars.forEach((char: string) => { @@ -518,9 +518,9 @@ class Util static makePlainError (err: Error): PlainError { return { - name: err.name, + name: err.name, message: err.message, - stack: err.stack + stack: err.stack }; } @@ -556,7 +556,7 @@ class Util if (!token) throw new Error('[util] Token missing.'); return fetch('https://discord.com/api/v7/gateway/bot', { - method: 'GET', + method: 'GET', headers: { Authorization: `Bot ${token.replace(/^Bot\s*/iu, '')}` } }).then((res) => { diff --git a/tsconfig.json b/tsconfig.json index d17bff5..c243f31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -110,7 +110,7 @@ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, "compileOnSave": true, - "exclude": ["archive", "api"], + "exclude": ["archive", "api", "eslint.config.mjs"], "include": ["src/**/*", "index.ts", "@types/*"], "watchOptions": { "watchFile": "useFsEvents", diff --git a/yarn.lock b/yarn.lock index f26eb8e..b350358 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,6 +15,16 @@ __metadata: languageName: node linkType: hard +"@ampproject/remapping@npm:^2.2.0": + version: 2.3.0 + resolution: "@ampproject/remapping@npm:2.3.0" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10/f3451525379c68a73eb0a1e65247fbf28c0cccd126d93af21c75fceff77773d43c0d4a2d51978fb131aff25b5f2cb41a9fe48cc296e61ae65e679c4f6918b0ab + languageName: node + linkType: hard + "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.18.6": version: 7.18.6 resolution: "@babel/code-frame@npm:7.18.6" @@ -24,6 +34,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/code-frame@npm:7.25.7" + dependencies: + "@babel/highlight": "npm:^7.25.7" + picocolors: "npm:^1.0.0" + checksum: 10/000fb8299fb35b6217d4f6c6580dcc1fa2f6c0f82d0a54b8a029966f633a8b19b490a7a906b56a94e9d8bee91c3bc44c74c44c33fb0abaa588202f6280186291 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.18.8": version: 7.18.8 resolution: "@babel/compat-data@npm:7.18.8" @@ -31,6 +51,13 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/compat-data@npm:7.25.7" + checksum: 10/8fdc451e0ed9e22d1324d504b84d4452ba6f4a806b0f5c364996ee4c2a77293f79ecf4da03033acb625c90bac115c61617eb6c894c2b88486724bcbe3af1a6eb + languageName: node + linkType: hard + "@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3": version: 7.18.10 resolution: "@babel/core@npm:7.18.10" @@ -54,6 +81,29 @@ __metadata: languageName: node linkType: hard +"@babel/core@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/core@npm:7.25.7" + dependencies: + "@ampproject/remapping": "npm:^2.2.0" + "@babel/code-frame": "npm:^7.25.7" + "@babel/generator": "npm:^7.25.7" + "@babel/helper-compilation-targets": "npm:^7.25.7" + "@babel/helper-module-transforms": "npm:^7.25.7" + "@babel/helpers": "npm:^7.25.7" + "@babel/parser": "npm:^7.25.7" + "@babel/template": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + convert-source-map: "npm:^2.0.0" + debug: "npm:^4.1.0" + gensync: "npm:^1.0.0-beta.2" + json5: "npm:^2.2.3" + semver: "npm:^6.3.1" + checksum: 10/f5fb7fb1e3ce357485cb33fe7984051a2d416472370b33144ae809df86a4663192b58cf0d828d40674d30f485790f3dd5aaf72eb659487673a4dc4be47cb3575 + languageName: node + linkType: hard + "@babel/generator@npm:^7.18.10, @babel/generator@npm:^7.7.2": version: 7.18.12 resolution: "@babel/generator@npm:7.18.12" @@ -65,6 +115,37 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/generator@npm:7.25.7" + dependencies: + "@babel/types": "npm:^7.25.7" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + jsesc: "npm:^3.0.2" + checksum: 10/01542829621388077fa8a7464970c1db0f748f1482968dddf5332926afe4003f953cbe08e3bbbb0a335b11eba0126c9a81779bd1c5baed681a9ccec4ae63b217 + languageName: node + linkType: hard + +"@babel/helper-annotate-as-pure@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-annotate-as-pure@npm:7.25.7" + dependencies: + "@babel/types": "npm:^7.25.7" + checksum: 10/38044806cab33032391c46861cd0a36adb960525b00bc03f2f3d4380c983bf17971cdabc431e58b93a328ef24bd0271f1dc3a8c1c1ea6cab49d04702961451d8 + languageName: node + linkType: hard + +"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.25.7" + dependencies: + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/e493c4b7ea1dcb1e406cf30265164b632e133ea9a039a5ddc8eadd5370ad498eddcd99871fdf500b9ac05d0b43f2a0987580ceb1f7adb3b7272e49b56589849a + languageName: node + linkType: hard + "@babel/helper-compilation-targets@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-compilation-targets@npm:7.18.9" @@ -79,6 +160,64 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-compilation-targets@npm:7.25.7" + dependencies: + "@babel/compat-data": "npm:^7.25.7" + "@babel/helper-validator-option": "npm:^7.25.7" + browserslist: "npm:^4.24.0" + lru-cache: "npm:^5.1.1" + semver: "npm:^6.3.1" + checksum: 10/bbf9be8480da3f9a89e36e9ea2e1c76601014c1074ccada7c2edb1adeb3b62bc402cc4abaf8d16760734b25eceb187a9510ce44f6a7a6f696ccc74f69283625b + languageName: node + linkType: hard + +"@babel/helper-create-class-features-plugin@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-create-class-features-plugin@npm:7.25.7" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.25.7" + "@babel/helper-member-expression-to-functions": "npm:^7.25.7" + "@babel/helper-optimise-call-expression": "npm:^7.25.7" + "@babel/helper-replace-supers": "npm:^7.25.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + semver: "npm:^6.3.1" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/76e3bb727d7541d38acaa9b6ecff88f70e62370396dd22511837b90a556c6815a7efd6fd25b499bf1c8b02cdb18c575781a6aba0c442c38a2129a403b5bf9b1e + languageName: node + linkType: hard + +"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-create-regexp-features-plugin@npm:7.25.7" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.25.7" + regexpu-core: "npm:^6.1.1" + semver: "npm:^6.3.1" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/fa083f83ae9ba3326e32762c9839fea171de34d66bffc65569a6a67222ec55cf4ef35b6b26f332d24485c0622a69a2e0b9eb2a7ca279595b174cfeeec68849ac + languageName: node + linkType: hard + +"@babel/helper-define-polyfill-provider@npm:^0.6.2": + version: 0.6.2 + resolution: "@babel/helper-define-polyfill-provider@npm:0.6.2" + dependencies: + "@babel/helper-compilation-targets": "npm:^7.22.6" + "@babel/helper-plugin-utils": "npm:^7.22.5" + debug: "npm:^4.1.1" + lodash.debounce: "npm:^4.0.8" + resolve: "npm:^1.14.2" + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: 10/bb32ec12024d3f16e70641bc125d2534a97edbfdabbc9f69001ec9c4ce46f877c7a224c566aa6c8c510c3b0def2e43dc4433bf6a40896ba5ce0cef4ea5ccbcff + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-environment-visitor@npm:7.18.9" @@ -105,6 +244,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-member-expression-to-functions@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-member-expression-to-functions@npm:7.25.7" + dependencies: + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/f953a0ddbcfbaae835033b54fdbf42cc3aea08c554875fccfc02ed4b1e5fe3ee06abf1b7a8419314357841fabc9efdbcbb8afdf07c4f216a73164a45a147562b + languageName: node + linkType: hard + "@babel/helper-module-imports@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-module-imports@npm:7.18.6" @@ -114,6 +263,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-imports@npm:7.25.7" + dependencies: + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/94556712c27058ea35a1a39e21a3a9f067cd699405b64333d7d92b2b3d2f24d6f0ffa51aedba0b908e320acb1854e70d296259622e636fb021eeae9a6d996f01 + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-module-transforms@npm:7.18.9" @@ -130,6 +289,29 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-transforms@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": "npm:^7.25.7" + "@babel/helper-simple-access": "npm:^7.25.7" + "@babel/helper-validator-identifier": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/480309b1272ceaa985de1393f0e4c41aede0d5921ca644cec5aeaf43c8e4192b6dd56a58ef6d7e9acd02a43184ab45d3b241fc8c3a0a00f9dbb30235fd8a1181 + languageName: node + linkType: hard + +"@babel/helper-optimise-call-expression@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-optimise-call-expression@npm:7.25.7" + dependencies: + "@babel/types": "npm:^7.25.7" + checksum: 10/8da0d9f5aae15991678ad1bbe58e52cd62a0ed36871075756d9684c0a7a65988ed81bab53ad6436c39a470d3cd690694dd2b07147817217e3ca87178a129c509 + languageName: node + linkType: hard + "@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.8.0": version: 7.18.9 resolution: "@babel/helper-plugin-utils@npm:7.18.9" @@ -137,6 +319,39 @@ __metadata: languageName: node linkType: hard +"@babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.25.7, @babel/helper-plugin-utils@npm:^7.8.3": + version: 7.25.7 + resolution: "@babel/helper-plugin-utils@npm:7.25.7" + checksum: 10/e1b0ea5e67b05378d6360e3fc370e99bfb247eed9f68145b5cce541da703424e1887fb6fc60ab2f7f743c72dcbfbed79d3032af43f2c251c229c734dc2572a5b + languageName: node + linkType: hard + +"@babel/helper-remap-async-to-generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-remap-async-to-generator@npm:7.25.7" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.25.7" + "@babel/helper-wrap-function": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/3d563ac35cb1306bf70e7353fc807e7b082a7510d955a36db089fa861c6a8b2c470184996f3177d5384e5290a1be9e7eed424efb9e2dd3bed3a8cf6c2d6a9723 + languageName: node + linkType: hard + +"@babel/helper-replace-supers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-replace-supers@npm:7.25.7" + dependencies: + "@babel/helper-member-expression-to-functions": "npm:^7.25.7" + "@babel/helper-optimise-call-expression": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/87b65c7b278fabcb67458e592082a0b4532d5400acbb51e496ea47763077d0a64dc0531d32bafcb1d51f04d61d4715dadb1fd0301bc8449c26fcfd06913eb45e + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-simple-access@npm:7.18.6" @@ -146,6 +361,26 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-simple-access@npm:7.25.7" + dependencies: + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/42da1c358f2516337a4f2927c77ebb952907543b9f85d7cb1e2b5b5f6d808cdc081ee66a73e2ecdf48c315d9b0c2a81a857d5e1923ea210b8e81aba5e6cd2b53 + languageName: node + linkType: hard + +"@babel/helper-skip-transparent-expression-wrappers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.25.7" + dependencies: + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/466c81d09981bfb9e10aa6697ecb621389ff92a86187daaca34a969ca990d7327ebe931e87f7d52a200e499542d398469478d83dfaaa244d2f49df4e078490b3 + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-split-export-declaration@npm:7.18.6" @@ -169,6 +404,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 10/2b8de9fa86c3f3090a349f1ce6e8ee2618a95355cbdafc6f228d82fa4808c84bf3d1d25290c6616d0a18b26b6cfeb6ec2aeebf01404bc8c60051d0094209f0e6 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-validator-identifier@npm:7.18.6" @@ -183,6 +425,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 10/ec6934cc47fc35baaeb968414a372b064f14f7b130cf6489a014c9486b0fd2549b3c6c682cc1fc35080075e8e38d96aeb40342d63d09fc1a62510c8ce25cde1e + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-validator-option@npm:7.18.6" @@ -190,6 +439,24 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-option@npm:7.25.7" + checksum: 10/3c46cbdd666d176f90a0b7e952a0c6e92184b66633336eca79aca243d1f86085ec339a6e45c3d44efa9e03f1829b470a350ddafa70926af6bbf1ac611284f8d3 + languageName: node + linkType: hard + +"@babel/helper-wrap-function@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-wrap-function@npm:7.25.7" + dependencies: + "@babel/template": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/00e2291a2b67e060b98cae90b4cc9107cff29d7b26bd5eb61149c63fb99418d9bd00bb0708b8b3e733cae4b1ea3a2b41a709d85192accfa15903f8af5c821fe6 + languageName: node + linkType: hard + "@babel/helpers@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helpers@npm:7.18.9" @@ -201,6 +468,16 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helpers@npm:7.25.7" + dependencies: + "@babel/template": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/2632909f83aa99e8b0da4e10e5ab7fc4f0274e6497bb0f17071e004e037d25e4a595583620261dc21410a526fb32b4f7063c3e15e60ed7890a6f9b8ad52312c5 + languageName: node + linkType: hard + "@babel/highlight@npm:^7.18.6": version: 7.18.6 resolution: "@babel/highlight@npm:7.18.6" @@ -212,6 +489,18 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/highlight@npm:7.25.7" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.25.7" + chalk: "npm:^2.4.2" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.0.0" + checksum: 10/823be2523d246dbf80aab3cc81c2a36c6111b16ac2949ef06789da54387824c2bfaa88c6627cdeb4ba7151d047a5d6765e49ebd0b478aba09759250111e65e08 + languageName: node + linkType: hard + "@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.18.11": version: 7.18.11 resolution: "@babel/parser@npm:7.18.11" @@ -221,6 +510,85 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/parser@npm:7.25.7" + dependencies: + "@babel/types": "npm:^7.25.7" + bin: + parser: ./bin/babel-parser.js + checksum: 10/98eaa81bd378734a5f2790f02c7c076ecaba0839217445b4b84f45a7b391d640c34034253231a5bb2b2daf8204796f03584c3f94c10d46b004369bbb426a418f + languageName: node + linkType: hard + +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/25f1d0a2ec6f9e912d2513b3830b239acdf9c75f453c208f77074687393f380b1150684ca0acb78368391fa1035242ac66e7f3856834d8003f01d1af17747230 + languageName: node + linkType: hard + +"@babel/plugin-bugfix-safari-class-field-initializer-scope@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-bugfix-safari-class-field-initializer-scope@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/52551470b6164a787460c28019428e97d20097d5dffab74f8866512706a3b002e57fdb23fe8e5156149bc4c9cfea48d5a0347b7a9e7e2a05f681941037136ab3 + languageName: node + linkType: hard + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/c37204ec3c82a1babba13f0cc2a68220959224cbab1294b1d7d8501af4734de1664b43c67b97fcaa1b3f53c865b0a4ad6f887102c7d7b913aab43df29ac7da52 + languageName: node + linkType: hard + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.7" + "@babel/plugin-transform-optional-chaining": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.13.0 + checksum: 10/507c92bbcb3d7747c82290370336b50368fbb652af31fea718be8f1928142f1c5f7c6f2b9810d8b9b2905734f8f6b778f9e4b1cfb5a11073a2f1cfe9e5e5b354 + languageName: node + linkType: hard + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/289c6da5840c5049adbeb9b4cfb166d422f0b7b3f3a54aff64e8a053a1249e8eb513eac0fa3d033869372ffc30eda1e8555fa789b9daa1064bfdaf7f4717daa8 + languageName: node + linkType: hard + +"@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2": + version: 7.21.0-placeholder-for-preset-env.2 + resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/fab70f399aa869275690ec6c7cedb4ef361d4e8b6f55c3d7b04bfee61d52fb93c87cec2c65d73cddbaca89fb8ef5ec0921fce675c9169d9d51f18305ab34e78a + languageName: node + linkType: hard + "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -243,7 +611,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-class-properties@npm:^7.8.3": +"@babel/plugin-syntax-class-properties@npm:^7.12.13, @babel/plugin-syntax-class-properties@npm:^7.8.3": version: 7.12.13 resolution: "@babel/plugin-syntax-class-properties@npm:7.12.13" dependencies: @@ -254,7 +622,62 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-import-meta@npm:^7.8.3": +"@babel/plugin-syntax-class-static-block@npm:^7.14.5": + version: 7.14.5 + resolution: "@babel/plugin-syntax-class-static-block@npm:7.14.5" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.14.5" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/3e80814b5b6d4fe17826093918680a351c2d34398a914ce6e55d8083d72a9bdde4fbaf6a2dcea0e23a03de26dc2917ae3efd603d27099e2b98380345703bf948 + languageName: node + linkType: hard + +"@babel/plugin-syntax-dynamic-import@npm:^7.8.3": + version: 7.8.3 + resolution: "@babel/plugin-syntax-dynamic-import@npm:7.8.3" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.8.0" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/ce307af83cf433d4ec42932329fad25fa73138ab39c7436882ea28742e1c0066626d224e0ad2988724c82644e41601cef607b36194f695cb78a1fcdc959637bd + languageName: node + linkType: hard + +"@babel/plugin-syntax-export-namespace-from@npm:^7.8.3": + version: 7.8.3 + resolution: "@babel/plugin-syntax-export-namespace-from@npm:7.8.3" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/85740478be5b0de185228e7814451d74ab8ce0a26fcca7613955262a26e99e8e15e9da58f60c754b84515d4c679b590dbd3f2148f0f58025f4ae706f1c5a5d4a + languageName: node + linkType: hard + +"@babel/plugin-syntax-import-assertions@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-syntax-import-assertions@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/d72615f8dcc5ffbcb456bcf7ce27bc22b30cc9ea8d809e461d80af486033d31bd0b6d83c9a7997c9cd36ff283a9c1207f806da4361bb620370659c256c5454e9 + languageName: node + linkType: hard + +"@babel/plugin-syntax-import-attributes@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-syntax-import-attributes@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/7c5451e2d8351693acbc53b1e1f6951026e35899d22847a6d22424a1ee5c92c11ac6c6f209a9e18f85d7bb9267caaf2532653e892997cdcd51784106a5858b7e + languageName: node + linkType: hard + +"@babel/plugin-syntax-import-meta@npm:^7.10.4, @babel/plugin-syntax-import-meta@npm:^7.8.3": version: 7.10.4 resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4" dependencies: @@ -276,7 +699,18 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-logical-assignment-operators@npm:^7.8.3": +"@babel/plugin-syntax-jsx@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-syntax-jsx@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/243476a943a84b6b86e99076301e66f48268e8799564053e8feccab90da7944a0b42c91360216dbfb0b2958bbd0ed100d2c7b2db688dab83d19ff2745d4892eb + languageName: node + linkType: hard + +"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4, @babel/plugin-syntax-logical-assignment-operators@npm:^7.8.3": version: 7.10.4 resolution: "@babel/plugin-syntax-logical-assignment-operators@npm:7.10.4" dependencies: @@ -298,7 +732,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-numeric-separator@npm:^7.8.3": +"@babel/plugin-syntax-numeric-separator@npm:^7.10.4, @babel/plugin-syntax-numeric-separator@npm:^7.8.3": version: 7.10.4 resolution: "@babel/plugin-syntax-numeric-separator@npm:7.10.4" dependencies: @@ -342,7 +776,18 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-top-level-await@npm:^7.8.3": +"@babel/plugin-syntax-private-property-in-object@npm:^7.14.5": + version: 7.14.5 + resolution: "@babel/plugin-syntax-private-property-in-object@npm:7.14.5" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.14.5" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/b317174783e6e96029b743ccff2a67d63d38756876e7e5d0ba53a322e38d9ca452c13354a57de1ad476b4c066dbae699e0ca157441da611117a47af88985ecda + languageName: node + linkType: hard + +"@babel/plugin-syntax-top-level-await@npm:^7.14.5, @babel/plugin-syntax-top-level-await@npm:^7.8.3": version: 7.14.5 resolution: "@babel/plugin-syntax-top-level-await@npm:7.14.5" dependencies: @@ -353,6 +798,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-typescript@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-syntax-typescript@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/f1492336230920cc4daa6e7aa3571253fb0c0fd05a1d0a7b5dc0a5b907f31945235ee8bf09c83f7738b89943a2320a61dda95e0db2b6310b07040aeda6be4f44 + languageName: node + linkType: hard + "@babel/plugin-syntax-typescript@npm:^7.7.2": version: 7.18.6 resolution: "@babel/plugin-syntax-typescript@npm:7.18.6" @@ -364,6 +820,752 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-unicode-sets-regex@npm:^7.18.6": + version: 7.18.6 + resolution: "@babel/plugin-syntax-unicode-sets-regex@npm:7.18.6" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.18.6" + "@babel/helper-plugin-utils": "npm:^7.18.6" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/a651d700fe63ff0ddfd7186f4ebc24447ca734f114433139e3c027bc94a900d013cf1ef2e2db8430425ba542e39ae160c3b05f06b59fd4656273a3df97679e9c + languageName: node + linkType: hard + +"@babel/plugin-transform-arrow-functions@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-arrow-functions@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/45a6b05acd132bd399ab127d54d43f7117f650908092c15da7c41c61c5e49bfdb63c0e65bd59ad68c94bfc6aade602732a98a55b146b69dfae212516203d43f9 + languageName: node + linkType: hard + +"@babel/plugin-transform-async-generator-functions@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-async-generator-functions@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-remap-async-to-generator": "npm:^7.25.7" + "@babel/plugin-syntax-async-generators": "npm:^7.8.4" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/f5e14796bcb04db7f045833d695e49bb1178162c74754f67f25fd6934ebbd0e57a59784d76a23b3f472bbd3e5a0c33d433ab60e7c6a5c7ca240b54d8ca231baa + languageName: node + linkType: hard + +"@babel/plugin-transform-async-to-generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-async-to-generator@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-remap-async-to-generator": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/fdc6161e9027bec8bbe523e40934a2cccf1a30cf241006c98a120b2cda6e4f75d4a4cb4831cf3ece43d9b752183117e4ca5ec43778750146d5fc9a74b22b1acf + languageName: node + linkType: hard + +"@babel/plugin-transform-block-scoped-functions@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/334debb143d002295c6dd5559ebf24483557787621fd1d7283ac748eb401ed96b7d43c981f1d2b6795720979fe7872dd0719aed890d064244d52b1c4fe6f3347 + languageName: node + linkType: hard + +"@babel/plugin-transform-block-scoping@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-block-scoping@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/bbc5b815c6850eb798a294a5d31ed09bb0db367a31196e78c0d02ce3f845ddd2e0dcfd7ec70505dfa4e1bd67f13e46b315d290c58aa7531468feed380e267d97 + languageName: node + linkType: hard + +"@babel/plugin-transform-class-properties@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-class-properties@npm:7.25.7" + dependencies: + "@babel/helper-create-class-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/fe1dbbd77275ade96964fec0c85a1f14e2dac0c6565bccddf00680e43c2e906d289dd9d483aff6359420cef2a044b4aaaeb303f64a3a1a005601c018188368e7 + languageName: node + linkType: hard + +"@babel/plugin-transform-class-static-block@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-class-static-block@npm:7.25.7" + dependencies: + "@babel/helper-create-class-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" + peerDependencies: + "@babel/core": ^7.12.0 + checksum: 10/d6fa7132071860d4b6e58baa43c8efdd241d5b4ff3d31b0b6593390c7b39bf17ab549e427c08db550c84b0fb02eaad41fc96c2d299fbee4c0a6030315b0a5296 + languageName: node + linkType: hard + +"@babel/plugin-transform-classes@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-classes@npm:7.25.7" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.25.7" + "@babel/helper-compilation-targets": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-replace-supers": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + globals: "npm:^11.1.0" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/239926ceb7fa926054fe9aabb7a64dba090d8f83d075bcec804d602a5715501c56dc26367bb90e6780e1113cc04cf6ad32c131e2782ccf1768fd059ac7eba04b + languageName: node + linkType: hard + +"@babel/plugin-transform-computed-properties@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-computed-properties@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/template": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/f25caeb3366847a1f67efe4b250a460f88a5ebb4c12c566d945bf211ef28977dd21f4dd6539f63743f3fabdbb174b4d34e22af2a451aba3bcfd702396442eb53 + languageName: node + linkType: hard + +"@babel/plugin-transform-destructuring@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-destructuring@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/b58347dc1b807ef8e6aaf995d59c6f09aa9de2c590bb90a52bc9c4082836ef72f70f8fc062370138134220de40dad06af6122ffcce77fb97d5e77ca7cd71e5c7 + languageName: node + linkType: hard + +"@babel/plugin-transform-dotall-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-dotall-regex@npm:7.25.7" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/a4727ee33b95d1f7e33b277b0003e3e91ebb9c3c611512e1ca5f3f0d99efd552a6c42b09e5520ea686ef0389dd8159a77c7c59fb53d0d1a1ff7d385c362da71b + languageName: node + linkType: hard + +"@babel/plugin-transform-duplicate-keys@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-duplicate-keys@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/b132ce919643f1fa519c8597513fba77155fde2d7689154c73791847efd218ff7ce11694b539ca9dee65538c9e774adf4bd6a6e950800dd648f43d5906a38155 + languageName: node + linkType: hard + +"@babel/plugin-transform-duplicate-named-capturing-groups-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-duplicate-named-capturing-groups-regex@npm:7.25.7" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/688ab66ed249a08d4b2e3ae8a2c10678fbe23f6466d5020d4cc3e031946dc335c028f5a1bee3221acb3875a1e901b0237020463157690fabc06edc4bdd6c6c88 + languageName: node + linkType: hard + +"@babel/plugin-transform-dynamic-import@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-dynamic-import@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/a153f2a8b10a733f884a0ba0e680387d0ba643d40774885c26cceef90cc61b8e2f946a64e1764605189498a9a04e1d4da4e886c3e26a850e7c4e5ea5fb4b3f50 + languageName: node + linkType: hard + +"@babel/plugin-transform-exponentiation-operator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.25.7" + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/3371fc79c052a3c63652785284a9f4b943a188ae5aa3e68a760c45afc43739d654ad6d8d24b93ed04fe736f6c0b4a7a11ace56bc954d3a6520d0b3c79e058c03 + languageName: node + linkType: hard + +"@babel/plugin-transform-export-namespace-from@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-export-namespace-from@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/e3ec589906380d1daa3349c358f8a56c9adc1c5003b4069321172e1e8160f2a497e9ae112ad1ac68e26dce33eb19019932cf938ad411493441ad202db0e72c2b + languageName: node + linkType: hard + +"@babel/plugin-transform-for-of@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-for-of@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/6fdfc1747283f50ada9f08d4f801d2156658f183db731369ac2b17f5f885661114906b3645c6a38bb6a5e24b771e6bd43c0ea47580c4fcb9347cd1d179e57435 + languageName: node + linkType: hard + +"@babel/plugin-transform-function-name@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-function-name@npm:7.25.7" + dependencies: + "@babel/helper-compilation-targets": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/465d54942c03f77da3be5fb56404c6f8162f0e99034b8aceab6af2d386a77ecaf3df0c5f2dd67a00b66cd8ad970c0a08151026ed14aa44673a33f495e6849cc7 + languageName: node + linkType: hard + +"@babel/plugin-transform-json-strings@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-json-strings@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-json-strings": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/99e7b19d5b8f0df78eb2eaef2c1c8734e634b08910b47d5c2f61e43e75bd94a9f8e51c8baf2d2fa181bf0a7424c08b0aee29a95ae5f9e59f50e51e188dc943a1 + languageName: node + linkType: hard + +"@babel/plugin-transform-literals@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-literals@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/435d9709204e4cae46f9e75973a1424b98bb71516d9cfb0619260cfb56d445b43fa34aa49dacb0e1fbc2a19fdd9373f4b4db4908007be8f9e9e3f0ccf6c73e71 + languageName: node + linkType: hard + +"@babel/plugin-transform-logical-assignment-operators@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/28d00bae5637564243585e4fa044b9bc1da4b5c2ac2859e848e2db5f1c11c24dbc1ecc690755a00f593815a40d9cd99df2b31110ab68626840b22598ecf08d93 + languageName: node + linkType: hard + +"@babel/plugin-transform-member-expression-literals@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-member-expression-literals@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/fb2b985cfa0436bfbed6fbcdd430573272518cf3454c9b0de374cfb80ac6fe60b2ebbe0818a83035e436a9ff08b159bb87527dfd712560c52a0ebfabe6f65121 + languageName: node + linkType: hard + +"@babel/plugin-transform-modules-amd@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-modules-amd@npm:7.25.7" + dependencies: + "@babel/helper-module-transforms": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/0d061c91130433fccc723b4eb1359ced515a5dd7196c3ec75f2b2c24613154365ec1c89fe89bee648c1dc28a54c9625dd2b21b6196659a9f2b8ebff0b2352f6c + languageName: node + linkType: hard + +"@babel/plugin-transform-modules-commonjs@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.25.7" + dependencies: + "@babel/helper-module-transforms": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-simple-access": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/4b3d038b55bfe5553e9eea360cc1b3dd689068256a9bce1939061ab1dfa194fea0b7b54f10c53b0af0be44508fd0037022c32709a6d96ac1277fb9c7de0f510c + languageName: node + linkType: hard + +"@babel/plugin-transform-modules-systemjs@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.25.7" + dependencies: + "@babel/helper-module-transforms": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-validator-identifier": "npm:^7.25.7" + "@babel/traverse": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/abd3522e60a9b639f8ad58b2ee237debe9e78a3a1462e3c5b17b4fbdc1b4bb2235edb1ed7d204b45701ec99dd3506d87164ece8ac9d9465a3e603cf13170b65b + languageName: node + linkType: hard + +"@babel/plugin-transform-modules-umd@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-modules-umd@npm:7.25.7" + dependencies: + "@babel/helper-module-transforms": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/06d6e95a9948aa91b218ada2940b8f568f78991265f2923f6e69c29e97ef1731c1b79adaf72a072a834a86f98fc0bd0117dfb14a37aaea6337fb4468f757471a + languageName: node + linkType: hard + +"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.25.7" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/4c8340cacb1d21794777abb68db2ea434a89274e9ca539e6f564488f5e8a7f517fdf0f9dc754a14cdb8702a3a488ba2bf0fad404a7da3ba4481f620fa6f234c9 + languageName: node + linkType: hard + +"@babel/plugin-transform-new-target@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-new-target@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/c410edc9d8800590e34e648851a633534c3d153d0a76a34cc12854a4ecd578ce1b1c121e42e8c8f654757fcba13849a39fccde0d619de9ee3567a8f9fa2c8fc0 + languageName: node + linkType: hard + +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/af4d2d17eb0bdfa4a0414eb02a402f65226363ea3cc6d781028fd0051893918eeb3cf13aaceef8ef58ef35b36362dbcc25cd018e0c24b5b441226e086bf3b58f + languageName: node + linkType: hard + +"@babel/plugin-transform-numeric-separator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-numeric-separator@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/963ff47d27b7e61e0b346a29e2ff86ccf4fb779f7069b54c09e93376e6ed769523d81b9ef4ef60ae2d8fe35f3411a25d4b2e8d0a23850afa821f47f33c7b510c + languageName: node + linkType: hard + +"@babel/plugin-transform-object-rest-spread@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-object-rest-spread@npm:7.25.7" + dependencies: + "@babel/helper-compilation-targets": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" + "@babel/plugin-transform-parameters": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/b831c56921cb4818956941fd6eb54ba75fa51e5e5c1dc00466d70c79fea2a73d166a6ff02e8a27d63e40238de49f966af2bd243a8b6d281f784672f1a285d47c + languageName: node + linkType: hard + +"@babel/plugin-transform-object-super@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-object-super@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-replace-supers": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/c033337d27f98a255509c3ac152a54ce25d707b7969a64ba5262c7ddb54ba962da081fe756ce922caa57d782cacc6705e3d8e74364938391170f043eb9c5905e + languageName: node + linkType: hard + +"@babel/plugin-transform-optional-catch-binding@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/b195680e047bd2e0e36debfb75e5649f0fd8c88185e33c627c5418c68f9990cb4d96faccfbf47a2fdf9ff848a9e013ca077647616aa9dc1f78fa250ef1521437 + languageName: node + linkType: hard + +"@babel/plugin-transform-optional-chaining@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-optional-chaining@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.7" + "@babel/plugin-syntax-optional-chaining": "npm:^7.8.3" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/9c0a742eb3111f250b95065cd7d27b31c724d3f3c29b1de3c6655632172f69d5aa658d3ebff76d3b530b6792b6f4cf4845f4132ac8a1fea6e57ff19e3ec6f531 + languageName: node + linkType: hard + +"@babel/plugin-transform-parameters@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-parameters@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/c6a77fece85b3fd7323ec4ecc62329932b92c2c1ec20f1cc7617d3e49cc175f143988e756f5ccc45deca0fe582040afa67eeefd1704a8188cf2dc437efcfaf53 + languageName: node + linkType: hard + +"@babel/plugin-transform-private-methods@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-private-methods@npm:7.25.7" + dependencies: + "@babel/helper-create-class-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/79506a74334dc77f6c53f44109f0a3fcf6c50410faa5dd5e5d17ac4b73194098de509f5515a7aed3724a4bfa5dd246517e22a1dff4c20fc052df7a189bf2160d + languageName: node + linkType: hard + +"@babel/plugin-transform-private-property-in-object@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-private-property-in-object@npm:7.25.7" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.25.7" + "@babel/helper-create-class-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/c23786b9c123cceb0f69ab074377236825d76db090413db0b92d1a412b0e488e7ebde3e6155883ddbce6616114c54693485274a5d2b8a9a280b40781f80bd343 + languageName: node + linkType: hard + +"@babel/plugin-transform-property-literals@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-property-literals@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/f8be4090e9ffa9eebaca5eab4534de16acc5c84a476649cfed532de564817fc982a47d9349e6e447c510786897625153f60740fe9128b40d3a1eae3bbb5e1438 + languageName: node + linkType: hard + +"@babel/plugin-transform-regenerator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-regenerator@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + regenerator-transform: "npm:^0.15.2" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/7a68e841b12b5f767d98ee650aa914ea246d99cc84de054bdb331185894c0fa554ec4296f32d65385e3012dcf083a098e06c14e518056d7e8a0804227a12d85d + languageName: node + linkType: hard + +"@babel/plugin-transform-reserved-words@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-reserved-words@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/484edb3f4aa52f49914bea5f832fe380d159fff44e007ac9063666cf773bc258ef5b741f5a323167087bfd6a6dd5c2f96556d1ce5b3765bdf3a54fc018f3670d + languageName: node + linkType: hard + +"@babel/plugin-transform-shorthand-properties@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-shorthand-properties@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/71c9c1d77887ffa452b2d7c9026ee8e40596e4b4208b077369a997e4e031b474ab08c2991b882a9883b78d7cd6d0d2a2b73345b17e195577b28538360b36f914 + languageName: node + linkType: hard + +"@babel/plugin-transform-spread@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-spread@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/5dd9e269241fccfdb8c9ac9cb21c53fa776113c3cee0ea92bb029940c6231b3bc7c0c70e13e5df220b80cfafe8683264cadff5b182bed9fd1b1317557f1a6c2d + languageName: node + linkType: hard + +"@babel/plugin-transform-sticky-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-sticky-regex@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/9f918281fdf2661a095d53ce8b981acaec0fef2a133af4a4fb66132c7a8ad509c49f444ee140bfa5821db24f987d278b3886d3f04e6ba94a6a55c7b2ed024443 + languageName: node + linkType: hard + +"@babel/plugin-transform-template-literals@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-template-literals@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/bdb541c31d4890a0aea4cf73a897975b69372cc524302ee9b375424d1706c38d1344b891c14ad2cbc3926e9553ffc2596772e8dab5982e09a9da0d959e4a1e92 + languageName: node + linkType: hard + +"@babel/plugin-transform-typeof-symbol@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-typeof-symbol@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/1145d65dbf720837b0a1bdcdb2b8b0a761587f3602703ba42209e06b6b8d81801a2041671a881ed0cff6866acec4f7c17031f8540017f2d53913584e152453db + languageName: node + linkType: hard + +"@babel/plugin-transform-typescript@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-typescript@npm:7.25.7" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.25.7" + "@babel/helper-create-class-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.7" + "@babel/plugin-syntax-typescript": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/2648da981cd71c2100a4ea496684f2c0b939fc77eb4bb9cc8f113d433eab17d4930d2e5ed8d280606bcedef58df99002a64dc92579c6cc7f6c6ee71ceaa77418 + languageName: node + linkType: hard + +"@babel/plugin-transform-unicode-escapes@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-unicode-escapes@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/3c8d5b36738690c2d0b843fcc213a18766e617d16b6cfd92f13be2eba025228b6a796fd8e5b6e209daffa1b453c52544bf62e40b917a32c7446184fef52c98fc + languageName: node + linkType: hard + +"@babel/plugin-transform-unicode-property-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.25.7" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/cccdddc6837f5e82f0aca59fd77dbab5efd5024dcd6d358efc74faccb4892f69e943f7750f613fcc241f33973fe8622a7e96909305697e7e5868f8e9954cb84e + languageName: node + linkType: hard + +"@babel/plugin-transform-unicode-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-unicode-regex@npm:7.25.7" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/1a5a068d39741febd9b8cfce7bf4abf79b282a13c29d39ef7685bffdeb65e5d595e23d9630fedd34428a144d96701efed5a48ea1db0c250c4daf53f44da52983 + languageName: node + linkType: hard + +"@babel/plugin-transform-unicode-sets-regex@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.25.7" + dependencies: + "@babel/helper-create-regexp-features-plugin": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10/c06dd8e66704fc60a97ce2555fa9f6cdfa98bb935a811b15e811cf3a8b5723e508e92b24077163ad704ddce56115062b8cf2f5490d1ad7d23f863d93a8125f89 + languageName: node + linkType: hard + +"@babel/preset-env@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/preset-env@npm:7.25.7" + dependencies: + "@babel/compat-data": "npm:^7.25.7" + "@babel/helper-compilation-targets": "npm:^7.25.7" + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-validator-option": "npm:^7.25.7" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "npm:^7.25.7" + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "npm:^7.25.7" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "npm:^7.25.7" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "npm:^7.25.7" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "npm:^7.25.7" + "@babel/plugin-proposal-private-property-in-object": "npm:7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-async-generators": "npm:^7.8.4" + "@babel/plugin-syntax-class-properties": "npm:^7.12.13" + "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" + "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" + "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" + "@babel/plugin-syntax-import-assertions": "npm:^7.25.7" + "@babel/plugin-syntax-import-attributes": "npm:^7.25.7" + "@babel/plugin-syntax-import-meta": "npm:^7.10.4" + "@babel/plugin-syntax-json-strings": "npm:^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" + "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" + "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" + "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" + "@babel/plugin-syntax-optional-chaining": "npm:^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" + "@babel/plugin-syntax-top-level-await": "npm:^7.14.5" + "@babel/plugin-syntax-unicode-sets-regex": "npm:^7.18.6" + "@babel/plugin-transform-arrow-functions": "npm:^7.25.7" + "@babel/plugin-transform-async-generator-functions": "npm:^7.25.7" + "@babel/plugin-transform-async-to-generator": "npm:^7.25.7" + "@babel/plugin-transform-block-scoped-functions": "npm:^7.25.7" + "@babel/plugin-transform-block-scoping": "npm:^7.25.7" + "@babel/plugin-transform-class-properties": "npm:^7.25.7" + "@babel/plugin-transform-class-static-block": "npm:^7.25.7" + "@babel/plugin-transform-classes": "npm:^7.25.7" + "@babel/plugin-transform-computed-properties": "npm:^7.25.7" + "@babel/plugin-transform-destructuring": "npm:^7.25.7" + "@babel/plugin-transform-dotall-regex": "npm:^7.25.7" + "@babel/plugin-transform-duplicate-keys": "npm:^7.25.7" + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "npm:^7.25.7" + "@babel/plugin-transform-dynamic-import": "npm:^7.25.7" + "@babel/plugin-transform-exponentiation-operator": "npm:^7.25.7" + "@babel/plugin-transform-export-namespace-from": "npm:^7.25.7" + "@babel/plugin-transform-for-of": "npm:^7.25.7" + "@babel/plugin-transform-function-name": "npm:^7.25.7" + "@babel/plugin-transform-json-strings": "npm:^7.25.7" + "@babel/plugin-transform-literals": "npm:^7.25.7" + "@babel/plugin-transform-logical-assignment-operators": "npm:^7.25.7" + "@babel/plugin-transform-member-expression-literals": "npm:^7.25.7" + "@babel/plugin-transform-modules-amd": "npm:^7.25.7" + "@babel/plugin-transform-modules-commonjs": "npm:^7.25.7" + "@babel/plugin-transform-modules-systemjs": "npm:^7.25.7" + "@babel/plugin-transform-modules-umd": "npm:^7.25.7" + "@babel/plugin-transform-named-capturing-groups-regex": "npm:^7.25.7" + "@babel/plugin-transform-new-target": "npm:^7.25.7" + "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.25.7" + "@babel/plugin-transform-numeric-separator": "npm:^7.25.7" + "@babel/plugin-transform-object-rest-spread": "npm:^7.25.7" + "@babel/plugin-transform-object-super": "npm:^7.25.7" + "@babel/plugin-transform-optional-catch-binding": "npm:^7.25.7" + "@babel/plugin-transform-optional-chaining": "npm:^7.25.7" + "@babel/plugin-transform-parameters": "npm:^7.25.7" + "@babel/plugin-transform-private-methods": "npm:^7.25.7" + "@babel/plugin-transform-private-property-in-object": "npm:^7.25.7" + "@babel/plugin-transform-property-literals": "npm:^7.25.7" + "@babel/plugin-transform-regenerator": "npm:^7.25.7" + "@babel/plugin-transform-reserved-words": "npm:^7.25.7" + "@babel/plugin-transform-shorthand-properties": "npm:^7.25.7" + "@babel/plugin-transform-spread": "npm:^7.25.7" + "@babel/plugin-transform-sticky-regex": "npm:^7.25.7" + "@babel/plugin-transform-template-literals": "npm:^7.25.7" + "@babel/plugin-transform-typeof-symbol": "npm:^7.25.7" + "@babel/plugin-transform-unicode-escapes": "npm:^7.25.7" + "@babel/plugin-transform-unicode-property-regex": "npm:^7.25.7" + "@babel/plugin-transform-unicode-regex": "npm:^7.25.7" + "@babel/plugin-transform-unicode-sets-regex": "npm:^7.25.7" + "@babel/preset-modules": "npm:0.1.6-no-external-plugins" + babel-plugin-polyfill-corejs2: "npm:^0.4.10" + babel-plugin-polyfill-corejs3: "npm:^0.10.6" + babel-plugin-polyfill-regenerator: "npm:^0.6.1" + core-js-compat: "npm:^3.38.1" + semver: "npm:^6.3.1" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/2d09aa2cb765a9a1c8a7566e22948e69d69de6b9b763322790bd72ec0bd5bcadf7b02abbc6ad1bab917e1f6d60b1a7f4606778d88cc7d7e1388cc52d292db97d + languageName: node + linkType: hard + +"@babel/preset-modules@npm:0.1.6-no-external-plugins": + version: 0.1.6-no-external-plugins + resolution: "@babel/preset-modules@npm:0.1.6-no-external-plugins" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.0.0" + "@babel/types": "npm:^7.4.4" + esutils: "npm:^2.0.2" + peerDependencies: + "@babel/core": ^7.0.0-0 || ^8.0.0-0 <8.0.0 + checksum: 10/039aba98a697b920d6440c622aaa6104bb6076d65356b29dad4b3e6627ec0354da44f9621bafbeefd052cd4ac4d7f88c9a2ab094efcb50963cb352781d0c6428 + languageName: node + linkType: hard + +"@babel/preset-typescript@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/preset-typescript@npm:7.25.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.25.7" + "@babel/helper-validator-option": "npm:^7.25.7" + "@babel/plugin-syntax-jsx": "npm:^7.25.7" + "@babel/plugin-transform-modules-commonjs": "npm:^7.25.7" + "@babel/plugin-transform-typescript": "npm:^7.25.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/cf6501971f696800096f3b3aef4f7e2c774210b4204bb3a076b2f253970d6649c28003de3afc620b7c7ad67fb346083819c89bae2c644f59995ddb64d6003541 + languageName: node + linkType: hard + +"@babel/runtime@npm:^7.8.4": + version: 7.25.7 + resolution: "@babel/runtime@npm:7.25.7" + dependencies: + regenerator-runtime: "npm:^0.14.0" + checksum: 10/73411fe0f1bff3a962586cef05b30f49e554b6563767e6d84f7d79d605b2c20e7fc3df291a3aebef69043181a8f893afdab9e6672557a5c2d08b9377d6f678cd + languageName: node + linkType: hard + "@babel/template@npm:^7.18.10, @babel/template@npm:^7.18.6, @babel/template@npm:^7.3.3": version: 7.18.10 resolution: "@babel/template@npm:7.18.10" @@ -375,6 +1577,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/template@npm:7.25.7" + dependencies: + "@babel/code-frame": "npm:^7.25.7" + "@babel/parser": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + checksum: 10/49e1e88d2eac17d31ae28d6cf13d6d29c1f49384c4f056a6751c065d6565c351e62c01ce6b11fef5edb5f3a77c87e114ea7326ca384fa618b4834e10cf9b20f3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.18.10, @babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.7.2": version: 7.18.11 resolution: "@babel/traverse@npm:7.18.11" @@ -393,6 +1606,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/traverse@npm:7.25.7" + dependencies: + "@babel/code-frame": "npm:^7.25.7" + "@babel/generator": "npm:^7.25.7" + "@babel/parser": "npm:^7.25.7" + "@babel/template": "npm:^7.25.7" + "@babel/types": "npm:^7.25.7" + debug: "npm:^4.3.1" + globals: "npm:^11.1.0" + checksum: 10/5b2d332fcd6bc78e6500c997e79f7e2a54dfb357e06f0908cb7f0cdd9bb54e7fd3c5673f45993849d433d01ea6076a6d04b825958f0cfa01288ad55ffa5c286f + languageName: node + linkType: hard + "@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.10, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3": version: 7.18.10 resolution: "@babel/types@npm:7.18.10" @@ -404,6 +1632,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.20.7, @babel/types@npm:^7.25.7, @babel/types@npm:^7.4.4": + version: 7.25.7 + resolution: "@babel/types@npm:7.25.7" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.7" + "@babel/helper-validator-identifier": "npm:^7.25.7" + to-fast-properties: "npm:^2.0.0" + checksum: 10/4504e16a95b6a67d50cfaa389bcbc0621019084cff73784ad4797f82d1bb76c870cb0abb6d9881d5776eb06b4607419a2b1205a08c3e87b152d74bd0884b822a + languageName: node + linkType: hard + "@babel/types@npm:^7.8.3": version: 7.22.5 resolution: "@babel/types@npm:7.22.5" @@ -422,18 +1661,18 @@ __metadata: languageName: node linkType: hard -"@discordjs/builders@npm:^1.7.0": - version: 1.7.0 - resolution: "@discordjs/builders@npm:1.7.0" +"@discordjs/builders@npm:^1.9.0": + version: 1.9.0 + resolution: "@discordjs/builders@npm:1.9.0" dependencies: - "@discordjs/formatters": "npm:^0.3.3" - "@discordjs/util": "npm:^1.0.2" - "@sapphire/shapeshift": "npm:^3.9.3" - discord-api-types: "npm:0.37.61" + "@discordjs/formatters": "npm:^0.5.0" + "@discordjs/util": "npm:^1.1.1" + "@sapphire/shapeshift": "npm:^4.0.0" + discord-api-types: "npm:0.37.97" fast-deep-equal: "npm:^3.1.3" - ts-mixer: "npm:^6.0.3" - tslib: "npm:^2.6.2" - checksum: 10/1152d8989ec51e625bc66b87e11322de3ce1ea62cdd9f1b6cc40feabaede9dfe6a1dc283c0b10ac1eae815ebe85853b6231f0a6b895124f4b9dd96bee9f99f0c + ts-mixer: "npm:^6.0.4" + tslib: "npm:^2.6.3" + checksum: 10/8d45f4919355237d8e442df7a98cec49fcd9dcdcb193cdbb88dbc8775d5cb25f6451317a40542921ab54649a9e9fc801e781617f290634db78ae3cd91454ccd3 languageName: node linkType: hard @@ -451,19 +1690,19 @@ __metadata: languageName: node linkType: hard -"@discordjs/collection@npm:^2.0.0": - version: 2.0.0 - resolution: "@discordjs/collection@npm:2.0.0" - checksum: 10/58e91ed7f29671c1c6fe98d2e23599100c1098fe26e0ca71ff52e15bacd95407e0b56c69155403a81e07d9abf208aa39f57404e80f5d2f6fb37c150e1262265a +"@discordjs/collection@npm:^2.1.0, @discordjs/collection@npm:^2.1.1": + version: 2.1.1 + resolution: "@discordjs/collection@npm:2.1.1" + checksum: 10/2bf815120929e20bdcc94a7d0a9c0e567ef859b8cc502f5ecddaeae31ba3457711df708ab200ac6e86ffccab31f796192860f8ad609a9ddc2cdd7ffe5825a266 languageName: node linkType: hard -"@discordjs/formatters@npm:^0.3.3": - version: 0.3.3 - resolution: "@discordjs/formatters@npm:0.3.3" +"@discordjs/formatters@npm:^0.5.0": + version: 0.5.0 + resolution: "@discordjs/formatters@npm:0.5.0" dependencies: - discord-api-types: "npm:0.37.61" - checksum: 10/372f5b03dc770f9640c7b90b6cbec22d4965b8af57824c67e55adf3c012bb5d1c3f312f286abb439b9e0790023b72b85b43d1b7237a2faecf52d79dbff1dbf25 + discord-api-types: "npm:0.37.97" + checksum: 10/71643849aef40cdbee997739cad95fcd2e803800fd8db9c8decffd9bbfc37467b0ca1dd8dd827d4bd34651c2b0944e93aea0879f9db6b7f03bdc24fbc07928bf languageName: node linkType: hard @@ -483,20 +1722,20 @@ __metadata: languageName: node linkType: hard -"@discordjs/rest@npm:^2.1.0": - version: 2.2.0 - resolution: "@discordjs/rest@npm:2.2.0" +"@discordjs/rest@npm:^2.3.0, @discordjs/rest@npm:^2.4.0": + version: 2.4.0 + resolution: "@discordjs/rest@npm:2.4.0" dependencies: - "@discordjs/collection": "npm:^2.0.0" - "@discordjs/util": "npm:^1.0.2" - "@sapphire/async-queue": "npm:^1.5.0" - "@sapphire/snowflake": "npm:^3.5.1" - "@vladfrangu/async_event_emitter": "npm:^2.2.2" - discord-api-types: "npm:0.37.61" - magic-bytes.js: "npm:^1.5.0" - tslib: "npm:^2.6.2" - undici: "npm:5.27.2" - checksum: 10/213245a3137b6cf1636d904fd105300df9b0e352c28f0e96323046dd8c62da59f4d60503e82b8a500bc07398054f2f479bff5c99d2fa66cf1cef77f4a98e0f98 + "@discordjs/collection": "npm:^2.1.1" + "@discordjs/util": "npm:^1.1.1" + "@sapphire/async-queue": "npm:^1.5.3" + "@sapphire/snowflake": "npm:^3.5.3" + "@vladfrangu/async_event_emitter": "npm:^2.4.6" + discord-api-types: "npm:0.37.97" + magic-bytes.js: "npm:^1.10.0" + tslib: "npm:^2.6.3" + undici: "npm:6.19.8" + checksum: 10/aca81c02f24b953400425d0ba96b96bf1a7b9a42aa9ccff021ea795cd9bed3fa36586a921720569a88cceb659507a76084b72c28f08b931121ea0e4b292a1431 languageName: node linkType: hard @@ -507,31 +1746,31 @@ __metadata: languageName: node linkType: hard -"@discordjs/util@npm:^1.0.2": - version: 1.0.2 - resolution: "@discordjs/util@npm:1.0.2" - checksum: 10/a72343b2c7576110af7a7d57aab4a98830dd7cdadeca7cb21983f3a67b964871389d15324623a01d59006659644ad91419445876e203ef4e172ce8958d724618 +"@discordjs/util@npm:^1.1.0, @discordjs/util@npm:^1.1.1": + version: 1.1.1 + resolution: "@discordjs/util@npm:1.1.1" + checksum: 10/3c8ae0c47fcf124e13bfef6232cf4564c35da9ac6b95b63888458c6662742e387324cdafa6207d625415553a5d05fc854f106c726a00c8e81c3414fd5e7eaf2c languageName: node linkType: hard -"@discordjs/ws@npm:^1.0.2": - version: 1.0.2 - resolution: "@discordjs/ws@npm:1.0.2" +"@discordjs/ws@npm:1.1.1": + version: 1.1.1 + resolution: "@discordjs/ws@npm:1.1.1" dependencies: - "@discordjs/collection": "npm:^2.0.0" - "@discordjs/rest": "npm:^2.1.0" - "@discordjs/util": "npm:^1.0.2" - "@sapphire/async-queue": "npm:^1.5.0" - "@types/ws": "npm:^8.5.9" - "@vladfrangu/async_event_emitter": "npm:^2.2.2" - discord-api-types: "npm:0.37.61" + "@discordjs/collection": "npm:^2.1.0" + "@discordjs/rest": "npm:^2.3.0" + "@discordjs/util": "npm:^1.1.0" + "@sapphire/async-queue": "npm:^1.5.2" + "@types/ws": "npm:^8.5.10" + "@vladfrangu/async_event_emitter": "npm:^2.2.4" + discord-api-types: "npm:0.37.83" tslib: "npm:^2.6.2" - ws: "npm:^8.14.2" - checksum: 10/83254ffb68f40b790ce1778a4412e2dfcf5be70488b84c232489fd1d05a70e4c2ccfbebc26e16435a8a315ad38e41e81fc6d97622d8d9c7663a169be527a0636 + ws: "npm:^8.16.0" + checksum: 10/d926fee9e6c6d9e01b574340bdec848baf620b08d34fa9d1547aadb806b5e25317707a82867b36ff6f75feefa373fa208648fac54e01038adb5dfc91c9e55349 languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" dependencies: @@ -542,52 +1781,85 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0": - version: 4.5.1 - resolution: "@eslint-community/regexpp@npm:4.5.1" - checksum: 10/e31e456d44e9bf98d59c8ac445549098e1a6d9c4e22053cad58e86a9f78a1e64104ef7f7f46255c442e0c878fe0e566ffba287787d070196c83510ef30d1d197 +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0": + version: 4.11.1 + resolution: "@eslint-community/regexpp@npm:4.11.1" + checksum: 10/934b6d3588c7f16b18d41efec4fdb89616c440b7e3256b8cb92cfd31ae12908600f2b986d6c1e61a84cbc10256b1dd3448cd1eec79904bd67ac365d0f1aba2e2 languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.0.3": - version: 2.0.3 - resolution: "@eslint/eslintrc@npm:2.0.3" +"@eslint/config-array@npm:^0.18.0": + version: 0.18.0 + resolution: "@eslint/config-array@npm:0.18.0" + dependencies: + "@eslint/object-schema": "npm:^2.1.4" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10/60ccad1eb4806710b085cd739568ec7afd289ee5af6ca0383f0876f9fe375559ef525f7b3f86bdb3f961493de952f2cf3ab4aa4a6ccaef0ae3cd688267cabcb3 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.6.0": + version: 0.6.0 + resolution: "@eslint/core@npm:0.6.0" + checksum: 10/ec5cce168c8773fbd60c5a505563c6cf24398b3e1fa352929878d63129e0dd5b134d3232be2f2c49e8124a965d03359b38962aa0dcf7dfaf50746059d2a2f798 + languageName: node + linkType: hard + +"@eslint/eslintrc@npm:^3.1.0": + version: 3.1.0 + resolution: "@eslint/eslintrc@npm:3.1.0" dependencies: ajv: "npm:^6.12.4" debug: "npm:^4.3.2" - espree: "npm:^9.5.2" - globals: "npm:^13.19.0" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" ignore: "npm:^5.2.0" import-fresh: "npm:^3.2.1" js-yaml: "npm:^4.1.0" minimatch: "npm:^3.1.2" strip-json-comments: "npm:^3.1.1" - checksum: 10/3508a9eb1a1cdf205f34648a993862b15c178669b71d6a9544787558b925ac689d8ddf3e598990156a17b708e79d3cb867fb45d5662908d14c1b10eaad858516 + checksum: 10/02bf892d1397e1029209dea685e9f4f87baf643315df2a632b5f121ec7e8548a3b34f428a007234fa82772218fa8a3ac2d10328637b9ce63b7f8344035b74db3 languageName: node linkType: hard -"@eslint/js@npm:8.42.0": - version: 8.42.0 - resolution: "@eslint/js@npm:8.42.0" - checksum: 10/f6efef5c8071c997e68d6d83dd67e1de51b68932c61e9d9db10166d01c589c4d4b4dbf1ba10f6eb6f4381a790dc3036d0843f2f2c15635423af88d4a37f3117e +"@eslint/js@npm:9.12.0, @eslint/js@npm:^9.12.0": + version: 9.12.0 + resolution: "@eslint/js@npm:9.12.0" + checksum: 10/c4ec9f7ff664f778324002bccdfd63e4a563018e4d7efc838d8149898f9df8649fbc51a379c3d7deea40da4fba9e8e62f39f2df3ff2b9616e2241bbfc10456b0 languageName: node linkType: hard -"@fastify/busboy@npm:^2.0.0": - version: 2.1.0 - resolution: "@fastify/busboy@npm:2.1.0" - checksum: 10/f22c1e5c52dc350ddf9ba8be9f87b48d3ea5af00a37fd0a0d1e3e4b37f94d96763e514c68a350c7f570260fdd2f08b55ee090cdd879f92a03249eb0e3fd19113 +"@eslint/object-schema@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/object-schema@npm:2.1.4" + checksum: 10/221e8d9f281c605948cd6e030874aacce83fe097f8f9c1964787037bccf08e82b7aa9eff1850a30fffac43f1d76555727ec22a2af479d91e268e89d1e035131e languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.10": - version: 0.11.10 - resolution: "@humanwhocodes/config-array@npm:0.11.10" +"@eslint/plugin-kit@npm:^0.2.0": + version: 0.2.0 + resolution: "@eslint/plugin-kit@npm:0.2.0" dependencies: - "@humanwhocodes/object-schema": "npm:^1.2.1" - debug: "npm:^4.1.1" - minimatch: "npm:^3.0.5" - checksum: 10/f93086ae6a340e739a6bb23d4575b69f52acc4e4e3d62968eaaf77a77db4ba69d6d3e50c0028ba19b634ef6b241553a9d9a13d91b797b3ea33d5d711bb3362fb + levn: "npm:^0.4.1" + checksum: 10/ebb363174397341dea47dc35fc206e24328083e4f0fa1c539687dbb7f94bef77e43faa12867d032e6eea5ac980ea8fbb6b1d844186e422d327c04088041b99f3 + languageName: node + linkType: hard + +"@humanfs/core@npm:^0.19.0": + version: 0.19.0 + resolution: "@humanfs/core@npm:0.19.0" + checksum: 10/9c4f96b9e934b7d2f69c5ee8b9414dcaf5c5a03225eb08f8ace3b80429c0fc796e11c4e2ef182172790e7b4560b1137ef984da4dc9662cdd5e3e92baceb02821 + languageName: node + linkType: hard + +"@humanfs/node@npm:^0.16.5": + version: 0.16.5 + resolution: "@humanfs/node@npm:0.16.5" + dependencies: + "@humanfs/core": "npm:^0.19.0" + "@humanwhocodes/retry": "npm:^0.3.0" + checksum: 10/16e49b5f9d4a3cf8205af18f0909b8c6e00faa70a0e01bc606b413423ee20123e53028b6ca22c57725595341d62e148cd1908c297a761ee495087cc674f7b0a6 languageName: node linkType: hard @@ -598,10 +1870,10 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^1.2.1": - version: 1.2.1 - resolution: "@humanwhocodes/object-schema@npm:1.2.1" - checksum: 10/b48a8f87fcd5fdc4ac60a31a8bf710d19cc64556050575e6a35a4a48a8543cf8cde1598a65640ff2cdfbfd165b38f9db4fa3782bea7848eb585cc3db824002e6 +"@humanwhocodes/retry@npm:^0.3.0, @humanwhocodes/retry@npm:^0.3.1": + version: 0.3.1 + resolution: "@humanwhocodes/retry@npm:0.3.1" + checksum: 10/eb457f699529de7f07649679ec9e0353055eebe443c2efe71c6dd950258892475a038e13c6a8c5e13ed1fb538cdd0a8794faa96b24b6ffc4c87fb1fc9f70ad7f languageName: node linkType: hard @@ -891,6 +2163,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": "npm:^1.2.1" + "@jridgewell/sourcemap-codec": "npm:^1.4.10" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10/81587b3c4dd8e6c60252122937cea0c637486311f4ed208b52b62aae2e7a87598f63ec330e6cd0984af494bfb16d3f0d60d3b21d7e5b4aedd2602ff3fe9d32e2 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.0.3": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" @@ -898,6 +2181,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 10/97106439d750a409c22c8bff822d648f6a71f3aa9bc8e5129efdc36343cd3096ddc4eeb1c62d2fe48e9bdd4db37b05d4646a17114ecebd3bbcacfa2de51c3c1d + languageName: node + linkType: hard + "@jridgewell/set-array@npm:^1.0.0, @jridgewell/set-array@npm:^1.0.1": version: 1.1.2 resolution: "@jridgewell/set-array@npm:1.1.2" @@ -905,6 +2195,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 10/832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:^1.4.10": version: 1.4.14 resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" @@ -912,6 +2209,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 10/4ed6123217569a1484419ac53f6ea0d9f3b57e5b57ab30d7c267bdb27792a27eb0e4b08e84a2680aa55cc2f2b411ffd6ec3db01c44fdc6dc43aca4b55f8374fd + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.13, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.14 resolution: "@jridgewell/trace-mapping@npm:0.3.14" @@ -922,6 +2226,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.1.0" + "@jridgewell/sourcemap-codec": "npm:^1.4.14" + checksum: 10/dced32160a44b49d531b80a4a2159dceab6b3ddf0c8e95a0deae4b0e894b172defa63d5ac52a19c2068e1fe7d31ea4ba931fbeec103233ecb4208953967120fc + languageName: node + linkType: hard + "@mongodb-js/saslprep@npm:^1.1.0": version: 1.1.1 resolution: "@mongodb-js/saslprep@npm:1.1.1" @@ -975,7 +2289,7 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": +"@nodelib/fs.walk@npm:^1.2.3": version: 1.2.8 resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: @@ -1008,17 +2322,31 @@ __metadata: languageName: node linkType: hard -"@sapphire/shapeshift@npm:^3.9.3": - version: 3.9.3 - resolution: "@sapphire/shapeshift@npm:3.9.3" - dependencies: - fast-deep-equal: "npm:^3.1.3" - lodash: "npm:^4.17.21" - checksum: 10/9fce0135d4b6b2acbab83af078dcc5d9780c83c2cea9094178f19128d78ca7e7fa0d90f5b1c4ed4ab345194eb138415e4c902a1014eff2c5d68b77e75f5774e9 +"@sapphire/async-queue@npm:^1.5.2, @sapphire/async-queue@npm:^1.5.3": + version: 1.5.3 + resolution: "@sapphire/async-queue@npm:1.5.3" + checksum: 10/6a9fdeeaa3e4591c057cb67b5aae86d9c94326dcb0ea9e8e3b8eba8cbcfee2a0f672d837a51e3da2c838f9861a6117fced2b0ac8e1b719bc5caf1bbbee781fb3 languageName: node linkType: hard -"@sapphire/snowflake@npm:3.5.1, @sapphire/snowflake@npm:^3.4.2, @sapphire/snowflake@npm:^3.5.1": +"@sapphire/shapeshift@npm:^4.0.0": + version: 4.0.0 + resolution: "@sapphire/shapeshift@npm:4.0.0" + dependencies: + fast-deep-equal: "npm:^3.1.3" + lodash: "npm:^4.17.21" + checksum: 10/71437388066ca19a521f94f3066633010a5b3e24d9da1c07664389b9b02635af502b81236af92f24bb4c0f312a93b0f4ac544391afd464c2e98e6f93e2a4ded0 + languageName: node + linkType: hard + +"@sapphire/snowflake@npm:3.5.3, @sapphire/snowflake@npm:^3.5.3": + version: 3.5.3 + resolution: "@sapphire/snowflake@npm:3.5.3" + checksum: 10/f306626f76a6e9bdc7de9130c1baf7ddcd8681d7d03b2ab6f2404081f71c94085d4001e8a62ae2c2372b3b54d2d52ec21d43695f2c73fb101caabc2d3bf524aa + languageName: node + linkType: hard + +"@sapphire/snowflake@npm:^3.4.2": version: 3.5.1 resolution: "@sapphire/snowflake@npm:3.5.1" checksum: 10/12d09f0e4f52f86bdc330d70e4a3042f212d787c2d40e7bc41769218c8d08649786109aa78d777262a658a8f29f12ef5bacc6188d46fd1dd35a4e1f29d378723 @@ -1064,6 +2392,19 @@ __metadata: languageName: node linkType: hard +"@types/babel__core@npm:^7": + version: 7.20.5 + resolution: "@types/babel__core@npm:7.20.5" + dependencies: + "@babel/parser": "npm:^7.20.7" + "@babel/types": "npm:^7.20.7" + "@types/babel__generator": "npm:*" + "@types/babel__template": "npm:*" + "@types/babel__traverse": "npm:*" + checksum: 10/c32838d280b5ab59d62557f9e331d3831f8e547ee10b4f85cb78753d97d521270cebfc73ce501e9fb27fe71884d1ba75e18658692c2f4117543f0fc4e3e118b3 + languageName: node + linkType: hard + "@types/babel__core@npm:^7.1.14": version: 7.1.19 resolution: "@types/babel__core@npm:7.1.19" @@ -1086,6 +2427,13 @@ __metadata: languageName: node linkType: hard +"@types/babel__preset-env@npm:^7": + version: 7.9.7 + resolution: "@types/babel__preset-env@npm:7.9.7" + checksum: 10/624425a84d9149aec04795fed6b1ac2f27dfd5d7976fde479bb1a4d754de34c92cdc28a1a373a5826382a68127b536420a0e090aa5fae522cb62724b7a571cb5 + languageName: node + linkType: hard + "@types/babel__template@npm:*": version: 7.4.1 resolution: "@types/babel__template@npm:7.4.1" @@ -1112,6 +2460,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10/9d35d475095199c23e05b431bcdd1f6fec7380612aed068b14b2a08aa70494de8a9026765a5a91b1073f636fb0368f6d8973f518a31391d519e20c59388ed88d + languageName: node + linkType: hard + "@types/graceful-fs@npm:^4.1.3": version: 4.1.5 resolution: "@types/graceful-fs@npm:4.1.5" @@ -1153,6 +2508,13 @@ __metadata: languageName: node linkType: hard +"@types/json-schema@npm:^7.0.15": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 10/1a3c3e06236e4c4aab89499c428d585527ce50c24fe8259e8b3926d3df4cfbbbcf306cfc73ddfb66cbafc973116efd15967020b0f738f63e09e64c7d260519e7 + languageName: node + linkType: hard + "@types/json-schema@npm:^7.0.9": version: 7.0.12 resolution: "@types/json-schema@npm:7.0.12" @@ -1176,10 +2538,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.15.11": - version: 18.16.18 - resolution: "@types/node@npm:18.16.18" - checksum: 10/4692b4c927bf63efbc3aed6e18c1a264eb8b5673fa7cc0649a38f394ab34d4d4d0e7a2b98f4235bc8dc7615e88080a1b443a06eac9324f67e426398ed857b4a1 +"@types/node@npm:^22.7.4": + version: 22.7.4 + resolution: "@types/node@npm:22.7.4" + dependencies: + undici-types: "npm:~6.19.2" + checksum: 10/19ddab80c4eba2253c855ed67c9bbc47417183049d01e59010a738bd80d47338bab79fd1f44ae51516bd63a1db4bf21ddb38b16bf6401a2e93252068ec52e88b languageName: node linkType: hard @@ -1234,21 +2598,12 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:8.5.9": - version: 8.5.9 - resolution: "@types/ws@npm:8.5.9" +"@types/ws@npm:^8.5.10": + version: 8.5.12 + resolution: "@types/ws@npm:8.5.12" dependencies: "@types/node": "npm:*" - checksum: 10/7cf66383b8525196875157985658f7f6b40601265023c0fbaf935a22adc8b6133cc563e2683691d61becdc3d9612deb6e8376a5c4d2ec8349aa526d467c02be6 - languageName: node - linkType: hard - -"@types/ws@npm:^8.5.9": - version: 8.5.10 - resolution: "@types/ws@npm:8.5.10" - dependencies: - "@types/node": "npm:*" - checksum: 10/9b414dc5e0b6c6f1ea4b1635b3568c58707357f68076df9e7cd33194747b7d1716d5189c0dbdd68c8d2521b148e88184cf881bac7429eb0e5c989b001539ed31 + checksum: 10/d8a3ddfb5ff8fea992a043113579d61ac1ea21e8464415af9e2b01b205ed19d817821ad64ca1b3a90062d1df1c23b0f586d8351d25ca6728844df99a74e8f76d languageName: node linkType: hard @@ -1268,44 +2623,44 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.58.0": - version: 5.59.11 - resolution: "@typescript-eslint/eslint-plugin@npm:5.59.11" +"@typescript-eslint/eslint-plugin@npm:^8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.8.0" dependencies: - "@eslint-community/regexpp": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:5.59.11" - "@typescript-eslint/type-utils": "npm:5.59.11" - "@typescript-eslint/utils": "npm:5.59.11" - debug: "npm:^4.3.4" - grapheme-splitter: "npm:^1.0.4" - ignore: "npm:^5.2.0" - natural-compare-lite: "npm:^1.4.0" - semver: "npm:^7.3.7" - tsutils: "npm:^3.21.0" + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:8.8.0" + "@typescript-eslint/type-utils": "npm:8.8.0" + "@typescript-eslint/utils": "npm:8.8.0" + "@typescript-eslint/visitor-keys": "npm:8.8.0" + graphemer: "npm:^1.4.0" + ignore: "npm:^5.3.1" + natural-compare: "npm:^1.4.0" + ts-api-utils: "npm:^1.3.0" peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/0834d2ab5a0587d6461166dac72a2ff154e941ef5358d028b9a5f6aa48930f1dd2f58c417df18fd4939362b87caac816ca7ddae152893da173bad582854bd21c + checksum: 10/e8a47053731dcd42c1d8489ec22e176097a202a500fb0913653b501aa4dd3d1c559b9e90ad12194a3f2f3335566a9036d37276a93ca7ff8d76bfd65ff6c7c0ed languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.58.0": - version: 5.59.11 - resolution: "@typescript-eslint/parser@npm:5.59.11" +"@typescript-eslint/parser@npm:^8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/parser@npm:8.8.0" dependencies: - "@typescript-eslint/scope-manager": "npm:5.59.11" - "@typescript-eslint/types": "npm:5.59.11" - "@typescript-eslint/typescript-estree": "npm:5.59.11" + "@typescript-eslint/scope-manager": "npm:8.8.0" + "@typescript-eslint/types": "npm:8.8.0" + "@typescript-eslint/typescript-estree": "npm:8.8.0" + "@typescript-eslint/visitor-keys": "npm:8.8.0" debug: "npm:^4.3.4" peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/d323bd68cd50f8bdbf86836fcf65aad2541c2f7bf42b8d8649a66eb108796f5b52769fbf1ba69235d9e921481fe9287330de00d10c484564d652c0509f0dce42 + checksum: 10/8d3c3afb508aa7d6c16dd8a786762f05e174ace50213768232405b1c31534ca568d38e1793feb41d53fe1327c901e5f93e70f61222b31848b2a9ae955b14fff2 languageName: node linkType: hard @@ -1319,20 +2674,28 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.59.11": - version: 5.59.11 - resolution: "@typescript-eslint/type-utils@npm:5.59.11" +"@typescript-eslint/scope-manager@npm:8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/scope-manager@npm:8.8.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:5.59.11" - "@typescript-eslint/utils": "npm:5.59.11" + "@typescript-eslint/types": "npm:8.8.0" + "@typescript-eslint/visitor-keys": "npm:8.8.0" + checksum: 10/d1cd97f35bbba85eb25879e9a0acfc4fcd6908bee1f60467d9eb6b6da4732a07f0947b6a97d3f2bc8f03205e530ce49f00d4540b515082e37d1abcd781f7cad0 + languageName: node + linkType: hard + +"@typescript-eslint/type-utils@npm:8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/type-utils@npm:8.8.0" + dependencies: + "@typescript-eslint/typescript-estree": "npm:8.8.0" + "@typescript-eslint/utils": "npm:8.8.0" debug: "npm:^4.3.4" - tsutils: "npm:^3.21.0" - peerDependencies: - eslint: "*" + ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10/8a871b94e322315af6ff40e18802be4abf39bd1261ee7773e1cc92cc7cd9a95b4977fb296c72c8109195e0a89821647c578106d722ef18117a11f4ab1ab2cee4 + checksum: 10/7e46352090d97935692fa070c62edc7cd824540e3b432dab655e2a46e430ae5c3473f8582d9d41e851d1d74a11e356b61396deda944d186e4d868b16d402bce1 languageName: node linkType: hard @@ -1343,6 +2706,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/types@npm:8.8.0" + checksum: 10/8f82c7ffd9fb11a4b90ee06b486df71341bc7ca63a6d0e9864120fbad26afe99c69408b0c887e71078b58df47239fae7640d40fcd1373ca6b8970949fb6f688f + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:5.59.11": version: 5.59.11 resolution: "@typescript-eslint/typescript-estree@npm:5.59.11" @@ -1361,7 +2731,40 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.59.11, @typescript-eslint/utils@npm:^5.10.0": +"@typescript-eslint/typescript-estree@npm:8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.8.0" + dependencies: + "@typescript-eslint/types": "npm:8.8.0" + "@typescript-eslint/visitor-keys": "npm:8.8.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/b7cee47db25106c791c816117ea602efe6cf09707bff1fcf8c5f49d3bb1d8104e5f56a407db62a4821fafa6708bb9f4d331e75857272b77e5883c89dd520a946 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/utils@npm:8.8.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.8.0" + "@typescript-eslint/types": "npm:8.8.0" + "@typescript-eslint/typescript-estree": "npm:8.8.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + checksum: 10/94eed69f1ecc4d1594d3b43d552289bdcc70e074ad03fb360888a934d9a927e8c1c88419cda3797128c9dd49780fa10af0971643f600a1f2748a2e35f95f9306 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:^5.10.0": version: 5.59.11 resolution: "@typescript-eslint/utils@npm:5.59.11" dependencies: @@ -1389,10 +2792,20 @@ __metadata: languageName: node linkType: hard -"@vladfrangu/async_event_emitter@npm:^2.2.2": - version: 2.2.2 - resolution: "@vladfrangu/async_event_emitter@npm:2.2.2" - checksum: 10/1c1fcee04aecfa3cceb05e9bcd3a8aae053ce0512e79e7f878a5d2b8458a926aa3e6da553be0a431e7acb58d9aec3df435a845653a642b864c6b67e2a44ec40c +"@typescript-eslint/visitor-keys@npm:8.8.0": + version: 8.8.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.8.0" + dependencies: + "@typescript-eslint/types": "npm:8.8.0" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10/325733fce58c8ac917ff8485949fff927794fd842abb4a665549e7a2e63437e6b7b464b60d3c320da1980e43a6bee69b9dd84139b8dc93685b188efbf96fa707 + languageName: node + linkType: hard + +"@vladfrangu/async_event_emitter@npm:^2.2.4, @vladfrangu/async_event_emitter@npm:^2.4.6": + version: 2.4.6 + resolution: "@vladfrangu/async_event_emitter@npm:2.4.6" + checksum: 10/6a329441bbd36bb8bdc8c49f18328abf724834597c8cab56b5741f18fa167a010bb841bc9ec3638b6b73c6692b85d0de724612b0a416b523650574576fd1a197 languageName: node linkType: hard @@ -1412,12 +2825,12 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.8.0": - version: 8.8.2 - resolution: "acorn@npm:8.8.2" +"acorn@npm:^8.12.0": + version: 8.12.1 + resolution: "acorn@npm:8.12.1" bin: acorn: bin/acorn - checksum: 10/b4e77d56d24d3e11a45d9ac8ae661b4e14a4af04ae33edbf1e6bf910887e5bb352cc60e9ea06a0944880e6b658f58c095d3b54e88e1921cb9319608b51085dd7 + checksum: 10/d08c2d122bba32d0861e0aa840b2ee25946c286d5dc5990abca991baf8cdbfbe199b05aacb221b979411a2fea36f83e26b5ac4f6b4e0ce49038c62316c1848f0 languageName: node linkType: hard @@ -1451,7 +2864,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.12.4": +"ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -1610,6 +3023,42 @@ __metadata: languageName: node linkType: hard +"babel-plugin-polyfill-corejs2@npm:^0.4.10": + version: 0.4.11 + resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" + dependencies: + "@babel/compat-data": "npm:^7.22.6" + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" + semver: "npm:^6.3.1" + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: 10/9c79908bed61b9f52190f254e22d3dca6ce25769738642579ba8d23832f3f9414567a90d8367a31831fa45d9b9607ac43d8d07ed31167d8ca8cda22871f4c7a1 + languageName: node + linkType: hard + +"babel-plugin-polyfill-corejs3@npm:^0.10.6": + version: 0.10.6 + resolution: "babel-plugin-polyfill-corejs3@npm:0.10.6" + dependencies: + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" + core-js-compat: "npm:^3.38.0" + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: 10/360ac9054a57a18c540059dc627ad5d84d15f79790cb3d84d19a02eec7188c67d08a07db789c3822d6f5df22d918e296d1f27c4055fec2e287d328f09ea8a78a + languageName: node + linkType: hard + +"babel-plugin-polyfill-regenerator@npm:^0.6.1": + version: 0.6.2 + resolution: "babel-plugin-polyfill-regenerator@npm:0.6.2" + dependencies: + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: 10/150233571072b6b3dfe946242da39cba8587b7f908d1c006f7545fc88b0e3c3018d445739beb61e7a75835f0c2751dbe884a94ff9b245ec42369d9267e0e1b3f + languageName: node + linkType: hard + "babel-preset-current-node-syntax@npm:^1.0.0": version: 1.0.1 resolution: "babel-preset-current-node-syntax@npm:1.0.1" @@ -1707,6 +3156,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.23.3, browserslist@npm:^4.24.0": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: "npm:^1.0.30001663" + electron-to-chromium: "npm:^1.5.28" + node-releases: "npm:^2.0.18" + update-browserslist-db: "npm:^1.1.0" + bin: + browserslist: cli.js + checksum: 10/26c1b8ba257a0b51b102080ba9d42945af2abaa8c4cf6da21cd47b3f123fc1e81640203b293214356c2c17d9d265bb3a5ed428b6d302f383576dd6ce8fd5036c + languageName: node + linkType: hard + "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -1797,7 +3260,14 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0": +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001667 + resolution: "caniuse-lite@npm:1.0.30001667" + checksum: 10/5f0c48abb806737c422f05d0d9dda72facc25ee8adbae2c2ea9c57b87d9c2fa9ad8c3f6d54f21aca4e31ee1742cb5dd1543bf6b9133e3f77f79a645876322414 + languageName: node + linkType: hard + +"chalk@npm:^2.0.0, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -1975,6 +3445,22 @@ __metadata: languageName: node linkType: hard +"convert-source-map@npm:^2.0.0": + version: 2.0.0 + resolution: "convert-source-map@npm:2.0.0" + checksum: 10/c987be3ec061348cdb3c2bfb924bec86dea1eacad10550a85ca23edb0fe3556c3a61c7399114f3331ccb3499d7fd0285ab24566e5745929412983494c3926e15 + languageName: node + linkType: hard + +"core-js-compat@npm:^3.38.0, core-js-compat@npm:^3.38.1": + version: 3.38.1 + resolution: "core-js-compat@npm:3.38.1" + dependencies: + browserslist: "npm:^4.23.3" + checksum: 10/4e2f219354fd268895f79486461a12df96f24ed307321482fe2a43529c5a64e7c16bcba654980ba217d603444f5141d43a79058aeac77511085f065c5da72207 + languageName: node + linkType: hard + "core-util-is@npm:~1.0.0": version: 1.0.3 resolution: "core-util-is@npm:1.0.3" @@ -2021,6 +3507,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.1": + version: 4.3.7 + resolution: "debug@npm:4.3.7" + dependencies: + ms: "npm:^2.1.3" + peerDependenciesMeta: + supports-color: + optional: true + checksum: 10/71168908b9a78227ab29d5d25fe03c5867750e31ce24bf2c44a86efc5af041758bb56569b0a3d48a9b5344c00a24a777e6f4100ed6dfd9534a42c1dde285125a + languageName: node + linkType: hard + "dedent@npm:^0.7.0": version: 0.7.0 resolution: "dedent@npm:0.7.0" @@ -2079,10 +3577,24 @@ __metadata: languageName: node linkType: hard -"discord-api-types@npm:0.37.61": - version: 0.37.61 - resolution: "discord-api-types@npm:0.37.61" - checksum: 10/f11d593722ab8ba72c07fd841d62484f22c30e36f4ce6b644f8bbf48422d20b0cd6acbf126d60aa2c535e4bd55df694745cc730c6c0382717dc10b2a81fb2805 +"discord-api-types@npm:0.37.100": + version: 0.37.100 + resolution: "discord-api-types@npm:0.37.100" + checksum: 10/44b7366784b11e32d9015709658d2429d040a643748c0b8733752a1d2b0db328dc1ab9fa3210f93423d6b3762561e60ada6ba781ac1edd7fddf6174e3c645311 + languageName: node + linkType: hard + +"discord-api-types@npm:0.37.83": + version: 0.37.83 + resolution: "discord-api-types@npm:0.37.83" + checksum: 10/63aee8b4634f98e24921ba7ba82eab30105917d7bf40739b7fbe327a8c93134a78408d842bd7ad7cf3f45948d86db5ec0cb670d66e0fe0f8229cb15bfda5108f + languageName: node + linkType: hard + +"discord-api-types@npm:0.37.97": + version: 0.37.97 + resolution: "discord-api-types@npm:0.37.97" + checksum: 10/94eea4b95ebb7ab89cce325c5c5654ce7fd3f1e17efa997fd375b7fe81cd5e872c097cf98cfc9d4d7ff233c924f501d812516a048913023bde02f3bbba21849b languageName: node linkType: hard @@ -2093,34 +3605,23 @@ __metadata: languageName: node linkType: hard -"discord.js@npm:^14.14.1": - version: 14.14.1 - resolution: "discord.js@npm:14.14.1" +"discord.js@npm:^14.16.3": + version: 14.16.3 + resolution: "discord.js@npm:14.16.3" dependencies: - "@discordjs/builders": "npm:^1.7.0" + "@discordjs/builders": "npm:^1.9.0" "@discordjs/collection": "npm:1.5.3" - "@discordjs/formatters": "npm:^0.3.3" - "@discordjs/rest": "npm:^2.1.0" - "@discordjs/util": "npm:^1.0.2" - "@discordjs/ws": "npm:^1.0.2" - "@sapphire/snowflake": "npm:3.5.1" - "@types/ws": "npm:8.5.9" - discord-api-types: "npm:0.37.61" + "@discordjs/formatters": "npm:^0.5.0" + "@discordjs/rest": "npm:^2.4.0" + "@discordjs/util": "npm:^1.1.1" + "@discordjs/ws": "npm:1.1.1" + "@sapphire/snowflake": "npm:3.5.3" + discord-api-types: "npm:0.37.100" fast-deep-equal: "npm:3.1.3" lodash.snakecase: "npm:4.1.1" - tslib: "npm:2.6.2" - undici: "npm:5.27.2" - ws: "npm:8.14.2" - checksum: 10/c6603421dea13ee0215ee779fdfa93eeab7177ff54b317312c03c53f9e101d4958ed72da5d0c4036556f6183828460e7059004589f170e272a609b37806145e9 - languageName: node - linkType: hard - -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: "npm:^2.0.2" - checksum: 10/b4b28f1df5c563f7d876e7461254a4597b8cabe915abe94d7c5d1633fed263fcf9a85e8d3836591fc2d040108e822b0d32758e5ec1fe31c590dc7e08086e3e48 + tslib: "npm:^2.6.3" + undici: "npm:6.19.8" + checksum: 10/d8ac4116411922acab80a19b0caac696e1d071646fbf01202a185a484b2c0145f4306aad07c1a448efff4b38c98f601cae767e91b3fc3dc4cd14b05d1278a0db languageName: node linkType: hard @@ -2145,6 +3646,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.32 + resolution: "electron-to-chromium@npm:1.5.32" + checksum: 10/906b852f67e9de0a5f643085570f7383c5bb28b28b1dd0916bdc55d24d8a2238eb61c26db51a766630993e4c55fb7bbf6551b0ae570751fec2503eb592611c89 + languageName: node + linkType: hard + "emittery@npm:^0.10.2": version: 0.10.2 resolution: "emittery@npm:0.10.2" @@ -2205,6 +3713,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 10/9d7169e3965b2f9ae46971afa392f6e5a25545ea30f2e2dd99c9b0a95a3f52b5653681a84f5b2911a413ddad2d7a93d3514165072f349b5ffc59c75a899970d6 + languageName: node + linkType: hard + "escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -2281,13 +3796,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.0": - version: 7.2.0 - resolution: "eslint-scope@npm:7.2.0" +"eslint-scope@npm:^8.1.0": + version: 8.1.0 + resolution: "eslint-scope@npm:8.1.0" dependencies: esrecurse: "npm:^4.3.0" estraverse: "npm:^5.2.0" - checksum: 10/94d8942840b35bf5e6559bd0f0a8b10610d65b1e44e41295e66ed1fe82f83bc51756e7af607d611b75f435adf821122bd901aa565701596ca1a628db41c0cd87 + checksum: 10/4c34a12fbeb0677822a9e93e81f2027e39e6f27557c17bc1e5ff76debbd41e748c3673517561792bda9e276245f89fbfd9b0b24fcec3b33a04ee2196729b3489 languageName: node linkType: hard @@ -2307,70 +3822,85 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1": +"eslint-visitor-keys@npm:^3.3.0": version: 3.4.1 resolution: "eslint-visitor-keys@npm:3.4.1" checksum: 10/92641e7ccde470065aa2931161a6a053690a54aae35ae08f38e376ecfd7c012573c542b37a3baecf921eb951fd57943411392f464c2b8f3399adee4723a1369f languageName: node linkType: hard -"eslint@npm:^8.42.0": - version: 8.42.0 - resolution: "eslint@npm:8.42.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.4.0" - "@eslint/eslintrc": "npm:^2.0.3" - "@eslint/js": "npm:8.42.0" - "@humanwhocodes/config-array": "npm:^0.11.10" - "@humanwhocodes/module-importer": "npm:^1.0.1" - "@nodelib/fs.walk": "npm:^1.2.8" - ajv: "npm:^6.10.0" - chalk: "npm:^4.0.0" - cross-spawn: "npm:^7.0.2" - debug: "npm:^4.3.2" - doctrine: "npm:^3.0.0" - escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^7.2.0" - eslint-visitor-keys: "npm:^3.4.1" - espree: "npm:^9.5.2" - esquery: "npm:^1.4.2" - esutils: "npm:^2.0.2" - fast-deep-equal: "npm:^3.1.3" - file-entry-cache: "npm:^6.0.1" - find-up: "npm:^5.0.0" - glob-parent: "npm:^6.0.2" - globals: "npm:^13.19.0" - graphemer: "npm:^1.4.0" - ignore: "npm:^5.2.0" - import-fresh: "npm:^3.0.0" - imurmurhash: "npm:^0.1.4" - is-glob: "npm:^4.0.0" - is-path-inside: "npm:^3.0.3" - js-yaml: "npm:^4.1.0" - json-stable-stringify-without-jsonify: "npm:^1.0.1" - levn: "npm:^0.4.1" - lodash.merge: "npm:^4.6.2" - minimatch: "npm:^3.1.2" - natural-compare: "npm:^1.4.0" - optionator: "npm:^0.9.1" - strip-ansi: "npm:^6.0.1" - strip-json-comments: "npm:^3.1.0" - text-table: "npm:^0.2.0" - bin: - eslint: bin/eslint.js - checksum: 10/189ba2ae856703c187deef590fa2cee70f294a381837e6acf0fdd9a715235bc91381c62d8ccc891de09155e950d1bd9495c9b18019053fdde7db0a39938b2934 +"eslint-visitor-keys@npm:^3.4.3": + version: 3.4.3 + resolution: "eslint-visitor-keys@npm:3.4.3" + checksum: 10/3f357c554a9ea794b094a09bd4187e5eacd1bc0d0653c3adeb87962c548e6a1ab8f982b86963ae1337f5d976004146536dcee5d0e2806665b193fbfbf1a9231b languageName: node linkType: hard -"espree@npm:^9.5.2": - version: 9.5.2 - resolution: "espree@npm:9.5.2" +"eslint-visitor-keys@npm:^4.1.0": + version: 4.1.0 + resolution: "eslint-visitor-keys@npm:4.1.0" + checksum: 10/3fb5bd1b2f36db89d0ac57ddd66d36ccd3b1e3cddb2a55a0f9f6f1c85268cfcc1cc32e7eda4990e3423107a120dd254fb6cb52d6154cf81d344d8c3fa671f7c2 + languageName: node + linkType: hard + +"eslint@npm:^9.12.0": + version: 9.12.0 + resolution: "eslint@npm:9.12.0" dependencies: - acorn: "npm:^8.8.0" + "@eslint-community/eslint-utils": "npm:^4.2.0" + "@eslint-community/regexpp": "npm:^4.11.0" + "@eslint/config-array": "npm:^0.18.0" + "@eslint/core": "npm:^0.6.0" + "@eslint/eslintrc": "npm:^3.1.0" + "@eslint/js": "npm:9.12.0" + "@eslint/plugin-kit": "npm:^0.2.0" + "@humanfs/node": "npm:^0.16.5" + "@humanwhocodes/module-importer": "npm:^1.0.1" + "@humanwhocodes/retry": "npm:^0.3.1" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" + ajv: "npm:^6.12.4" + chalk: "npm:^4.0.0" + cross-spawn: "npm:^7.0.2" + debug: "npm:^4.3.2" + escape-string-regexp: "npm:^4.0.0" + eslint-scope: "npm:^8.1.0" + eslint-visitor-keys: "npm:^4.1.0" + espree: "npm:^10.2.0" + esquery: "npm:^1.5.0" + esutils: "npm:^2.0.2" + fast-deep-equal: "npm:^3.1.3" + file-entry-cache: "npm:^8.0.0" + find-up: "npm:^5.0.0" + glob-parent: "npm:^6.0.2" + ignore: "npm:^5.2.0" + imurmurhash: "npm:^0.1.4" + is-glob: "npm:^4.0.0" + json-stable-stringify-without-jsonify: "npm:^1.0.1" + lodash.merge: "npm:^4.6.2" + minimatch: "npm:^3.1.2" + natural-compare: "npm:^1.4.0" + optionator: "npm:^0.9.3" + text-table: "npm:^0.2.0" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true + bin: + eslint: bin/eslint.js + checksum: 10/c3f10d1ca3798bf1d0f71e43846e254d4bf0ea9ffbb0e61f9686a98e412aa762a454c5e5ef4e74fd71956b1500c04817c9f08dbf7a0cec47317160e28f585e4f + languageName: node + linkType: hard + +"espree@npm:^10.0.1, espree@npm:^10.2.0": + version: 10.2.0 + resolution: "espree@npm:10.2.0" + dependencies: + acorn: "npm:^8.12.0" acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10/2c9d0fec9ac1230856baec338bd238ca9a69b451ee451f0da25e07d356e1bdef45a2ae5f8c374f492f4bb568d17fc7c998ef44f04a2e9b6a11fc8c194c677ba4 + eslint-visitor-keys: "npm:^4.1.0" + checksum: 10/365076a963ca84244c1e2d36e4f812362d21cfa7e7df10d67f7b82b759467796df81184721d153c4e235d9ef5eb5b4d044167dd66be3be00f53a21a515b1bfb1 languageName: node linkType: hard @@ -2384,12 +3914,12 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.2": - version: 1.5.0 - resolution: "esquery@npm:1.5.0" +"esquery@npm:^1.5.0": + version: 1.6.0 + resolution: "esquery@npm:1.6.0" dependencies: estraverse: "npm:^5.1.0" - checksum: 10/e65fcdfc1e0ff5effbf50fb4f31ea20143ae5df92bb2e4953653d8d40aa4bc148e0d06117a592ce4ea53eeab1dafdfded7ea7e22a5be87e82d73757329a1b01d + checksum: 10/c587fb8ec9ed83f2b1bc97cf2f6854cc30bf784a79d62ba08c6e358bf22280d69aee12827521cf38e69ae9761d23fb7fde593ce315610f85655c139d99b05e5a languageName: node linkType: hard @@ -2487,6 +4017,19 @@ __metadata: languageName: node linkType: hard +"fast-glob@npm:^3.3.2": + version: 3.3.2 + resolution: "fast-glob@npm:3.3.2" + dependencies: + "@nodelib/fs.stat": "npm:^2.0.2" + "@nodelib/fs.walk": "npm:^1.2.3" + glob-parent: "npm:^5.1.2" + merge2: "npm:^1.3.0" + micromatch: "npm:^4.0.4" + checksum: 10/222512e9315a0efca1276af9adb2127f02105d7288fa746145bf45e2716383fb79eb983c89601a72a399a56b7c18d38ce70457c5466218c5f13fad957cee16df + languageName: node + linkType: hard + "fast-json-stable-stringify@npm:^2.0.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" @@ -2529,12 +4072,12 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" dependencies: - flat-cache: "npm:^3.0.4" - checksum: 10/099bb9d4ab332cb93c48b14807a6918a1da87c45dce91d4b61fd40e6505d56d0697da060cb901c729c90487067d93c9243f5da3dc9c41f0358483bfdebca736b + flat-cache: "npm:^4.0.0" + checksum: 10/afe55c4de4e0d226a23c1eae62a7219aafb390859122608a89fa4df6addf55c7fd3f1a2da6f5b41e7cdff496e4cf28bbd215d53eab5c817afa96d2b40c81bfb0 languageName: node linkType: hard @@ -2578,20 +4121,20 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" dependencies: - flatted: "npm:^3.1.0" - rimraf: "npm:^3.0.2" - checksum: 10/9fe5d0cb97c988e3b25242e71346965fae22757674db3fca14206850af2efa3ca3b04a3ba0eba8d5e20fd8a3be80a2e14b1c2917e70ffe1acb98a8c3327e4c9f + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.4" + checksum: 10/58ce851d9045fffc7871ce2bd718bc485ad7e777bf748c054904b87c351ff1080c2c11da00788d78738bfb51b71e4d5ea12d13b98eb36e3358851ffe495b62dc languageName: node linkType: hard -"flatted@npm:^3.1.0": - version: 3.2.6 - resolution: "flatted@npm:3.2.6" - checksum: 10/38299999b6b5fa176b30cda666bc81d75ca2d6a528c5609178c6c84997b148f68caa0533e1dab3450371538d92965d5a0f2106432831ed7f10ba17d0ae27f423 +"flatted@npm:^3.2.9": + version: 3.3.1 + resolution: "flatted@npm:3.3.1" + checksum: 10/7b8376061d5be6e0d3658bbab8bde587647f68797cf6bfeae9dea0e5137d9f27547ab92aaff3512dd9d1299086a6d61be98e9d48a56d17531b634f77faadbc49 languageName: node linkType: hard @@ -2770,12 +4313,17 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.20.0 - resolution: "globals@npm:13.20.0" - dependencies: - type-fest: "npm:^0.20.2" - checksum: 10/9df85cde2f0dce6ac9b3a5e08bec109d2f3b38ddd055a83867e0672c55704866d53ce6a4265859fa630624baadd46f50ca38602a13607ad86be853a8c179d3e7 +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10/03939c8af95c6df5014b137cac83aa909090c3a3985caef06ee9a5a669790877af8698ab38007e4c0186873adc14c0b13764acc754b16a754c216cc56aa5f021 + languageName: node + linkType: hard + +"globals@npm:^15.10.0": + version: 15.10.0 + resolution: "globals@npm:15.10.0" + checksum: 10/d649208c62406fa71f131be643cb6d18703be5e612f8fa4da8a35bda56ce5a6a8caeb13a2f5a927e4d3324d73872e897067eb6f92ddd46a29876ffa5c4910cb8 languageName: node linkType: hard @@ -2807,13 +4355,6 @@ __metadata: languageName: node linkType: hard -"grapheme-splitter@npm:^1.0.4": - version: 1.0.4 - resolution: "grapheme-splitter@npm:1.0.4" - checksum: 10/fdb2f51fd430ce881e18e44c4934ad30e59736e46213f7ad35ea5970a9ebdf7d0fe56150d15cc98230d55d2fd48c73dc6781494c38d8cf2405718366c36adb88 - languageName: node - linkType: hard - "graphemer@npm:^1.4.0": version: 1.4.0 resolution: "graphemer@npm:1.4.0" @@ -2955,7 +4496,14 @@ __metadata: languageName: node linkType: hard -"import-fresh@npm:^3.0.0, import-fresh@npm:^3.2.1": +"ignore@npm:^5.3.1": + version: 5.3.2 + resolution: "ignore@npm:5.3.2" + checksum: 10/cceb6a457000f8f6a50e1196429750d782afce5680dd878aa4221bd79972d68b3a55b4b1458fc682be978f4d3c6a249046aa0880637367216444ab7b014cfc98 + languageName: node + linkType: hard + +"import-fresh@npm:^3.2.1": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" dependencies: @@ -3093,13 +4641,6 @@ __metadata: languageName: node linkType: hard -"is-path-inside@npm:^3.0.3": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: 10/abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 - languageName: node - linkType: hard - "is-stream@npm:^2.0.0": version: 2.0.1 resolution: "is-stream@npm:2.0.1" @@ -3664,6 +5205,22 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2, jsesc@npm:~3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: 10/8e5a7de6b70a8bd71f9cb0b5a7ade6a73ae6ab55e697c74cc997cede97417a3a65ed86c36f7dd6125fe49766e8386c845023d9e213916ca92c9dfdd56e2babf3 + languageName: node + linkType: hard + +"json-buffer@npm:3.0.1": + version: 3.0.1 + resolution: "json-buffer@npm:3.0.1" + checksum: 10/82876154521b7b68ba71c4f969b91572d1beabadd87bd3a6b236f85fbc7dc4695089191ed60bb59f9340993c51b33d479f45b6ba9f3548beb519705281c32c3c + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -3694,6 +5251,24 @@ __metadata: languageName: node linkType: hard +"json5@npm:^2.2.3": + version: 2.2.3 + resolution: "json5@npm:2.2.3" + bin: + json5: lib/cli.js + checksum: 10/1db67b853ff0de3534085d630691d3247de53a2ed1390ba0ddff681ea43e9b3e30ecbdb65c5e9aab49435e44059c23dbd6fee8ee619419ba37465bb0dd7135da + languageName: node + linkType: hard + +"keyv@npm:^4.5.4": + version: 4.5.4 + resolution: "keyv@npm:4.5.4" + dependencies: + json-buffer: "npm:3.0.1" + checksum: 10/167eb6ef64cc84b6fa0780ee50c9de456b422a1e18802209234f7c2cf7eae648c7741f32e50d7e24ccb22b24c13154070b01563d642755b156c357431a191e75 + languageName: node + linkType: hard + "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -3752,6 +5327,13 @@ __metadata: languageName: node linkType: hard +"lodash.debounce@npm:^4.0.8": + version: 4.0.8 + resolution: "lodash.debounce@npm:4.0.8" + checksum: 10/cd0b2819786e6e80cb9f5cda26b1a8fc073daaf04e48d4cb462fa4663ec9adb3a5387aa22d7129e48eed1afa05b482e2a6b79bfc99b86886364449500cbb00fd + languageName: node + linkType: hard + "lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" @@ -3773,6 +5355,15 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^5.1.1": + version: 5.1.1 + resolution: "lru-cache@npm:5.1.1" + dependencies: + yallist: "npm:^3.0.2" + checksum: 10/951d2673dcc64a7fb888bf3d13bc2fdf923faca97d89cdb405ba3dfff77e2b26e5798d405e78fcd7094c9e7b8b4dab2ddc5a4f8a11928af24a207b7c738ca3f8 + languageName: node + linkType: hard + "lru-cache@npm:^6.0.0": version: 6.0.0 resolution: "lru-cache@npm:6.0.0" @@ -3796,10 +5387,10 @@ __metadata: languageName: node linkType: hard -"magic-bytes.js@npm:^1.5.0": - version: 1.5.0 - resolution: "magic-bytes.js@npm:1.5.0" - checksum: 10/ffb86aec8f4d05446355433392f5a67882c9cbcd46bc1d53ece4f46f73938ec16a35ad4d53decda661185c92e3007a94243bf48809bc73f111a8a28b63eeee19 +"magic-bytes.js@npm:^1.10.0": + version: 1.10.0 + resolution: "magic-bytes.js@npm:1.10.0" + checksum: 10/4b84d54b79914df3e9824ba6aba4eb01ea2555d14c7a4fa45be43ef8be3c286ad3a8dcdb536b328de2d7469dbbd3a21ee4b15d338cadc43eb08c0df249a19e7a languageName: node linkType: hard @@ -3882,7 +5473,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -3900,6 +5491,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.4": + version: 9.0.5 + resolution: "minimatch@npm:9.0.5" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10/dd6a8927b063aca6d910b119e1f2df6d2ce7d36eab91de83167dd136bb85e1ebff97b0d3de1cb08bd1f7e018ca170b4962479fefab5b2a69e2ae12cb2edc8348 + languageName: node + linkType: hard + "minipass-collect@npm:^1.0.2": version: 1.0.2 resolution: "minipass-collect@npm:1.0.2" @@ -4051,7 +5651,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0, ms@npm:^2.1.1": +"ms@npm:^2.0.0, ms@npm:^2.1.1, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: 10/aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -4079,13 +5679,6 @@ __metadata: languageName: node linkType: hard -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 10/5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -4104,27 +5697,35 @@ __metadata: version: 0.0.0-use.local resolution: "new-gbot@workspace:." dependencies: + "@babel/core": "npm:^7.25.7" + "@babel/preset-env": "npm:^7.25.7" + "@babel/preset-typescript": "npm:^7.25.7" "@discordjs/collection": "npm:^1.5.1" "@discordjs/rest": "npm:^1.7.1" + "@eslint/eslintrc": "npm:^3.1.0" + "@eslint/js": "npm:^9.12.0" "@navy.gif/logger": "npm:^2.5.4" "@navy.gif/timestring": "npm:^6.0.6" + "@types/babel__core": "npm:^7" + "@types/babel__preset-env": "npm:^7" "@types/common-tags": "npm:^1.8.1" "@types/humanize-duration": "npm:^3.27.1" "@types/mysql": "npm:^2.15.21" - "@types/node": "npm:^18.15.11" + "@types/node": "npm:^22.7.4" "@types/object-hash": "npm:^3.0.2" "@types/similarity": "npm:^1.2.1" - "@typescript-eslint/eslint-plugin": "npm:^5.58.0" - "@typescript-eslint/parser": "npm:^5.58.0" + "@typescript-eslint/eslint-plugin": "npm:^8.8.0" + "@typescript-eslint/parser": "npm:^8.8.0" bufferutil: "npm:^4.0.8" chalk: "npm:^5.3.0" common-tags: "npm:^1.8.2" - discord.js: "npm:^14.14.1" + discord.js: "npm:^14.16.3" dotenv: "npm:^16.3.1" escape-string-regexp: "npm:4.0.0" - eslint: "npm:^8.42.0" + eslint: "npm:^9.12.0" eslint-plugin-jest: "npm:^27.2.1" eslint-plugin-node: "npm:^11.1.0" + globals: "npm:^15.10.0" humanize-duration: "npm:^3.28.0" jest: "npm:^28.0.2" moment: "npm:^2.29.4" @@ -4134,7 +5735,7 @@ __metadata: nodemon: "npm:^2.0.7" object-hash: "npm:^3.0.0" similarity: "npm:^1.2.1" - typescript: "npm:^5.3.2" + typescript: "npm:^5.6.2" utf-8-validate: "npm:^6.0.3" zlib-sync: "npm:^0.1.9" languageName: unknown @@ -4211,6 +5812,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: 10/241e5fa9556f1c12bafb83c6c3e94f8cf3d8f2f8f904906ecef6e10bcaa1d59aa61212d4651bec70052015fc54bd3fdcdbe7fc0f638a17e6685aa586c076ec4e + languageName: node + linkType: hard + "node-releases@npm:^2.0.6": version: 2.0.6 resolution: "node-releases@npm:2.0.6" @@ -4313,17 +5921,17 @@ __metadata: languageName: node linkType: hard -"optionator@npm:^0.9.1": - version: 0.9.1 - resolution: "optionator@npm:0.9.1" +"optionator@npm:^0.9.3": + version: 0.9.4 + resolution: "optionator@npm:0.9.4" dependencies: deep-is: "npm:^0.1.3" fast-levenshtein: "npm:^2.0.6" levn: "npm:^0.4.1" prelude-ls: "npm:^1.2.1" type-check: "npm:^0.4.0" - word-wrap: "npm:^1.2.3" - checksum: 10/19cfb625ba3cafd99c204744595a8b5111491632d379be341a8286c53a0101adac6f7ca9be4319ccecaaf5d43a55e65dde8b434620726032472833d958d43698 + word-wrap: "npm:^1.2.5" + checksum: 10/a8398559c60aef88d7f353a4f98dcdff6090a4e70f874c827302bf1213d9106a1c4d5fcb68dacb1feb3c30a04c4102f41047aa55d4c576b863d6fc876e001af6 languageName: node linkType: hard @@ -4459,6 +6067,13 @@ __metadata: languageName: node linkType: hard +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: 10/a2ad60d94d185c30f2a140b19c512547713fb89b920d32cc6cf658fa786d63a37ba7b8451872c3d9fc34883971fb6e5878e07a20b60506e0bb2554dce9169ccb + languageName: node + linkType: hard + "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -4607,6 +6222,38 @@ __metadata: languageName: node linkType: hard +"regenerate-unicode-properties@npm:^10.2.0": + version: 10.2.0 + resolution: "regenerate-unicode-properties@npm:10.2.0" + dependencies: + regenerate: "npm:^1.4.2" + checksum: 10/9150eae6fe04a8c4f2ff06077396a86a98e224c8afad8344b1b656448e89e84edcd527e4b03aa5476774129eb6ad328ed684f9c1459794a935ec0cc17ce14329 + languageName: node + linkType: hard + +"regenerate@npm:^1.4.2": + version: 1.4.2 + resolution: "regenerate@npm:1.4.2" + checksum: 10/dc6c95ae4b3ba6adbd7687cafac260eee4640318c7a95239d5ce847d9b9263979758389e862fe9c93d633b5792ea4ada5708df75885dc5aa05a309fa18140a87 + languageName: node + linkType: hard + +"regenerator-runtime@npm:^0.14.0": + version: 0.14.1 + resolution: "regenerator-runtime@npm:0.14.1" + checksum: 10/5db3161abb311eef8c45bcf6565f4f378f785900ed3945acf740a9888c792f75b98ecb77f0775f3bf95502ff423529d23e94f41d80c8256e8fa05ed4b07cf471 + languageName: node + linkType: hard + +"regenerator-transform@npm:^0.15.2": + version: 0.15.2 + resolution: "regenerator-transform@npm:0.15.2" + dependencies: + "@babel/runtime": "npm:^7.8.4" + checksum: 10/c4fdcb46d11bbe32605b4b9ed76b21b8d3f241a45153e9dc6f5542fed4c7744fed459f42701f650d5d5956786bf7de57547329d1c05a9df2ed9e367b9d903302 + languageName: node + linkType: hard + "regexpp@npm:^3.0.0": version: 3.2.0 resolution: "regexpp@npm:3.2.0" @@ -4614,6 +6261,38 @@ __metadata: languageName: node linkType: hard +"regexpu-core@npm:^6.1.1": + version: 6.1.1 + resolution: "regexpu-core@npm:6.1.1" + dependencies: + regenerate: "npm:^1.4.2" + regenerate-unicode-properties: "npm:^10.2.0" + regjsgen: "npm:^0.8.0" + regjsparser: "npm:^0.11.0" + unicode-match-property-ecmascript: "npm:^2.0.0" + unicode-match-property-value-ecmascript: "npm:^2.1.0" + checksum: 10/6a7ffb42781cacedd7df3c47c72e2d725401a699855be94a37ece5e29d3f25ab3abdd81d73f2d9d32ebc4d41bd25e3c3cc21e5284203faf19e60943adc55252d + languageName: node + linkType: hard + +"regjsgen@npm:^0.8.0": + version: 0.8.0 + resolution: "regjsgen@npm:0.8.0" + checksum: 10/b930f03347e4123c917d7b40436b4f87f625b8dd3e705b447ddd44804e4616c3addb7453f0902d6e914ab0446c30e816e445089bb641a4714237fe8141a0ef9d + languageName: node + linkType: hard + +"regjsparser@npm:^0.11.0": + version: 0.11.1 + resolution: "regjsparser@npm:0.11.1" + dependencies: + jsesc: "npm:~3.0.2" + bin: + regjsparser: bin/parser + checksum: 10/06295f1666f8e378c3b70eb01578b46e075eee0556865a297497ab40753f04cce526e96513b18e21e66b79c972e7377bd3b5caa86935ed5d736e9b3e0f857363 + languageName: node + linkType: hard + "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -4651,7 +6330,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.10.1": +"resolve@npm:^1.10.1, resolve@npm:^1.14.2": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -4677,7 +6356,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@npm%3A^1.10.1#optional!builtin": +"resolve@patch:resolve@npm%3A^1.10.1#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -4776,7 +6455,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^6.1.0": +"semver@npm:^6.1.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" bin: @@ -4807,6 +6486,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.6.0": + version: 7.6.3 + resolution: "semver@npm:7.6.3" + bin: + semver: bin/semver.js + checksum: 10/36b1fbe1a2b6f873559cd57b238f1094a053dbfd997ceeb8757d79d1d2089c56d1321b9f1069ce263dc64cfa922fa1d2ad566b39426fe1ac6c723c1487589e10 + languageName: node + linkType: hard + "semver@npm:~7.0.0": version: 7.0.0 resolution: "semver@npm:7.0.0" @@ -5062,7 +6750,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": +"strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 10/492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -5225,17 +6913,19 @@ __metadata: languageName: node linkType: hard -"ts-mixer@npm:^6.0.3": - version: 6.0.3 - resolution: "ts-mixer@npm:6.0.3" - checksum: 10/ac9178bdac5e5f760472269ad4c461587a0f6793532ddbef1326bb01482425a6247be98f9bd11bf35a9fdd36b63b8c8dde393942b9b9ee52d154eef082fca39a +"ts-api-utils@npm:^1.3.0": + version: 1.3.0 + resolution: "ts-api-utils@npm:1.3.0" + peerDependencies: + typescript: ">=4.2.0" + checksum: 10/3ee44faa24410cd649b5c864e068d438aa437ef64e9e4a66a41646a6d3024d3097a695eeb3fb26ee364705d3cb9653a65756d009e6a53badb6066a5f447bf7ed languageName: node linkType: hard -"tslib@npm:2.6.2, tslib@npm:^2.6.2": - version: 2.6.2 - resolution: "tslib@npm:2.6.2" - checksum: 10/bd26c22d36736513980091a1e356378e8b662ded04204453d353a7f34a4c21ed0afc59b5f90719d4ba756e581a162ecbf93118dc9c6be5acf70aa309188166ca +"ts-mixer@npm:^6.0.4": + version: 6.0.4 + resolution: "ts-mixer@npm:6.0.4" + checksum: 10/f20571a4a4ff7b5e1a2ff659208c1ea9d4180dda932b71d289edc99e25a2948c9048e2e676b930302ac0f8e88279e0da6022823183e67de3906a3f3a8b72ea80 languageName: node linkType: hard @@ -5253,6 +6943,20 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 10/bd26c22d36736513980091a1e356378e8b662ded04204453d353a7f34a4c21ed0afc59b5f90719d4ba756e581a162ecbf93118dc9c6be5acf70aa309188166ca + languageName: node + linkType: hard + +"tslib@npm:^2.6.3": + version: 2.7.0 + resolution: "tslib@npm:2.7.0" + checksum: 10/9a5b47ddac65874fa011c20ff76db69f97cf90c78cff5934799ab8894a5342db2d17b4e7613a087046bc1d133d21547ddff87ac558abeec31ffa929c88b7fce6 + languageName: node + linkType: hard + "tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0" @@ -5280,13 +6984,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.20.2": - version: 0.20.2 - resolution: "type-fest@npm:0.20.2" - checksum: 10/8907e16284b2d6cfa4f4817e93520121941baba36b39219ea36acfe64c86b9dbc10c9941af450bd60832c8f43464974d51c0957f9858bc66b952b66b6914cbb9 - languageName: node - linkType: hard - "type-fest@npm:^0.21.3": version: 0.21.3 resolution: "type-fest@npm:0.21.3" @@ -5294,23 +6991,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.3.2": - version: 5.3.2 - resolution: "typescript@npm:5.3.2" +"typescript@npm:^5.6.2": + version: 5.6.2 + resolution: "typescript@npm:5.6.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/415e5fb6611f5713e460bad48039f00bcfdbde53a2f911727862d5aa9c5d5edd250059a419df382d8f031709e15a169c41eb62b6a401da5eec7ac0f4e359d6ac + checksum: 10/f95365d4898f357823e93d334ecda9fcade54f009b397c7d05b7621cd9e865981033cf89ccde0f3e3a7b73b1fdbae18e92bc77db237b43e912f053fef0f9a53b languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.3.2#optional!builtin": - version: 5.3.2 - resolution: "typescript@patch:typescript@npm%3A5.3.2#optional!builtin::version=5.3.2&hash=e012d7" +"typescript@patch:typescript@npm%3A^5.6.2#optional!builtin": + version: 5.6.2 + resolution: "typescript@patch:typescript@npm%3A5.6.2#optional!builtin::version=5.6.2&hash=379a07" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/1b45cdfb577a78ae7a9a9d0b77a7b772142cb98ba05e4e5aefba7044a028ded885bcecef63166407a5986645cea816fe4986894336aacd5e791796ea79a6a7ed + checksum: 10/060a7349adf698477b411be4ace470aee6c2c1bd99917fdf5d33697c17ec55c64fe724eb10399387530b50e9913b41528dd8bfcca0a5fc8f8bac63fbb4580a2e languageName: node linkType: hard @@ -5321,12 +7018,17 @@ __metadata: languageName: node linkType: hard -"undici@npm:5.27.2": - version: 5.27.2 - resolution: "undici@npm:5.27.2" - dependencies: - "@fastify/busboy": "npm:^2.0.0" - checksum: 10/2bf96b102fb84568fb235bdf6e1e352e5d2bf99566b243cd1b13b41578bf9dd5c7c3d3d82192b20a3fec61fe7a528f9d80cd5b4555ce65405c06c69b023013de +"undici-types@npm:~6.19.2": + version: 6.19.8 + resolution: "undici-types@npm:6.19.8" + checksum: 10/cf0b48ed4fc99baf56584afa91aaffa5010c268b8842f62e02f752df209e3dea138b372a60a963b3b2576ed932f32329ce7ddb9cb5f27a6c83040d8cd74b7a70 + languageName: node + linkType: hard + +"undici@npm:6.19.8": + version: 6.19.8 + resolution: "undici@npm:6.19.8" + checksum: 10/19ae4ba38b029a664d99fd330935ef59136cf99edb04ed821042f27b5a9e84777265fb744c8a7abc83f2059afb019446c69a4ebef07bbc0ed6b2de8d67ef4090 languageName: node linkType: hard @@ -5339,6 +7041,37 @@ __metadata: languageName: node linkType: hard +"unicode-canonical-property-names-ecmascript@npm:^2.0.0": + version: 2.0.1 + resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.1" + checksum: 10/3c3dabdb1d22aef4904399f9e810d0b71c0b12b3815169d96fac97e56d5642840c6071cf709adcace2252bc6bb80242396c2ec74b37224eb015c5f7aca40bad7 + languageName: node + linkType: hard + +"unicode-match-property-ecmascript@npm:^2.0.0": + version: 2.0.0 + resolution: "unicode-match-property-ecmascript@npm:2.0.0" + dependencies: + unicode-canonical-property-names-ecmascript: "npm:^2.0.0" + unicode-property-aliases-ecmascript: "npm:^2.0.0" + checksum: 10/1f34a7434a23df4885b5890ac36c5b2161a809887000be560f56ad4b11126d433c0c1c39baf1016bdabed4ec54829a6190ee37aa24919aa116dc1a5a8a62965a + languageName: node + linkType: hard + +"unicode-match-property-value-ecmascript@npm:^2.1.0": + version: 2.2.0 + resolution: "unicode-match-property-value-ecmascript@npm:2.2.0" + checksum: 10/9fd53c657aefe5d3cb8208931b4c34fbdb30bb5aa9a6c6bf744e2f3036f00b8889eeaf30cb55a873b76b6ee8b5801ea770e1c49b3352141309f58f0ebb3011d8 + languageName: node + linkType: hard + +"unicode-property-aliases-ecmascript@npm:^2.0.0": + version: 2.1.0 + resolution: "unicode-property-aliases-ecmascript@npm:2.1.0" + checksum: 10/243524431893649b62cc674d877bd64ef292d6071dd2fd01ab4d5ad26efbc104ffcd064f93f8a06b7e4ec54c172bf03f6417921a0d8c3a9994161fe1f88f815b + languageName: node + linkType: hard + "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -5371,6 +7104,20 @@ __metadata: languageName: node linkType: hard +"update-browserslist-db@npm:^1.1.0": + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" + dependencies: + escalade: "npm:^3.2.0" + picocolors: "npm:^1.1.0" + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 10/7678dd8609750588d01aa7460e8eddf2ff9d16c2a52fb1811190e0d056390f1fdffd94db3cf8fb209cf634ab4fa9407886338711c71cc6ccade5eeb22b093734 + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -5478,10 +7225,10 @@ __metadata: languageName: node linkType: hard -"word-wrap@npm:^1.2.3": - version: 1.2.3 - resolution: "word-wrap@npm:1.2.3" - checksum: 10/08a677e1578b9cc367a03d52bc51b6869fec06303f68d29439e4ed647257411f857469990c31066c1874678937dac737c9f8f20d3fd59918fb86b7d926a76b15 +"word-wrap@npm:^1.2.5": + version: 1.2.5 + resolution: "word-wrap@npm:1.2.5" + checksum: 10/1ec6f6089f205f83037be10d0c4b34c9183b0b63fca0834a5b3cee55dd321429d73d40bb44c8fc8471b5203d6e8f8275717f49a8ff4b2b0ab41d7e1b563e0854 languageName: node linkType: hard @@ -5524,9 +7271,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.14.2, ws@npm:^8.14.2": - version: 8.14.2 - resolution: "ws@npm:8.14.2" +"ws@npm:^8.16.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -5535,7 +7282,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 10/815ff01d9bc20a249b2228825d9739268a03a4408c2e0b14d49b0e2ae89d7f10847e813b587ba26992bdc33e9d03bed131e4cae73ff996baf789d53e99c31186 + checksum: 10/70dfe53f23ff4368d46e4c0b1d4ca734db2c4149c6f68bc62cb16fc21f753c47b35fcc6e582f3bdfba0eaeb1c488cddab3c2255755a5c3eecb251431e42b3ff6 languageName: node linkType: hard @@ -5546,6 +7293,13 @@ __metadata: languageName: node linkType: hard +"yallist@npm:^3.0.2": + version: 3.1.1 + resolution: "yallist@npm:3.1.1" + checksum: 10/9af0a4329c3c6b779ac4736c69fae4190ac03029fa27c1aef4e6bcc92119b73dea6fe5db5fe881fb0ce2a0e9539a42cdf60c7c21eda04d1a0b8c082e38509efb + languageName: node + linkType: hard + "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0" -- 2.45.2 From f163f2c9ea74ca0897cdbb2d03f8d470cb6a5c7f Mon Sep 17 00:00:00 2001 From: Navy Date: Thu, 17 Oct 2024 22:50:34 +0300 Subject: [PATCH 3/3] Debug statement --- src/client/infractions/Addrole.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/infractions/Addrole.ts b/src/client/infractions/Addrole.ts index 30791ff..a69dfa4 100644 --- a/src/client/infractions/Addrole.ts +++ b/src/client/infractions/Addrole.ts @@ -76,6 +76,8 @@ class AddroleInfraction extends Infraction this.logger.error(`Infraction missing ${this.member ? 'roleIds' : 'member'}:\n${new Error().stack}`); return this._fail('INFRACTION_ERROR'); } + const existingRoles = this.member.roles.cache.keys(); + this.guild.debug(`Roles in cache: ${[ ...existingRoles ].join(', ')}`); try { this.guild.debug(`Adding roles ${this.data.roleIds.join(', ')} to ${this.member.tag} (${this.member.id})`); -- 2.45.2