diff --git a/package.json b/package.json index d6d9af4dc..9b3db2818 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "postinstall": "mkdir -p ./logs", "lint": "npx eslint 'src/**/*.ts' --fix", "register": "node ./dist/register-commands.js", + "register-dev": "node ./dist/register-commands-dev.js", "run": "node --max-old-space-size=10240 --no-deprecation --no-warnings --experimental-json-modules ./dist/index.js", "start": "pnpx prisma generate && pnpx prisma db push && pnpm run run", "watch": "swc src -d dist --strip-leading-paths --copy-files --watch" @@ -16,13 +17,13 @@ "dependencies": { "@discordjs/core": "^2.0.1", "@discordjs/rest": "^2.4.2", - "@prisma/client": "^6.2.1", + "@prisma/client": "^6.3.0", "@total-typescript/ts-reset": "^0.6.1", - "@types/lodash": "^4.17.14", + "@types/lodash": "^4.17.15", "@types/lodash.merge": "^4.6.9", "captcha-canvas": "^2.3.1", "client@latest": "link:prisma/client@latest", - "discord-api-types": "0.37.115", + "discord-api-types": "0.37.118", "discord-hybrid-sharding": "^2.2.4", "discord.js": "^14.17.3", "dotenv": "^16.4.7", @@ -44,22 +45,22 @@ "@babel/eslint-parser": "^7.26.5", "@babel/eslint-plugin": "^7.25.9", "@swc/cli": "^0.6.0", - "@swc/core": "1.10.7", + "@swc/core": "1.10.12", "@types/body-parser": "^1.19.5", "@types/clone": "^2.1.4", "@types/glob": "^8.1.0", "@types/lodash.clonedeep": "^4.5.9", "@types/moment-duration-format": "^2.2.6", - "@types/ms": "^0.7.34", - "@types/node": "^22.10.6", + "@types/ms": "^2.1.0", + "@types/node": "^22.13.0", "@types/node-schedule": "^2.1.7", "@types/request": "^2.48.12", "@types/source-map-support": "^0.5.10", "@types/string-similarity": "^4.0.2", "@types/valid-url": "^1.0.7", - "@types/ws": "^8.5.13", - "@typescript-eslint/eslint-plugin": "^8.20.0", - "@typescript-eslint/parser": "^8.20.0", + "@types/ws": "^8.5.14", + "@typescript-eslint/eslint-plugin": "^8.22.0", + "@typescript-eslint/parser": "^8.22.0", "eslint": "^8.57.1", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^10.0.1", @@ -67,9 +68,9 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-json": "^4.0.1", "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-prettier": "^5.2.3", "prettier": "^3.4.2", - "prisma": "^6.2.1", + "prisma": "^6.3.0", "source-map-support": "^0.5.21", "typescript": "^5.7.3" }, diff --git a/src/BaseClient/UtilModules/getDuration.ts b/src/BaseClient/UtilModules/getDuration.ts index a9e65eb68..7d2c2a078 100644 --- a/src/BaseClient/UtilModules/getDuration.ts +++ b/src/BaseClient/UtilModules/getDuration.ts @@ -1,4 +1,4 @@ -import ms from 'ms'; +import ms, { type StringValue } from 'ms'; /** * Calculates the total duration of a given time string. @@ -12,7 +12,7 @@ export default (duration: string, max?: number) => { const mergedDurationArgs: string[] = []; for (let i = 0; i < args.length; i += 1) { - if (Number(args[i]) === ms(args[i])) { + if (Number(args[i]) === ms(args[i] as StringValue)) { mergedDurationArgs.push(`${args[i]} ${args[i + 1]}`); i += 1; break; @@ -22,7 +22,7 @@ export default (duration: string, max?: number) => { } const result = mergedDurationArgs - .map((arg) => ms(arg)) + .map((arg) => ms(arg as StringValue)) .reduce((partialSum, arg) => partialSum + arg, 0); if (max && Math.abs(result) > max) return max; diff --git a/src/Commands/ModalCommands/settings/autoModRule/duration.ts b/src/Commands/ModalCommands/settings/autoModRule/duration.ts index 54146c3c1..be5037a67 100644 --- a/src/Commands/ModalCommands/settings/autoModRule/duration.ts +++ b/src/Commands/ModalCommands/settings/autoModRule/duration.ts @@ -1,5 +1,5 @@ import * as Discord from 'discord.js'; -import ms from 'ms'; +import ms, { type StringValue } from 'ms'; import * as CT from '../../../../Typings/Typings.js'; import { getAPIRule } from '../../../ButtonCommands/settings/autoModRule/boolean.js'; import * as SettingsFile from '../../../SlashCommands/settings/moderation/denylist-rules.js'; @@ -23,7 +23,7 @@ export default async (cmd: Discord.ModalSubmitInteraction, args: string[]) => { const verify = (): Promise<{ value?: number; error?: Error }> => new Promise((res) => { try { - ms(field.value); + ms(field.value as StringValue); res({ value: cmd.client.util.getDuration(field.value) / 1000 }); } catch (e) { res({ error: e as Error }); diff --git a/src/Commands/ModalCommands/settings/duration.ts b/src/Commands/ModalCommands/settings/duration.ts index e60d9af84..171f0acfa 100644 --- a/src/Commands/ModalCommands/settings/duration.ts +++ b/src/Commands/ModalCommands/settings/duration.ts @@ -1,5 +1,5 @@ import type * as Discord from 'discord.js'; -import ms from 'ms'; +import ms, { type StringValue } from 'ms'; import * as CT from '../../../Typings/Typings.js'; export default async (cmd: Discord.ModalSubmitInteraction, args: string[]) => { @@ -22,7 +22,7 @@ export default async (cmd: Discord.ModalSubmitInteraction, args: string[]) => { const verify = (): Promise<{ value?: number; error?: Error }> => new Promise((res) => { try { - ms(field.value); + ms(field.value as StringValue); res({ value: cmd.client.util.getDuration(field.value) / 1000 }); } catch (e) { res({ error: e as Error });