Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(rest): switch api to fetch-like and provide strategies #9416

Merged
merged 1 commit into from
May 6, 2023

Conversation

ckohen
Copy link
Member

@ckohen ckohen commented Apr 18, 2023

Please describe the changes this PR makes and why it should be merged:

Undici request was originally chosen for performance reasons. At the scale of discord bots, this performance difference is irrelevant. This instead is the first step towards cross environment compatability.

This refactor also changes the actual network request portion into a strategy. By default, this will use undici.request. This strategy has also been provided and exported as /undiciRequest

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@ckohen ckohen added this to the rest v2 milestone Apr 18, 2023
@ckohen ckohen self-assigned this Apr 18, 2023
@ckohen ckohen requested review from a team and iCrawl as code owners April 18, 2023 12:33
@vercel
Copy link

vercel bot commented Apr 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) May 6, 2023 1:06pm
discord-js-guide ⬜️ Ignored (Inspect) May 6, 2023 1:06pm

packages/proxy/__tests__/proxyRequests.test.ts Outdated Show resolved Hide resolved
packages/rest/src/lib/REST.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #9416 (c0dccd6) into main (28f5179) will increase coverage by 0.15%.
The diff coverage is 95.73%.

❗ Current head c0dccd6 differs from pull request most recent head 5c7cf19. Consider uploading reports for the commit 5c7cf19 to get more accurate results

@@            Coverage Diff             @@
##             main    #9416      +/-   ##
==========================================
+ Coverage   58.55%   58.70%   +0.15%     
==========================================
  Files         226      227       +1     
  Lines       14765    14756       -9     
  Branches     1256     1268      +12     
==========================================
+ Hits         8645     8663      +18     
+ Misses       6080     6053      -27     
  Partials       40       40              
Flag Coverage Δ
proxy 75.65% <90.00%> (-0.35%) ⬇️
rest 93.12% <96.10%> (+1.22%) ⬆️
ws 54.38% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/proxy/src/util/responseHelpers.ts 80.95% <90.00%> (-0.76%) ⬇️
packages/rest/src/lib/handlers/Shared.ts 88.38% <90.90%> (-0.15%) ⬇️
...ackages/rest/src/lib/handlers/SequentialHandler.ts 87.74% <93.75%> (ø)
packages/rest/src/strategies/undiciRequest.ts 94.28% <94.28%> (ø)
packages/rest/src/lib/REST.ts 98.91% <100.00%> (+0.03%) ⬆️
packages/rest/src/lib/RequestManager.ts 90.07% <100.00%> (-0.10%) ⬇️
packages/rest/src/lib/handlers/BurstHandler.ts 91.09% <100.00%> (ø)
packages/rest/src/lib/utils/constants.ts 96.96% <100.00%> (+0.09%) ⬆️
packages/rest/src/lib/utils/utils.ts 94.73% <100.00%> (-1.72%) ⬇️

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you update the respective README.md files about the Node.js bump!

@ckohen ckohen requested review from didinele, Jiralite and a team April 19, 2023 11:18
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also what jaw0r3k said

packages/rest/src/lib/global/fetch.d.ts Show resolved Hide resolved
@KhafraDev
Copy link
Contributor

KhafraDev commented May 2, 2023

When I said that it's is a horrible change I meant switching to fetch, which is what I've implemented a majority of. It was meant as a critique of my own work, rather than this PR. Fetch just isn't a good http client in node; it's slower than node-fetch (which uses node:http/s), it's slower than undici.request. It's a browser API in a server environment. On the edge it's more fitting & I would love to be able to use it in CFW, but not at the expense of my bot running node.js.

I have a draft PR implement the hook but I can't test it out because of <issues>. We can continue in Discord if you want?

@ckohen
Copy link
Member Author

ckohen commented May 2, 2023

The latest commit will need to be squashed before this merges, leaving it separate for ease of review for now.

