1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-25 23:15:38 -05:00

Patch d.js for Discord issue that breaks interactions

This commit is contained in:
toast-ts 2024-07-03 10:15:26 +10:00
parent f4f0545da9
commit a83005b852
5 changed files with 38 additions and 3 deletions

3
.gitignore vendored
View File

@ -1,7 +1,8 @@
.env .env
.yarn .yarn/*
.pnp.* .pnp.*
dist dist
build_cache build_cache
src/private src/private
src/*.json src/*.json
!.yarn/patches

View File

@ -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<Snowflake, Entitlement>}
*/
- this.entitlements = data.entitlements.reduce(
+ this.entitlements = (data.entitlements ?? []).reduce(
(coll, entitlement) => coll.set(entitlement.id, this.client.application.entitlements._add(entitlement)),
new Collection(),
);

View File

@ -7,6 +7,7 @@ RUN apk update && apk upgrade && apk add --no-cache git fontconfig ttf-dejavu
WORKDIR /Daggerbot WORKDIR /Daggerbot
RUN npm install -g typescript RUN npm install -g typescript
RUN git config --global --add safe.directory /Daggerbot RUN git config --global --add safe.directory /Daggerbot
COPY .yarn/patches .yarn/patches
COPY tsconfig.json package.json yarn.lock .yarnrc.yml ./ COPY tsconfig.json package.json yarn.lock .yarnrc.yml ./
RUN yarn RUN yarn

View File

@ -34,7 +34,7 @@
"@toast/tokenservice-client": "1.2.8", "@toast/tokenservice-client": "1.2.8",
"ansi-colors": "4.1.3", "ansi-colors": "4.1.3",
"dayjs": "1.11.11", "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", "fast-xml-parser": "4.4.0",
"mathjs": "13.0.0", "mathjs": "13.0.0",
"ms": "2.1.3", "ms": "2.1.3",

View File

@ -667,7 +667,7 @@ __metadata:
"@types/node-cron": "npm:3.0.11" "@types/node-cron": "npm:3.0.11"
ansi-colors: "npm:4.1.3" ansi-colors: "npm:4.1.3"
dayjs: "npm:1.11.11" 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" fast-xml-parser: "npm:4.4.0"
mathjs: "npm:13.0.0" mathjs: "npm:13.0.0"
ms: "npm:2.1.3" ms: "npm:2.1.3"
@ -733,6 +733,26 @@ __metadata:
languageName: node languageName: node
linkType: hard 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": "dottie@npm:^2.0.6":
version: 2.0.6 version: 2.0.6
resolution: "dottie@npm:2.0.6" resolution: "dottie@npm:2.0.6"