From 2a70dd079c16651f68759574413d13391489160b Mon Sep 17 00:00:00 2001 From: kevinlul <6320810+kevinlul@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:38:08 -0400 Subject: [PATCH] Bump discord.js to 14.16.1 --- package.json | 4 +- src/slash/start.ts | 2 +- src/util/discord.ts | 2 +- yarn.lock | 122 +++++++++++++++++++++++++++++--------------- 4 files changed, 85 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index f8df4656..717ae206 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "async-mutex": "^0.5.0", "coveralls": "link:./node_modules/.NULL", "debug": "^4.3.6", - "discord.js": "^14.15.3", + "discord.js": "^14.16.1", "dotenv": "^16.4.5", "jimp": "link:./node_modules/.NULL", "make-fetch-happen": "^13.0.1", @@ -53,7 +53,7 @@ "@types/node-fetch": "^2.6.11" }, "resolutions": { - "@types/node": "^20.16.0", + "@types/node": "^20.16.3", "better-sqlite3": "^11.1.2", "coveralls": "link:./node_modules/.NULL", "jimp": "link:./node_modules/.NULL", diff --git a/src/slash/start.ts b/src/slash/start.ts index fc19042b..cc50b0f0 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()) { + if (publicChannel && publicChannel.isTextBased() && !publicChannel.isDMBased()) { 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 96394cb4..5c852249 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()) { + if (channel?.isTextBased() && !channel.isDMBased()) { return await channel.send(...args); } throw new Error(`${channelId} is not a text channel`); diff --git a/yarn.lock b/yarn.lock index 5125b267..316de549 100644 --- a/yarn.lock +++ b/yarn.lock @@ -219,18 +219,18 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@discordjs/builders@^1.8.2": - version "1.8.2" - resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.8.2.tgz#535d970331ee40f20dec9ef8079e43092f323ce9" - integrity sha512-6wvG3QaCjtMu0xnle4SoOIeFB4y6fKMN6WZfy3BMKJdQQtPLik8KGzDwBVL/+wTtcE/ZlFjgEk74GublyEVZ7g== +"@discordjs/builders@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.9.0.tgz#71fa6de91132bd1deaff2a9daea7aa5d5c9f124a" + integrity sha512-0zx8DePNVvQibh5ly5kCEei5wtPBIUbSoE9n+91Rlladz4tgtFbJ36PZMxxZrTEOQ7AHMZ/b0crT/0fCy6FTKg== dependencies: - "@discordjs/formatters" "^0.4.0" - "@discordjs/util" "^1.1.0" - "@sapphire/shapeshift" "^3.9.7" - discord-api-types "0.37.83" + "@discordjs/formatters" "^0.5.0" + "@discordjs/util" "^1.1.1" + "@sapphire/shapeshift" "^4.0.0" + discord-api-types "0.37.97" fast-deep-equal "^3.1.3" ts-mixer "^6.0.4" - tslib "^2.6.2" + tslib "^2.6.3" "@discordjs/collection@1.5.3": version "1.5.3" @@ -242,12 +242,17 @@ resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-2.1.0.tgz#f327d944ab2dcf9a1f674470a481f78a120a5e3b" integrity sha512-mLcTACtXUuVgutoznkh6hS3UFqYirDYAg5Dc1m8xn6OvPjetnUlf/xjtqnnc47OwWdaoCQnHmHh9KofhD6uRqw== -"@discordjs/formatters@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.4.0.tgz#066a2c2163b26ac066e6f621f17445be9690c6a9" - integrity sha512-fJ06TLC1NiruF35470q3Nr1bi95BdvKFAF+T5bNfZJ4bNdqZ3VZ+Ttg6SThqTxm6qumSG3choxLBHMC69WXNXQ== +"@discordjs/collection@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-2.1.1.tgz#901917bc538c12b9c3613036d317847baee08cae" + integrity sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg== + +"@discordjs/formatters@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.5.0.tgz#2d284c4271bc41984339936df1d0164e470f3b7a" + integrity sha512-98b3i+Y19RFq1Xke4NkVY46x8KjJQjldHUuEbCqMvp1F5Iq9HgnGpu91jOi/Ufazhty32eRsKnnzS8n4c+L93g== dependencies: - discord-api-types "0.37.83" + discord-api-types "0.37.97" "@discordjs/rest@^2.3.0": version "2.3.0" @@ -264,12 +269,32 @@ tslib "^2.6.2" undici "6.13.0" +"@discordjs/rest@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-2.4.0.tgz#63bfc816af58af844914e3589d7eae609cd199b5" + integrity sha512-Xb2irDqNcq+O8F0/k/NaDp7+t091p+acb51iA4bCKfIn+WFWd6HrNvcsSbMMxIR9NjcMZS6NReTKygqiQN+ntw== + dependencies: + "@discordjs/collection" "^2.1.1" + "@discordjs/util" "^1.1.1" + "@sapphire/async-queue" "^1.5.3" + "@sapphire/snowflake" "^3.5.3" + "@vladfrangu/async_event_emitter" "^2.4.6" + discord-api-types "0.37.97" + magic-bytes.js "^1.10.0" + tslib "^2.6.3" + undici "6.19.8" + "@discordjs/util@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.1.0.tgz#dcffd2b61aab8eadd66bea67811bc34fc769bb2a" integrity sha512-IndcI5hzlNZ7GS96RV3Xw1R2kaDuXEp7tRIy/KlhidpN/BQ1qh1NZt3377dMLTa44xDUNKT7hnXkA/oUAzD/lg== -"@discordjs/ws@^1.1.1": +"@discordjs/util@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.1.1.tgz#bafcde0faa116c834da1258d78ec237080bbab29" + integrity sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g== + +"@discordjs/ws@1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@discordjs/ws/-/ws-1.1.1.tgz#bffbfd46838258ab09054ed98ddef1a36f6507a3" integrity sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA== @@ -571,15 +596,15 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@sapphire/async-queue@^1.5.2": +"@sapphire/async-queue@^1.5.2", "@sapphire/async-queue@^1.5.3": version "1.5.3" resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.3.tgz#03cd2a2f3665068f314736bdc56eee2025352422" integrity sha512-x7zadcfJGxFka1Q3f8gCts1F0xMwCKbZweM85xECGI0hBTeIZJGGCrHgLggihBoprlQ/hBmDR5LKfIPqnmHM3w== -"@sapphire/shapeshift@^3.9.7": - version "3.9.7" - resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.7.tgz#43e23243cac8a0c046bf1e73baf3dbf407d33a0c" - integrity sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g== +"@sapphire/shapeshift@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-4.0.0.tgz#86c1b41002ff5d0b2ad21cbc3418b06834b89040" + integrity sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg== dependencies: fast-deep-equal "^3.1.3" lodash "^4.17.21" @@ -731,10 +756,10 @@ "@types/node" "*" form-data "^4.0.0" -"@types/node@*", "@types/node@^18.11.18", "@types/node@^20.14.9", "@types/node@^20.16.0": - version "20.16.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.0.tgz#02e5cd414f76bf345874ee65a1e5590d755d894f" - integrity sha512-vDxceJcoZhIVh67S568bm1UGZO0DX0hpplJZxzeXMKwIPLn190ec5RRxQ69BKhX44SUGIxxgMdDY557lGLKprQ== +"@types/node@*", "@types/node@^18.11.18", "@types/node@^20.14.9", "@types/node@^20.16.3": + version "20.16.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.3.tgz#7b4f9a37091cf03a0c2561bf76a9a55f03f4f523" + integrity sha512-/wdGiWRkMOm53gAsSyFMXFZHbVg7C6CbkrzHNpaHoYfsUWPg7m6ZRKtvQjgvQ9i8WT540a3ydRlRQbxjY30XxQ== dependencies: undici-types "~6.19.2" @@ -924,6 +949,11 @@ resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.5.tgz#7bc35026fdc3398a5e1aac801edd21b28cdf4cfa" integrity sha512-J7T3gUr3Wz0l7Ni1f9upgBZ7+J22/Q1B7dl0X6fG+fTsD+H+31DIosMHj4Um1dWQwqbcQ3oQf+YS2foYkDc9cQ== +"@vladfrangu/async_event_emitter@^2.4.6": + version "2.4.6" + resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.6.tgz#508b6c45b03f917112a9008180b308ba0e4d1805" + integrity sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA== + abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" @@ -1659,23 +1689,28 @@ discord-api-types@0.37.83: resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.83.tgz#a22a799729ceded8176ea747157837ddf4708b1f" integrity sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA== -discord.js@^14.15.3: - version "14.15.3" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.15.3.tgz#b2a67a1a4ef192be498fb8b6784224a42906f1be" - integrity sha512-/UJDQO10VuU6wQPglA4kz2bw2ngeeSbogiIPx/TsnctfzV/tNf+q+i1HlgtX1OGpeOBpJH9erZQNO5oRM2uAtQ== +discord-api-types@0.37.97: + version "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== dependencies: - "@discordjs/builders" "^1.8.2" + "@discordjs/builders" "^1.9.0" "@discordjs/collection" "1.5.3" - "@discordjs/formatters" "^0.4.0" - "@discordjs/rest" "^2.3.0" - "@discordjs/util" "^1.1.0" - "@discordjs/ws" "^1.1.1" + "@discordjs/formatters" "^0.5.0" + "@discordjs/rest" "^2.4.0" + "@discordjs/util" "^1.1.1" + "@discordjs/ws" "1.1.1" "@sapphire/snowflake" "3.5.3" - discord-api-types "0.37.83" + discord-api-types "0.37.97" fast-deep-equal "3.1.3" lodash.snakecase "4.1.1" - tslib "2.6.2" - undici "6.13.0" + tslib "^2.6.3" + undici "6.19.8" docker-compose@^0.24.8: version "0.24.8" @@ -3968,16 +4003,16 @@ tsconfig@^7.0.0: strip-bom "^3.0.0" strip-json-comments "^2.0.0" -tslib@2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== +tslib@^2.6.3: + version "2.7.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" + integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -4060,6 +4095,11 @@ undici@6.13.0: resolved "https://registry.yarnpkg.com/undici/-/undici-6.13.0.tgz#7edbf4b7f3aac5f8a681d515151bf55cb3589d72" integrity sha512-Q2rtqmZWrbP8nePMq7mOJIN98M0fYvSgV89vwl/BQRT4mDOeY2GXZngfGpcBBhtky3woM7G24wZV3Q304Bv6cw== +undici@6.19.8: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.19.8.tgz#002d7c8a28f8cc3a44ff33c3d4be4d85e15d40e1" + integrity sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g== + undici@^5.28.4: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068"