@ckohen ckohen changed the title refactor(rest): switch from undici request to global fetch refactor(rest): default to global fetch May 2, 2023
packages/rest/src/lib/utils/constants.ts Outdated Show resolved Hide resolved
packages/rest/src/strategies/undiciRequest.ts Outdated Show resolved Hide resolved
packages/rest/src/strategies/undiciRequest.ts Outdated Show resolved Hide resolved
packages/rest/src/lib/utils/constants.ts Outdated Show resolved Hide resolved
@ckohen ckohen changed the title refactor(rest): default to global fetch refactor(rest): switch api to fetch-like and provide strategies May 2, 2023
@ckohen ckohen requested a review from kyranet May 4, 2023 08:53
kyranet
kyranet previously requested changes May 5, 2023
packages/rest/src/lib/RequestManager.ts Outdated Show resolved Hide resolved
packages/proxy/src/util/responseHelpers.ts Outdated Show resolved Hide resolved
ci: bump node version

test: remove console log

refactor(Handler): .d.ts interface file

refactor(Handler): move to interfaces folder

chore: mark undici as normal dep

feat: network request strategies

refactor: default to request strategy

docs: update to reflect recent changes

refactor: performance improvements

BREAKING CHANGE: NodeJS v18+ is required when using node due to the use of global `fetch`
BREAKING CHANGE: The raw method of REST now returns a web compatible `Respone` object.
BREAKING CHANGE: The `parseResponse` utility method has been updated to operate on a web compatible `Response` object.
BREAKING CHANGE: Many underlying internals have changed, some of which were exported.
BREAKING CHANGE: `DefaultRestOptions` used to contain a default `agent`, which is now set to `null` instead.
Copy link
Member

