From 057cb4da75d96653735c45af973bd0f686614baa Mon Sep 17 00:00:00 2001 From: kevinlul <6320810+kevinlul@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:18:02 -0400 Subject: [PATCH] Bump discord.js to 14.16.2 --- .github/dependabot.yml | 3 +- package.json | 6 +-- src/slash/start.ts | 2 +- src/util/discord.ts | 2 +- test/events/messageCreate.unit.ts | 6 +-- yarn.lock | 84 +++++++++++++++---------------- 6 files changed, 50 insertions(+), 53 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 55d4c1b6..00b522ee 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,8 +15,7 @@ updates: allow: - dependency-type: all groups: - development: - dependency-type: development + all: patterns: - "*" - package-ecosystem: docker diff --git a/package.json b/package.json index c7fd0cb3..324a68c2 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "async-mutex": "^0.5.0", "coveralls": "link:./node_modules/.NULL", "debug": "^4.3.7", - "discord.js": "^14.16.1", + "discord.js": "^14.16.2", "dotenv": "^16.4.5", "jimp": "link:./node_modules/.NULL", "make-fetch-happen": "^13.0.1", @@ -47,7 +47,7 @@ "devDependencies": { "@alphakretin/essentials": "^6.2.0", "@alphakretin/mocha-ecosystem": "^1.1.0", - "@testcontainers/postgresql": "^10.13.0", + "@testcontainers/postgresql": "^10.13.1", "@types/debug": "^4.1.12", "@types/make-fetch-happen": "^10.0.4", "@types/node-fetch": "^2.6.11" @@ -68,4 +68,4 @@ "nyc": { "extends": "@alphakretin/mocha-ecosystem" } -} \ No newline at end of file +} diff --git a/src/slash/start.ts b/src/slash/start.ts index cc50b0f0..b737d080 100644 --- a/src/slash/start.ts +++ b/src/slash/start.ts @@ -54,7 +54,7 @@ export class StartCommand extends AutocompletableCommand { if (tournament.publicChannel) { const publicChannel = await interaction.client.channels.fetch(tournament.publicChannel); - if (publicChannel && publicChannel.isTextBased() && !publicChannel.isDMBased()) { + if (publicChannel && publicChannel.isSendable()) { if (tournament.registerMessage) { const registerMessage = await publicChannel.messages.fetch(tournament.registerMessage); await registerMessage?.delete(); diff --git a/src/util/discord.ts b/src/util/discord.ts index 5c852249..458f7268 100644 --- a/src/util/discord.ts +++ b/src/util/discord.ts @@ -4,7 +4,7 @@ import { UserError } from "./errors"; // eslint-disable-next-line @typescript-eslint/explicit-function-return-type export async function send(bot: Client, channelId: string, ...args: Parameters) { const channel = await bot.channels.fetch(channelId); - if (channel?.isTextBased() && !channel.isDMBased()) { + if (channel?.isSendable()) { return await channel.send(...args); } throw new Error(`${channelId} is not a text channel`); diff --git a/test/events/messageCreate.unit.ts b/test/events/messageCreate.unit.ts index 96148a25..8a505796 100644 --- a/test/events/messageCreate.unit.ts +++ b/test/events/messageCreate.unit.ts @@ -93,8 +93,7 @@ describe("Direct message submissions", function () { const replySpy = this.stub(sampleMessage, "reply").resolves(); const send = this.spy(); const fetchStub = this.stub(mockBotClient.channels, "fetch").resolves({ - isTextBased: () => true, - isDMBased: () => false, + isSendable: () => true, send // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); @@ -197,8 +196,7 @@ describe("Direct message submissions", function () { const replySpy = this.stub(sampleMessage, "reply").resolves(); const send = this.spy(); const fetchStub = this.stub(mockBotClient.channels, "fetch").resolves({ - isTextBased: () => true, - isDMBased: () => false, + isSendable: () => true, send // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); diff --git a/yarn.lock b/yarn.lock index 07bf16e8..6520db2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -292,9 +292,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.6.1": - version "4.11.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" - integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== "@eslint/eslintrc@^2.1.4": version "2.1.4" @@ -636,12 +636,12 @@ resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.5.tgz#3abc203c79b8c3e90fd6c156a0c62d5403520e12" integrity sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw== -"@testcontainers/postgresql@^10.13.0": - version "10.13.0" - resolved "https://registry.yarnpkg.com/@testcontainers/postgresql/-/postgresql-10.13.0.tgz#ccbfd01062d697c43e2ad4fc5dbf7d746f7e73af" - integrity sha512-wsZHOEkcAA2rszCeq5Jk/46FwjpuQCxx8dT41Ka7Pjk41WP41vgFptXeykQbd8qqIe8V7vaXcbuzprAec58V4g== +"@testcontainers/postgresql@^10.13.1": + version "10.13.1" + resolved "https://registry.yarnpkg.com/@testcontainers/postgresql/-/postgresql-10.13.1.tgz#62e4a6f5c2a0fa990e0183cbfda0444ca3150f21" + integrity sha512-HAh/3uLAzAhOmzXsOE6hVxkvetczPnX/Zoyt+SgK7QotW98Npr1MDx8OKiaLGTJ8XkIvVvS4Ch6bl+frt4pnkQ== dependencies: - testcontainers "^10.13.0" + testcontainers "^10.13.1" "@tsconfig/node10@^1.0.7": version "1.0.11" @@ -1125,18 +1125,18 @@ bare-events@^2.0.0, bare-events@^2.2.0: integrity sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q== bare-fs@^2.1.1: - version "2.3.4" - resolved "https://registry.yarnpkg.com/bare-fs/-/bare-fs-2.3.4.tgz#339d3a9ee574bf58de3a9c93f45dd6f1c62c92d2" - integrity sha512-7YyxitZEq0ey5loOF5gdo1fZQFF7290GziT+VbAJ+JbYTJYaPZwuEz2r/Nq23sm4fjyTgUf2uJI2gkT3xAuSYA== + version "2.3.5" + resolved "https://registry.yarnpkg.com/bare-fs/-/bare-fs-2.3.5.tgz#05daa8e8206aeb46d13c2fe25a2cd3797b0d284a" + integrity sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw== dependencies: bare-events "^2.0.0" bare-path "^2.0.0" bare-stream "^2.0.0" bare-os@^2.1.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/bare-os/-/bare-os-2.4.2.tgz#2de697579bfc7830a2b1892fe09a9cb365ee2352" - integrity sha512-HZoJwzC+rZ9lqEemTMiO0luOePoGYNBgsLLgegKR/cljiJvcDNhDZQkzC+NC5Oh0aHbdBNSOHpghwMuB5tqhjg== + version "2.4.4" + resolved "https://registry.yarnpkg.com/bare-os/-/bare-os-2.4.4.tgz#01243392eb0a6e947177bb7c8a45123d45c9b1a9" + integrity sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ== bare-path@^2.0.0, bare-path@^2.1.0: version "2.1.3" @@ -1146,12 +1146,12 @@ bare-path@^2.0.0, bare-path@^2.1.0: bare-os "^2.1.0" bare-stream@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/bare-stream/-/bare-stream-2.2.1.tgz#0315ee6aa8e1b1d3bcc66e96e1ab427089496a0e" - integrity sha512-YTB47kHwBW9zSG8LD77MIBAAQXjU2WjAkMHeeb7hUplVs6+IoM5I7uEVQNPMB7lj9r8I76UMdoMkGnCodHOLqg== + version "2.3.0" + resolved "https://registry.yarnpkg.com/bare-stream/-/bare-stream-2.3.0.tgz#5bef1cab8222517315fca1385bd7f08dff57f435" + integrity sha512-pVRWciewGUeCyKEuRxwv06M079r+fRjAQjBEK2P6OYGrO43O+Z0LrPZZEjlc4mB6C2RpZ9AxJ1s7NLEtOHO6eA== dependencies: b4a "^1.6.6" - streamx "^2.18.0" + streamx "^2.20.0" base64-js@^1.3.1: version "1.5.1" @@ -1665,10 +1665,10 @@ discord-api-types@0.37.97: resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.97.tgz#d658573f726ad179261d538dbad4e7e8eca48d11" integrity sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA== -discord.js@^14.16.1: - version "14.16.1" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.16.1.tgz#9499c71093bdba9541c77806c4cb43576c863299" - integrity sha512-/diX4shp3q1F3EySGQbQl10el+KIpffLSOJdtM35gGV7zw2ED7rKbASKJT7UIR9L/lTd0KtNenZ/h739TN7diA== +discord.js@^14.16.2: + version "14.16.2" + resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.16.2.tgz#c878977b5a377cf41eaed0b1901115f8faec9852" + integrity sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw== dependencies: "@discordjs/builders" "^1.9.0" "@discordjs/collection" "1.5.3" @@ -1729,9 +1729,9 @@ dynamic-dedupe@^0.3.0: xtend "^4.0.0" electron-to-chromium@^1.5.4: - version "1.5.19" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.19.tgz#aeaa0a076f3f0f0e8db2c57fd10158508f00725a" - integrity sha512-kpLJJi3zxTR1U828P+LIUDZ5ohixyo68/IcYOHLqnbTPr/wdgn4i1ECvmALN9E16JPA6cvCG5UG79gVwVdEK5w== + version "1.5.23" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.23.tgz#6dabd8f7fec5cbf618b732ff4c42950dcc7a3be5" + integrity sha512-mBhODedOXg4v5QWwl21DjM5amzjmI1zw9EPrPK/5Wx7C8jt33bpZNrC7OhHUG3pxRtbLpr3W2dXT+Ph1SsfRZA== emoji-regex@^8.0.0: version "8.0.0" @@ -3129,9 +3129,9 @@ path-scurry@^1.11.1: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-to-regexp@^6.2.1: - version "6.2.2" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.2.tgz#324377a83e5049cbecadc5554d6a63a9a4866b36" - integrity sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw== + version "6.3.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.3.0.tgz#2b6a26a337737a8e1416f9272ed0766b1c0389f4" + integrity sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ== path-type@^4.0.0: version "4.0.0" @@ -3322,9 +3322,9 @@ proxyquire@^2.1.3: resolve "^1.11.1" pump@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.1.tgz#cf711a61348b26a05ad8ce598e50d7e0ea03d398" - integrity sha512-2ynnAmUu45oUSq51AQbeugLkMSKaz8FqVpZ6ykTqzOVkzXe8u/ezkGsYrFJqKZx+D9cVxoDrSbR7CeAwxFa5cQ== + version "3.0.2" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" + integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== dependencies: end-of-stream "^1.1.0" once "^1.3.1" @@ -3681,10 +3681,10 @@ ssri@^10.0.0: dependencies: minipass "^7.0.3" -streamx@^2.15.0, streamx@^2.18.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.20.0.tgz#5f3608483499a9346852122b26042f964ceec931" - integrity sha512-ZGd1LhDeGFucr1CUCTBOS58ZhEendd0ttpGT3usTvosS4ntIwKN9LJFp+OeCSprsCPL14BXVRZlHGRY1V9PVzQ== +streamx@^2.15.0, streamx@^2.20.0: + version "2.20.1" + resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.20.1.tgz#471c4f8b860f7b696feb83d5b125caab2fdbb93c" + integrity sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA== dependencies: fast-fifo "^1.3.2" queue-tick "^1.0.1" @@ -3845,10 +3845,10 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -testcontainers@^10.13.0: - version "10.13.0" - resolved "https://registry.yarnpkg.com/testcontainers/-/testcontainers-10.13.0.tgz#cc70601db4f7a95d8a3ad669613450bd56b022ee" - integrity sha512-SDblQvirbJw1ZpenxaAairGtAesw5XMOCHLbRhTTUBJtBkZJGce8Vx/I8lXQxWIM8HRXsg3HILTHGQvYo4x7wQ== +testcontainers@^10.13.1: + version "10.13.1" + resolved "https://registry.yarnpkg.com/testcontainers/-/testcontainers-10.13.1.tgz#febdf275cd3156bee76428908fdeeb7dd53a0b5f" + integrity sha512-JBbOhxmygj/ouH/47GnoVNt+c55Telh/45IjVxEbDoswsLchVmJiuKiw/eF6lE5i7LN+/99xsrSCttI3YRtirg== dependencies: "@balena/dockerignore" "^1.0.2" "@types/dockerode" "^3.3.29" @@ -3867,9 +3867,9 @@ testcontainers@^10.13.0: undici "^5.28.4" text-decoder@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/text-decoder/-/text-decoder-1.1.1.tgz#5df9c224cebac4a7977720b9f083f9efa1aefde8" - integrity sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA== + version "1.2.0" + resolved "https://registry.yarnpkg.com/text-decoder/-/text-decoder-1.2.0.tgz#85f19d4d5088e0b45cd841bdfaeac458dbffeefc" + integrity sha512-n1yg1mOj9DNpk3NeZOx7T6jchTbyJS3i3cucbNN6FcdPriMZx7NsgrGpWWdWZZGxD7ES1XB+3uoqHMgOKaN+fg== dependencies: b4a "^1.6.4"