From ddcce09b6932b4a7165a97031f3deeaeb64698ad Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 15:57:07 -0400 Subject: [PATCH 01/34] test this change --- .docker-compose.yml | 24 ++++++++++++++++++++++++ .env.production.sample | 18 ++++++++++++++++++ .gitignore | 1 + Dockerfile | 25 +++++++++++++++++++------ package.json | 2 +- 5 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 .docker-compose.yml create mode 100644 .env.production.sample diff --git a/.docker-compose.yml b/.docker-compose.yml new file mode 100644 index 00000000..b381d138 --- /dev/null +++ b/.docker-compose.yml @@ -0,0 +1,24 @@ +# You should configure the passwords/username's where expected +services: + web: + build: . + ports: + - "127.0.0.1:3000:3000" # Expected to be proxied via something like Nginx + restart: always + shm_size: 1024mb # Set 1gb default memory alloc. 1gb should be more than enough + + mongo: + image: mongo + restart: always + env_file: .env.production + networks: + - mongo + + mongo-express: + image: mongo-express + restart: always + env_file: .env.production + ports: + - "8081:8081" + networks: + - mongo \ No newline at end of file diff --git a/.env.production.sample b/.env.production.sample new file mode 100644 index 00000000..8d2a502e --- /dev/null +++ b/.env.production.sample @@ -0,0 +1,18 @@ +# This is a sample configuration file. You will need to copy this file +# and fill in the appropriate values before attempting to run +# this in a production environment! This is important! + +# This assumes usage of docker-compose.yml - this file is generally useless +# otherwise, and you can, ignore it should you choose. + +# MongoDB +# ----- +MONGO_INITDB_ROOT_USERNAME: del +MONGO_INITDB_ROOT_PASSWORD: h@ckm3 # CHANGE ME + +# MongoDB-Express Admin Interface +# ----- +ME_CONFIG_MONGODB_ADMINUSERNAME: del +ME_CONFIG_MONGODB_ADMINPASSWORD: h@ckm3 # CHANGE ME +ME_CONFIG_SITE_COOKIESECRET: 'cookiesecret' # CHANGE ME +ME_CONFIG_SITE_SESSIONSECRET: 'sessionsecret' # CHANGE ME \ No newline at end of file diff --git a/.gitignore b/.gitignore index be81c1a8..344b33ac 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,7 @@ dist .tern-port # SSL & configuration files +.env.production settings.json .env ssl/ diff --git a/Dockerfile b/Dockerfile index 5b630c8f..6591b424 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,22 @@ -FROM node:17.9.0-alpine3.14 -WORKDIR /app -RUN apk update && apk add git ca-certificates -COPY . . -RUN mv settings.example.json settings.json +# syntax=docker/dockerfile:1.4 +# NOTE: You should have made a settings.json file before running docker compose. +# Node v17 is EOL, Node v18 is current +ARG NODE_VERSION="18.15.0-alpine3.16" +ARG DEL_VERSION="v5" +FROM node:${NODE_VERSION} as build +# Set new working dir +WORKDIR /opt/del${DEL_VERSION} +# Copy to-be-compiled files to container filesystem +COPY . /opt/del${DEL_VERSION}/ +# Run apt update & add needed packages +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + git ca-certificates +# Install node modules RUN npm ci --production +# Compile new dist file RUN npx tsc-transpile-only -RUN rm -rf src/ @types/ settings.json +# Remove non-dist files +RUN rm -rf src/ @types/ settings.json .env.production +# Start the process within the container CMD ["npm", "start"] diff --git a/package.json b/package.json index f8c9523d..bd442f9a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "engines": { "npm": ">=8.5.0", - "node": ">=17.9.0" + "node": ">=18.15.0" }, "dependencies": { "@sentry/node": "^6.19.2", From 7510b28f42c9ddf4a4d1b75958632b781587ff8d Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 16:15:07 -0400 Subject: [PATCH 02/34] almost forgot about redis lmao --- .docker-compose.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.docker-compose.yml b/.docker-compose.yml index b381d138..e9a185a3 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -6,6 +6,9 @@ services: - "127.0.0.1:3000:3000" # Expected to be proxied via something like Nginx restart: always shm_size: 1024mb # Set 1gb default memory alloc. 1gb should be more than enough + depends_on: + - redis + - mongo mongo: image: mongo @@ -13,6 +16,14 @@ services: env_file: .env.production networks: - mongo + volumes: + - ./data/mongo:/data/db + healthcheck: + test: ["CMD", "echo 'db.runCommand(\"ping\").ok' | mongo mongo:27017/test --quiet"] + interval: 10s + timeout: 10s + retries: 5 + start_period: 40s mongo-express: image: mongo-express @@ -21,4 +32,18 @@ services: ports: - "8081:8081" networks: - - mongo \ No newline at end of file + - mongo + depends_on: + - mongo + + redis: + restart: always + image: redis:7-alpine + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 10s + retries: 5 + start_period: 40s + volumes: + - ./data/redis:/data From 1d332f27ab7d97ef1ec7e17f4b51d07fb9b61370 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 16:23:13 -0400 Subject: [PATCH 03/34] forgot this --- .docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.docker-compose.yml b/.docker-compose.yml index e9a185a3..095b03b7 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -47,3 +47,6 @@ services: start_period: 40s volumes: - ./data/redis:/data + +networks: + mongo: From 8b4a8ce15038e5832d3f01e6086940050721fa92 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 16:31:18 -0400 Subject: [PATCH 04/34] right. alpine --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6591b424..a51c93a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,8 @@ WORKDIR /opt/del${DEL_VERSION} # Copy to-be-compiled files to container filesystem COPY . /opt/del${DEL_VERSION}/ # Run apt update & add needed packages -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - git ca-certificates +RUN apk update && \ + apk add git ca-certificates # Install node modules RUN npm ci --production # Compile new dist file From ea050a7cf018d6453a94f7fcfcec77f179e7a609 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 16:39:28 -0400 Subject: [PATCH 05/34] fix --- .env.production.sample | 8 ++++++-- Dockerfile | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.env.production.sample b/.env.production.sample index 8d2a502e..f97d39e0 100644 --- a/.env.production.sample +++ b/.env.production.sample @@ -12,7 +12,11 @@ MONGO_INITDB_ROOT_PASSWORD: h@ckm3 # CHANGE ME # MongoDB-Express Admin Interface # ----- -ME_CONFIG_MONGODB_ADMINUSERNAME: del -ME_CONFIG_MONGODB_ADMINPASSWORD: h@ckm3 # CHANGE ME +ME_CONFIG_MONGODB_SERVER: mongo # Assumes mongo docker network +ME_CONFIG_MONGODB_ENABLE_ADMIN: false +ME_CONFIG_MONGODB_AUTH_USERNAME: del +ME_CONFIG_MONGODB_AUTH_PASSWORD: h@ckm3 +ME_CONFIG_BASICAUTH_USERNAME: deluser +ME_CONFIG_BASICAUTH_PASSWORD: h@ckm3 ME_CONFIG_SITE_COOKIESECRET: 'cookiesecret' # CHANGE ME ME_CONFIG_SITE_SESSIONSECRET: 'sessionsecret' # CHANGE ME \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a51c93a2..57c784db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,11 @@ # NOTE: You should have made a settings.json file before running docker compose. # Node v17 is EOL, Node v18 is current ARG NODE_VERSION="18.15.0-alpine3.16" -ARG DEL_VERSION="v5" FROM node:${NODE_VERSION} as build # Set new working dir -WORKDIR /opt/del${DEL_VERSION} +WORKDIR /opt/del # Copy to-be-compiled files to container filesystem -COPY . /opt/del${DEL_VERSION}/ +COPY . /opt/del/ # Run apt update & add needed packages RUN apk update && \ apk add git ca-certificates @@ -16,6 +15,6 @@ RUN npm ci --production # Compile new dist file RUN npx tsc-transpile-only # Remove non-dist files -RUN rm -rf src/ @types/ settings.json .env.production +RUN rm -rf src/ @types/ .env.production # Start the process within the container CMD ["npm", "start"] From 8e6c046de87a5fb350f1b07d42bddfc4eece941f Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 17:16:25 -0400 Subject: [PATCH 06/34] how did I not see that --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 57c784db..c8c87f96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ FROM node:${NODE_VERSION} as build # Set new working dir WORKDIR /opt/del # Copy to-be-compiled files to container filesystem -COPY . /opt/del/ +COPY . /opt/del # Run apt update & add needed packages RUN apk update && \ apk add git ca-certificates From 5aa124cbb9fda1cc452c7cd2eb092094868332a2 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 17:23:37 -0400 Subject: [PATCH 07/34] am i an idiot? likely --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8c87f96..75802d79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,10 @@ # Node v17 is EOL, Node v18 is current ARG NODE_VERSION="18.15.0-alpine3.16" FROM node:${NODE_VERSION} as build -# Set new working dir -WORKDIR /opt/del # Copy to-be-compiled files to container filesystem COPY . /opt/del +# Set new working dir +WORKDIR /opt/del # Run apt update & add needed packages RUN apk update && \ apk add git ca-certificates From 904fdfd0c3a0553a8e50bb15759057aed5559578 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 17:30:36 -0400 Subject: [PATCH 08/34] wasted an hour. didn't see it was in ignore. --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 842e2568..8a23701e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ .gitignore .gitattributes -settings.json .git node_modules/ \ No newline at end of file From 9f99cf4589adac827dac13a99a883ce57dea1f22 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 17:50:59 -0400 Subject: [PATCH 09/34] may cause issues on RHEL8 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 75802d79..ac0c294b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # NOTE: You should have made a settings.json file before running docker compose. # Node v17 is EOL, Node v18 is current ARG NODE_VERSION="18.15.0-alpine3.16" -FROM node:${NODE_VERSION} as build +FROM node:${NODE_VERSION} # Copy to-be-compiled files to container filesystem COPY . /opt/del # Set new working dir From 4bab80661eefa8404bb2355074fa4557732e9fed Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 17:59:42 -0400 Subject: [PATCH 10/34] will error --- .dockerignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 8a23701e..e2fc6355 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ .gitignore .gitattributes .git -node_modules/ \ No newline at end of file +node_modules/ +data/ \ No newline at end of file From 628543538e442834bc3e9d79d6f7e681adaf3588 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 18:43:26 -0400 Subject: [PATCH 11/34] bump discordjs --- package-lock.json | 247 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 118 insertions(+), 131 deletions(-) diff --git a/package-lock.json b/package-lock.json index 98222abe..4c38c946 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", "discord-api-types": "^0.30.0", - "discord.js": "^13.6.0", + "discord.js": "^13.14.0", "ejs": "^3.1.7", "express": "^4.17.3", "express-device": "^0.4.2", @@ -69,7 +69,7 @@ "node-sass": "^7.0.1" }, "engines": { - "node": ">=17.9.0", + "node": ">=18.15.0", "npm": ">=8.5.0" } }, @@ -180,41 +180,38 @@ } }, "node_modules/@discordjs/builders": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", - "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.16.0.tgz", + "integrity": "sha512-9/NCiZrLivgRub2/kBc0Vm5pMBE5AUdYbdXsLu/yg9ANgvnaJ0bZKTY8yYnLbsEc/LYUP79lEIdC73qEYhWq7A==", + "deprecated": "no longer supported", "dependencies": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.26.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "@sapphire/shapeshift": "^3.5.1", + "discord-api-types": "^0.36.2", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.1", + "tslib": "^2.4.0" }, "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", - "engines": { - "node": ">=12" - } + "version": "0.36.3", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", + "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "node_modules/@discordjs/builders/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", + "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==", + "deprecated": "no longer supported", "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, "node_modules/@gar/promisify": { @@ -321,9 +318,22 @@ } }, "node_modules/@sapphire/async-queue": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", - "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", + "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/shapeshift": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz", + "integrity": "sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lodash": "^4.17.21" + }, "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -408,17 +418,6 @@ "node": ">=6" } }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, "node_modules/@snyk/protect": { "version": "1.984.0", "resolved": "https://registry.npmjs.org/@snyk/protect/-/protect-1.984.0.tgz", @@ -618,9 +617,9 @@ "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" }, "node_modules/@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", "dependencies": { "@types/node": "*", "form-data": "^3.0.0" @@ -1674,19 +1673,19 @@ "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" }, "node_modules/discord.js": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", - "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", - "dependencies": { - "@discordjs/builders": "^0.11.0", - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.26.0", + "version": "13.14.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.14.0.tgz", + "integrity": "sha512-EXHAZmFHMf6qBHDsIANwSG792SYJpzEFv2nssfakyDqEn0HLxFLLXMaOxBtVohdkUMgtD+dzyeBlbDvAW/A0AA==", + "dependencies": { + "@discordjs/builders": "^0.16.0", + "@discordjs/collection": "^0.7.0", + "@sapphire/async-queue": "^1.5.0", + "@types/node-fetch": "^2.6.2", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.33.5", "form-data": "^4.0.0", - "node-fetch": "^2.6.1", - "ws": "^8.4.0" + "node-fetch": "^2.6.7", + "ws": "^8.9.0" }, "engines": { "node": ">=16.6.0", @@ -1694,12 +1693,9 @@ } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", - "engines": { - "node": ">=12" - } + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.5.tgz", + "integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg==" }, "node_modules/discord.js/node_modules/node-fetch": { "version": "2.6.7", @@ -5126,9 +5122,9 @@ } }, "node_modules/ts-mixer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", - "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", + "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==" }, "node_modules/tslib": { "version": "1.14.1", @@ -5406,15 +5402,15 @@ "dev": true }, "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -5475,14 +5471,6 @@ "engines": { "node": ">=10" } - }, - "node_modules/zod": { - "version": "3.14.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", - "integrity": "sha512-U9BFLb2GO34Sfo9IUYp0w3wJLlmcyGoMd75qU9yf+DrdGA4kEx6e+l9KOkAlyUO0PSQzZCa3TR4qVlcmwqSDuw==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } }, "dependencies": { @@ -5571,33 +5559,33 @@ } }, "@discordjs/builders": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", - "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.16.0.tgz", + "integrity": "sha512-9/NCiZrLivgRub2/kBc0Vm5pMBE5AUdYbdXsLu/yg9ANgvnaJ0bZKTY8yYnLbsEc/LYUP79lEIdC73qEYhWq7A==", "requires": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.26.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "@sapphire/shapeshift": "^3.5.1", + "discord-api-types": "^0.36.2", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.1", + "tslib": "^2.4.0" }, "dependencies": { "discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" + "version": "0.36.3", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", + "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" } } }, "@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", + "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==" }, "@gar/promisify": { "version": "1.1.3", @@ -5691,9 +5679,18 @@ } }, "@sapphire/async-queue": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", - "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz", + "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==" + }, + "@sapphire/shapeshift": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz", + "integrity": "sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw==", + "requires": { + "fast-deep-equal": "^3.1.3", + "lodash": "^4.17.21" + } }, "@sentry/core": { "version": "6.19.6", @@ -5756,11 +5753,6 @@ "tslib": "^1.9.3" } }, - "@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" - }, "@snyk/protect": { "version": "1.984.0", "resolved": "https://registry.npmjs.org/@snyk/protect/-/protect-1.984.0.tgz", @@ -5951,9 +5943,9 @@ "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" }, "@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", "requires": { "@types/node": "*", "form-data": "^3.0.0" @@ -6792,25 +6784,25 @@ "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" }, "discord.js": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", - "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", - "requires": { - "@discordjs/builders": "^0.11.0", - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.26.0", + "version": "13.14.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.14.0.tgz", + "integrity": "sha512-EXHAZmFHMf6qBHDsIANwSG792SYJpzEFv2nssfakyDqEn0HLxFLLXMaOxBtVohdkUMgtD+dzyeBlbDvAW/A0AA==", + "requires": { + "@discordjs/builders": "^0.16.0", + "@discordjs/collection": "^0.7.0", + "@sapphire/async-queue": "^1.5.0", + "@types/node-fetch": "^2.6.2", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.33.5", "form-data": "^4.0.0", - "node-fetch": "^2.6.1", - "ws": "^8.4.0" + "node-fetch": "^2.6.7", + "ws": "^8.9.0" }, "dependencies": { "discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.5.tgz", + "integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg==" }, "node-fetch": { "version": "2.6.7", @@ -9430,9 +9422,9 @@ } }, "ts-mixer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", - "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", + "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==" }, "tslib": { "version": "1.14.1", @@ -9647,9 +9639,9 @@ "dev": true }, "ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "requires": {} }, "xtend": { @@ -9690,11 +9682,6 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true - }, - "zod": { - "version": "3.14.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.4.tgz", - "integrity": "sha512-U9BFLb2GO34Sfo9IUYp0w3wJLlmcyGoMd75qU9yf+DrdGA4kEx6e+l9KOkAlyUO0PSQzZCa3TR4qVlcmwqSDuw==" } } } diff --git a/package.json b/package.json index bd442f9a..1675954d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", "discord-api-types": "^0.30.0", - "discord.js": "^13.6.0", + "discord.js": "^14.8.0", "ejs": "^3.1.7", "express": "^4.17.3", "express-device": "^0.4.2", From 01b28f617d38dc88d1b4abedb6e51abf5b8d9740 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 18:44:26 -0400 Subject: [PATCH 12/34] update networking --- .docker-compose.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.docker-compose.yml b/.docker-compose.yml index 095b03b7..3fc6f2a4 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -9,6 +9,9 @@ services: depends_on: - redis - mongo + networks: + - mongo + - redis mongo: image: mongo @@ -47,6 +50,11 @@ services: start_period: 40s volumes: - ./data/redis:/data + networks: + - redis networks: mongo: + internal: true + redis: + internal: true From aa8c6b52762a4b25b5ac77b905051b1ca673a3a2 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 18:49:19 -0400 Subject: [PATCH 13/34] oops --- package-lock.json | 598 ++++++++++++++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 393 insertions(+), 207 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c38c946..a2231e1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", "discord-api-types": "^0.30.0", - "discord.js": "^13.14.0", + "discord.js": "v14.8", "ejs": "^3.1.7", "express": "^4.17.3", "express-device": "^0.4.2", @@ -180,25 +180,26 @@ } }, "node_modules/@discordjs/builders": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.16.0.tgz", - "integrity": "sha512-9/NCiZrLivgRub2/kBc0Vm5pMBE5AUdYbdXsLu/yg9ANgvnaJ0bZKTY8yYnLbsEc/LYUP79lEIdC73qEYhWq7A==", - "deprecated": "no longer supported", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.5.0.tgz", + "integrity": "sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA==", "dependencies": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.36.2", + "@discordjs/formatters": "^0.2.0", + "@discordjs/util": "^0.2.0", + "@sapphire/shapeshift": "^3.8.1", + "discord-api-types": "^0.37.35", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.3", + "tslib": "^2.5.0" }, "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" }, "node_modules/@discordjs/builders/node_modules/tslib": { "version": "2.5.0", @@ -206,10 +207,61 @@ "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/@discordjs/collection": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", - "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==", - "deprecated": "no longer supported", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.4.0.tgz", + "integrity": "sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ==", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/formatters": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.2.0.tgz", + "integrity": "sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA==", + "dependencies": { + "discord-api-types": "^0.37.35" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/formatters/node_modules/discord-api-types": { + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" + }, + "node_modules/@discordjs/rest": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.6.0.tgz", + "integrity": "sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA==", + "dependencies": { + "@discordjs/collection": "^1.4.0", + "@discordjs/util": "^0.2.0", + "@sapphire/async-queue": "^1.5.0", + "@sapphire/snowflake": "^3.4.0", + "discord-api-types": "^0.37.35", + "file-type": "^18.2.1", + "tslib": "^2.5.0", + "undici": "^5.20.0" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/rest/node_modules/discord-api-types": { + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" + }, + "node_modules/@discordjs/rest/node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, + "node_modules/@discordjs/util": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz", + "integrity": "sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==", "engines": { "node": ">=16.9.0" } @@ -339,6 +391,15 @@ "npm": ">=7.0.0" } }, + "node_modules/@sapphire/snowflake": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", + "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@sentry/core": { "version": "6.19.6", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.6.tgz", @@ -429,6 +490,11 @@ "node": ">=10" } }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -616,28 +682,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" }, - "node_modules/@types/node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -740,9 +784,9 @@ } }, "node_modules/@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "dependencies": { "@types/node": "*" } @@ -1157,6 +1201,17 @@ "integrity": "sha512-y3dHsxlCYkuxUg87KKN9H4InM8NCk8tdnrlxLkYak8sd2WQdllg3wP2Nv41lj8X46uPXX2ADP0MO65LlXPHt/Q==", "dev": true }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -1673,67 +1728,37 @@ "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" }, "node_modules/discord.js": { - "version": "13.14.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.14.0.tgz", - "integrity": "sha512-EXHAZmFHMf6qBHDsIANwSG792SYJpzEFv2nssfakyDqEn0HLxFLLXMaOxBtVohdkUMgtD+dzyeBlbDvAW/A0AA==", - "dependencies": { - "@discordjs/builders": "^0.16.0", - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.5.0", - "@types/node-fetch": "^2.6.2", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.33.5", - "form-data": "^4.0.0", - "node-fetch": "^2.6.7", - "ws": "^8.9.0" + "version": "14.8.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", + "integrity": "sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ==", + "dependencies": { + "@discordjs/builders": "^1.5.0", + "@discordjs/collection": "^1.4.0", + "@discordjs/formatters": "^0.2.0", + "@discordjs/rest": "^1.6.0", + "@discordjs/util": "^0.2.0", + "@sapphire/snowflake": "^3.4.0", + "@types/ws": "^8.5.4", + "discord-api-types": "^0.37.35", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.5.0", + "undici": "^5.20.0", + "ws": "^8.12.1" }, "engines": { - "node": ">=16.6.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.5.tgz", - "integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg==" + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" }, - "node_modules/discord.js/node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/discord.js/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/discord.js/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/discord.js/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } + "node_modules/discord.js/node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/dogapi": { "version": "2.8.4", @@ -1872,6 +1897,7 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, "optional": true, "dependencies": { "iconv-lite": "^0.6.2" @@ -1881,6 +1907,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -2199,6 +2226,22 @@ "node": "^12.20 || >= 14.13" } }, + "node_modules/file-type": { + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.1.tgz", + "integrity": "sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==", + "dependencies": { + "readable-web-to-node-stream": "^3.0.2", + "strtok3": "^7.0.0", + "token-types": "^5.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -2300,19 +2343,6 @@ "node": "*" } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -3102,6 +3132,11 @@ "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" + }, "node_modules/lru_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", @@ -3999,6 +4034,18 @@ "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" }, + "node_modules/peek-readable": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -4265,7 +4312,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -4275,6 +4321,21 @@ "node": ">= 6" } }, + "node_modules/readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -4937,11 +4998,18 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -4992,6 +5060,22 @@ "node": ">=0.10.0" } }, + "node_modules/strtok3": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^5.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5080,6 +5164,22 @@ "node": ">=0.6" } }, + "node_modules/token-types": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -5215,6 +5315,17 @@ "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.4.tgz", "integrity": "sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA==" }, + "node_modules/undici": { + "version": "5.20.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz", + "integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.18" + } + }, "node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -5275,8 +5386,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/utils-merge": { "version": "1.0.1", @@ -5559,21 +5669,23 @@ } }, "@discordjs/builders": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.16.0.tgz", - "integrity": "sha512-9/NCiZrLivgRub2/kBc0Vm5pMBE5AUdYbdXsLu/yg9ANgvnaJ0bZKTY8yYnLbsEc/LYUP79lEIdC73qEYhWq7A==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.5.0.tgz", + "integrity": "sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA==", "requires": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.36.2", + "@discordjs/formatters": "^0.2.0", + "@discordjs/util": "^0.2.0", + "@sapphire/shapeshift": "^3.8.1", + "discord-api-types": "^0.37.35", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "ts-mixer": "^6.0.3", + "tslib": "^2.5.0" }, "dependencies": { "discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" }, "tslib": { "version": "2.5.0", @@ -5583,9 +5695,56 @@ } }, "@discordjs/collection": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", - "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.4.0.tgz", + "integrity": "sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ==" + }, + "@discordjs/formatters": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.2.0.tgz", + "integrity": "sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA==", + "requires": { + "discord-api-types": "^0.37.35" + }, + "dependencies": { + "discord-api-types": { + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" + } + } + }, + "@discordjs/rest": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.6.0.tgz", + "integrity": "sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA==", + "requires": { + "@discordjs/collection": "^1.4.0", + "@discordjs/util": "^0.2.0", + "@sapphire/async-queue": "^1.5.0", + "@sapphire/snowflake": "^3.4.0", + "discord-api-types": "^0.37.35", + "file-type": "^18.2.1", + "tslib": "^2.5.0", + "undici": "^5.20.0" + }, + "dependencies": { + "discord-api-types": { + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" + }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + } + } + }, + "@discordjs/util": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz", + "integrity": "sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==" }, "@gar/promisify": { "version": "1.1.3", @@ -5692,6 +5851,11 @@ "lodash": "^4.17.21" } }, + "@sapphire/snowflake": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", + "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==" + }, "@sentry/core": { "version": "6.19.6", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.6.tgz", @@ -5758,6 +5922,11 @@ "resolved": "https://registry.npmjs.org/@snyk/protect/-/protect-1.984.0.tgz", "integrity": "sha512-R+XQotaoMVBBkAfzDQqO/hcUYlMHKjxXNjeMhlvSjnD4cR8IOrC+XTPyAO2l5v7L81wBMkKjCJ10YQwB6xYISg==" }, + "@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + }, "@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -5942,27 +6111,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" }, - "@types/node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, "@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -6065,9 +6213,9 @@ } }, "@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "requires": { "@types/node": "*" } @@ -6386,6 +6534,14 @@ "integrity": "sha512-y3dHsxlCYkuxUg87KKN9H4InM8NCk8tdnrlxLkYak8sd2WQdllg3wP2Nv41lj8X46uPXX2ADP0MO65LlXPHt/Q==", "dev": true }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "requires": { + "streamsearch": "^1.1.0" + } + }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -6784,52 +6940,34 @@ "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" }, "discord.js": { - "version": "13.14.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.14.0.tgz", - "integrity": "sha512-EXHAZmFHMf6qBHDsIANwSG792SYJpzEFv2nssfakyDqEn0HLxFLLXMaOxBtVohdkUMgtD+dzyeBlbDvAW/A0AA==", - "requires": { - "@discordjs/builders": "^0.16.0", - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.5.0", - "@types/node-fetch": "^2.6.2", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.33.5", - "form-data": "^4.0.0", - "node-fetch": "^2.6.7", - "ws": "^8.9.0" + "version": "14.8.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", + "integrity": "sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ==", + "requires": { + "@discordjs/builders": "^1.5.0", + "@discordjs/collection": "^1.4.0", + "@discordjs/formatters": "^0.2.0", + "@discordjs/rest": "^1.6.0", + "@discordjs/util": "^0.2.0", + "@sapphire/snowflake": "^3.4.0", + "@types/ws": "^8.5.4", + "discord-api-types": "^0.37.35", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.5.0", + "undici": "^5.20.0", + "ws": "^8.12.1" }, "dependencies": { "discord-api-types": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.5.tgz", - "integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg==" + "version": "0.37.35", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", + "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" } } }, @@ -6937,6 +7075,7 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, "optional": true, "requires": { "iconv-lite": "^0.6.2" @@ -6946,6 +7085,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, "optional": true, "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -7192,6 +7332,16 @@ "web-streams-polyfill": "^3.0.3" } }, + "file-type": { + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.1.tgz", + "integrity": "sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==", + "requires": { + "readable-web-to-node-stream": "^3.0.2", + "strtok3": "^7.0.0", + "token-types": "^5.0.1" + } + }, "filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -7279,16 +7429,6 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, "formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -7899,6 +8039,11 @@ "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" + }, "lru_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", @@ -8561,6 +8706,11 @@ "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" }, + "peek-readable": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==" + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -8753,13 +8903,20 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, + "readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "requires": { + "readable-stream": "^3.6.0" + } + }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -9282,11 +9439,15 @@ } } }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "requires": { "safe-buffer": "~5.2.0" } @@ -9325,6 +9486,15 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, + "strtok3": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", + "requires": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^5.0.0" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -9389,6 +9559,15 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "token-types": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", + "requires": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + } + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -9487,6 +9666,14 @@ "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.4.tgz", "integrity": "sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA==" }, + "undici": { + "version": "5.20.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz", + "integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==", + "requires": { + "busboy": "^1.6.0" + } + }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -9546,8 +9733,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { "version": "1.0.1", diff --git a/package.json b/package.json index 1675954d..af181d01 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", "discord-api-types": "^0.30.0", - "discord.js": "^14.8.0", + "discord.js": "v14.8", "ejs": "^3.1.7", "express": "^4.17.3", "express-device": "^0.4.2", From 90d9e3bccc9f863bffddfe7f4d5c0ec0b90a1d81 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 18:50:50 -0400 Subject: [PATCH 14/34] forgot this lol --- .docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.docker-compose.yml b/.docker-compose.yml index 3fc6f2a4..642d64b9 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -12,6 +12,7 @@ services: networks: - mongo - redis + - public mongo: image: mongo @@ -58,3 +59,5 @@ networks: internal: true redis: internal: true + public: + external: true From 0696cb2894fdb7d76b93fe223f7a95c04c38327e Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 18:51:44 -0400 Subject: [PATCH 15/34] broken autocomplete ffs --- .docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.docker-compose.yml b/.docker-compose.yml index 642d64b9..e2f6644b 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -60,4 +60,3 @@ networks: redis: internal: true public: - external: true From 70b73d6ac35fb0c9f3625a7c2726ce22d88c94b8 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 19:00:32 -0400 Subject: [PATCH 16/34] changes for v14 --- src/Routes/autosync.ts | 6 +++--- src/Routes/bots.ts | 8 ++++---- src/Routes/servers.ts | 6 +++--- src/Routes/templates.ts | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Routes/autosync.ts b/src/Routes/autosync.ts index ec539cbd..81f43b84 100644 --- a/src/Routes/autosync.ts +++ b/src/Routes/autosync.ts @@ -26,7 +26,7 @@ import * as serverCache from "../Util/Services/serverCaching.js"; import * as templateCache from "../Util/Services/templateCaching.js"; import * as userCache from "../Util/Services/userCaching.js"; import * as functions from "../Util/Function/main.js"; -import { MessageEmbed } from "discord.js"; +import { EmbedBuilder } from "discord.js"; import { APIInvite, APITemplate, RESTGetAPIInviteQuery, RESTPostOAuth2AccessTokenResult, APIApplicationCommand, OAuth2Scopes, Routes, APIApplication, APIUser } from "discord-api-types/v10"; import settings from "../../settings.json" assert { type: "json" }; @@ -173,7 +173,7 @@ router.get('/servers', async (req, res) => { await serverCache.deleteServer(id); - const embed = new MessageEmbed(); + const embed = new EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); @@ -273,7 +273,7 @@ router.get('/templates', async (req, res) => { await templateCache.deleteTemplate(id); - const embed = new MessageEmbed(); + const embed = new EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index fd7fa104..bce178cf 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -3346,7 +3346,7 @@ router.post( await botCache.updateBot(req.params.id); - const embed = new Discord.MessageEmbed(); + const embed = new Discord.EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); @@ -3501,7 +3501,7 @@ router.post( await botCache.updateBot(req.params.id); - const embed = new Discord.MessageEmbed(); + const embed = new Discord.EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); @@ -3658,7 +3658,7 @@ router.post( await botCache.updateBot(req.params.id); - const embed = new Discord.MessageEmbed(); + const embed = new Discord.EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); @@ -3805,7 +3805,7 @@ router.post( await botCache.updateBot(req.params.id); - const embed = new Discord.MessageEmbed(); + const embed = new Discord.EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index 319b96e5..8d58f89a 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -36,7 +36,7 @@ import * as userCache from "../Util/Services/userCaching.js"; import * as serverCache from "../Util/Services/serverCaching.js"; import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; -import { MessageEmbed } from "discord.js"; +import { EmbedBuilder } from "discord.js"; import type { serverReasons } from "../../@types/enums.js"; import mdi from "markdown-it"; @@ -928,7 +928,7 @@ router.post( await serverCache.updateServer(req.params.id); - const embed = new MessageEmbed(); + const embed = new EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); @@ -1197,7 +1197,7 @@ router.post( await serverCache.deleteServer(req.params.id); - const embed = new MessageEmbed(); + const embed = new EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); diff --git a/src/Routes/templates.ts b/src/Routes/templates.ts index 4bafa8aa..720f24d2 100644 --- a/src/Routes/templates.ts +++ b/src/Routes/templates.ts @@ -33,7 +33,7 @@ import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; import type { APITemplate } from "discord-api-types/v10"; import type { DiscordAPIError } from "discord.js"; -import { MessageEmbed } from "discord.js"; +import { EmbedBuilder } from "discord.js"; import type { templateReasons } from "../../@types/enums.js"; import mdi from "markdown-it"; @@ -810,7 +810,7 @@ router.post( await templateCache.deleteTemplate(req.params.id); - const embed = new MessageEmbed(); + const embed = new EmbedBuilder(); embed.setColor(0x2f3136); embed.setTitle("Reason"); embed.setDescription(req.body.reason); From a48c6c727d56a0cb2975e6ae6a21e25c4884710d Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Sun, 12 Mar 2023 19:17:10 -0400 Subject: [PATCH 17/34] changes in v14 --- src/Routes/authentication.ts | 2 +- src/Routes/bots.ts | 20 ++++++++++---------- src/Routes/servers.ts | 12 ++++++------ src/Routes/templates.ts | 6 +++--- src/Routes/users.ts | 2 +- src/Util/Services/discord.ts | 3 +-- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/Routes/authentication.ts b/src/Routes/authentication.ts index 773777eb..4f0e315b 100644 --- a/src/Routes/authentication.ts +++ b/src/Routes/authentication.ts @@ -237,7 +237,7 @@ router.get( discord.bot.api.guilds(settings.guild.main).members(req.user.id).put({ data: { access_token: req.user.accessToken } }) .catch((error: DiscordAPIError) => { console.error(error) - if (error.httpStatus === 403 && !req.user.impersonator) { + if (error.code === 403 && !req.user.impersonator) { return res.status(403).render("status", { title: res.__("common.error"), status: 403, diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index bce178cf..15161e55 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -280,7 +280,7 @@ router.post( .guilds(req.body.widgetServer) .channels.get() .catch((e: DiscordAPIError) => { - if ([400, 404].includes(e.httpStatus)) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -339,7 +339,7 @@ router.post( .channels(req.body.widgetChannel) .get() .catch((e: DiscordAPIError) => { - if ([400, 404].includes(e.httpStatus)) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -720,7 +720,7 @@ router.post( errors: [ res.__("common.error.bot.arr.fetchError"), `${error.name}: ${error.message}`, - `${error.httpStatus} ${error.method} ${error.path}` + `${error.code} ${error.method} ${error.url}` ] }); }); @@ -1224,7 +1224,7 @@ router.post( .guilds(req.body.widgetServer) .channels.get() .catch((e: DiscordAPIError) => { - if ([400, 404].includes(e.httpStatus)) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -1283,7 +1283,7 @@ router.post( .channels(req.body.widgetChannel) .get() .catch((e: DiscordAPIError) => { - if ([400, 404].includes(e.httpStatus)) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -1662,7 +1662,7 @@ router.post( errors: [ res.__("common.error.bot.arr.fetchError"), `${error.name}: ${error.message}`, - `${error.httpStatus} ${error.method} ${error.path}` + `${error.code} ${error.method} ${error.url}` ] }); }); @@ -2544,7 +2544,7 @@ router.post( .guilds(req.body.widgetServer) .channels.get() .catch((e: DiscordAPIError) => { - if ([400, 404].includes(e.httpStatus)) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -2603,7 +2603,7 @@ router.post( .channels(req.body.widgetChannel) .get() .catch((e: DiscordAPIError) => { - if ([400, 404].includes(e.httpStatus)) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -2970,7 +2970,7 @@ router.post( errors: [ res.__("common.error.bot.arr.fetchError"), `${error.name}: ${error.message}`, - `${error.httpStatus} ${error.method} ${error.path}` + `${error.code} ${error.method} ${error.url}` ] }); }); @@ -4050,7 +4050,7 @@ router.get( errors: [ res.__("common.error.bot.arr.fetchError"), `${error.name}: ${error.message}`, - `${error.httpStatus} ${error.method} ${error.path}` + `${error.code} ${error.method} ${error.url}` ] }); }); diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index 8d58f89a..931606a3 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -186,7 +186,7 @@ router.post( if (fetchChannel) await discord.bot.api.channels(req.body.previewChannel).get() .catch((e: DiscordAPIError) => { - if([400, 404].includes(e.httpStatus)) { + if([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -364,7 +364,7 @@ router.post( return res.status(400).json({ error: true, status: 400, - errors: [`${error.name}: ${error.message}`, `${error.httpStatus} ${error.method} ${error.path}`] + errors: [`${error.name}: ${error.message}`, `${error.code} ${error.method} ${error.url}`] }); }); } @@ -601,7 +601,7 @@ router.post( if (fetchChannel) await discord.bot.api.channels(req.body.previewChannel).get() .catch((e: DiscordAPIError) => { - if([400, 404].includes(e.httpStatus)) { + if([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -792,7 +792,7 @@ router.post( return res.status(400).json({ error: true, status: 400, - errors: [`${error.name}: ${error.message}`, `${error.httpStatus} ${error.method} ${error.path}`] + errors: [`${error.name}: ${error.message}`, `${error.code} ${error.method} ${error.url}`] }); }); } @@ -933,7 +933,7 @@ router.post( embed.setTitle("Reason"); embed.setDescription(req.body.reason); embed.setURL(`${settings.website.url}/servers/${server._id}`); - embed.setFooter("It will still be shown as a normal server, it was declined from being listed as an LGBT community."); + embed.setFooter({ text: "It will still be shown as a normal server, it was declined from being listed as an LGBT community." }); discord.channels.logs.send({ content: `${settings.emoji.cross} **${functions.escapeFormatting( @@ -1339,7 +1339,7 @@ router.get( return res.status(400).render("status", { title: res.__("common.error"), status: 400, - subtitle: `${error.name}: ${error.message} | ${error.httpStatus} ${error.method} ${error.path}`, + subtitle: `${error.name}: ${error.message} | ${error.code} ${error.method} ${error.url}`, req, type: "Error" }); diff --git a/src/Routes/templates.ts b/src/Routes/templates.ts index 720f24d2..bee697b5 100644 --- a/src/Routes/templates.ts +++ b/src/Routes/templates.ts @@ -282,7 +282,7 @@ router.post( return res.status(400).json({ error: true, status: 400, - errors: [`${error.name}: ${error.message}`, `${error.httpStatus} ${error.method} ${error.path}`] + errors: [`${error.name}: ${error.message}`, `${error.code} ${error.method} ${error.url}`] }); }); } @@ -668,7 +668,7 @@ router.post( return res.status(400).json({ error: true, status: 400, - errors: [`${error.name}: ${error.message}`, `${error.httpStatus} ${error.method} ${error.path}`] + errors: [`${error.name}: ${error.message}`, `${error.code} ${error.method} ${error.url}`] }); }); } @@ -973,7 +973,7 @@ router.get( return res.status(400).render("status", { title: res.__("common.error"), status: 400, - subtitle: `${error.name}: ${error.message} | ${error.httpStatus} ${error.method} ${error.path}`, + subtitle: `${error.name}: ${error.message} | ${error.code} ${error.method} ${error.url}`, req, type: "Error" }); diff --git a/src/Routes/users.ts b/src/Routes/users.ts index 6d581628..cea491b6 100644 --- a/src/Routes/users.ts +++ b/src/Routes/users.ts @@ -576,7 +576,7 @@ router.get( return res.status(400).render("status", { title: res.__("common.error"), status: 400, - subtitle: `${error.name}: ${error.message} | ${error.httpStatus} ${error.method} ${error.path}`, + subtitle: `${error.name}: ${error.message} | ${error.code} ${error.method} ${error.url}`, req, type: "Error" }); diff --git a/src/Util/Services/discord.ts b/src/Util/Services/discord.ts index 1752b4bb..975571d3 100644 --- a/src/Util/Services/discord.ts +++ b/src/Util/Services/discord.ts @@ -55,8 +55,7 @@ class Client extends Discord.Client { export const bot = new Client({ allowedMentions: { parse: [] }, - intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_PRESENCES"], - http: { version: 8 } + intents: ["Guilds", "GuildMembers", "GuildPresences"], }); bot.on("guildBanRemove", async (ban) => { From 9c342f8d83c8b3e1d90ea29b14c6eb6391397389 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Mon, 13 Mar 2023 12:48:11 -0400 Subject: [PATCH 18/34] one last change --- .docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker-compose.yml b/.docker-compose.yml index e2f6644b..d19d3c68 100644 --- a/.docker-compose.yml +++ b/.docker-compose.yml @@ -34,7 +34,7 @@ services: restart: always env_file: .env.production ports: - - "8081:8081" + - "127.0.0.1:8081:8081" # Expected to be proxied by something like Nginx networks: - mongo depends_on: From 962b76d45abf2008251f8f305a4d7bd440dff0be Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 17:28:01 -0400 Subject: [PATCH 19/34] Moves to the new 'rest' module/separation sys --- @types/del.d.ts | 2 +- package-lock.json | 12 +-- package.json | 2 +- src/Routes/authentication.ts | 20 +++-- src/Routes/autosync.ts | 13 ++- src/Routes/bots.ts | 60 +++++-------- src/Routes/servers.ts | 143 ++++++++++++++----------------- src/Routes/staff.ts | 8 +- src/Routes/templates.ts | 12 +-- src/Routes/users.ts | 7 +- src/Util/Function/main.ts | 2 +- src/Util/Function/permissions.ts | 8 +- src/Util/Function/rest.ts | 8 ++ src/Util/Services/discord.ts | 7 +- src/Util/Services/featuring.ts | 2 +- 15 files changed, 135 insertions(+), 171 deletions(-) create mode 100644 src/Util/Function/rest.ts diff --git a/@types/del.d.ts b/@types/del.d.ts index bff18183..776fdba8 100644 --- a/@types/del.d.ts +++ b/@types/del.d.ts @@ -17,7 +17,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -import type { UserFlags, APIChannel, APIRole, APIUser, APIApplicationCommand, RESTPostOAuth2AccessTokenResult, OAuth2Scopes, Snowflake } from 'discord-api-types/v10' +import type { UserFlags, APIChannel, APIRole, APIUser, APIApplicationCommand, RESTPostOAuth2AccessTokenResult, OAuth2Scopes, Snowflake } from 'discord.js' declare global { interface authUser extends RESTPostOAuth2AccessTokenResult { diff --git a/package-lock.json b/package-lock.json index a2231e1f..8d62b283 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "v5.5.0-Next", "license": "AGPL-3.0", "dependencies": { + "@discordjs/rest": "^1.6.0", "@sentry/node": "^6.19.2", "@snyk/protect": "^1.984.0", "body-parser": "^1.19.2", @@ -21,7 +22,6 @@ "datadog-metrics": "^0.9.3", "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", - "discord-api-types": "^0.30.0", "discord.js": "v14.8", "ejs": "^3.1.7", "express": "^4.17.3", @@ -1722,11 +1722,6 @@ "node": ">=8" } }, - "node_modules/discord-api-types": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.30.0.tgz", - "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" - }, "node_modules/discord.js": { "version": "14.8.0", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", @@ -6934,11 +6929,6 @@ "path-type": "^4.0.0" } }, - "discord-api-types": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.30.0.tgz", - "integrity": "sha512-wYst0jrT8EJs2tVlwUTQ2xT0oWMjUrRMpFTkNY3NMleWyQNHgWaKhqFfxdLPdC2im9IuR5EsxcEgjhf/npeftw==" - }, "discord.js": { "version": "14.8.0", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", diff --git a/package.json b/package.json index af181d01..f3687e93 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "node": ">=18.15.0" }, "dependencies": { + "@discordjs/rest": "^1.6.0", "@sentry/node": "^6.19.2", "@snyk/protect": "^1.984.0", "body-parser": "^1.19.2", @@ -24,7 +25,6 @@ "datadog-metrics": "^0.9.3", "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", - "discord-api-types": "^0.30.0", "discord.js": "v14.8", "ejs": "^3.1.7", "express": "^4.17.3", diff --git a/src/Routes/authentication.ts b/src/Routes/authentication.ts index 4f0e315b..fbb09852 100644 --- a/src/Routes/authentication.ts +++ b/src/Routes/authentication.ts @@ -24,11 +24,12 @@ import { Strategy } from "passport-discord"; import type { VerifyCallback } from "passport-oauth2" import refresh from "passport-oauth2-refresh" import * as discord from "../Util/Services/discord.js"; -import type { RESTPostOAuth2AccessTokenResult } from "discord-api-types/v10"; -import { OAuth2Scopes } from "discord-api-types/v10" +import type { RESTPostOAuth2AccessTokenResult } from "discord.js"; +import { OAuth2Scopes, Routes } from "discord.js" import type { DiscordAPIError } from "discord.js"; import fetch from "node-fetch"; import * as userCache from "../Util/Services/userCaching.js" +import { rest } from "../Util/Function/rest.js"; import settings from "../../settings.json" assert { type: "json" }; import * as tokenManager from "../Util/Services/adminTokenManager.js"; @@ -43,7 +44,7 @@ const strategy = new Strategy( }, (_accessToken: string, refreshToken: string, params: RESTPostOAuth2AccessTokenResult, profile: Strategy.Profile, done: VerifyCallback) => { process.nextTick(() => { - return done(null, {...profile, refreshToken, ...params}); + return done(null, { ...profile, refreshToken, ...params }); }) } ) @@ -61,7 +62,7 @@ router.use( }) ); -router.get("/login/joinGuild", +router.get("/login/joinGuild", (req, res) => { req.session.joinGuild = true; res.redirect(`/auth/login/callback?scope=${OAuth2Scopes.Identify} ${OAuth2Scopes.GuildsJoin}`); @@ -82,7 +83,7 @@ router.get( .collection("users") .findOne({ _id: req.user.id }); - const { scopes } = await (await fetch("https://discord.com/api/v8/oauth2/@me", {headers: {authorization: `Bearer ${req.user.accessToken}`}})).json() as {scopes: OAuth2Scopes[]} + const { scopes } = await (await fetch("https://discord.com/api/v8/oauth2/@me", { headers: { authorization: `Bearer ${req.user.accessToken}` } })).json() as { scopes: OAuth2Scopes[] } if (!user) { const handleDefault: delUser["staffTracking"]["handledBots"] = { @@ -117,7 +118,7 @@ router.get( auth: { accessToken: req.user.accessToken, refreshToken: req.user.refreshToken, - expires: Date.now() + req.user.expires_in*1000, + expires: Date.now() + req.user.expires_in * 1000, scopes }, name: req.user.username, @@ -194,7 +195,7 @@ router.get( auth: { accessToken: req.user.accessToken, refreshToken: req.user.refreshToken, - expires: Date.now() + req.user.expires_in*1000, + expires: Date.now() + req.user.expires_in * 1000, scopes }, name: req.user.username, @@ -233,8 +234,9 @@ router.get( if (req.session.joinGuild && req.session.joinGuild === true) { req.session.joinGuild = false; - - discord.bot.api.guilds(settings.guild.main).members(req.user.id).put({ data: { access_token: req.user.accessToken } }) + await rest.put(Routes.guildMember(settings.guild.main, req.user.id), { + body: { access_token: req.user.accessToken } + }) .catch((error: DiscordAPIError) => { console.error(error) if (error.code === 403 && !req.user.impersonator) { diff --git a/src/Routes/autosync.ts b/src/Routes/autosync.ts index 81f43b84..68de1561 100644 --- a/src/Routes/autosync.ts +++ b/src/Routes/autosync.ts @@ -27,8 +27,9 @@ import * as templateCache from "../Util/Services/templateCaching.js"; import * as userCache from "../Util/Services/userCaching.js"; import * as functions from "../Util/Function/main.js"; import { EmbedBuilder } from "discord.js"; -import { APIInvite, APITemplate, RESTGetAPIInviteQuery, RESTPostOAuth2AccessTokenResult, APIApplicationCommand, OAuth2Scopes, Routes, APIApplication, APIUser } from "discord-api-types/v10"; +import { APIInvite, APITemplate, RESTGetAPIInviteQuery, RESTPostOAuth2AccessTokenResult, APIApplicationCommand, OAuth2Scopes, Routes, APIApplication, APIUser } from "discord.js"; import settings from "../../settings.json" assert { type: "json" }; +import { rest } from "../Util/Function/rest.js"; const router = express.Router(); @@ -56,8 +57,7 @@ router.get('/bots', async (req, res) => { .findOne({ _id: id }); if (botExists) try { - const app = await discord.bot.api.applications(botExists.clientID || id).rpc.get() as APIApplication - + const app = await rest.get(Routes.applicationCommands(botExists.clientID || id)) as APIApplication let commands: APIApplicationCommand[] = botExists.commands || [] if (botExists.scopes?.slashCommands) { @@ -92,7 +92,7 @@ router.get('/bots', async (req, res) => { let userFlags = 0 if (botExists.scopes?.bot) { - const user = await discord.bot.api.users(id).get().catch(() => { }) as APIUser + const user = await rest.get(Routes.user(id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -136,9 +136,8 @@ router.get('/servers', async (req, res) => { .findOne({ _id: id }); if (server) try { - const invite = await discord.bot.api.invites(server.inviteCode).get({ query: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) as APIInvite + const invite = await rest.get(Routes.invite(server.inviteCode), { body: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) as APIInvite if (invite.guild.id !== server._id) throw 'Invite points to a different server' - if (invite.expires_at) throw 'This invite is set to expire' await global.db.collection("servers").updateOne( @@ -221,7 +220,7 @@ router.get('/templates', async (req, res) => { .findOne({ _id: id }); if (dbTemplate) try { - const template = await discord.bot.api.guilds.templates(id).get() as APITemplate + const template = await rest.get(Routes.template(id)) as APITemplate await global.db.collection("templates").updateOne( { _id: id }, diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index 15161e55..cae6b54f 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -19,9 +19,9 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; -import { APIApplication, APIApplicationCommand, APIUser, PresenceUpdateStatus, RESTPostOAuth2AccessTokenResult, UserFlags } from "discord-api-types/v10"; -import { OAuth2Scopes, RESTJSONErrorCodes, Routes } from "discord-api-types/v10" - +import { APIApplication, APIApplicationCommand, APIUser, PresenceUpdateStatus, RESTPostOAuth2AccessTokenResult, UserFlags } from "discord.js"; +import { OAuth2Scopes, RESTJSONErrorCodes, Routes } from "discord.js" +import { rest } from "../Util/Function/rest.js"; import fetch from "node-fetch"; import * as crypto from "crypto"; import * as Discord from "discord.js"; @@ -165,7 +165,7 @@ router.post( errors.push(res.__("common.error.bot.arr.clientIDTooLong")); } - await discord.bot.api.users(req.body.clientID).get() + await rest.get(Routes.user(req.body.clientID)) .then(() => { error = true; errors.push(res.__("common.error.bot.arr.clientIDIsUser")); @@ -276,9 +276,7 @@ router.post( } if (fetchServer) - await discord.bot.api - .guilds(req.body.widgetServer) - .channels.get() + await rest.get(Routes.guildChannels(req.body.widgetServer)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -335,9 +333,7 @@ router.post( } if (fetchChannel) - await discord.bot.api - .channels(req.body.widgetChannel) - .get() + await rest.get(Routes.channel(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -515,7 +511,7 @@ router.post( let userFlags = 0 if (req.body.bot) { - const user = await discord.bot.api.users(req.body.id).get().catch(() => { }) as APIUser + const user = await rest.get(Routes.user(req.body.id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -526,9 +522,7 @@ router.post( errors: errors }); - discord.bot.api - .applications(req.body.clientID || req.body.id).rpc - .get() + await rest.get(Routes.user(req.body.clientID || req.body.id)) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -1074,7 +1068,7 @@ router.post( errors.push(res.__("common.error.bot.arr.clientIDTooLong")); } if (req.body.clientID !== req.params.id) - await discord.bot.api.users(req.body.clientID).get() + await rest.get(Routes.user(req.body.clientID)) .then(() => { error = true; errors.push( @@ -1220,9 +1214,7 @@ router.post( } if (fetchServer) - await discord.bot.api - .guilds(req.body.widgetServer) - .channels.get() + await rest.get(Routes.guildChannels(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -1279,9 +1271,7 @@ router.post( } if (fetchChannel) - await discord.bot.api - .channels(req.body.widgetChannel) - .get() + await rest.get(Routes.channel(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -1462,7 +1452,7 @@ router.post( let userFlags = 0 if (req.body.bot) { - const user = await discord.bot.api.users(bot._id).get().catch(() => { }) as APIUser + const user = await rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -1478,9 +1468,7 @@ router.post( }); } - discord.bot.api - .applications(req.body.clientID || req.params.id).rpc - .get() + await rest.get(Routes.user(req.body.clientID || req.params.id)) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -2393,7 +2381,7 @@ router.post( } if (req.body.clientID !== req.params.id) - await discord.bot.api.users(req.body.clientID).get() + await rest.get(Routes.user(req.body.clientID)) .then(() => { error = true errors.push(res.__("common.error.bot.arr.clientIDIsUser")); @@ -2540,9 +2528,7 @@ router.post( } if (fetchServer) - await discord.bot.api - .guilds(req.body.widgetServer) - .channels.get() + await rest.get(Routes.guildChannels(req.body.widgetServer)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -2599,9 +2585,7 @@ router.post( } if (fetchChannel) - await discord.bot.api - .channels(req.body.widgetChannel) - .get() + await rest.get(Routes.channel(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -2777,7 +2761,7 @@ router.post( let userFlags = 0 if (req.body.bot) { - const user = await discord.bot.api.users(bot._id).get().catch(() => { }) as APIUser + const user = await rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -2788,9 +2772,7 @@ router.post( errors: errors }); - discord.bot.api - .applications(req.body.clientID || req.params.id).rpc - .get() + await rest.get(Routes.user(req.body.clientID || req.params.id)) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -3979,13 +3961,11 @@ router.get( let userFlags = 0 if (bot.scopes?.bot) { - const user = await discord.bot.api.users(bot._id).get().catch(() => { }) as APIUser + const user = await rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } - discord.bot.api - .applications(botExists.clientID || req.params.id).rpc - .get() + await rest.get(Routes.user(botExists.clientID || req.params.id)) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index 931606a3..c878e74a 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -20,9 +20,8 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; import { Response as fetchRes } from "node-fetch"; -import type { APIInvite, RESTGetAPIInviteQuery } from "discord-api-types/v10"; -import { RESTJSONErrorCodes } from "discord-api-types/v10" - +import type { APIInvite, RESTGetAPIInviteQuery } from "discord.js"; +import { RESTJSONErrorCodes, Routes } from "discord.js" import fetch from "node-fetch"; import type { DiscordAPIError } from "discord.js"; import sanitizeHtml from "sanitize-html"; @@ -38,7 +37,7 @@ import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; import { EmbedBuilder } from "discord.js"; import type { serverReasons } from "../../@types/enums.js"; - +import { rest } from "../Util/Function/rest.js"; import mdi from "markdown-it"; import entities from "html-entities"; import { ParamsDictionary } from "express-serve-static-core"; @@ -122,22 +121,22 @@ router.post( error = true errors.push(res.__("common.error.listing.arr.invite.invalid")) } - - if(req.body.invite.length > 2000) { + + if (req.body.invite.length > 2000) { error = true errors.push(res.__("common.error.listing.arr.invite.tooLong")) } - - if(functions.isURL(req.body.invite)) { + + if (functions.isURL(req.body.invite)) { error = true errors.push(res.__("common.error.listing.arr.invite.isURL")) } - if(req.body.invite.includes("discord.gg")) { + if (req.body.invite.includes("discord.gg")) { error = true errors.push(res.__("common.error.server.arr.invite.dgg")) } - + if (req.body.website && !functions.isURL(req.body.website)) { error = true; errors.push( @@ -184,9 +183,9 @@ router.post( } if (fetchChannel) - await discord.bot.api.channels(req.body.previewChannel).get() + await rest.get(Routes.channel(req.body.previewChannel)) .catch((e: DiscordAPIError) => { - if([400, 404].includes(Number(e.code))) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -198,13 +197,13 @@ router.post( }) if (fetchChannel) - await fetch(`https://stonks.widgetbot.io/api/graphql`, { - method: 'post', - body: JSON.stringify({ - query: `{channel(id:"${req.body.previewChannel}"){id}}` - }), - headers: { 'Content-Type': 'application/json' }, - }).then(async (fetchRes: fetchRes) => { + await fetch(`https://stonks.widgetbot.io/api/graphql`, { + method: 'post', + body: JSON.stringify({ + query: `{channel(id:"${req.body.previewChannel}"){id}}` + }), + headers: { 'Content-Type': 'application/json' }, + }).then(async (fetchRes: fetchRes) => { const data: any = await fetchRes.json(); if (!data.channel?.id) { error = true; @@ -243,13 +242,16 @@ router.post( errors: errors }); - discord.bot.api.invites(req.body.invite).get({query: {with_counts: true, with_expiration: true} as RESTGetAPIInviteQuery}) + await rest.get(Routes.invite(req.body.invite), { + body: + { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery + }) .then(async (invite: APIInvite) => { const serverExists: | delServer | undefined = await global.db - .collection("servers") - .findOne({ _id: invite.guild.id }); + .collection("servers") + .findOne({ _id: invite.guild.id }); if (serverExists) return res.status(409).json({ error: true, @@ -296,12 +298,10 @@ router.post( discord.channels.logs.send( `${settings.emoji.add} **${functions.escapeFormatting( req.user.db.fullUsername - )}** \`(${ - req.user.id + )}** \`(${req.user.id })\` added server **${functions.escapeFormatting( invite.guild.name - )}** \`(${invite.guild.id})\`\n<${ - settings.website.url + )}** \`(${invite.guild.id})\`\n<${settings.website.url }/servers/${invite.guild.id}>` ); @@ -354,7 +354,7 @@ router.post( }); }) .catch((error: DiscordAPIError) => { - if(error.code === RESTJSONErrorCodes.UnknownInvite) + if (error.code === RESTJSONErrorCodes.UnknownInvite) return res.status(400).json({ error: true, status: 400, @@ -432,7 +432,7 @@ router.get( permission.auth, async (req, res) => { res.send(String(await global.redis?.hexists("servers", req.params.id))) -}) + }) router.get( "/:id/src", @@ -599,9 +599,9 @@ router.post( } if (fetchChannel) - await discord.bot.api.channels(req.body.previewChannel).get() + await rest.get(Routes.channel(req.body.previewChannel)) .catch((e: DiscordAPIError) => { - if([400, 404].includes(Number(e.code))) { + if ([400, 404].includes(Number(e.code))) { error = true; errors.push( res.__( @@ -646,7 +646,7 @@ router.post( error = true; errors.push(res.__("common.error.listing.arr.longDescRequired")); } - + let tags: string[] = tagHandler(req, server); if (error === true) @@ -656,7 +656,7 @@ router.post( errors: errors }); - discord.bot.api.invites(req.body.invite).get({query: {with_counts: true, with_expiration: true} as RESTGetAPIInviteQuery}) + await rest.get(Routes.invite(req.body.invite), { body: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).json({ @@ -705,12 +705,10 @@ router.post( discord.channels.logs.send( `${settings.emoji.edit} **${functions.escapeFormatting( req.user.db.fullUsername - )}** \`(${ - req.user.id + )}** \`(${req.user.id })\` edited server **${functions.escapeFormatting( invite.guild.name - )}** \`(${invite.guild.id})\`\n<${ - settings.website.url + )}** \`(${invite.guild.id})\`\n<${settings.website.url }/servers/${invite.guild.id}>` ); @@ -782,7 +780,7 @@ router.post( }); }) .catch((error: DiscordAPIError) => { - if(error.code === RESTJSONErrorCodes.UnknownInvite) + if (error.code === RESTJSONErrorCodes.UnknownInvite) return res.status(400).json({ error: true, status: 400, @@ -914,7 +912,7 @@ router.post( } } ); - + const type = serverType(req.body.type); await global.db.collection("audit").insertOne({ @@ -938,13 +936,11 @@ router.post( discord.channels.logs.send({ content: `${settings.emoji.cross} **${functions.escapeFormatting( req.user.db.fullUsername - )}** \`(${ - req.user.id - })\` declined server **${functions.escapeFormatting( - server.name - )}** \`(${ - server._id - })\``, + )}** \`(${req.user.id + })\` declined server **${functions.escapeFormatting( + server.name + )}** \`(${server._id + })\``, embeds: [embed] }); @@ -952,14 +948,11 @@ router.post( if (owner) owner .send( - `${ - settings.emoji.cross + `${settings.emoji.cross } **|** Your server **${functions.escapeFormatting( server.name - )}** \`(${ - server._id - })\` was declined from being listed as an LGBT community. It will still appear as a normal server.\n**Reason:** \`${ - req.body.reason || "None specified." + )}** \`(${server._id + })\` was declined from being listed as an LGBT community. It will still appear as a normal server.\n**Reason:** \`${req.body.reason || "None specified." }\`` ) .catch((e) => { @@ -1030,16 +1023,14 @@ router.get( await serverCache.updateServer(req.params.id); discord.channels.logs.send( - `${settings.emoji.check} **${functions.escapeFormatting( - req.user.db.fullUsername - )}** \`(${ - req.user.id - })\` approved server **${functions.escapeFormatting( - server.name - )}** \`(${server._id})\` to be listed as an LGBT community.\n<${ - settings.website.url - }/servers/${server._id}>` - ) + `${settings.emoji.check} **${functions.escapeFormatting( + req.user.db.fullUsername + )}** \`(${req.user.id + })\` approved server **${functions.escapeFormatting( + server.name + )}** \`(${server._id})\` to be listed as an LGBT community.\n<${settings.website.url + }/servers/${server._id}>` + ) .catch((e) => { console.error(e); }); @@ -1048,12 +1039,10 @@ router.get( if (owner) owner .send( - `${ - settings.emoji.check + `${settings.emoji.check } **|** Your server **${functions.escapeFormatting( server.name - )}** \`(${ - server._id + )}** \`(${server._id })\` was approved as being listed as an LGBT community.` ) .catch((e) => { @@ -1094,8 +1083,7 @@ router.get( discord.channels.logs.send( `${settings.emoji.delete} **${functions.escapeFormatting( req.user.db.fullUsername - )}** \`(${ - req.user.id + )}** \`(${req.user.id })\` deleted server **${functions.escapeFormatting( server.name )}** \`(${server._id})\`` @@ -1183,7 +1171,7 @@ router.post( } await global.db.collection("servers").deleteOne({ _id: req.params.id }); - + const type = serverType(req.body.type); await global.db.collection("audit").insertOne({ @@ -1205,11 +1193,10 @@ router.post( discord.channels.logs.send({ content: `${settings.emoji.delete} **${functions.escapeFormatting( req.user.db.fullUsername - )}** \`(${ - req.user.id - })\` removed server **${functions.escapeFormatting( - server.name - )}** \`(${server._id})\``, + )}** \`(${req.user.id + })\` removed server **${functions.escapeFormatting( + server.name + )}** \`(${server._id})\``, embeds: [embed] }); @@ -1217,12 +1204,10 @@ router.post( if (owner) owner .send( - `${ - settings.emoji.delete + `${settings.emoji.delete } **|** Your server **${functions.escapeFormatting( server.name - )}** \`(${server._id})\` has been removed!\n**Reason:** \`${ - req.body.reason || "None specified." + )}** \`(${server._id})\` has been removed!\n**Reason:** \`${req.body.reason || "None specified." }\`` ) .catch((e: string) => { @@ -1253,7 +1238,7 @@ router.get( req: req }); - discord.bot.api.invites(server.inviteCode).get({query: {with_counts: true, with_expiration: true} as RESTGetAPIInviteQuery}) + await rest.get(Routes.invite(server.inviteCode), { body: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).render("status", { @@ -1327,7 +1312,7 @@ router.get( res.redirect(`/servers/${req.params.id}`); }) .catch((error: DiscordAPIError) => { - if(error.code === RESTJSONErrorCodes.UnknownInvite) + if (error.code === RESTJSONErrorCodes.UnknownInvite) return res.status(400).render("status", { title: res.__("common.error"), status: 400, diff --git a/src/Routes/staff.ts b/src/Routes/staff.ts index 6bcdfacc..fedbaad9 100644 --- a/src/Routes/staff.ts +++ b/src/Routes/staff.ts @@ -19,8 +19,8 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; -import type { APIUser, Snowflake } from "discord-api-types/v10"; - +import type { APIUser, Snowflake } from "discord.js"; +import { Routes } from "discord.js" import settings from "../../settings.json" assert { type: "json" }; import * as permission from "../Util/Function/permissions.js"; import * as functions from "../Util/Function/main.js"; @@ -32,7 +32,7 @@ import * as announcementCache from "../Util/Services/announcementCaching.js"; import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; import * as discord from "../Util/Services/discord.js"; - +import { rest } from "../Util/Function/rest.js"; const router = express.Router(); router.get( @@ -927,7 +927,7 @@ router.get( .collection("users") .findOne({ _id: req.params.id }); - discord.bot.api.users(req.params.id).get() + await rest.get(Routes.user(req.params.id)) .then(async (discordUser: APIUser) => { if (!user) { await global.db.collection("users").insertOne({ diff --git a/src/Routes/templates.ts b/src/Routes/templates.ts index bee697b5..80fc40a0 100644 --- a/src/Routes/templates.ts +++ b/src/Routes/templates.ts @@ -31,11 +31,11 @@ import * as userCache from "../Util/Services/userCaching.js"; import * as templateCache from "../Util/Services/templateCaching.js"; import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; -import type { APITemplate } from "discord-api-types/v10"; +import type { APITemplate } from "discord.js"; import type { DiscordAPIError } from "discord.js"; -import { EmbedBuilder } from "discord.js"; +import { EmbedBuilder, Routes } from "discord.js"; import type { templateReasons } from "../../@types/enums.js"; - +import { rest } from "../Util/Function/rest.js"; import mdi from "markdown-it"; import entities from "html-entities"; const md = new mdi @@ -155,7 +155,7 @@ router.post( errors: errors }); - discord.bot.api.guilds.templates(req.body.code).get() + await rest.get(Routes.template(req.body.code)) .then(async (template: APITemplate) => { await global.db.collection("templates").insertOne({ _id: template.code, @@ -523,7 +523,7 @@ router.post( errors: errors }); - discord.bot.api.guilds.templates(req.body.code).get() + await rest.get(Routes.template(req.body.code)) .then(async (template: APITemplate) => { await global.db.collection("templates").updateOne( { _id: req.params.id }, @@ -868,7 +868,7 @@ router.get( type: "Error" }); - await discord.bot.api.guilds.templates(req.params.id).get() + await rest.get(Routes.template(req.params.id)) .then(async (template: APITemplate) => { await global.db.collection("templates").updateOne( { _id: req.params.id }, diff --git a/src/Routes/users.ts b/src/Routes/users.ts index cea491b6..c189ebda 100644 --- a/src/Routes/users.ts +++ b/src/Routes/users.ts @@ -19,8 +19,9 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; -import type { APIUser } from "discord-api-types/v10"; - +import type { APIUser } from "discord.js"; +import { Routes } from "discord.js"; +import { rest } from "../Util/Function/rest.js"; import * as discord from "../Util/Services/discord.js"; import * as banned from "../Util/Services/banned.js"; import { variables } from "../Util/Function/variables.js"; @@ -529,7 +530,7 @@ router.get( req: req }); - discord.bot.api.users(req.params.id).get() + await rest.get(Routes.user(req.params.id)) .then(async (user: APIUser) => { await global.db.collection("users").updateOne( { _id: req.params.id }, diff --git a/src/Util/Function/main.ts b/src/Util/Function/main.ts index 5ed3a799..2f46c60e 100644 --- a/src/Util/Function/main.ts +++ b/src/Util/Function/main.ts @@ -20,7 +20,7 @@ along with this program. If not, see . import * as botCache from "../Services/botCaching.js"; import * as userCache from "../Services/userCaching.js"; import { URL } from "url"; -import { OAuth2Scopes } from "discord-api-types/v10"; +import { OAuth2Scopes } from "discord.js"; export const escapeFormatting = (text: string) => { const unescaped = text.replace(/\\(\*|_|`|~|\\)/g, "$1"); const escaped = unescaped.replace(/(\*|_|`|~|\\)/g, "\\$1"); diff --git a/src/Util/Function/permissions.ts b/src/Util/Function/permissions.ts index 83f56542..d75ef77e 100644 --- a/src/Util/Function/permissions.ts +++ b/src/Util/Function/permissions.ts @@ -17,11 +17,11 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -import { OAuth2Scopes } from "discord-api-types/v10"; +import { OAuth2Scopes, Routes } from "discord.js"; import { Request, Response } from "express"; import settings from "../../../settings.json" assert { type: "json" }; import * as discord from "../Services/discord.js"; - +import { rest } from "./rest.js"; export const auth = (req: Request, res: Response, next: () => void) => { if (req.session.logoutJustCont === true) { req.session.logoutJust = false; @@ -60,8 +60,8 @@ export const member = async (req: Request, res: Response, next: () => void) => { } if (!await discord.getMember(req.body.id)) { - discord.bot.api.guilds(settings.guild.main).members(req.user.id).put({ data: { access_token: req.user.db.auth.accessToken } }) - .catch(() => {}); + await rest.get(Routes.guildMembers(settings.guild.main), { body: { access_token: req.user.db.auth.accessToken } }) + .catch(() => { }); } next(); diff --git a/src/Util/Function/rest.ts b/src/Util/Function/rest.ts new file mode 100644 index 00000000..4ca94cf8 --- /dev/null +++ b/src/Util/Function/rest.ts @@ -0,0 +1,8 @@ + +import { REST } from '@discordjs/rest'; +import settings from "../../../settings.json" assert { type: "json" }; + +// Create rest client +export const rest = new REST({version: '10'}).setToken(settings.secrets.discord.token) + +// Custom exportable functions below (if any) \ No newline at end of file diff --git a/src/Util/Services/discord.ts b/src/Util/Services/discord.ts index 975571d3..5f585ee9 100644 --- a/src/Util/Services/discord.ts +++ b/src/Util/Services/discord.ts @@ -22,7 +22,7 @@ import metrics from "datadog-metrics"; import settings from "../../../settings.json" assert { type: "json" }; import moment from "moment"; -import { PresenceUpdateStatus } from "discord-api-types/v10"; +import { PresenceUpdateStatus } from "discord.js"; import * as botCache from "./botCaching.js"; import { hostname } from "os"; @@ -38,9 +38,8 @@ setInterval(async () => { await postTodaysGrowth(); }, 8.568e+7); // 23.8h, to account for eventual time drift if the site is online for a while (which is the goal lol) - AJ -// @ts-expect-error class Client extends Discord.Client { - readonly api: { + /* readonly rest: { applications: any; channels: any; gateway: any; @@ -50,7 +49,7 @@ class Client extends Discord.Client { users: any; voice: any; webhooks: any; - } + } */ } export const bot = new Client({ diff --git a/src/Util/Services/featuring.ts b/src/Util/Services/featuring.ts index ee8a1aea..a7067788 100644 --- a/src/Util/Services/featuring.ts +++ b/src/Util/Services/featuring.ts @@ -17,7 +17,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -import { PresenceUpdateStatus, UserFlags } from "discord-api-types/v10"; +import { PresenceUpdateStatus, UserFlags } from "discord.js"; import * as functions from "../Function/main.js"; export async function getFeaturedBots(): Promise { From fb99c95b7fa2097e24ee26aa3b0ee001148ec401 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 17:36:08 -0400 Subject: [PATCH 20/34] might bc giving incorrect counts bc of this --- src/Util/Services/discord.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/Services/discord.ts b/src/Util/Services/discord.ts index 5f585ee9..c12df22a 100644 --- a/src/Util/Services/discord.ts +++ b/src/Util/Services/discord.ts @@ -83,7 +83,7 @@ bot.on("ready", async () => { bots.forEach(async bot => { if (guilds.main.members.cache.has(bot._id)) botsToFetch.push(bot._id) }); - await guilds.main.members.fetch({ user: botsToFetch }) + guilds.main.members.fetch({ user: botsToFetch }) .then(x => console.log(`Retrieved ${x.size} members!`)) .catch(() => null); // It is most likely that DEL has another instance running to handle this, so catch the error and ignore. }); From c6848345f4c6f26b8e9678a0f6e4108e29bd897d Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 19:26:05 -0400 Subject: [PATCH 21/34] Use direct URL instead of half working way --- src/Routes/bots.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index cae6b54f..c73ccd67 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -49,7 +49,7 @@ import entities from "html-entities"; const md = new mdi const router = express.Router(); -const DAPI = "https://discord.com/api/v8"; +const DAPI = "https://discord.com/api/v10"; function botType(bodyType: string): number { let type: botReasons = parseInt(bodyType); @@ -503,7 +503,6 @@ router.post( } }) } - const receivedCommands = await (await fetch(DAPI + Routes.applicationCommands(req.body.id), { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json().catch(() => { }) as APIApplicationCommand[] if (Array.isArray(receivedCommands)) commands = receivedCommands; } @@ -522,8 +521,9 @@ router.post( errors: errors }); - await rest.get(Routes.user(req.body.clientID || req.body.id)) + (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { + console.log(app) if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ error: true, @@ -1468,7 +1468,8 @@ router.post( }); } - await rest.get(Routes.user(req.body.clientID || req.params.id)) + + (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -2772,7 +2773,8 @@ router.post( errors: errors }); - await rest.get(Routes.user(req.body.clientID || req.params.id)) + + (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -3965,7 +3967,8 @@ router.get( if (user.public_flags) userFlags = user.public_flags } - await rest.get(Routes.user(botExists.clientID || req.params.id)) + + (await fetch(DAPI + `/oauth2/applications/${botExists.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ From 96817d67c729409be97139764e76bd2433eed1c4 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 19:30:54 -0400 Subject: [PATCH 22/34] so that's why it was never sending alerts --- src/Routes/autosync.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Routes/autosync.ts b/src/Routes/autosync.ts index 68de1561..53343d7a 100644 --- a/src/Routes/autosync.ts +++ b/src/Routes/autosync.ts @@ -84,7 +84,7 @@ router.get('/bots', async (req, res) => { }) } - const receivedCommands = await (await fetch('https://discord.com/api/v8' + Routes.applicationCommands(app.id), { headers: { authorization: `Bearer ${owner.auth.accessToken}` } })).json().catch(() => { }) as APIApplicationCommand[] + const receivedCommands = await (await fetch('https://discord.com/api/v10' + Routes.applicationCommands(app.id), { headers: { authorization: `Bearer ${owner.auth.accessToken}` } })).json().catch(() => { }) as APIApplicationCommand[] if (Array.isArray(receivedCommands)) commands = receivedCommands; } } @@ -177,7 +177,7 @@ router.get('/servers', async (req, res) => { embed.setTitle("Reason"); embed.setDescription(req.body.reason); - discord.channels.logs.send({ + discord.channels.alerts.send({ content: `${settings.emoji.delete} **AutoSync System** removed server **${functions.escapeFormatting( server.name )}** \`(${server._id})\``, @@ -198,8 +198,6 @@ router.get('/servers', async (req, res) => { }); await discord.postWebMetric("server"); - // keeping this here incase the team wants it - // discord.channels.alerts.send(`${settings.emoji.warn} failed to autosync server **${server.name}** \`(${id})\`: ${e}\n<${settings.website.url}/servers/${id}>`) } await global.redis?.hset("autosync", "nextServer", getNext(ids, id)) @@ -277,7 +275,7 @@ router.get('/templates', async (req, res) => { embed.setTitle("Reason"); embed.setDescription(req.body.reason); - discord.channels.logs.send({ + discord.channels.alerts.send({ content: `${settings.emoji.delete} **AutoSync System** removed template **${functions.escapeFormatting( dbTemplate.name )}** \`(${id})\``, @@ -299,8 +297,6 @@ router.get('/templates', async (req, res) => { }); await discord.postWebMetric("template"); - // keeping the below just in-case the team wants it still. - // discord.channels.alerts.send(`${settings.emoji.warn} failed to autosync template **${dbTemplate.name}** \`(${id})\`: ${e}\n<${settings.website.url}/templates/${id}>`) } await global.redis?.hset("autosync", "nextTemplate", getNext(ids, id)) From 095b7d6aee1f467ae1948fe7f2a01968ef33a50c Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 19:48:32 -0400 Subject: [PATCH 23/34] fixes manual sync failing if only _id --- src/Routes/bots.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index c73ccd67..7a1a3c74 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -3968,8 +3968,9 @@ router.get( } - (await fetch(DAPI + `/oauth2/applications/${botExists.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() + (await fetch(DAPI + `/oauth2/applications/${botExists.clientID || botExists._id || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { + console.log(app) if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ error: true, @@ -4020,6 +4021,7 @@ router.get( await botCache.updateBot(req.params.id); }) .catch((error: DiscordAPIError) => { + console.log(error) if (error.code === RESTJSONErrorCodes.UnknownApplication) return res.status(400).json({ error: true, From 56ce4b8f41bcedf1e2cf9fb6c54ad02a2cb0c25f Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 19:51:02 -0400 Subject: [PATCH 24/34] didn't mean to keep those logs in lol --- src/Routes/bots.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index 7a1a3c74..140037d6 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -523,7 +523,6 @@ router.post( (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { - console.log(app) if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ error: true, @@ -3970,7 +3969,6 @@ router.get( (await fetch(DAPI + `/oauth2/applications/${botExists.clientID || botExists._id || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() .then(async (app: APIApplication) => { - console.log(app) if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ error: true, @@ -4021,7 +4019,6 @@ router.get( await botCache.updateBot(req.params.id); }) .catch((error: DiscordAPIError) => { - console.log(error) if (error.code === RESTJSONErrorCodes.UnknownApplication) return res.status(400).json({ error: true, From 0d4dce4ff0db8110175f31ed0bc82411666e7bc6 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 19:52:44 -0400 Subject: [PATCH 25/34] remove ??? logs --- src/Routes/search.ts | 1 - src/Util/Function/permissions.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Routes/search.ts b/src/Routes/search.ts index 6c30698a..b72a3c6d 100644 --- a/src/Routes/search.ts +++ b/src/Routes/search.ts @@ -57,7 +57,6 @@ router.post("/", variables, async (req: Request, res: Response) => { status: 400, message: "Missing body parameter 'query'" }); - console.log(only) const originalQuery = query; query = query.toLowerCase(); let isStaff = false; diff --git a/src/Util/Function/permissions.ts b/src/Util/Function/permissions.ts index d75ef77e..ecca1a7c 100644 --- a/src/Util/Function/permissions.ts +++ b/src/Util/Function/permissions.ts @@ -40,7 +40,6 @@ export const scopes = (scopes: OAuth2Scopes[]) => (req: Request, res: Response, if (req.session.logoutJustCont === true) { req.session.logoutJust = false; req.session.logoutJustCont = false; - console.log('logoutJustCont') return res.redirect("/"); } From 43ed1fa9c4e7f2fa3e25148bd638204b516c6bdf Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 20:37:19 -0400 Subject: [PATCH 26/34] for some reason this didn't parse right --- src/Routes/autosync.ts | 4 ++-- src/Routes/servers.ts | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Routes/autosync.ts b/src/Routes/autosync.ts index 53343d7a..064a90c5 100644 --- a/src/Routes/autosync.ts +++ b/src/Routes/autosync.ts @@ -30,7 +30,7 @@ import { EmbedBuilder } from "discord.js"; import { APIInvite, APITemplate, RESTGetAPIInviteQuery, RESTPostOAuth2AccessTokenResult, APIApplicationCommand, OAuth2Scopes, Routes, APIApplication, APIUser } from "discord.js"; import settings from "../../settings.json" assert { type: "json" }; import { rest } from "../Util/Function/rest.js"; - +const DAPI = "https://discord.com/api/v10"; const router = express.Router(); const getNext = (arr: string[], id: string) => { @@ -136,7 +136,7 @@ router.get('/servers', async (req, res) => { .findOne({ _id: id }); if (server) try { - const invite = await rest.get(Routes.invite(server.inviteCode), { body: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) as APIInvite + const invite = await (await fetch(DAPI + `/invites/${server.inviteCode}?with_counts=true&with_expiration=true`)).json() as APIInvite if (invite.guild.id !== server._id) throw 'Invite points to a different server' if (invite.expires_at) throw 'This invite is set to expire' diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index c878e74a..fbc7c9d1 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -20,7 +20,7 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; import { Response as fetchRes } from "node-fetch"; -import type { APIInvite, RESTGetAPIInviteQuery } from "discord.js"; +import type { APIInvite, RequestData, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from "discord.js"; import { RESTJSONErrorCodes, Routes } from "discord.js" import fetch from "node-fetch"; import type { DiscordAPIError } from "discord.js"; @@ -42,6 +42,7 @@ import mdi from "markdown-it"; import entities from "html-entities"; import { ParamsDictionary } from "express-serve-static-core"; import { ParsedQs } from "qs"; +const DAPI = "https://discord.com/api/v10"; const md = new mdi const router = express.Router(); let reviewRequired = false; // Needs to be outside of the functions or it cannot be referenced outside of x function - AJ @@ -242,11 +243,9 @@ router.post( errors: errors }); - await rest.get(Routes.invite(req.body.invite), { - body: - { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery - }) + (await fetch(DAPI + `/invites/${req.body.invite}?with_counts=true&with_expiration=true`)).json() .then(async (invite: APIInvite) => { + console.log(invite) const serverExists: | delServer | undefined = await global.db @@ -656,7 +655,7 @@ router.post( errors: errors }); - await rest.get(Routes.invite(req.body.invite), { body: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) + (await fetch(DAPI + `/invites/${req.body.invite}?with_counts=true&with_expiration=true`)).json() .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).json({ @@ -1238,7 +1237,7 @@ router.get( req: req }); - await rest.get(Routes.invite(server.inviteCode), { body: { with_counts: true, with_expiration: true } as RESTGetAPIInviteQuery }) + (await fetch(DAPI + `/invites/${req.body.invite}?with_counts=true&with_expiration=true`)).json() .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).render("status", { From 3c85ec4a2e5b34f0620b7ae7bbbd4eff380ec598 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 20:43:09 -0400 Subject: [PATCH 27/34] im a fool --- src/Routes/servers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index fbc7c9d1..75578f7f 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -1237,7 +1237,7 @@ router.get( req: req }); - (await fetch(DAPI + `/invites/${req.body.invite}?with_counts=true&with_expiration=true`)).json() + (await fetch(DAPI + `/invites/${server.inviteCode}?with_counts=true&with_expiration=true`)).json() .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).render("status", { From 62f7ce2453d4c0dae7e8a6fb5d0c4c6bce9c996e Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Wed, 15 Mar 2023 20:50:50 -0400 Subject: [PATCH 28/34] Use proper enums --- src/Util/Services/discord.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Util/Services/discord.ts b/src/Util/Services/discord.ts index c12df22a..690f5f3b 100644 --- a/src/Util/Services/discord.ts +++ b/src/Util/Services/discord.ts @@ -22,7 +22,7 @@ import metrics from "datadog-metrics"; import settings from "../../../settings.json" assert { type: "json" }; import moment from "moment"; -import { PresenceUpdateStatus } from "discord.js"; +import { PresenceUpdateStatus, GatewayIntentBits } from "discord.js"; import * as botCache from "./botCaching.js"; import { hostname } from "os"; @@ -54,7 +54,7 @@ class Client extends Discord.Client { export const bot = new Client({ allowedMentions: { parse: [] }, - intents: ["Guilds", "GuildMembers", "GuildPresences"], + intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences], }); bot.on("guildBanRemove", async (ban) => { From ba01f4be4ac5c195570c681c8a74ce3d88816013 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Thu, 16 Mar 2023 12:52:24 -0400 Subject: [PATCH 29/34] Ensure values *are* cached --- src/app.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index e89e62f1..ddbf5569 100644 --- a/src/app.ts +++ b/src/app.ts @@ -30,6 +30,10 @@ import passport from "passport"; import logger from "morgan"; import * as libCache from "./Util/Services/libCaching.js"; +import { uploadBots } from "./Util/Services/botCaching.js"; +import { uploadServers } from "./Util/Services/serverCaching.js"; +import { uploadTemplates } from "./Util/Services/templateCaching.js"; +/*Not uploading users, as that isn't a publicly searchable function, and they are re-set/cached on login/auth, if need be - AJ*/ import * as announcementCache from "./Util/Services/announcementCaching.js"; import * as featuredCache from "./Util/Services/featuring.js"; import * as ddosMode from "./Util/Services/ddosMode.js"; @@ -172,7 +176,7 @@ new Promise((resolve, reject) => { const s = new Redis(redisConfig); /*There is no point in flushing the DEL redis database, it's persistent as is, and will lead to problems. - Ice*/ - + /*Ref #1 - While ice is totally right, we also aren't caching things at all unless it's being added, which means god forbid it get cleared, or flushed somehow, it doesn't work, which explains some issues - AJ*/ console.log("Attempting to acquire caching lock..."); const lock = await global.redis.get("cache_lock"); if (lock && lock != hostname()) { // We have a lock, but it is not held for us. @@ -211,6 +215,10 @@ new Promise((resolve, reject) => { console.log("Also acquired the discord lock!"); await global.redis.setex("cache_lock", 300, hostname()); console.time("Redis"); + /*Relates to Ref #1 above, we weren't caching servers, bots, or templates on startup, and these were never called. Meaning some queries are failing (from what debugging results in anyway) - AJ*/ + await uploadBots() + await uploadServers() // may perhaps be a bit intensive, but with a set of 15000 randomly generated entries, it didn't take too terribly long ~1ms, especially if results already exist and reply with 0 (or string for hmset) + await uploadTemplates() await libCache.cacheLibs(); await announcementCache.updateCache(); await featuredCache.updateFeaturedServers(); From c9279206190df02d1b376352a9efbe554386561e Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Thu, 16 Mar 2023 13:30:11 -0400 Subject: [PATCH 30/34] Should fix pagination being broken --- src/Routes/index.ts | 7 ++++--- views/templates/search.ejs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Routes/index.ts b/src/Routes/index.ts index f381ed4a..58d5c08d 100644 --- a/src/Routes/index.ts +++ b/src/Routes/index.ts @@ -236,8 +236,9 @@ router.get("/servers", variables, async (req: Request, res: Response) => { res.locals.premidPageInfo = res.__("premid.servers"); if (!req.query.page) req.query.page = "1"; - - const servers = (await serverCache.getAllServers()).slice( + // Can't calculate total pages with sliced value - AJ + const allServers = await serverCache.getAllServers() + const servers = [...allServers].slice( 15 * Number(req.query.page) - 15, 15 * Number(req.query.page) ).filter( @@ -251,7 +252,7 @@ router.get("/servers", variables, async (req: Request, res: Response) => { servers, serversPgArr: servers, page: req.query.page, - pages: Math.ceil(servers.length / 15) + pages: Math.ceil(allServers.length / 15) }); }); diff --git a/views/templates/search.ejs b/views/templates/search.ejs index 5d748850..fc91a8f0 100644 --- a/views/templates/search.ejs +++ b/views/templates/search.ejs @@ -94,7 +94,7 @@ const input = document.querySelector("input.input.is-rounded.is-dark#searchInput"); - if (input.value.match(/gay(\s+)?(men\s+)?.*/i)) return window.location.href = "/users/302604426781261824"; + // if (input.value.match(/gay(\s+)?(men\s+)?.*/i)) return window.location.href = "/users/302604426781261824"; - This causes simple terms like "gay" to result in a redirect, which is, not intended is my guess - AJ if (input.value.toLowerCase() === "developers developers developers developers") return document.body.innerHTML = ``; const c = document.querySelector("input[type='checkbox']#users"); @@ -131,7 +131,6 @@ }) .then(data => { let content = ""; - if (data.data.pages.length !== 0) { for (const card of data.data.pages[0]) { content = content + card; From acd25e554a158906a76db1f2d773a18ba9bcc961 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Thu, 16 Mar 2023 14:10:12 -0400 Subject: [PATCH 31/34] the problem is different, this is unneeded --- src/app.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/app.ts b/src/app.ts index ddbf5569..c1fff534 100644 --- a/src/app.ts +++ b/src/app.ts @@ -30,10 +30,6 @@ import passport from "passport"; import logger from "morgan"; import * as libCache from "./Util/Services/libCaching.js"; -import { uploadBots } from "./Util/Services/botCaching.js"; -import { uploadServers } from "./Util/Services/serverCaching.js"; -import { uploadTemplates } from "./Util/Services/templateCaching.js"; -/*Not uploading users, as that isn't a publicly searchable function, and they are re-set/cached on login/auth, if need be - AJ*/ import * as announcementCache from "./Util/Services/announcementCaching.js"; import * as featuredCache from "./Util/Services/featuring.js"; import * as ddosMode from "./Util/Services/ddosMode.js"; @@ -176,7 +172,6 @@ new Promise((resolve, reject) => { const s = new Redis(redisConfig); /*There is no point in flushing the DEL redis database, it's persistent as is, and will lead to problems. - Ice*/ - /*Ref #1 - While ice is totally right, we also aren't caching things at all unless it's being added, which means god forbid it get cleared, or flushed somehow, it doesn't work, which explains some issues - AJ*/ console.log("Attempting to acquire caching lock..."); const lock = await global.redis.get("cache_lock"); if (lock && lock != hostname()) { // We have a lock, but it is not held for us. @@ -215,10 +210,6 @@ new Promise((resolve, reject) => { console.log("Also acquired the discord lock!"); await global.redis.setex("cache_lock", 300, hostname()); console.time("Redis"); - /*Relates to Ref #1 above, we weren't caching servers, bots, or templates on startup, and these were never called. Meaning some queries are failing (from what debugging results in anyway) - AJ*/ - await uploadBots() - await uploadServers() // may perhaps be a bit intensive, but with a set of 15000 randomly generated entries, it didn't take too terribly long ~1ms, especially if results already exist and reply with 0 (or string for hmset) - await uploadTemplates() await libCache.cacheLibs(); await announcementCache.updateCache(); await featuredCache.updateFeaturedServers(); From 5d7b4011a53d177d265bec8bc194806fdceecbc3 Mon Sep 17 00:00:00 2001 From: AlienKnight Date: Thu, 16 Mar 2023 14:10:59 -0400 Subject: [PATCH 32/34] switching this to async caused much faster results --- src/Routes/search.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Routes/search.ts b/src/Routes/search.ts index b72a3c6d..d470371a 100644 --- a/src/Routes/search.ts +++ b/src/Routes/search.ts @@ -97,7 +97,7 @@ router.post("/", variables, async (req: Request, res: Response) => { _id === query || fullUsername.toLowerCase().indexOf(query) >= 0 ) - .map((user) => { + .map(async (user) => { return ejs.renderFile(renderPath + "/cards/userCard.ejs", { req, linkPrefix: res.locals.linkPrefix, @@ -117,7 +117,7 @@ router.post("/", variables, async (req: Request, res: Response) => { ({ status }) => !status.archived && status.approved && !status.siteBot && !status.hidden && !status.modHidden ) - .map((bot) => { + .map(async (bot) => { return ejs.renderFile(renderPath + "/cards/botCard.ejs", { req, linkPrefix: res.locals.linkPrefix, @@ -136,7 +136,7 @@ router.post("/", variables, async (req: Request, res: Response) => { ({ _id, name }) => _id === query || name.toLowerCase().indexOf(query) >= 0 ) - .map((server) => { + .map(async (server) => { return ejs.renderFile( renderPath + "/cards/serverCard.ejs", { @@ -156,7 +156,7 @@ router.post("/", variables, async (req: Request, res: Response) => { ({ _id, name }) => _id === query || name.toLowerCase().indexOf(query) >= 0 ) - .map((template) => { + .map(async (template) => { return ejs.renderFile( renderPath + "/cards/templateCard.ejs", { From 9d09bb873a7cc312f75a9af1e5a202910bacd7cf Mon Sep 17 00:00:00 2001 From: advaith Date: Sun, 23 Jul 2023 21:00:07 -0700 Subject: [PATCH 33/34] use client rest, update deps, clean up, update ci --- .github/workflows/compile.yml | 15 +- @types/del.d.ts | 7 + package-lock.json | 1263 +++++++++----------- package.json | 19 +- src/Routes/authentication.ts | 22 +- src/Routes/autosync.ts | 26 +- src/Routes/bots.ts | 65 +- src/Routes/servers.ts | 43 +- src/Routes/staff.ts | 3 +- src/Routes/templates.ts | 34 +- src/Routes/users.ts | 12 +- src/Util/Function/permissions.ts | 3 +- src/Util/Function/rest.ts | 8 - src/Util/Services/banned.ts | 2 +- src/Util/Services/discord.ts | 18 +- views/partials/header.ejs | 4 +- views/partials/isDefaultCSS/codeTag.ejs | 2 +- views/templates/bots/edit.ejs | 4 +- views/templates/bots/submit.ejs | 4 +- views/templates/search.ejs | 1 - views/templates/serverTemplates/submit.ejs | 2 +- views/templates/serverTemplates/view.ejs | 2 +- views/templates/servers/submit.ejs | 2 +- views/templates/servers/view.ejs | 2 +- views/templates/users/snake.ejs | 2 +- 25 files changed, 735 insertions(+), 830 deletions(-) delete mode 100644 src/Util/Function/rest.ts diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 0d84aec2..cb204e95 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -7,17 +7,16 @@ on: pull_request: jobs: - node14: - name: node v17 - tsc + node18: + name: node v18 - tsc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: install node v17 - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - name: install node v18 + uses: actions/setup-node@v3 with: - node-version: 17 - - name: install - run: npm install + node-version: 18 + cache: 'npm' - name: dependencies run: npm ci - name: settings diff --git a/@types/del.d.ts b/@types/del.d.ts index 776fdba8..493e44d9 100644 --- a/@types/del.d.ts +++ b/@types/del.d.ts @@ -247,6 +247,11 @@ declare global { options: string; server: string; }; + date?: { + submitted: number; + approved: number; + edited: number; + }; status: { approved: boolean; premium: boolean; @@ -257,6 +262,8 @@ declare global { }; } + type partialBot = Partial & { status: Partial }>; + interface delServer { _id: Snowflake; inviteCode: string; diff --git a/package-lock.json b/package-lock.json index 8d62b283..9f9c492e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,8 @@ "version": "v5.5.0-Next", "license": "AGPL-3.0", "dependencies": { - "@discordjs/rest": "^1.6.0", "@sentry/node": "^6.19.2", "@snyk/protect": "^1.984.0", - "body-parser": "^1.19.2", "browser-detect": "^0.2.28", "chunk": "0.0.3", "color": "^4.2.1", @@ -22,9 +20,9 @@ "datadog-metrics": "^0.9.3", "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", - "discord.js": "v14.8", + "discord.js": "^14.11.0", "ejs": "^3.1.7", - "express": "^4.17.3", + "express": "^4.18.2", "express-device": "^0.4.2", "express-sitemap": "^1.8.0", "html-entities": "^2.3.2", @@ -32,16 +30,15 @@ "i18n": "^0.14.2", "ioredis": "^4.28.5", "markdown-it": "^12.3.2", - "moment": "^2.29.1", + "moment": "^2.29.4", "mongodb": "^4.4.1", "morgan": "~1.10.0", - "node-fetch": "^3.2.3", + "node-fetch": "^3.3.1", "passport": "^0.5.2", "passport-discord": "^0.1.4", "passport-oauth2-refresh": "^2.1.0", - "request": "^2.88.2", "sanitize-html": "^2.7.0", - "typescript": "^4.6.3", + "typescript": "^5.1.6", "typescript-transpile-only": "0.0.4" }, "devDependencies": { @@ -52,13 +49,13 @@ "@types/cookie-session": "^2.0.44", "@types/datadog-metrics": "^0.6.2", "@types/ejs": "^3.1.0", - "@types/express": "^4.17.13", + "@types/express": "^4.17.17", "@types/http-errors": "^1.8.2", "@types/i18n": "^0.13.2", "@types/ioredis": "^4.28.10", "@types/markdown-it": "^12.2.3", "@types/morgan": "^1.9.3", - "@types/node": "^17.0.23", + "@types/node": "^18.17.0", "@types/passport": "^1.0.7", "@types/passport-discord": "^0.1.5", "@types/passport-oauth2-refresh": "^1.1.1", @@ -180,14 +177,14 @@ } }, "node_modules/@discordjs/builders": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.5.0.tgz", - "integrity": "sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA==", - "dependencies": { - "@discordjs/formatters": "^0.2.0", - "@discordjs/util": "^0.2.0", - "@sapphire/shapeshift": "^3.8.1", - "discord-api-types": "^0.37.35", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.6.3.tgz", + "integrity": "sha512-CTCh8NqED3iecTNuiz49mwSsrc2iQb4d0MjMdmS/8pb69Y4IlzJ/DIy/p5GFlgOrFbNO2WzMHkWKQSiJ3VNXaw==", + "dependencies": { + "@discordjs/formatters": "^0.3.1", + "@discordjs/util": "^0.3.1", + "@sapphire/shapeshift": "^3.8.2", + "discord-api-types": "^0.37.41", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.3", "tslib": "^2.5.0" @@ -196,76 +193,85 @@ "node": ">=16.9.0" } }, - "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "node_modules/@discordjs/builders/node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" }, "node_modules/@discordjs/collection": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.4.0.tgz", - "integrity": "sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.1.tgz", + "integrity": "sha512-aWEc9DCf3TMDe9iaJoOnO2+JVAjeRNuRxPZQA6GVvBf+Z3gqUuWYBy2NWh4+5CLYq5uoc3MOvUQ5H5m8CJBqOA==", "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/formatters": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.2.0.tgz", - "integrity": "sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.1.tgz", + "integrity": "sha512-M7X4IGiSeh4znwcRGcs+49B5tBkNDn4k5bmhxJDAUhRxRHTiFAOTVUNQ6yAKySu5jZTnCbSvTYHW3w0rAzV1MA==", "dependencies": { - "discord-api-types": "^0.37.35" + "discord-api-types": "^0.37.41" }, "engines": { "node": ">=16.9.0" } }, - "node_modules/@discordjs/formatters/node_modules/discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "node_modules/@discordjs/rest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.6.0.tgz", - "integrity": "sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.7.1.tgz", + "integrity": "sha512-Ofa9UqT0U45G/eX86cURQnX7gzOJLG2oC28VhIk/G6IliYgQF7jFByBJEykPSHE4MxPhqCleYvmsrtfKh1nYmQ==", "dependencies": { - "@discordjs/collection": "^1.4.0", - "@discordjs/util": "^0.2.0", + "@discordjs/collection": "^1.5.1", + "@discordjs/util": "^0.3.0", "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.4.0", - "discord-api-types": "^0.37.35", - "file-type": "^18.2.1", + "@sapphire/snowflake": "^3.4.2", + "discord-api-types": "^0.37.41", + "file-type": "^18.3.0", "tslib": "^2.5.0", - "undici": "^5.20.0" + "undici": "^5.22.0" }, "engines": { "node": ">=16.9.0" } }, - "node_modules/@discordjs/rest/node_modules/discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "node_modules/@discordjs/rest/node_modules/tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/@discordjs/util": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz", - "integrity": "sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.3.1.tgz", + "integrity": "sha512-HxXKYKg7vohx2/OupUN/4Sd02Ev3PBJ5q0gtjdcvXb0ErCva8jNHWfe/v5sU3UKjIB/uxOhc+TDOnhqffj9pRA==", "engines": { "node": ">=16.9.0" } }, + "node_modules/@discordjs/ws": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-0.8.3.tgz", + "integrity": "sha512-hcYtppanjHecbdNyCKQNH2I4RP9UrphDgmRgLYrATEQF1oo4sYSve7ZmGsBEXSzH72MO2tBPdWSThunbxUVk0g==", + "dependencies": { + "@discordjs/collection": "^1.5.1", + "@discordjs/rest": "^1.7.1", + "@discordjs/util": "^0.3.1", + "@sapphire/async-queue": "^1.5.0", + "@types/ws": "^8.5.4", + "@vladfrangu/async_event_emitter": "^2.2.1", + "discord-api-types": "^0.37.41", + "tslib": "^2.5.0", + "ws": "^8.13.0" + }, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/ws/node_modules/tslib": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" + }, "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -379,9 +385,9 @@ } }, "node_modules/@sapphire/shapeshift": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz", - "integrity": "sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw==", + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.2.tgz", + "integrity": "sha512-YRbCXWy969oGIdqR/wha62eX8GNHsvyYi0Rfd4rNW6tSVVa8p0ELiMEuOH/k8rgtvRoM+EMV7Csqz77YdwiDpA==", "dependencies": { "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21" @@ -392,9 +398,9 @@ } }, "node_modules/@sapphire/snowflake": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", - "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz", + "integrity": "sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" @@ -585,26 +591,27 @@ "dev": true }, "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", "dev": true, "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", + "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "version": "4.17.35", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", + "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "node_modules/@types/http-errors": { @@ -678,9 +685,9 @@ } }, "node_modules/@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" + "version": "18.17.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.0.tgz", + "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -759,6 +766,16 @@ "htmlparser2": "^6.0.0" } }, + "node_modules/@types/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "node_modules/@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -791,6 +808,15 @@ "@types/node": "*" } }, + "node_modules/@vladfrangu/async_event_emitter": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz", + "integrity": "sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -892,6 +918,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -977,6 +1004,7 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -985,6 +1013,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, "engines": { "node": ">=0.8" } @@ -1006,12 +1035,14 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, "engines": { "node": "*" } @@ -1019,7 +1050,8 @@ "node_modules/aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true }, "node_modules/balanced-match": { "version": "1.0.2", @@ -1073,6 +1105,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -1086,9 +1119,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -1098,7 +1131,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -1305,7 +1338,8 @@ "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "node_modules/chalk": { "version": "4.1.2", @@ -1414,6 +1448,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1536,7 +1571,8 @@ "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -1556,6 +1592,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -1658,12 +1695,13 @@ }, "node_modules/del-i18n": { "version": "0.0.0", - "resolved": "git+ssh://git@github.com/discordextremelist/i18n.git#5af01c6e56db157ae743ba113ea00e4f9d61019c" + "resolved": "git+ssh://git@github.com/discordextremelist/i18n.git#9e3305a3be8839bd2af50625b660683717e770a1" }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -1722,34 +1760,35 @@ "node": ">=8" } }, + "node_modules/discord-api-types": { + "version": "0.37.50", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.50.tgz", + "integrity": "sha512-X4CDiMnDbA3s3RaUXWXmgAIbY1uxab3fqe3qwzg5XutR3wjqi7M3IkgQbsIBzpqBN2YWr/Qdv7JrFRqSgb4TFg==" + }, "node_modules/discord.js": { - "version": "14.8.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", - "integrity": "sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ==", - "dependencies": { - "@discordjs/builders": "^1.5.0", - "@discordjs/collection": "^1.4.0", - "@discordjs/formatters": "^0.2.0", - "@discordjs/rest": "^1.6.0", - "@discordjs/util": "^0.2.0", - "@sapphire/snowflake": "^3.4.0", + "version": "14.11.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.11.0.tgz", + "integrity": "sha512-CkueWYFQ28U38YPR8HgsBR/QT35oPpMbEsTNM30Fs8loBIhnA4s70AwQEoy6JvLcpWWJO7GY0y2BUzZmuBMepQ==", + "dependencies": { + "@discordjs/builders": "^1.6.3", + "@discordjs/collection": "^1.5.1", + "@discordjs/formatters": "^0.3.1", + "@discordjs/rest": "^1.7.1", + "@discordjs/util": "^0.3.1", + "@discordjs/ws": "^0.8.3", + "@sapphire/snowflake": "^3.4.2", "@types/ws": "^8.5.4", - "discord-api-types": "^0.37.35", + "discord-api-types": "^0.37.41", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", "tslib": "^2.5.0", - "undici": "^5.20.0", - "ws": "^8.12.1" + "undici": "^5.22.0", + "ws": "^8.13.0" }, "engines": { "node": ">=16.9.0" } }, - "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "node_modules/discord.js/node_modules/tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -1825,6 +1864,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -1883,7 +1923,7 @@ "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "engines": { "node": ">= 0.8" } @@ -1955,7 +1995,7 @@ "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "node_modules/escape-string-regexp": { "version": "4.0.0", @@ -1971,43 +2011,44 @@ "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "engines": { "node": ">= 0.6" } }, "node_modules/express": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", - "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.2", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.2", + "cookie": "0.5.0", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "2.0.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.2.0", "fresh": "0.5.2", + "http-errors": "2.0.0", "merge-descriptors": "1.0.1", "methods": "~1.1.2", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.9.7", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.17.2", - "serve-static": "1.14.2", + "send": "0.18.0", + "serve-static": "1.15.0", "setprototypeof": "1.2.0", - "statuses": "~1.5.0", + "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" @@ -2048,24 +2089,12 @@ "node": ">=4" } }, - "node_modules/express/node_modules/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" - }, + "node_modules/express/node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/express/node_modules/debug": { @@ -2076,69 +2105,10 @@ "ms": "2.0.0" } }, - "node_modules/express/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express/node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/express/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/express/node_modules/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/express/node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/extend": { "version": "3.0.2", @@ -2149,6 +2119,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, "engines": [ "node >=0.6.0" ] @@ -2177,7 +2148,8 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-printf": { "version": "1.6.9", @@ -2222,9 +2194,9 @@ } }, "node_modules/file-type": { - "version": "18.2.1", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.1.tgz", - "integrity": "sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==", + "version": "18.5.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz", + "integrity": "sha512-yvpl5U868+V6PqXHMmsESpg6unQ5GfnPssl4dxdJudBrr9qy7Fddt7EVX1VLlddFfe8Gj9N7goCZH22FXuSQXQ==", "dependencies": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -2277,16 +2249,16 @@ } }, "node_modules/finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", - "statuses": "~1.5.0", + "statuses": "2.0.1", "unpipe": "~1.0.0" }, "engines": { @@ -2304,18 +2276,7 @@ "node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/finalhandler/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/find-up": { "version": "4.1.0", @@ -2334,6 +2295,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, "engines": { "node": "*" } @@ -2360,7 +2322,7 @@ "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "engines": { "node": ">= 0.6" } @@ -2430,13 +2392,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2455,6 +2418,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -2567,6 +2531,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, "engines": { "node": ">=4" } @@ -2576,6 +2541,7 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "deprecated": "this library is no longer supported", + "dev": true, "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -2612,6 +2578,17 @@ "node": ">=8" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2665,9 +2642,9 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "node_modules/http-errors": { @@ -2685,14 +2662,6 @@ "node": ">= 0.8" } }, - "node_modules/http-errors/node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", @@ -2711,6 +2680,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -2965,7 +2935,8 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "node_modules/isarray": { "version": "1.0.0", @@ -2982,7 +2953,8 @@ "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "node_modules/jake": { "version": "10.8.5", @@ -3016,7 +2988,8 @@ "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "node_modules/json-bigint": { "version": "1.0.0", @@ -3035,22 +3008,26 @@ "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "node_modules/jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -3618,9 +3595,9 @@ } }, "node_modules/node-fetch": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", - "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -3706,9 +3683,9 @@ } }, "node_modules/node-sass": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.1.tgz", - "integrity": "sha512-uMy+Xt29NlqKCFdFRZyXKOTqGt+QaKHexv9STj2WeLottnlqZEEWx6Bj0MXNthmFRRdM/YwyNo/8Tr46TOM0jQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.3.tgz", + "integrity": "sha512-8MIlsY/4dXUkJDYht9pIWBhMil3uHmE8b/AdJPjmFn1nBx9X9BASzfzmsCy0uCCb8eqI3SYYzVPDswWqSx7gjw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -3724,7 +3701,7 @@ "node-gyp": "^8.4.1", "npmlog": "^5.0.0", "request": "^2.88.0", - "sass-graph": "4.0.0", + "sass-graph": "^4.0.1", "stdout-stream": "^1.4.0", "true-case-path": "^1.0.2" }, @@ -3786,6 +3763,7 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, "engines": { "node": "*" } @@ -3800,9 +3778,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4044,7 +4022,8 @@ "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -4131,7 +4110,8 @@ "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true }, "node_modules/punycode": { "version": "2.1.1", @@ -4142,9 +4122,9 @@ } }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -4286,9 +4266,9 @@ } }, "node_modules/read-pkg/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -4373,6 +4353,7 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -4403,6 +4384,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -4416,6 +4398,7 @@ "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true, "engines": { "node": ">=0.6" } @@ -4558,14 +4541,14 @@ } }, "node_modules/sass-graph": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.0.tgz", - "integrity": "sha512-WSO/MfXqKH7/TS8RdkCX3lVkPFQzCgbqdGsmSKq6tlPU+GpGEsa/5aW18JqItnqh+lPtcjifqdZ/VmiILkKckQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.1.tgz", + "integrity": "sha512-5YCfmGBmxoIRYHnKK2AKzrAkCoQ8ozO+iumT8K4tXJXRVCPf+7s1/9KxTSW3Rbvf+7Y7b4FR3mWyLnQr3PHocA==", "dev": true, "dependencies": { "glob": "^7.0.0", "lodash": "^4.17.11", - "scss-tokenizer": "^0.3.0", + "scss-tokenizer": "^0.4.3", "yargs": "^17.2.1" }, "bin": { @@ -4575,85 +4558,90 @@ "node": ">=12" } }, + "node_modules/sass-graph/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/sass-graph/node_modules/yargs": { - "version": "17.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", - "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" + "yargs-parser": "^21.1.1" }, "engines": { "node": ">=12" } }, "node_modules/sass-graph/node_modules/yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/scss-tokenizer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.3.0.tgz", - "integrity": "sha512-14Zl9GcbBvOT9057ZKjpz5yPOyUWG2ojd9D5io28wHRYsOrs7U95Q+KNL87+32p8rc+LvDpbu/i9ZYjM9Q+FsQ==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.4.3.tgz", + "integrity": "sha512-raKLgf1LI5QMQnG+RxHz6oK0sL3x3I4FN2UDLqgLOGO8hodECNnNh5BXn7fAyBxrA8zVzdQizQ6XjNJQ+uBwMw==", "dev": true, "dependencies": { - "js-base64": "^2.4.3", - "source-map": "^0.7.1" + "js-base64": "^2.4.9", + "source-map": "^0.7.3" } }, "node_modules/semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { - "lru-cache": "^7.4.0" + "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/semver/node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true, - "engines": { - "node": ">=12" + "node": ">=10" } }, "node_modules/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dependencies": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", + "depd": "2.0.0", + "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "statuses": "2.0.1" }, "engines": { "node": ">= 0.8.0" @@ -4670,61 +4658,22 @@ "node_modules/send/node_modules/debug/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/send/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/send/node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "node_modules/send/node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "node_modules/send/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/serve-static": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", - "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.2" + "send": "0.18.0" }, "engines": { "node": ">= 0.8.0" @@ -4848,9 +4797,9 @@ } }, "node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, "engines": { "node": ">= 8" @@ -4909,6 +4858,7 @@ "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "dev": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -4947,11 +4897,11 @@ "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" }, "node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "engines": { - "node": ">= 0.6" + "node": ">= 0.8" } }, "node_modules/stdout-stream": { @@ -5179,6 +5129,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -5238,6 +5189,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "dependencies": { "safe-buffer": "^5.0.1" }, @@ -5248,7 +5200,8 @@ "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "node_modules/type-fest": { "version": "0.18.1", @@ -5275,15 +5228,15 @@ } }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/typescript-transpile-only": { @@ -5311,14 +5264,14 @@ "integrity": "sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA==" }, "node_modules/undici": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz", - "integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==", + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", "dependencies": { "busboy": "^1.6.0" }, "engines": { - "node": ">=12.18" + "node": ">=14.0" } }, "node_modules/unique-filename": { @@ -5351,6 +5304,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -5396,6 +5350,7 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, "bin": { "uuid": "bin/uuid" } @@ -5422,6 +5377,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "engines": [ "node >=0.6.0" ], @@ -5664,71 +5620,54 @@ } }, "@discordjs/builders": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.5.0.tgz", - "integrity": "sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA==", - "requires": { - "@discordjs/formatters": "^0.2.0", - "@discordjs/util": "^0.2.0", - "@sapphire/shapeshift": "^3.8.1", - "discord-api-types": "^0.37.35", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.6.3.tgz", + "integrity": "sha512-CTCh8NqED3iecTNuiz49mwSsrc2iQb4d0MjMdmS/8pb69Y4IlzJ/DIy/p5GFlgOrFbNO2WzMHkWKQSiJ3VNXaw==", + "requires": { + "@discordjs/formatters": "^0.3.1", + "@discordjs/util": "^0.3.1", + "@sapphire/shapeshift": "^3.8.2", + "discord-api-types": "^0.37.41", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.3", "tslib": "^2.5.0" }, "dependencies": { - "discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" } } }, "@discordjs/collection": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.4.0.tgz", - "integrity": "sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ==" + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.1.tgz", + "integrity": "sha512-aWEc9DCf3TMDe9iaJoOnO2+JVAjeRNuRxPZQA6GVvBf+Z3gqUuWYBy2NWh4+5CLYq5uoc3MOvUQ5H5m8CJBqOA==" }, "@discordjs/formatters": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.2.0.tgz", - "integrity": "sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.1.tgz", + "integrity": "sha512-M7X4IGiSeh4znwcRGcs+49B5tBkNDn4k5bmhxJDAUhRxRHTiFAOTVUNQ6yAKySu5jZTnCbSvTYHW3w0rAzV1MA==", "requires": { - "discord-api-types": "^0.37.35" - }, - "dependencies": { - "discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - } + "discord-api-types": "^0.37.41" } }, "@discordjs/rest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.6.0.tgz", - "integrity": "sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.7.1.tgz", + "integrity": "sha512-Ofa9UqT0U45G/eX86cURQnX7gzOJLG2oC28VhIk/G6IliYgQF7jFByBJEykPSHE4MxPhqCleYvmsrtfKh1nYmQ==", "requires": { - "@discordjs/collection": "^1.4.0", - "@discordjs/util": "^0.2.0", + "@discordjs/collection": "^1.5.1", + "@discordjs/util": "^0.3.0", "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.4.0", - "discord-api-types": "^0.37.35", - "file-type": "^18.2.1", + "@sapphire/snowflake": "^3.4.2", + "discord-api-types": "^0.37.41", + "file-type": "^18.3.0", "tslib": "^2.5.0", - "undici": "^5.20.0" + "undici": "^5.22.0" }, "dependencies": { - "discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -5737,9 +5676,32 @@ } }, "@discordjs/util": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz", - "integrity": "sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-0.3.1.tgz", + "integrity": "sha512-HxXKYKg7vohx2/OupUN/4Sd02Ev3PBJ5q0gtjdcvXb0ErCva8jNHWfe/v5sU3UKjIB/uxOhc+TDOnhqffj9pRA==" + }, + "@discordjs/ws": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-0.8.3.tgz", + "integrity": "sha512-hcYtppanjHecbdNyCKQNH2I4RP9UrphDgmRgLYrATEQF1oo4sYSve7ZmGsBEXSzH72MO2tBPdWSThunbxUVk0g==", + "requires": { + "@discordjs/collection": "^1.5.1", + "@discordjs/rest": "^1.7.1", + "@discordjs/util": "^0.3.1", + "@sapphire/async-queue": "^1.5.0", + "@types/ws": "^8.5.4", + "@vladfrangu/async_event_emitter": "^2.2.1", + "discord-api-types": "^0.37.41", + "tslib": "^2.5.0", + "ws": "^8.13.0" + }, + "dependencies": { + "tslib": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" + } + } }, "@gar/promisify": { "version": "1.1.3", @@ -5838,18 +5800,18 @@ "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==" }, "@sapphire/shapeshift": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz", - "integrity": "sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw==", + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.2.tgz", + "integrity": "sha512-YRbCXWy969oGIdqR/wha62eX8GNHsvyYi0Rfd4rNW6tSVVa8p0ELiMEuOH/k8rgtvRoM+EMV7Csqz77YdwiDpA==", "requires": { "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21" } }, "@sapphire/snowflake": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.4.0.tgz", - "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==" + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz", + "integrity": "sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==" }, "@sentry/core": { "version": "6.19.6", @@ -6009,26 +5971,27 @@ "dev": true }, "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", "dev": true, "requires": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", + "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } }, "@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "version": "4.17.35", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", + "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", "dev": true, "requires": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "@types/http-errors": { @@ -6102,9 +6065,9 @@ } }, "@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" + "version": "18.17.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.0.tgz", + "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -6183,6 +6146,16 @@ "htmlparser2": "^6.0.0" } }, + "@types/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "dev": true, + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -6215,6 +6188,11 @@ "@types/node": "*" } }, + "@vladfrangu/async_event_emitter": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz", + "integrity": "sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==" + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -6294,6 +6272,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -6357,6 +6336,7 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -6364,7 +6344,8 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "async": { "version": "3.2.3", @@ -6380,17 +6361,20 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true }, "balanced-match": { "version": "1.0.2", @@ -6426,6 +6410,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -6436,9 +6421,9 @@ "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" }, "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -6448,7 +6433,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -6608,7 +6593,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "chalk": { "version": "4.1.2", @@ -6693,6 +6679,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -6790,7 +6777,8 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cross-spawn": { "version": "7.0.3", @@ -6807,6 +6795,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -6883,13 +6872,14 @@ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" }, "del-i18n": { - "version": "git+ssh://git@github.com/discordextremelist/i18n.git#5af01c6e56db157ae743ba113ea00e4f9d61019c", + "version": "git+ssh://git@github.com/discordextremelist/i18n.git#9e3305a3be8839bd2af50625b660683717e770a1", "from": "del-i18n@github:discordextremelist/i18n" }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "delegates": { "version": "1.0.0", @@ -6929,31 +6919,32 @@ "path-type": "^4.0.0" } }, + "discord-api-types": { + "version": "0.37.50", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.50.tgz", + "integrity": "sha512-X4CDiMnDbA3s3RaUXWXmgAIbY1uxab3fqe3qwzg5XutR3wjqi7M3IkgQbsIBzpqBN2YWr/Qdv7JrFRqSgb4TFg==" + }, "discord.js": { - "version": "14.8.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.8.0.tgz", - "integrity": "sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ==", - "requires": { - "@discordjs/builders": "^1.5.0", - "@discordjs/collection": "^1.4.0", - "@discordjs/formatters": "^0.2.0", - "@discordjs/rest": "^1.6.0", - "@discordjs/util": "^0.2.0", - "@sapphire/snowflake": "^3.4.0", + "version": "14.11.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.11.0.tgz", + "integrity": "sha512-CkueWYFQ28U38YPR8HgsBR/QT35oPpMbEsTNM30Fs8loBIhnA4s70AwQEoy6JvLcpWWJO7GY0y2BUzZmuBMepQ==", + "requires": { + "@discordjs/builders": "^1.6.3", + "@discordjs/collection": "^1.5.1", + "@discordjs/formatters": "^0.3.1", + "@discordjs/rest": "^1.7.1", + "@discordjs/util": "^0.3.1", + "@discordjs/ws": "^0.8.3", + "@sapphire/snowflake": "^3.4.2", "@types/ws": "^8.5.4", - "discord-api-types": "^0.37.35", + "discord-api-types": "^0.37.41", "fast-deep-equal": "^3.1.3", "lodash.snakecase": "^4.1.1", "tslib": "^2.5.0", - "undici": "^5.20.0", - "ws": "^8.12.1" + "undici": "^5.22.0", + "ws": "^8.13.0" }, "dependencies": { - "discord-api-types": { - "version": "0.37.35", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.35.tgz", - "integrity": "sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==" - }, "tslib": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", @@ -7010,6 +7001,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -7059,7 +7051,7 @@ "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, "encoding": { "version": "0.1.13", @@ -7118,7 +7110,7 @@ "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "escape-string-regexp": { "version": "4.0.0", @@ -7128,61 +7120,50 @@ "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", - "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.2", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.2", + "cookie": "0.5.0", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "2.0.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.2.0", "fresh": "0.5.2", + "http-errors": "2.0.0", "merge-descriptors": "1.0.1", "methods": "~1.1.2", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.9.7", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.17.2", - "serve-static": "1.14.2", + "send": "0.18.0", + "serve-static": "1.15.0", "setprototypeof": "1.2.0", - "statuses": "~1.5.0", + "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "dependencies": { - "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" - } + "cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" }, "debug": { "version": "2.6.9", @@ -7192,51 +7173,10 @@ "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==" - }, - "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", - "requires": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -7271,7 +7211,8 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fast-deep-equal": { "version": "3.1.3", @@ -7294,7 +7235,8 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-printf": { "version": "1.6.9", @@ -7323,9 +7265,9 @@ } }, "file-type": { - "version": "18.2.1", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.2.1.tgz", - "integrity": "sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==", + "version": "18.5.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz", + "integrity": "sha512-yvpl5U868+V6PqXHMmsESpg6unQ5GfnPssl4dxdJudBrr9qy7Fddt7EVX1VLlddFfe8Gj9N7goCZH22FXuSQXQ==", "requires": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -7368,16 +7310,16 @@ } }, "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", - "statuses": "~1.5.0", + "statuses": "2.0.1", "unpipe": "~1.0.0" }, "dependencies": { @@ -7392,15 +7334,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -7417,7 +7351,8 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "formdata-polyfill": { "version": "4.0.10", @@ -7435,7 +7370,7 @@ "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, "fs-minipass": { "version": "2.1.0", @@ -7490,13 +7425,14 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" } }, "get-stdin": { @@ -7509,6 +7445,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -7595,12 +7532,14 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -7625,6 +7564,11 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -7662,9 +7606,9 @@ } }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "http-errors": { @@ -7677,13 +7621,6 @@ "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" - }, - "dependencies": { - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" - } } }, "http-proxy-agent": { @@ -7701,6 +7638,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -7885,7 +7823,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "isarray": { "version": "1.0.0", @@ -7902,7 +7841,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "jake": { "version": "10.8.5", @@ -7930,7 +7870,8 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "json-bigint": { "version": "1.0.0", @@ -7949,22 +7890,26 @@ "json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -8395,9 +8340,9 @@ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" }, "node-fetch": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", - "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", "requires": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -8463,9 +8408,9 @@ } }, "node-sass": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.1.tgz", - "integrity": "sha512-uMy+Xt29NlqKCFdFRZyXKOTqGt+QaKHexv9STj2WeLottnlqZEEWx6Bj0MXNthmFRRdM/YwyNo/8Tr46TOM0jQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.3.tgz", + "integrity": "sha512-8MIlsY/4dXUkJDYht9pIWBhMil3uHmE8b/AdJPjmFn1nBx9X9BASzfzmsCy0uCCb8eqI3SYYzVPDswWqSx7gjw==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -8480,7 +8425,7 @@ "node-gyp": "^8.4.1", "npmlog": "^5.0.0", "request": "^2.88.0", - "sass-graph": "4.0.0", + "sass-graph": "^4.0.1", "stdout-stream": "^1.4.0", "true-case-path": "^1.0.2" } @@ -8526,7 +8471,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -8535,9 +8481,9 @@ "dev": true }, "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" }, "on-finished": { "version": "2.4.1", @@ -8704,7 +8650,8 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "picocolors": { "version": "1.0.0", @@ -8766,7 +8713,8 @@ "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true }, "punycode": { "version": "2.1.1", @@ -8774,9 +8722,9 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -8857,9 +8805,9 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true }, "type-fest": { @@ -8939,6 +8887,7 @@ "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -8966,6 +8915,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -8975,7 +8925,8 @@ "qs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true } } }, @@ -9064,85 +9015,88 @@ } }, "sass-graph": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.0.tgz", - "integrity": "sha512-WSO/MfXqKH7/TS8RdkCX3lVkPFQzCgbqdGsmSKq6tlPU+GpGEsa/5aW18JqItnqh+lPtcjifqdZ/VmiILkKckQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.1.tgz", + "integrity": "sha512-5YCfmGBmxoIRYHnKK2AKzrAkCoQ8ozO+iumT8K4tXJXRVCPf+7s1/9KxTSW3Rbvf+7Y7b4FR3mWyLnQr3PHocA==", "dev": true, "requires": { "glob": "^7.0.0", "lodash": "^4.17.11", - "scss-tokenizer": "^0.3.0", + "scss-tokenizer": "^0.4.3", "yargs": "^17.2.1" }, "dependencies": { + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, "yargs": { - "version": "17.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", - "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "requires": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" + "yargs-parser": "^21.1.1" } }, "yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true } } }, "scss-tokenizer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.3.0.tgz", - "integrity": "sha512-14Zl9GcbBvOT9057ZKjpz5yPOyUWG2ojd9D5io28wHRYsOrs7U95Q+KNL87+32p8rc+LvDpbu/i9ZYjM9Q+FsQ==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.4.3.tgz", + "integrity": "sha512-raKLgf1LI5QMQnG+RxHz6oK0sL3x3I4FN2UDLqgLOGO8hodECNnNh5BXn7fAyBxrA8zVzdQizQ6XjNJQ+uBwMw==", "dev": true, "requires": { - "js-base64": "^2.4.3", - "source-map": "^0.7.1" + "js-base64": "^2.4.9", + "source-map": "^0.7.3" } }, "semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { - "lru-cache": "^7.4.0" - }, - "dependencies": { - "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "dev": true - } + "lru-cache": "^6.0.0" } }, "send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "requires": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", + "depd": "2.0.0", + "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "statuses": "2.0.1" }, "dependencies": { "debug": { @@ -9156,56 +9110,26 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - } - }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } } } }, "serve-static": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", - "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.2" + "send": "0.18.0" } }, "set-blocking": { @@ -9302,9 +9226,9 @@ } }, "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true }, "source-map-js": { @@ -9357,6 +9281,7 @@ "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -9384,9 +9309,9 @@ "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" }, "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, "stdout-stream": { "version": "1.4.1", @@ -9562,6 +9487,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, "requires": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -9609,6 +9535,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -9616,7 +9543,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type-fest": { "version": "0.18.1", @@ -9634,9 +9562,9 @@ } }, "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==" + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==" }, "typescript-transpile-only": { "version": "0.0.4", @@ -9657,9 +9585,9 @@ "integrity": "sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA==" }, "undici": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz", - "integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==", + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", "requires": { "busboy": "^1.6.0" } @@ -9691,6 +9619,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -9733,7 +9662,8 @@ "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true }, "validate-npm-package-license": { "version": "3.0.4", @@ -9754,6 +9684,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", diff --git a/package.json b/package.json index f3687e93..bd315ce1 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,8 @@ "node": ">=18.15.0" }, "dependencies": { - "@discordjs/rest": "^1.6.0", "@sentry/node": "^6.19.2", "@snyk/protect": "^1.984.0", - "body-parser": "^1.19.2", "browser-detect": "^0.2.28", "chunk": "0.0.3", "color": "^4.2.1", @@ -25,9 +23,9 @@ "datadog-metrics": "^0.9.3", "debug": "~4.3.4", "del-i18n": "github:discordextremelist/i18n", - "discord.js": "v14.8", + "discord.js": "^14.11.0", "ejs": "^3.1.7", - "express": "^4.17.3", + "express": "^4.18.2", "express-device": "^0.4.2", "express-sitemap": "^1.8.0", "html-entities": "^2.3.2", @@ -35,16 +33,15 @@ "i18n": "^0.14.2", "ioredis": "^4.28.5", "markdown-it": "^12.3.2", - "moment": "^2.29.1", + "moment": "^2.29.4", "mongodb": "^4.4.1", "morgan": "~1.10.0", - "node-fetch": "^3.2.3", + "node-fetch": "^3.3.1", "passport": "^0.5.2", "passport-discord": "^0.1.4", "passport-oauth2-refresh": "^2.1.0", - "request": "^2.88.2", "sanitize-html": "^2.7.0", - "typescript": "^4.6.3", + "typescript": "^5.1.6", "typescript-transpile-only": "0.0.4" }, "devDependencies": { @@ -55,13 +52,13 @@ "@types/cookie-session": "^2.0.44", "@types/datadog-metrics": "^0.6.2", "@types/ejs": "^3.1.0", - "@types/express": "^4.17.13", + "@types/express": "^4.17.17", "@types/http-errors": "^1.8.2", "@types/i18n": "^0.13.2", "@types/ioredis": "^4.28.10", "@types/markdown-it": "^12.2.3", "@types/morgan": "^1.9.3", - "@types/node": "^17.0.23", + "@types/node": "^18.17.0", "@types/passport": "^1.0.7", "@types/passport-discord": "^0.1.5", "@types/passport-oauth2-refresh": "^1.1.1", @@ -96,6 +93,6 @@ "license": "AGPL-3.0", "snyk": true, "volta": { - "node": "14.18.3" + "node": "18.17.0" } } diff --git a/src/Routes/authentication.ts b/src/Routes/authentication.ts index fbb09852..e10e638f 100644 --- a/src/Routes/authentication.ts +++ b/src/Routes/authentication.ts @@ -18,18 +18,16 @@ along with this program. If not, see . */ import express from "express"; -import bodyParser from "body-parser"; import passport from "passport"; import { Strategy } from "passport-discord"; import type { VerifyCallback } from "passport-oauth2" import refresh from "passport-oauth2-refresh" import * as discord from "../Util/Services/discord.js"; -import type { RESTPostOAuth2AccessTokenResult } from "discord.js"; +import type { DiscordAPIError, RESTPostOAuth2AccessTokenResult, RESTPutAPIGuildMemberJSONBody } from "discord.js"; import { OAuth2Scopes, Routes } from "discord.js" -import type { DiscordAPIError } from "discord.js"; import fetch from "node-fetch"; import * as userCache from "../Util/Services/userCaching.js" -import { rest } from "../Util/Function/rest.js"; +import { DAPI } from "../Util/Services/discord.js" import settings from "../../settings.json" assert { type: "json" }; import * as tokenManager from "../Util/Services/adminTokenManager.js"; @@ -55,12 +53,8 @@ refresh.use(strategy); passport.serializeUser((user, done) => done(null, user)); passport.deserializeUser((user, done) => done(null, user)); -router.use(bodyParser.json()); -router.use( - bodyParser.urlencoded({ - extended: true - }) -); +router.use(express.json()); +router.use(express.urlencoded({ extended: true })); router.get("/login/joinGuild", (req, res) => { @@ -83,7 +77,7 @@ router.get( .collection("users") .findOne({ _id: req.user.id }); - const { scopes } = await (await fetch("https://discord.com/api/v8/oauth2/@me", { headers: { authorization: `Bearer ${req.user.accessToken}` } })).json() as { scopes: OAuth2Scopes[] } + const { scopes } = await (await fetch(DAPI + Routes.oauth2CurrentAuthorization(), { headers: { authorization: `Bearer ${req.user.accessToken}` } })).json() as { scopes: OAuth2Scopes[] } if (!user) { const handleDefault: delUser["staffTracking"]["handledBots"] = { @@ -189,7 +183,7 @@ router.get( handledServers: handleDefault, handledTemplates: handleDefault } - } as delUser); + } satisfies delUser); } else { const importUser = { auth: { @@ -234,8 +228,8 @@ router.get( if (req.session.joinGuild && req.session.joinGuild === true) { req.session.joinGuild = false; - await rest.put(Routes.guildMember(settings.guild.main, req.user.id), { - body: { access_token: req.user.accessToken } + await discord.bot.rest.put(Routes.guildMember(settings.guild.main, req.user.id), { + body: { access_token: req.user.accessToken } satisfies RESTPutAPIGuildMemberJSONBody }) .catch((error: DiscordAPIError) => { console.error(error) diff --git a/src/Routes/autosync.ts b/src/Routes/autosync.ts index 064a90c5..6fa59d67 100644 --- a/src/Routes/autosync.ts +++ b/src/Routes/autosync.ts @@ -26,11 +26,11 @@ import * as serverCache from "../Util/Services/serverCaching.js"; import * as templateCache from "../Util/Services/templateCaching.js"; import * as userCache from "../Util/Services/userCaching.js"; import * as functions from "../Util/Function/main.js"; -import { EmbedBuilder } from "discord.js"; -import { APIInvite, APITemplate, RESTGetAPIInviteQuery, RESTPostOAuth2AccessTokenResult, APIApplicationCommand, OAuth2Scopes, Routes, APIApplication, APIUser } from "discord.js"; +import { EmbedBuilder, RESTGetAPIInviteResult, makeURLSearchParams, OAuth2Scopes, Routes } from "discord.js"; +import type { APITemplate, RESTGetAPIInviteQuery, RESTPostOAuth2AccessTokenResult, APIApplicationCommand, APIApplication, APIUser } from "discord.js"; import settings from "../../settings.json" assert { type: "json" }; -import { rest } from "../Util/Function/rest.js"; -const DAPI = "https://discord.com/api/v10"; +import { DAPI } from "../Util/Services/discord.js" + const router = express.Router(); const getNext = (arr: string[], id: string) => { @@ -57,7 +57,7 @@ router.get('/bots', async (req, res) => { .findOne({ _id: id }); if (botExists) try { - const app = await rest.get(Routes.applicationCommands(botExists.clientID || id)) as APIApplication + const app = await discord.bot.rest.get(`/applications/${botExists.clientID || id}/rpc`) as APIApplication let commands: APIApplicationCommand[] = botExists.commands || [] if (botExists.scopes?.slashCommands) { @@ -84,7 +84,7 @@ router.get('/bots', async (req, res) => { }) } - const receivedCommands = await (await fetch('https://discord.com/api/v10' + Routes.applicationCommands(app.id), { headers: { authorization: `Bearer ${owner.auth.accessToken}` } })).json().catch(() => { }) as APIApplicationCommand[] + const receivedCommands = await (await fetch(DAPI + Routes.applicationCommands(app.id), { headers: { authorization: `Bearer ${owner.auth.accessToken}` } })).json().catch(() => { }) as APIApplicationCommand[] if (Array.isArray(receivedCommands)) commands = receivedCommands; } } @@ -92,7 +92,7 @@ router.get('/bots', async (req, res) => { let userFlags = 0 if (botExists.scopes?.bot) { - const user = await rest.get(Routes.user(id)).catch(() => { }) as APIUser + const user = await discord.bot.rest.get(Routes.user(id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -107,7 +107,7 @@ router.get('/bots', async (req, res) => { }, commands, userFlags - } as delBot + } satisfies Partial } ); @@ -136,7 +136,9 @@ router.get('/servers', async (req, res) => { .findOne({ _id: id }); if (server) try { - const invite = await (await fetch(DAPI + `/invites/${server.inviteCode}?with_counts=true&with_expiration=true`)).json() as APIInvite + const invite = await discord.bot.rest.get(Routes.invite(server.inviteCode), { + query: makeURLSearchParams({ with_counts: true, with_expiration: true } satisfies RESTGetAPIInviteQuery) + }) as RESTGetAPIInviteResult if (invite.guild.id !== server._id) throw 'Invite points to a different server' if (invite.expires_at) throw 'This invite is set to expire' @@ -153,7 +155,7 @@ router.get('/servers', async (req, res) => { hash: invite.guild.icon, url: `https://cdn.discordapp.com/icons/${invite.guild.id}/${invite.guild.icon}` } - } as delServer + } satisfies Partial } ); @@ -218,7 +220,7 @@ router.get('/templates', async (req, res) => { .findOne({ _id: id }); if (dbTemplate) try { - const template = await rest.get(Routes.template(id)) as APITemplate + const template = await discord.bot.rest.get(Routes.template(id)) as APITemplate await global.db.collection("templates").updateOne( { _id: id }, @@ -247,7 +249,7 @@ router.get('/templates', async (req, res) => { hash: template.serialized_source_guild.icon_hash, url: `https://cdn.discordapp.com/icons/${template.source_guild_id}/${template.serialized_source_guild.icon_hash}` } - } as unknown as delTemplate + } satisfies Partial } ); diff --git a/src/Routes/bots.ts b/src/Routes/bots.ts index 140037d6..cec05711 100644 --- a/src/Routes/bots.ts +++ b/src/Routes/bots.ts @@ -21,7 +21,6 @@ import express from "express"; import type { Request, Response } from "express"; import { APIApplication, APIApplicationCommand, APIUser, PresenceUpdateStatus, RESTPostOAuth2AccessTokenResult, UserFlags } from "discord.js"; import { OAuth2Scopes, RESTJSONErrorCodes, Routes } from "discord.js" -import { rest } from "../Util/Function/rest.js"; import fetch from "node-fetch"; import * as crypto from "crypto"; import * as Discord from "discord.js"; @@ -43,14 +42,13 @@ import { URL } from "url"; import type { DiscordAPIError } from "discord.js"; import type { botReasons } from "../../@types/enums.js"; import { Response as fetchRes } from "node-fetch"; +import { DAPI } from "../Util/Services/discord.js" import mdi from "markdown-it"; import entities from "html-entities"; const md = new mdi const router = express.Router(); -const DAPI = "https://discord.com/api/v10"; - function botType(bodyType: string): number { let type: botReasons = parseInt(bodyType); @@ -78,6 +76,7 @@ function botType(bodyType: string): number { return type; } + router.get("/search", (req: Request, res: Response) => { res.redirect("/search"); }); @@ -165,7 +164,7 @@ router.post( errors.push(res.__("common.error.bot.arr.clientIDTooLong")); } - await rest.get(Routes.user(req.body.clientID)) + await discord.bot.rest.get(Routes.user(req.body.clientID)) .then(() => { error = true; errors.push(res.__("common.error.bot.arr.clientIDIsUser")); @@ -276,7 +275,7 @@ router.post( } if (fetchServer) - await rest.get(Routes.guildChannels(req.body.widgetServer)) + await discord.bot.rest.get(Routes.guildChannels(req.body.widgetServer)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -333,7 +332,7 @@ router.post( } if (fetchChannel) - await rest.get(Routes.channel(req.body.widgetChannel)) + await discord.bot.rest.get(Routes.channel(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -510,7 +509,7 @@ router.post( let userFlags = 0 if (req.body.bot) { - const user = await rest.get(Routes.user(req.body.id)).catch(() => { }) as APIUser + const user = await discord.bot.rest.get(Routes.user(req.body.id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -521,7 +520,7 @@ router.post( errors: errors }); - (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() + discord.bot.rest.get(`/applications/${req.body.clientID || req.body.id}/rpc`) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -607,7 +606,7 @@ router.post( hidden: false, modHidden: false } - } as delBot); + } satisfies delBot); discord.channels.logs.send( `${settings.emoji.add} **${functions.escapeFormatting( @@ -642,6 +641,7 @@ router.post( shortDesc: req.body.shortDescription, longDesc: req.body.longDescription, modNotes: req.body.modNotes, + reviewNotes: [], editors, commands, owner: { @@ -684,9 +684,11 @@ router.post( approved: false, premium: false, siteBot: false, - archived: false + archived: false, + hidden: false, + modHidden: false } - } as delBot + } satisfies delBot } }); await botCache.updateBot(req.params.id); @@ -1067,7 +1069,7 @@ router.post( errors.push(res.__("common.error.bot.arr.clientIDTooLong")); } if (req.body.clientID !== req.params.id) - await rest.get(Routes.user(req.body.clientID)) + await discord.bot.rest.get(Routes.user(req.body.clientID)) .then(() => { error = true; errors.push( @@ -1213,7 +1215,7 @@ router.post( } if (fetchServer) - await rest.get(Routes.guildChannels(req.body.widgetChannel)) + await discord.bot.rest.get(Routes.guildChannels(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -1270,7 +1272,7 @@ router.post( } if (fetchChannel) - await rest.get(Routes.channel(req.body.widgetChannel)) + await discord.bot.rest.get(Routes.channel(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -1451,7 +1453,7 @@ router.post( let userFlags = 0 if (req.body.bot) { - const user = await rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser + const user = await discord.bot.rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -1467,8 +1469,7 @@ router.post( }); } - - (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() + discord.bot.rest.get(`/applications/${req.body.clientID || req.body.id}/rpc`) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -1572,7 +1573,7 @@ router.post( options: botExists.widgetbot.options, server: botExists.widgetbot.server } - } as delBot, + } satisfies Partial, new: { clientID: req.body.clientID, name: app.name, @@ -1612,7 +1613,7 @@ router.post( options: req.body.widgetOptions, server: req.body.widgetServer } - } as delBot + } satisfies Partial } }); await botCache.updateBot(req.params.id); @@ -2381,7 +2382,7 @@ router.post( } if (req.body.clientID !== req.params.id) - await rest.get(Routes.user(req.body.clientID)) + await discord.bot.rest.get(Routes.user(req.body.clientID)) .then(() => { error = true errors.push(res.__("common.error.bot.arr.clientIDIsUser")); @@ -2528,7 +2529,7 @@ router.post( } if (fetchServer) - await rest.get(Routes.guildChannels(req.body.widgetServer)) + await discord.bot.rest.get(Routes.guildChannels(req.body.widgetServer)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -2585,7 +2586,7 @@ router.post( } if (fetchChannel) - await rest.get(Routes.channel(req.body.widgetChannel)) + await discord.bot.rest.get(Routes.channel(req.body.widgetChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -2761,7 +2762,7 @@ router.post( let userFlags = 0 if (req.body.bot) { - const user = await rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser + const user = await discord.bot.rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } @@ -2772,8 +2773,7 @@ router.post( errors: errors }); - - (await fetch(DAPI + `/oauth2/applications/${req.body.clientID || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() + discord.bot.rest.get(`/applications/${req.body.clientID || req.body.id}/rpc`) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -2872,7 +2872,7 @@ router.post( status: { archived: true } - } as delBot, + } satisfies partialBot, new: { clientID: req.body.clientID, name: app.name, @@ -2915,7 +2915,7 @@ router.post( status: { archived: false } - } as delBot + } satisfies partialBot } }); await botCache.updateBot(req.params.id); @@ -3962,12 +3962,11 @@ router.get( let userFlags = 0 if (bot.scopes?.bot) { - const user = await rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser + const user = await discord.bot.rest.get(Routes.user(bot._id)).catch(() => { }) as APIUser if (user.public_flags) userFlags = user.public_flags } - - (await fetch(DAPI + `/oauth2/applications/${botExists.clientID || botExists._id || req.body.id}/rpc`, { headers: { authorization: `Bearer ${req.user.db.auth.accessToken}` } })).json() + discord.bot.rest.get(`/applications/${botExists.clientID || req.params.id}/rpc`) .then(async (app: APIApplication) => { if (app.bot_public === false) // not !app.bot_public; should not trigger when undefined return res.status(400).json({ @@ -3987,7 +3986,7 @@ router.get( }, commands, userFlags - } as delBot + } satisfies Partial } ); @@ -4005,7 +4004,7 @@ router.get( url: botExists.icon.url }, commands: botExists.commands - } as delBot, + } satisfies Partial, new: { name: app.name, icon: { @@ -4013,7 +4012,7 @@ router.get( url: `https://cdn.discordapp.com/app-icons/${app.id}/${app.icon}` }, commands - } as delBot + } satisfies Partial } }); await botCache.updateBot(req.params.id); diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index 75578f7f..7a44264d 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -20,10 +20,9 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; import { Response as fetchRes } from "node-fetch"; -import type { APIInvite, RequestData, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from "discord.js"; -import { RESTJSONErrorCodes, Routes } from "discord.js" +import type { APIInvite, DiscordAPIError, RESTGetAPIInviteQuery } from "discord.js"; +import { EmbedBuilder, RESTJSONErrorCodes, Routes, makeURLSearchParams } from "discord.js" import fetch from "node-fetch"; -import type { DiscordAPIError } from "discord.js"; import sanitizeHtml from "sanitize-html"; import settings from "../../settings.json" assert { type: "json" }; @@ -35,14 +34,13 @@ import * as userCache from "../Util/Services/userCaching.js"; import * as serverCache from "../Util/Services/serverCaching.js"; import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; -import { EmbedBuilder } from "discord.js"; import type { serverReasons } from "../../@types/enums.js"; -import { rest } from "../Util/Function/rest.js"; import mdi from "markdown-it"; import entities from "html-entities"; import { ParamsDictionary } from "express-serve-static-core"; import { ParsedQs } from "qs"; -const DAPI = "https://discord.com/api/v10"; +import { DAPI } from "../Util/Services/discord.js" + const md = new mdi const router = express.Router(); let reviewRequired = false; // Needs to be outside of the functions or it cannot be referenced outside of x function - AJ @@ -184,7 +182,7 @@ router.post( } if (fetchChannel) - await rest.get(Routes.channel(req.body.previewChannel)) + await discord.bot.rest.get(Routes.channel(req.body.previewChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -243,9 +241,10 @@ router.post( errors: errors }); - (await fetch(DAPI + `/invites/${req.body.invite}?with_counts=true&with_expiration=true`)).json() + discord.bot.rest.get(Routes.invite(req.body.invite), { + query: makeURLSearchParams({ with_counts: true, with_expiration: true } satisfies RESTGetAPIInviteQuery) + }) .then(async (invite: APIInvite) => { - console.log(invite) const serverExists: | delServer | undefined = await global.db @@ -292,7 +291,7 @@ router.post( status: { reviewRequired: reviewRequired } - } as delServer); + } satisfies delServer); discord.channels.logs.send( `${settings.emoji.add} **${functions.escapeFormatting( @@ -337,7 +336,7 @@ router.post( status: { reviewRequired: reviewRequired } - } as delServer + } satisfies delServer } }); @@ -598,7 +597,7 @@ router.post( } if (fetchChannel) - await rest.get(Routes.channel(req.body.previewChannel)) + await discord.bot.rest.get(Routes.channel(req.body.previewChannel)) .catch((e: DiscordAPIError) => { if ([400, 404].includes(Number(e.code))) { error = true; @@ -655,7 +654,9 @@ router.post( errors: errors }); - (await fetch(DAPI + `/invites/${req.body.invite}?with_counts=true&with_expiration=true`)).json() + discord.bot.rest.get(Routes.invite(req.body.invite), { + query: makeURLSearchParams({ with_counts: true, with_expiration: true } satisfies RESTGetAPIInviteQuery) + }) .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).json({ @@ -697,7 +698,7 @@ router.post( status: { reviewRequired: reviewRequired } - } as delServer + } satisfies Partial } ); @@ -741,7 +742,7 @@ router.post( status: { reviewRequired: reviewRequired } - } as delServer, + } satisfies Partial, old: { name: server.name, shortDesc: server.shortDesc, @@ -765,7 +766,7 @@ router.post( status: { reviewRequired: server.status.reviewRequired } - } as delServer + } satisfies Partial } }); @@ -1237,7 +1238,9 @@ router.get( req: req }); - (await fetch(DAPI + `/invites/${server.inviteCode}?with_counts=true&with_expiration=true`)).json() + discord.bot.rest.get(Routes.invite(server.inviteCode), { + query: makeURLSearchParams({ with_counts: true, with_expiration: true } satisfies RESTGetAPIInviteQuery) + }) .then(async (invite: APIInvite) => { if (invite.guild.id !== server._id) return res.status(400).render("status", { @@ -1270,7 +1273,7 @@ router.get( hash: invite.guild.icon, url: `https://cdn.discordapp.com/icons/${invite.guild.id}/${invite.guild.icon}` } - } as delServer + } satisfies Partial } ); @@ -1291,7 +1294,7 @@ router.get( hash: invite.guild.icon, url: `https://cdn.discordapp.com/icons/${invite.guild.id}/${invite.guild.icon}` } - } as delServer, + } satisfies Partial, old: { name: server.name, counts: { @@ -1302,7 +1305,7 @@ router.get( hash: server.icon.hash, url: server.icon.url } - } as delServer + } satisfies Partial } }); diff --git a/src/Routes/staff.ts b/src/Routes/staff.ts index fedbaad9..7f0183b6 100644 --- a/src/Routes/staff.ts +++ b/src/Routes/staff.ts @@ -32,7 +32,6 @@ import * as announcementCache from "../Util/Services/announcementCaching.js"; import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; import * as discord from "../Util/Services/discord.js"; -import { rest } from "../Util/Function/rest.js"; const router = express.Router(); router.get( @@ -927,7 +926,7 @@ router.get( .collection("users") .findOne({ _id: req.params.id }); - await rest.get(Routes.user(req.params.id)) + await discord.bot.rest.get(Routes.user(req.params.id)) .then(async (discordUser: APIUser) => { if (!user) { await global.db.collection("users").insertOne({ diff --git a/src/Routes/templates.ts b/src/Routes/templates.ts index 80fc40a0..25fcec21 100644 --- a/src/Routes/templates.ts +++ b/src/Routes/templates.ts @@ -31,11 +31,9 @@ import * as userCache from "../Util/Services/userCaching.js"; import * as templateCache from "../Util/Services/templateCaching.js"; import { variables } from "../Util/Function/variables.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; -import type { APITemplate } from "discord.js"; -import type { DiscordAPIError } from "discord.js"; -import { EmbedBuilder, Routes } from "discord.js"; +import type { APITemplate, DiscordAPIError } from "discord.js"; +import { EmbedBuilder, RESTJSONErrorCodes, Routes } from "discord.js"; import type { templateReasons } from "../../@types/enums.js"; -import { rest } from "../Util/Function/rest.js"; import mdi from "markdown-it"; import entities from "html-entities"; const md = new mdi @@ -155,7 +153,7 @@ router.post( errors: errors }); - await rest.get(Routes.template(req.body.code)) + await discord.bot.rest.get(Routes.template(req.body.code)) .then(async (template: APITemplate) => { await global.db.collection("templates").insertOne({ _id: template.code, @@ -194,7 +192,7 @@ router.post( linkToServerPage: false, template: `https://discord.new/${template.code}` } - } as delTemplate); + } satisfies delTemplate); discord.channels.logs.send( `${settings.emoji.add} **${functions.escapeFormatting( @@ -256,7 +254,7 @@ router.post( linkToServerPage: false, template: `https://discord.new/${template.code}` } - } as delTemplate + } satisfies delTemplate } }); @@ -272,7 +270,7 @@ router.post( }); }) .catch((error: DiscordAPIError) => { - if(error.code === 10057) + if (error.code === RESTJSONErrorCodes.UnknownGuildTemplate) return res.status(400).json({ error: true, status: 400, @@ -523,7 +521,7 @@ router.post( errors: errors }); - await rest.get(Routes.template(req.body.code)) + await discord.bot.rest.get(Routes.template(req.body.code)) .then(async (template: APITemplate) => { await global.db.collection("templates").updateOne( { _id: req.params.id }, @@ -559,7 +557,7 @@ router.post( linkToServerPage: linkToServerPage, template: `https://discord.new/${dbTemplate._id}` } - } as unknown as delTemplate + } satisfies Partial } ); @@ -614,7 +612,7 @@ router.post( linkToServerPage: linkToServerPage, template: `https://discord.new/${dbTemplate._id}` } - } as unknown as delTemplate, + } satisfies Partial, old: { name: dbTemplate.name, region: dbTemplate.region, @@ -644,7 +642,7 @@ router.post( linkToServerPage: linkToServerPage, template: `https://discord.new/${dbTemplate._id}` } - } as delTemplate + } satisfies Partial } }); @@ -658,7 +656,7 @@ router.post( }); }) .catch((error: DiscordAPIError) => { - if(error.code === 10057) + if (error.code === RESTJSONErrorCodes.UnknownGuildTemplate) return res.status(400).json({ error: true, status: 400, @@ -868,7 +866,7 @@ router.get( type: "Error" }); - await rest.get(Routes.template(req.params.id)) + await discord.bot.rest.get(Routes.template(req.params.id)) .then(async (template: APITemplate) => { await global.db.collection("templates").updateOne( { _id: req.params.id }, @@ -897,7 +895,7 @@ router.get( hash: template.serialized_source_guild.icon_hash, url: `https://cdn.discordapp.com/icons/${template.source_guild_id}/${template.serialized_source_guild.icon_hash}` } - } as unknown as delTemplate + } satisfies Partial } ); @@ -932,7 +930,7 @@ router.get( hash: template.serialized_source_guild.icon_hash, url: `https://cdn.discordapp.com/icons/${template.source_guild_id}/${template.serialized_source_guild.icon_hash}` } - } as unknown as delTemplate, + } satisfies Partial, old: { name: dbTemplate.name, region: dbTemplate.region, @@ -954,14 +952,14 @@ router.get( hash: dbTemplate.icon.hash, url: dbTemplate.icon.url } - } as delTemplate + } satisfies Partial } }); await templateCache.updateTemplate(req.params.id); }) .catch((error: DiscordAPIError) => { - if(error.code === 10057) + if (error.code === RESTJSONErrorCodes.UnknownGuildTemplate) return res.status(400).render("status", { title: res.__("common.error"), status: 400, diff --git a/src/Routes/users.ts b/src/Routes/users.ts index c189ebda..70053310 100644 --- a/src/Routes/users.ts +++ b/src/Routes/users.ts @@ -19,9 +19,8 @@ along with this program. If not, see . import express from "express"; import type { Request, Response } from "express"; -import type { APIUser } from "discord.js"; +import type { APIUser, DiscordAPIError } from "discord.js"; import { Routes } from "discord.js"; -import { rest } from "../Util/Function/rest.js"; import * as discord from "../Util/Services/discord.js"; import * as banned from "../Util/Services/banned.js"; import { variables } from "../Util/Function/variables.js"; @@ -32,7 +31,6 @@ import * as serverCache from "../Util/Services/serverCaching.js"; import * as templateCache from "../Util/Services/templateCaching.js"; import * as userCache from "../Util/Services/userCaching.js"; import * as tokenManager from "../Util/Services/adminTokenManager.js"; -import type { DiscordAPIError } from "discord.js"; import { themes } from "../../@types/enums.js"; import entities from "html-entities"; @@ -530,7 +528,7 @@ router.get( req: req }); - await rest.get(Routes.user(req.params.id)) + await discord.bot.rest.get(Routes.user(req.params.id)) .then(async (user: APIUser) => { await global.db.collection("users").updateOne( { _id: req.params.id }, @@ -542,7 +540,7 @@ router.get( hash: user.avatar, url: `https://cdn.discordapp.com/avatars/${req.params.id}/${user.avatar}` } - } as delUser + } satisfies Partial } ); @@ -560,7 +558,7 @@ router.get( hash: userProfile.avatar.hash, url: userProfile.avatar.url } - } as delUser, + } satisfies Partial, new: { name: user.username, flags: user.public_flags, @@ -568,7 +566,7 @@ router.get( hash: user.avatar, url: `https://cdn.discordapp.com/avatars/${req.params.id}/${user.avatar}` } - } as delUser + } satisfies Partial } }); await userCache.updateUser(req.params.id); diff --git a/src/Util/Function/permissions.ts b/src/Util/Function/permissions.ts index ecca1a7c..6ebbc059 100644 --- a/src/Util/Function/permissions.ts +++ b/src/Util/Function/permissions.ts @@ -21,7 +21,6 @@ import { OAuth2Scopes, Routes } from "discord.js"; import { Request, Response } from "express"; import settings from "../../../settings.json" assert { type: "json" }; import * as discord from "../Services/discord.js"; -import { rest } from "./rest.js"; export const auth = (req: Request, res: Response, next: () => void) => { if (req.session.logoutJustCont === true) { req.session.logoutJust = false; @@ -59,7 +58,7 @@ export const member = async (req: Request, res: Response, next: () => void) => { } if (!await discord.getMember(req.body.id)) { - await rest.get(Routes.guildMembers(settings.guild.main), { body: { access_token: req.user.db.auth.accessToken } }) + await discord.bot.rest.get(Routes.guildMembers(settings.guild.main), { body: { access_token: req.user.db.auth.accessToken } }) .catch(() => { }); } diff --git a/src/Util/Function/rest.ts b/src/Util/Function/rest.ts deleted file mode 100644 index 4ca94cf8..00000000 --- a/src/Util/Function/rest.ts +++ /dev/null @@ -1,8 +0,0 @@ - -import { REST } from '@discordjs/rest'; -import settings from "../../../settings.json" assert { type: "json" }; - -// Create rest client -export const rest = new REST({version: '10'}).setToken(settings.secrets.discord.token) - -// Custom exportable functions below (if any) \ No newline at end of file diff --git a/src/Util/Services/banned.ts b/src/Util/Services/banned.ts index f890fd47..b0321125 100644 --- a/src/Util/Services/banned.ts +++ b/src/Util/Services/banned.ts @@ -28,7 +28,7 @@ export async function check(user: string): Promise { export async function updateBanlist() { await global.redis?.del("bans"); const bans = await guilds.main.bans.fetch().catch(e => console.error(e)) as Collection; - if(bans.size > 0) await global.redis?.hmset( + if (bans.size > 0) await global.redis?.hmset( "bans", ...bans.map((ban) => [ban.user.id, true]) ); diff --git a/src/Util/Services/discord.ts b/src/Util/Services/discord.ts index 690f5f3b..85cb14b1 100644 --- a/src/Util/Services/discord.ts +++ b/src/Util/Services/discord.ts @@ -26,6 +26,8 @@ import { PresenceUpdateStatus, GatewayIntentBits } from "discord.js"; import * as botCache from "./botCaching.js"; import { hostname } from "os"; +export const DAPI = "https://discord.com/api/v10"; + const prefix = "statuses"; // If someone is to self-host or contribute, setting datadog metrics is a lot, // if they have nothing set in the secret section of settings.json, let's ignore metrics - AJ @@ -38,21 +40,7 @@ setInterval(async () => { await postTodaysGrowth(); }, 8.568e+7); // 23.8h, to account for eventual time drift if the site is online for a while (which is the goal lol) - AJ -class Client extends Discord.Client { - /* readonly rest: { - applications: any; - channels: any; - gateway: any; - guilds: any; - invites: any; - oauth2: any; - users: any; - voice: any; - webhooks: any; - } */ -} - -export const bot = new Client({ +export const bot = new Discord.Client({ allowedMentions: { parse: [] }, intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences], }); diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 9ff219f1..7f54d02d 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -10,8 +10,8 @@ <% if (pageType.bot === true) { let color = "#BA2EFF" - if(req.user) color = req.user.db.preferences.defaultColour - if(bot.theme?.useCustomColour) { + if (req.user) color = req.user.db.preferences.defaultColour + if (bot.theme?.useCustomColour) { color = bot.theme.colour; foreground = functions.getForeground(color); } diff --git a/views/partials/isDefaultCSS/codeTag.ejs b/views/partials/isDefaultCSS/codeTag.ejs index 8a16528d..f28ccfa7 100644 --- a/views/partials/isDefaultCSS/codeTag.ejs +++ b/views/partials/isDefaultCSS/codeTag.ejs @@ -1,7 +1,7 @@ <% let color = "#BA2EFF"; let foreground = "#ffffff"; - if(req.user) { + if (req.user) { color = req.user.db.preferences.defaultColour; foreground = req.user.db.preferences.foreground; } diff --git a/views/templates/bots/edit.ejs b/views/templates/bots/edit.ejs index 38d6bee3..15260317 100644 --- a/views/templates/bots/edit.ejs +++ b/views/templates/bots/edit.ejs @@ -237,7 +237,7 @@
-
+