@iCrawl iCrawl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@iCrawl iCrawl removed the blocked label May 6, 2023
@iCrawl iCrawl merged commit cdaa0a3 into discordjs:main May 6, 2023
@ckohen ckohen deleted the feature/djs-31 branch May 6, 2023 19:11
Vylpes pushed a commit to Vylpes/vylbot-app that referenced this pull request Aug 7, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@discordjs/rest](https://discord.js.org) ([source](https://github.com/discordjs/discord.js)) | dependencies | major | [`^1.1.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/@discordjs%2frest/1.7.1/2.0.0) |

---

### Release Notes

<details>
<summary>discordjs/discord.js</summary>

### [`v2.0.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/rest/CHANGELOG.md#discordjsrest200-httpsgithubcomdiscordjsdiscordjscomparediscordjsrest171discordjsrest200---2023-07-31)

[Compare Source](https://github.com/discordjs/discord.js/compare/@discordjs/[email protected]...@discordjs/[email protected])

#### Features

-   No-de-no-de, now with extra buns ([#&#8203;9683](discordjs/discord.js#9683)) ([386f206](discordjs/discord.js@386f206))
    -   **BREAKING CHANGE:** The REST and RequestManager classes now extend AsyncEventEmitter
        from `@vladfrangu/async_event_emitter`, which aids in cross-compatibility
        between Node, Deno, Bun, CF Workers, Vercel Functions, etc.
    -   **BREAKING CHANGE:** DefaultUserAgentAppendix has been adapted to support multiple
        different platforms (previously mentioned Deno, Bun, CF Workers, etc)
    -   **BREAKING CHANGE:** the entry point for `@discordjs/rest` will now differ
        in non-node-like environments (CF Workers, etc.)
    -   **Co-authored-by:** Suneet Tipirneni <[email protected]>
    -   **Co-authored-by:** Jiralite <[email protected]>
    -   **Co-authored-by:** suneettipirneni <[email protected]>
-   User avatar decorations ([#&#8203;8914](discordjs/discord.js#8914)) ([8d97017](discordjs/discord.js@8d97017))
-   Support new username system ([#&#8203;9512](discordjs/discord.js#9512)) ([1ab60f9](discordjs/discord.js@1ab60f9))

#### Refactor

-   **REST:** Remove double classing ([#&#8203;9722](discordjs/discord.js#9722)) ([8f4256d](discordjs/discord.js@8f4256d))
    -   **BREAKING CHANGE:** `REST` and `RequestManager` have been combined, most of the properties, methods, and events from both classes can now be found on `REST`
    -   **BREAKING CHANGE:** `REST#raw` has been removed in favor of `REST#queueRequest`
    -   **BREAKING CHANGE:** `REST#getAgent` has been removed in favor of `REST#agent`

<!---->

-   chore: update for /rest changes

<!---->

-   **rest:** Switch api to fetch-like and provide strategies ([#&#8203;9416](discordjs/discord.js#9416)) ([cdaa0a3](discordjs/discord.js@cdaa0a3))
    -   **BREAKING CHANGE:** NodeJS v18+ is required when using node due to the use of global `fetch`
    -   **BREAKING CHANGE:** The raw method of REST now returns a web compatible `Respone` object.
    -   **BREAKING CHANGE:** The `parseResponse` utility method has been updated to operate on a web compatible `Response` object.
    -   **BREAKING CHANGE:** Many underlying internals have changed, some of which were exported.
    -   **BREAKING CHANGE:** `DefaultRestOptions` used to contain a default `agent`, which is now set to `null` instead.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9-->

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/327
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Vylpes pushed a commit to Vylpes/vylbot-app that referenced this pull request Dec 11, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [discord.js](https://discord.js.org) ([source](https://github.com/discordjs/discord.js)) | dependencies | minor | [`14.11.0` -> `14.14.1`](https://renovatebot.com/diffs/npm/discord.js/14.11.0/14.14.1) |

---

### Release Notes

<details>
<summary>discordjs/discord.js (discord.js)</summary>

### [`v14.14.1`](https://github.com/discordjs/discord.js/blob/HEAD/packages/discord.js/CHANGELOG.md#14141---2023-11-12)

[Compare Source](discordjs/discord.js@14.14.0...14.14.1)

#### Bug Fixes

-   **Emoji:** `id` set as `undefined` edge case ([#&#8203;9953](discordjs/discord.js#9953)) ([cc07a28](discordjs/discord.js@cc07a28))
-   **BaseClient:** Default in objects properly ([#&#8203;9952](discordjs/discord.js#9952)) ([f93abf7](discordjs/discord.js@f93abf7))

#### Documentation

-   Use preferred nullable syntax (`?T` over `T | null`) ([#&#8203;9946](discordjs/discord.js#9946)) ([1e4ef35](discordjs/discord.js@1e4ef35))

#### Refactor

-   Use formatters ([#&#8203;9956](discordjs/discord.js#9956)) ([40726db](discordjs/discord.js@40726db))

#### Typings

-   Use wrapper utilities ([#&#8203;9945](discordjs/discord.js#9945)) ([4bc1dae](discordjs/discord.js@4bc1dae))

### [`v14.14.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/discord.js/CHANGELOG.md#14140---2023-11-12)

[Compare Source](discordjs/discord.js@14.13.0...14.14.0)

#### Bug Fixes

-   **Client:** Ensure destroyed connections are not ready ([#&#8203;9942](discordjs/discord.js#9942)) ([b5e23ec](discordjs/discord.js@b5e23ec))
-   **Webhook:** Do not call `client.deleteWebhook` in `delete` ([#&#8203;9786](discordjs/discord.js#9786)) ([31d914e](discordjs/discord.js@31d914e))
-   **GuildManager#fetch:** Inject shard id ([#&#8203;9921](discordjs/discord.js#9921)) ([85753a9](discordjs/discord.js@85753a9))
-   Prevent 'undefined' debug message on intentional shard closure ([#&#8203;9846](discordjs/discord.js#9846)) ([0e0b85b](discordjs/discord.js@0e0b85b))
-   **Role:** Calculate position correctly when rawPositions are equal ([#&#8203;9871](discordjs/discord.js#9871)) ([0529b2a](discordjs/discord.js@0529b2a))
-   **GuildScheduledEvent:** Use `if...else` pattern and handle partials ([#&#8203;9802](discordjs/discord.js#9802)) ([32d614c](discordjs/discord.js@32d614c))

#### Documentation

-   **Message:** Remove duplicated word 'of' in description ([#&#8203;9923](discordjs/discord.js#9923)) ([85a78f9](discordjs/discord.js@85a78f9))
-   **GuildMember:** Clarify display color ([#&#8203;9891](discordjs/discord.js#9891)) ([e38d03f](discordjs/discord.js@e38d03f))
-   Remove duplicate `APIEmoji` ([#&#8203;9880](discordjs/discord.js#9880)) ([8cfadb6](discordjs/discord.js@8cfadb6))
-   Consolidate API types ([#&#8203;9881](discordjs/discord.js#9881)) ([44a3cbf](discordjs/discord.js@44a3cbf))
-   Remove `FileOptions` ([#&#8203;9855](discordjs/discord.js#9855)) ([eaabcdf](discordjs/discord.js@eaabcdf))
-   **DiscordjsErrorCodes:** Deprecate unused properties ([#&#8203;9790](discordjs/discord.js#9790)) ([4588e07](discordjs/discord.js@4588e07))
-   **ApplicationCommandManager:** Id parameter can take options ([#&#8203;9664](discordjs/discord.js#9664)) ([ed14135](discordjs/discord.js@ed14135))
-   **Attachment:** Add MIME types link to `contentType` ([#&#8203;9824](discordjs/discord.js#9824)) ([85b2498](discordjs/discord.js@85b2498))
-   Fix "its" typo ([#&#8203;9825](discordjs/discord.js#9825)) ([c50809e](discordjs/discord.js@c50809e))
-   **GuildMember:** Clarify timeout parameter wording ([#&#8203;9800](discordjs/discord.js#9800)) ([8d97e2d](discordjs/discord.js@8d97e2d))
-   **create-discord-bot:** Support bun in create-discord-bot ([#&#8203;9798](discordjs/discord.js#9798)) ([7157748](discordjs/discord.js@7157748))

#### Features

-   Default select menu values ([#&#8203;9867](discordjs/discord.js#9867)) ([4ff3ea4](discordjs/discord.js@4ff3ea4))
-   Mainlib docs on new website ([#&#8203;9930](discordjs/discord.js#9930)) ([da455bc](discordjs/discord.js@da455bc))
-   **cleanContent:** Add slash commands and emojis ([#&#8203;9809](discordjs/discord.js#9809)) ([c2349d4](discordjs/discord.js@c2349d4))
-   **Emoji:** Add `imageURL()` ([#&#8203;9788](discordjs/discord.js#9788)) ([b6c762c](discordjs/discord.js@b6c762c))
-   Onboarding mode and edit method ([#&#8203;9647](discordjs/discord.js#9647)) ([7671a83](discordjs/discord.js@7671a83))
-   Support new application properties and patch endpoint ([#&#8203;9709](discordjs/discord.js#9709)) ([1fe7247](discordjs/discord.js@1fe7247))
-   **BaseChannel:** Add `isThreadOnly()` ([#&#8203;9847](discordjs/discord.js#9847)) ([699b232](discordjs/discord.js@699b232))
-   **StageInstanceManager:** Add `guildScheduledEvent` to `create()` ([#&#8203;8885](discordjs/discord.js#8885)) ([931c3ed](discordjs/discord.js@931c3ed))
-   Support `default_thread_rate_limit_per_user` in channel creation ([#&#8203;9273](discordjs/discord.js#9273)) ([1e5c14b](discordjs/discord.js@1e5c14b))
-   Add media channels ([#&#8203;9662](discordjs/discord.js#9662)) ([571aedd](discordjs/discord.js@571aedd))
-   Support widget image URL ([#&#8203;9782](discordjs/discord.js#9782)) ([b6a2441](discordjs/discord.js@b6a2441))
-   **GuildAuditLogsEntry:** Expose extra integrationType in relevant log types ([#&#8203;9796](discordjs/discord.js#9796)) ([3109798](discordjs/discord.js@3109798))
-   Add support for teams update ([#&#8203;9805](discordjs/discord.js#9805)) ([c66636d](discordjs/discord.js@c66636d))
-   **Presence:** Expose sync_id in Activity ([#&#8203;9766](discordjs/discord.js#9766)) ([485dd71](discordjs/discord.js@485dd71))

#### Refactor

-   **utils:** Remove `mergeDefault` ([#&#8203;9938](discordjs/discord.js#9938)) ([5b0aa92](discordjs/discord.js@5b0aa92))
-   Use proper variable names in callbacks ([#&#8203;9840](discordjs/discord.js#9840)) ([11f6955](discordjs/discord.js@11f6955))
-   **GuildAuditLogsEntry:** Abstract reduce logic into a new function ([#&#8203;9845](discordjs/discord.js#9845)) ([19ea0ba](discordjs/discord.js@19ea0ba))
-   Stickers are free (no more "premium" packs) ([#&#8203;9791](discordjs/discord.js#9791)) ([e02a59b](discordjs/discord.js@e02a59b))

#### Typings

-   **Partials:** Add toString() method to supported Partials ([#&#8203;9835](discordjs/discord.js#9835)) ([7422d9f](discordjs/discord.js@7422d9f))
-   **MessageEditOptions:** Correct `attachments` type ([#&#8203;9874](discordjs/discord.js#9874)) ([2aa3250](discordjs/discord.js@2aa3250))
-   **UserContextMenuCommandInteraction:** Nullify `targetMember` ([#&#8203;9844](discordjs/discord.js#9844)) ([3c043d8](discordjs/discord.js@3c043d8))
-   Don't include dom types ([#&#8203;9831](discordjs/discord.js#9831)) ([9dbc954](discordjs/discord.js@9dbc954))
-   **Client:** Fix isReady narrowing ([#&#8203;9828](discordjs/discord.js#9828)) ([6404c01](discordjs/discord.js@6404c01))

### [`v14.13.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/discord.js/CHANGELOG.md#14130---2023-08-17)

[Compare Source](discordjs/discord.js@14.12.1...14.13.0)

#### Bug Fixes

-   **Action:** Do not add the client user as a recipient ([#&#8203;9774](discordjs/discord.js#9774)) ([24fbb11](discordjs/discord.js@24fbb11))
-   **DMChannel:** Correct partial typo ([#&#8203;9773](discordjs/discord.js#9773)) ([c1ff545](discordjs/discord.js@c1ff545))
-   **CachedManager:** Allow overriding constructor for makeCache ([#&#8203;9763](discordjs/discord.js#9763)) ([346fa57](discordjs/discord.js@346fa57))
-   **types:** Fixed CachedManager constructor arguments in type ([#&#8203;9761](discordjs/discord.js#9761)) ([b3c85d3](discordjs/discord.js@b3c85d3))
-   **Action:** Do not set `undefined` values ([#&#8203;9755](discordjs/discord.js#9755)) ([d8e3755](discordjs/discord.js@d8e3755))

#### Documentation

-   **EmbedBuilder:** `@readonly` length ([#&#8203;9778](discordjs/discord.js#9778)) ([8f572a6](discordjs/discord.js@8f572a6))
-   **WebhookEditOptions:** Add all of the types ([#&#8203;9776](discordjs/discord.js#9776)) ([d5be424](discordjs/discord.js@d5be424))
-   Update Node.js requirement to 16.11.0 ([#&#8203;9764](discordjs/discord.js#9764)) ([188877c](discordjs/discord.js@188877c))

#### Features

-   **Client:** Add deleteWebhook method ([#&#8203;9777](discordjs/discord.js#9777)) ([d90ba8d](discordjs/discord.js@d90ba8d))
-   **ClientPresence:** Allow setting activity state ([#&#8203;9743](discordjs/discord.js#9743)) ([9ed1b59](discordjs/discord.js@9ed1b59))
-   **ClientApplication:** Approximate guild count and new `GET` route ([#&#8203;9713](discordjs/discord.js#9713)) ([632a9b4](discordjs/discord.js@632a9b4))
-   **Role:** Add `flags` ([#&#8203;9694](discordjs/discord.js#9694)) ([3b18e5b](discordjs/discord.js@3b18e5b))
-   **Attachment:** Add `flags` ([#&#8203;9686](discordjs/discord.js#9686)) ([692f0fc](discordjs/discord.js@692f0fc))
-   Add `Client#webhooksUpdate` ([#&#8203;9732](discordjs/discord.js#9732)) ([0de071d](discordjs/discord.js@0de071d))

#### Typings

-   **GuildInvitableChannelResolvable:** Allow forum channels ([#&#8203;9775](discordjs/discord.js#9775)) ([727dc09](discordjs/discord.js@727dc09))
-   Make activity name required ([#&#8203;9765](discordjs/discord.js#9765)) ([0a9a3ed](discordjs/discord.js@0a9a3ed))
-   **BaseButtonComponentData:** Narrow component type ([#&#8203;9735](discordjs/discord.js#9735)) ([a30d46c](discordjs/discord.js@a30d46c))

### [`v14.12.1`](https://github.com/discordjs/discord.js/blob/HEAD/packages/discord.js/CHANGELOG.md#14121---2023-08-01)

[Compare Source](discordjs/discord.js@14.12.0...14.12.1)

#### Bug Fixes

-   **BaseClient:** Fix destroy method ([#&#8203;9742](discordjs/discord.js#9742)) ([1af7e5a](discordjs/discord.js@1af7e5a))

### [`v14.12.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/discord.js/CHANGELOG.md#14120---2023-07-31)

[Compare Source](discordjs/discord.js@14.11.0...14.12.0)

#### Bug Fixes

-   **ChannelUpdate:** Check against unknown channels ([#&#8203;9697](discordjs/discord.js#9697)) ([7fb91c5](discordjs/discord.js@7fb91c5))
-   **Action:** Use existing recipients if available ([#&#8203;9653](discordjs/discord.js#9653)) ([719e54a](discordjs/discord.js@719e54a))
-   Everyone role members ([#&#8203;9685](discordjs/discord.js#9685)) ([0803eb5](discordjs/discord.js@0803eb5))
-   `awaitMessageComponent` with `MessageComponentInteraction`s ([#&#8203;8598](discordjs/discord.js#8598)) ([b61e4fb](discordjs/discord.js@b61e4fb))
-   **ThreadManager:** Fix internal crash upon conditionally resolving thread members ([#&#8203;9648](discordjs/discord.js#9648)) ([a6dbe16](discordjs/discord.js@a6dbe16))
-   **User:** Check global name in equals ([#&#8203;9631](discordjs/discord.js#9631)) ([8f3bd38](discordjs/discord.js@8f3bd38))
-   **WebSocketManager:** Await WebSocket destroy ([#&#8203;9519](discordjs/discord.js#9519)) ([75308f2](discordjs/discord.js@75308f2))
-   **Client:** Safe call for possibly null WebSocket ([#&#8203;9600](discordjs/discord.js#9600)) ([24a6149](discordjs/discord.js@24a6149))
-   **ThreadManager:** Ensure `fetchActive()` only returns active threads in a channel ([#&#8203;9568](discordjs/discord.js#9568)) ([53aa24d](discordjs/discord.js@53aa24d))
-   **LimitedCollection:** Allow items to be stored if keepOverLimit is true when maxSize is 0 ([#&#8203;9534](discordjs/discord.js#9534)) ([9345d1b](discordjs/discord.js@9345d1b))
-   **AutocompleteInteraction:** Prevent snake casing of locales ([#&#8203;9565](discordjs/discord.js#9565)) ([7196fe3](discordjs/discord.js@7196fe3))

#### Documentation

-   Change `Channel` to `BaseChannel` ([#&#8203;9718](discordjs/discord.js#9718)) ([e5effb6](discordjs/discord.js@e5effb6))
-   **BaseChannel:** Remove `APIChannel` ([#&#8203;9717](discordjs/discord.js#9717)) ([125405f](discordjs/discord.js@125405f))
-   **BuildersSelectMenuOption:** Update link ([#&#8203;9690](discordjs/discord.js#9690)) ([ede9f4e](discordjs/discord.js@ede9f4e))
-   **ClientOptions:** Change default value of sweepers in docs ([#&#8203;9591](discordjs/discord.js#9591)) ([911e6ef](discordjs/discord.js@911e6ef))
-   **Client:** Correct invite gateway permission checks ([#&#8203;9597](discordjs/discord.js#9597)) ([e1b6eee](discordjs/discord.js@e1b6eee))
-   Fix broken links to new documentation ([#&#8203;9563](discordjs/discord.js#9563)) ([d01e8aa](discordjs/discord.js@d01e8aa))

#### Features

-   Add ws option support for "buildIdentifyThrottler" ([#&#8203;9728](discordjs/discord.js#9728)) ([6307f81](discordjs/discord.js@6307f81))
-   **Client:** Add `guildAvailable` event ([#&#8203;9692](discordjs/discord.js#9692)) ([3c85fb2](discordjs/discord.js@3c85fb2))
-   User avatar decorations ([#&#8203;8914](discordjs/discord.js#8914)) ([8d97017](discordjs/discord.js@8d97017))
-   Add silent option to ShardingManager ([#&#8203;9506](discordjs/discord.js#9506)) ([df40dcd](discordjs/discord.js@df40dcd))
-   **EmbedBuilder:** Add `.length` ([#&#8203;8682](discordjs/discord.js#8682)) ([53c17e0](discordjs/discord.js@53c17e0))
-   Guild onboarding ([#&#8203;9120](discordjs/discord.js#9120)) ([dc73c93](discordjs/discord.js@dc73c93))
-   Add resume event in shard ([#&#8203;9650](discordjs/discord.js#9650)) ([a73d54e](discordjs/discord.js@a73d54e))
-   **presence:** Re-introduce image resolving for other platforms ([#&#8203;9637](discordjs/discord.js#9637)) ([73c2f8a](discordjs/discord.js@73c2f8a))
-   Add message to send resume event to shard ([#&#8203;9626](discordjs/discord.js#9626)) ([a873ec1](discordjs/discord.js@a873ec1))
-   Support new username system ([#&#8203;9512](discordjs/discord.js#9512)) ([1ab60f9](discordjs/discord.js@1ab60f9))
-   **GuildAuditLogsEntry#extra:** Add missing `channel` property ([#&#8203;9518](discordjs/discord.js#9518)) ([2272321](discordjs/discord.js@2272321))

#### Performance

-   **Channel:** Linear speed position getter ([#&#8203;9497](discordjs/discord.js#9497)) ([09b0382](discordjs/discord.js@09b0382))
-   **Role:** Improve `members` getter ([#&#8203;9529](discordjs/discord.js#9529)) ([37181ab](discordjs/discord.js@37181ab))

#### Refactor

-   **User:** Remove deprecation warning from tag ([#&#8203;9660](discordjs/discord.js#9660)) ([cf8012c](discordjs/discord.js@cf8012c))
-   **GuildMember:** Make `_roles` property non-enumerable ([#&#8203;9387](discordjs/discord.js#9387)) ([46167a7](discordjs/discord.js@46167a7))
-   **rest:** Switch api to fetch-like and provide strategies ([#&#8203;9416](discordjs/discord.js#9416)) ([cdaa0a3](discordjs/discord.js@cdaa0a3))
    -   **BREAKING CHANGE:** NodeJS v18+ is required when using node due to the use of global `fetch`
    -   **BREAKING CHANGE:** The raw method of REST now returns a web compatible `Respone` object.
    -   **BREAKING CHANGE:** The `parseResponse` utility method has been updated to operate on a web compatible `Response` object.
    -   **BREAKING CHANGE:** Many underlying internals have changed, some of which were exported.
    -   **BREAKING CHANGE:** `DefaultRestOptions` used to contain a default `agent`, which is now set to `null` instead.

#### Typings

-   **MessageManager:** Allow comparison of messages again ([#&#8203;9612](discordjs/discord.js#9612)) ([a48d0ef](discordjs/discord.js@a48d0ef))
-   **AutoModerationActionExecution:** Add forum channels as a possible type in `channel()` ([#&#8203;9623](discordjs/discord.js#9623)) ([d64330a](discordjs/discord.js@d64330a))
-   **ModalSubmitFields:** Components is an array ([#&#8203;9406](discordjs/discord.js#9406)) ([1cab79f](discordjs/discord.js@1cab79f))
-   Use `readonly` arrays and `const` type parameters in places ([#&#8203;9641](discordjs/discord.js#9641)) ([cd69868](discordjs/discord.js@cd69868))
-   **BaseInteraction:** `appPermissions` not `null` in guilds ([#&#8203;9601](discordjs/discord.js#9601)) ([6c2242f](discordjs/discord.js@6c2242f))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/351
Reviewed-by: Vylpes <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants