diff --git a/.gitignore b/.gitignore index 9ae1fac..c1dae3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ .env -.yarn +.yarn/* .pnp.* dist build_cache src/private src/*.json +!.yarn/patches diff --git a/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch b/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch new file mode 100644 index 0000000..b3135e5 --- /dev/null +++ b/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch @@ -0,0 +1,13 @@ +diff --git a/src/structures/BaseInteraction.js b/src/structures/BaseInteraction.js +index 8a25f6f6ac324f2596cc1891aa4b0ef5146abbab..914a125b7ccb59e779607a12dc3678e77870eafc 100644 +--- a/src/structures/BaseInteraction.js ++++ b/src/structures/BaseInteraction.js +@@ -103,7 +103,7 @@ class BaseInteraction extends Base { + * The entitlements for the invoking user, representing access to premium SKUs + * @type {Collection} + */ +- this.entitlements = data.entitlements.reduce( ++ this.entitlements = (data.entitlements ?? []).reduce( + (coll, entitlement) => coll.set(entitlement.id, this.client.application.entitlements._add(entitlement)), + new Collection(), + ); diff --git a/Dockerfile b/Dockerfile index fbc29aa..3766d3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ RUN apk update && apk upgrade && apk add --no-cache git fontconfig ttf-dejavu WORKDIR /Daggerbot RUN npm install -g typescript RUN git config --global --add safe.directory /Daggerbot +COPY .yarn/patches .yarn/patches COPY tsconfig.json package.json yarn.lock .yarnrc.yml ./ RUN yarn diff --git a/package.json b/package.json index 00213b4..5175a55 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@toast/tokenservice-client": "1.2.8", "ansi-colors": "4.1.3", "dayjs": "1.11.11", - "discord.js": "14.15.3", + "discord.js": "patch:discord.js@npm%3A14.15.3#~/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch", "fast-xml-parser": "4.4.0", "mathjs": "13.0.0", "ms": "2.1.3", diff --git a/yarn.lock b/yarn.lock index 9c1c681..267dacb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -667,7 +667,7 @@ __metadata: "@types/node-cron": "npm:3.0.11" ansi-colors: "npm:4.1.3" dayjs: "npm:1.11.11" - discord.js: "npm:14.15.3" + discord.js: "patch:discord.js@npm%3A14.15.3#~/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch" fast-xml-parser: "npm:4.4.0" mathjs: "npm:13.0.0" ms: "npm:2.1.3" @@ -733,6 +733,26 @@ __metadata: languageName: node linkType: hard +"discord.js@patch:discord.js@npm%3A14.15.3#~/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch": + version: 14.15.3 + resolution: "discord.js@patch:discord.js@npm%3A14.15.3#~/.yarn/patches/discord.js-npm-14.15.3-0c74284e59.patch::version=14.15.3&hash=c1b3e5" + dependencies: + "@discordjs/builders": "npm:^1.8.2" + "@discordjs/collection": "npm:1.5.3" + "@discordjs/formatters": "npm:^0.4.0" + "@discordjs/rest": "npm:^2.3.0" + "@discordjs/util": "npm:^1.1.0" + "@discordjs/ws": "npm:^1.1.1" + "@sapphire/snowflake": "npm:3.5.3" + discord-api-types: "npm:0.37.83" + fast-deep-equal: "npm:3.1.3" + lodash.snakecase: "npm:4.1.1" + tslib: "npm:2.6.2" + undici: "npm:6.13.0" + checksum: 10/6c13259ed2f3073e67ae3cfc141269f41cbb0ece4397bf3b97fdeaf8e005e9d47fb91edb348d168fa5f42a685caaf166dfd13441af95281e42cc3337e428b340 + languageName: node + linkType: hard + "dottie@npm:^2.0.6": version: 2.0.6 resolution: "dottie@npm:2.0.6"