<%= __("page.bots.theme.color.details") %> @@ -390,7 +390,7 @@ const useCustomColor = document.querySelector('#form_customColourSwitch') const customColor = document.querySelector('#form_customColour') useCustomColor.addEventListener('change', () => { - if(useCustomColor.checked) { + if (useCustomColor.checked) { customColor.style.display = 'inherit' } else customColor.style.display = 'none' }) diff --git a/views/templates/bots/submit.ejs b/views/templates/bots/submit.ejs index 5f6de81d..0016b0a3 100644 --- a/views/templates/bots/submit.ejs +++ b/views/templates/bots/submit.ejs @@ -443,7 +443,7 @@ }) const getApp = async id => { - const app = await (await fetch(`https://discord.com/api/v9/applications/${id}/rpc`)).json() + const app = await (await fetch(`https://discord.com/api/v10/applications/${id}/rpc`)).json() if (!app.id) return name.innerText = app.name @@ -497,7 +497,7 @@ const useCustomColour = document.querySelector('#form_customColourSwitch') const customColour = document.querySelector('#customColor') useCustomColour.addEventListener('change', () => { - if(useCustomColour.checked) { + if (useCustomColour.checked) { customColour.style.display = 'inherit' } else customColour.style.display = 'none' }) diff --git a/views/templates/search.ejs b/views/templates/search.ejs index fc91a8f0..bdad9e34 100644 --- a/views/templates/search.ejs +++ b/views/templates/search.ejs @@ -94,7 +94,6 @@ const input = document.querySelector("input.input.is-rounded.is-dark#searchInput"); - // if (input.value.match(/gay(\s+)?(men\s+)?.*/i)) return window.location.href = "/users/302604426781261824"; - This causes simple terms like "gay" to result in a redirect, which is, not intended is my guess - AJ if (input.value.toLowerCase() === "developers developers developers developers") return document.body.innerHTML = ``; const c = document.querySelector("input[type='checkbox']#users"); diff --git a/views/templates/serverTemplates/submit.ejs b/views/templates/serverTemplates/submit.ejs index 7e2b67b4..146b27a4 100644 --- a/views/templates/serverTemplates/submit.ejs +++ b/views/templates/serverTemplates/submit.ejs @@ -165,7 +165,7 @@ scroll(0, 0); } else document.getElementById("errors").style.display = "none"; - const template = await (await fetch(`https://discord.com/api/v8/guilds/templates/${code.value}`)).json() + const template = await (await fetch(`https://discord.com/api/v10/guilds/templates/${code.value}`)).json() if (!template.name) return name.innerText = template.name diff --git a/views/templates/serverTemplates/view.ejs b/views/templates/serverTemplates/view.ejs index f3a7cdf6..dd6137a4 100644 --- a/views/templates/serverTemplates/view.ejs +++ b/views/templates/serverTemplates/view.ejs @@ -419,7 +419,7 @@