diff --git a/.devcontainer/arm64.Dockerfile b/.devcontainer/arm64.Dockerfile new file mode 100644 index 0000000..92ade79 --- /dev/null +++ b/.devcontainer/arm64.Dockerfile @@ -0,0 +1,59 @@ +FROM arm64v8/node:20-slim + +# Please refer to https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker +# for more information on running puppeteer in docker + +# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) +# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer +# installs, work. +RUN apt-get update \ + && apt-get install -y wget gnupg \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise +# uncomment the following lines to have `dumb-init` as PID 1 +# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init +# RUN chmod +x /usr/local/bin/dumb-init +# ENTRYPOINT ["dumb-init", "--"] + +# Uncomment to skip the chromium download when installing puppeteer. If you do, +# you'll need to launch puppeteer with: +# browser.launch({executablePath: 'google-chrome-stable'}) +# ENV PUPPETEER_SKIP_DOWNLOAD true + +# Create app/working/bot directory +RUN mkdir -p /app +WORKDIR /app + +# Install app production dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ +RUN npm ci --omit=dev + +# Install puppeteer so it's available in the container. +# Add user so we don't need --no-sandbox. +# same layer as npm install to keep re-chowned files from using up several hundred MBs more space +RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \ + && mkdir -p /home/pptruser/Downloads \ + && chown -R pptruser:pptruser /home/pptruser \ + && chown -R pptruser:pptruser /app/node_modules \ + && chown -R pptruser:pptruser /app/package.json \ + && chown -R pptruser:pptruser /app/package-lock.json + +# Run everything after as non-privileged user. +USER pptruser + +# Bundle app source +COPY . ./ + +# Optional API/Backend port +EXPOSE 3000 + +# Run the start command +CMD [ "npm", "run", "start" ] diff --git a/.dockerignore b/.dockerignore index 86bf3ae..52b95c9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # Config .env *.env +.env.example Procfile release.config.js @@ -11,6 +12,7 @@ npm-debug.log # Ignoring all markdown files *.md +tutorials # Github .git @@ -23,15 +25,17 @@ npm-debug.log Dockerfile *.Dockerfile docker-compose.yml +*.docker-compose.yml +.dockerignore # Linter files .markdownlint.json .eslintrc.json - -# Etc -LICENSE linter-output.txt -.env.example -# .config.example.js used as fallback in test script -tsconfig.json # Only used to generate types in development -typings.d.ts # exported typings file \ No newline at end of file + +# Only used to generate types in development +tsconfig.json +# Exported typings file +typings.d.ts +# README static files +assets/showcase \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 49adc81..aa56175 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,31 @@ -FROM node:19 +FROM node:20-slim -# Docker Puppeteer reference: -# https://pptr.dev/guides/docker -# https://github.com/puppeteer/puppeteer/blob/main/docker/Dockerfile +# Please refer to https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker +# for more information on running puppeteer in docker # Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) -# Note: this installs the necessary libs to make the bundled version of Chrome that Puppeteer +# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer # installs, work. -RUN apt-get update --no-install-recommends\ - && apt-get install -y --no-install-recommends wget gnupg \ - && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \ - && sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ +RUN apt-get update \ + && apt-get install -y wget gnupg \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ && apt-get update \ - && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \ + && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* +# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise +# uncomment the following lines to have `dumb-init` as PID 1 +# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init +# RUN chmod +x /usr/local/bin/dumb-init +# ENTRYPOINT ["dumb-init", "--"] + +# Uncomment to skip the chromium download when installing puppeteer. If you do, +# you'll need to launch puppeteer with: +# browser.launch({executablePath: 'google-chrome-stable'}) +# ENV PUPPETEER_SKIP_DOWNLOAD true + # Create app/working/bot directory RUN mkdir -p /app WORKDIR /app @@ -26,6 +36,19 @@ WORKDIR /app COPY package*.json ./ RUN npm ci --omit=dev +# Install puppeteer so it's available in the container. +# Add user so we don't need --no-sandbox. +# same layer as npm install to keep re-chowned files from using up several hundred MBs more space +RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \ + && mkdir -p /home/pptruser/Downloads \ + && chown -R pptruser:pptruser /home/pptruser \ + && chown -R pptruser:pptruser /app/node_modules \ + && chown -R pptruser:pptruser /app/package.json \ + && chown -R pptruser:pptruser /app/package-lock.json + +# Run everything after as non-privileged user. +USER pptruser + # Bundle app source COPY . ./ diff --git a/docker-compose.yml b/docker-compose.yml index a2d73f9..5cb113d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,23 @@ version: '3.1' services: client: - build: . - container_name: client - restart: always + container_name: cftools-discord-bot + build: + context: . + dockerfile: Dockerfile + restart: unless-stopped volumes: - # Bind mount, read-only app - - ./:/app:ro - # Anonymous volume - - /app/node_modules + - ./config/config.js:/app/config/config.js + - ./config/servers.js:/app/config/servers.js + - ./cftools-discord-bot.db:/app/cftools-discord-bot.db env_file: - - ./config/.env \ No newline at end of file + - config/.env + + puppeteer: + container_name: cftools-discord-bot-puppeteer + image: buildkite/puppeteer + restart: unless-stopped + volumes: + - ./cftools-discord-bot.db:/app/cftools-discord-bot.db + env_file: + - config/.env \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c7fdbd9..86cd883 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,12 @@ "version": "1.9.0", "license": "MIT", "dependencies": { - "@discordjs/rest": "^2.2.0", + "@discordjs/rest": "2.0.0", + "@discordjs/ws": "1.0.0", "@mirasaki/logger": "^1.0.5", "cftools-sdk": "^3.1.7", "common-tags": "^1.8.2", - "discord.js": "^14.14.1", + "discord.js": "14.12.1", "dotenv": "^16.4.2", "express": "^4.18.2", "heatmap.js": "^2.0.5", @@ -349,30 +350,22 @@ } }, "node_modules/@discordjs/rest": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.2.0.tgz", - "integrity": "sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.0.0.tgz", + "integrity": "sha512-CW9ldfzsRzUbHcS4Oqu5+Moo+yrQ5qQ9groKNxPOzcoq2nuXa/fXOXkuQtQHcTeSVXsC9cmJ56M8gBDBUyLgGA==", "dependencies": { - "@discordjs/collection": "^2.0.0", - "@discordjs/util": "^1.0.2", + "@discordjs/collection": "^1.5.2", + "@discordjs/util": "^1.0.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.5.1", "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "magic-bytes.js": "^1.5.0", - "tslib": "^2.6.2", - "undici": "5.27.2" + "discord-api-types": "^0.37.50", + "magic-bytes.js": "^1.0.15", + "tslib": "^2.6.1", + "undici": "^5.22.1" }, "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz", - "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==", - "engines": { - "node": ">=18" + "node": ">=16.9.0" } }, "node_modules/@discordjs/util": { @@ -384,30 +377,22 @@ } }, "node_modules/@discordjs/ws": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.2.tgz", - "integrity": "sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.0.tgz", + "integrity": "sha512-POiImjuQJzwCxjJs4JCtDcTjzvjVsVQbnsaoW/F03yTVdrj/xSpmgv4383AnpNEYXI+CA6ggkz37phZDsZQ1NQ==", "dependencies": { - "@discordjs/collection": "^2.0.0", - "@discordjs/rest": "^2.1.0", - "@discordjs/util": "^1.0.2", + "@discordjs/collection": "^1.5.2", + "@discordjs/rest": "^2.0.0", + "@discordjs/util": "^1.0.0", "@sapphire/async-queue": "^1.5.0", - "@types/ws": "^8.5.9", + "@types/ws": "^8.5.5", "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "tslib": "^2.6.2", - "ws": "^8.14.2" + "discord-api-types": "^0.37.50", + "tslib": "^2.6.1", + "ws": "^8.13.0" }, "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/ws/node_modules/@discordjs/collection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz", - "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==", - "engines": { - "node": ">=18" + "node": ">=16.9.0" } }, "node_modules/@eslint-community/eslint-utils": { @@ -2726,27 +2711,27 @@ "integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==" }, "node_modules/discord.js": { - "version": "14.14.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.1.tgz", - "integrity": "sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==", - "dependencies": { - "@discordjs/builders": "^1.7.0", - "@discordjs/collection": "1.5.3", - "@discordjs/formatters": "^0.3.3", - "@discordjs/rest": "^2.1.0", - "@discordjs/util": "^1.0.2", - "@discordjs/ws": "^1.0.2", - "@sapphire/snowflake": "3.5.1", - "@types/ws": "8.5.9", - "discord-api-types": "0.37.61", - "fast-deep-equal": "3.1.3", - "lodash.snakecase": "4.1.1", - "tslib": "2.6.2", - "undici": "5.27.2", - "ws": "8.14.2" + "version": "14.12.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.12.1.tgz", + "integrity": "sha512-gGjhTkauIPgFXxpBl0UZgyehrKhDe90cIS8Hn1xFBYQ63EuUAkKoUqRNmc/pcla6DD16s4cUz5tAbdSpXivnxw==", + "dependencies": { + "@discordjs/builders": "^1.6.4", + "@discordjs/collection": "^1.5.2", + "@discordjs/formatters": "^0.3.1", + "@discordjs/rest": "^2.0.0", + "@discordjs/util": "^1.0.0", + "@discordjs/ws": "^1.0.0", + "@sapphire/snowflake": "^3.5.1", + "@types/ws": "^8.5.5", + "discord-api-types": "^0.37.50", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.6.1", + "undici": "^5.22.1", + "ws": "^8.13.0" }, "engines": { - "node": ">=16.11.0" + "node": ">=16.9.0" } }, "node_modules/doctrine": { @@ -4346,9 +4331,9 @@ } }, "node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==" }, "node_modules/ipaddr.js": { "version": "1.9.1", @@ -10165,7 +10150,7 @@ "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dependencies": { - "ip": "^2.0.0", + "ip": "^1.1.8", "smart-buffer": "^4.2.0" }, "engines": { @@ -10187,9 +10172,9 @@ } }, "node_modules/socks/node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" }, "node_modules/source-map": { "version": "0.6.1", @@ -10666,9 +10651,9 @@ "dev": true }, "node_modules/undici": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", - "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -11215,26 +11200,19 @@ } }, "@discordjs/rest": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.2.0.tgz", - "integrity": "sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.0.0.tgz", + "integrity": "sha512-CW9ldfzsRzUbHcS4Oqu5+Moo+yrQ5qQ9groKNxPOzcoq2nuXa/fXOXkuQtQHcTeSVXsC9cmJ56M8gBDBUyLgGA==", "requires": { - "@discordjs/collection": "^2.0.0", - "@discordjs/util": "^1.0.2", + "@discordjs/collection": "^1.5.2", + "@discordjs/util": "^1.0.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.5.1", "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "magic-bytes.js": "^1.5.0", - "tslib": "^2.6.2", - "undici": "5.27.2" - }, - "dependencies": { - "@discordjs/collection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz", - "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==" - } + "discord-api-types": "^0.37.50", + "magic-bytes.js": "^1.0.15", + "tslib": "^2.6.1", + "undici": "^5.22.1" } }, "@discordjs/util": { @@ -11243,26 +11221,19 @@ "integrity": "sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==" }, "@discordjs/ws": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.2.tgz", - "integrity": "sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.0.tgz", + "integrity": "sha512-POiImjuQJzwCxjJs4JCtDcTjzvjVsVQbnsaoW/F03yTVdrj/xSpmgv4383AnpNEYXI+CA6ggkz37phZDsZQ1NQ==", "requires": { - "@discordjs/collection": "^2.0.0", - "@discordjs/rest": "^2.1.0", - "@discordjs/util": "^1.0.2", + "@discordjs/collection": "^1.5.2", + "@discordjs/rest": "^2.0.0", + "@discordjs/util": "^1.0.0", "@sapphire/async-queue": "^1.5.0", - "@types/ws": "^8.5.9", + "@types/ws": "^8.5.5", "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "tslib": "^2.6.2", - "ws": "^8.14.2" - }, - "dependencies": { - "@discordjs/collection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz", - "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==" - } + "discord-api-types": "^0.37.50", + "tslib": "^2.6.1", + "ws": "^8.13.0" } }, "@eslint-community/eslint-utils": { @@ -12963,24 +12934,24 @@ "integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==" }, "discord.js": { - "version": "14.14.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.1.tgz", - "integrity": "sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==", + "version": "14.12.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.12.1.tgz", + "integrity": "sha512-gGjhTkauIPgFXxpBl0UZgyehrKhDe90cIS8Hn1xFBYQ63EuUAkKoUqRNmc/pcla6DD16s4cUz5tAbdSpXivnxw==", "requires": { - "@discordjs/builders": "^1.7.0", - "@discordjs/collection": "1.5.3", - "@discordjs/formatters": "^0.3.3", - "@discordjs/rest": "^2.1.0", - "@discordjs/util": "^1.0.2", - "@discordjs/ws": "^1.0.2", - "@sapphire/snowflake": "3.5.1", - "@types/ws": "8.5.9", - "discord-api-types": "0.37.61", - "fast-deep-equal": "3.1.3", - "lodash.snakecase": "4.1.1", - "tslib": "2.6.2", - "undici": "5.27.2", - "ws": "8.14.2" + "@discordjs/builders": "^1.6.4", + "@discordjs/collection": "^1.5.2", + "@discordjs/formatters": "^0.3.1", + "@discordjs/rest": "^2.0.0", + "@discordjs/util": "^1.0.0", + "@discordjs/ws": "^1.0.0", + "@sapphire/snowflake": "^3.5.1", + "@types/ws": "^8.5.5", + "discord-api-types": "^0.37.50", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.6.1", + "undici": "^5.22.1", + "ws": "^8.13.0" } }, "doctrine": { @@ -14159,9 +14130,9 @@ } }, "ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==" }, "ipaddr.js": { "version": "1.9.1", @@ -18181,14 +18152,13 @@ "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "requires": { - "ip": "^2.0.0", + "ip": "^1.1.8", "smart-buffer": "^4.2.0" }, "dependencies": { "ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + "version": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" } } }, @@ -18554,9 +18524,9 @@ "dev": true }, "undici": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", - "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", "requires": { "@fastify/busboy": "^2.0.0" } diff --git a/package.json b/package.json index 6c82423..cf29820 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,12 @@ "types": "npx -p typescript tsc src/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir types" }, "dependencies": { - "@discordjs/rest": "^2.2.0", + "@discordjs/rest": "2.0.0", + "@discordjs/ws": "1.0.0", "@mirasaki/logger": "^1.0.5", "cftools-sdk": "^3.1.7", "common-tags": "^1.8.2", - "discord.js": "^14.14.1", + "discord.js": "14.12.1", "dotenv": "^16.4.2", "express": "^4.18.2", "heatmap.js": "^2.0.5",