Skip to content

Conversation

@ckohen
Copy link
Member

@ckohen ckohen commented Nov 10, 2025

BREAKING CHANGE: WebhookClient has been removed, use @discordjs/core instead or fetch webhooks. Alternative solutions are in the works

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

WebhookClient is an incredibly inefficient way to interact with webhooks (creates a rest instance per webhook, an entire client per webhook etc..). We are working on developing an alternative to this that will mimic the simplicity of WebhookClient. In the meantime, we recommend using @discordjs/core if you are not connected to gateway, and fetching webhooks from the client if you are. We know making an extra API call is not ideal, the alternative will solve this and will land as soon as we finish internal discussions.

Closes: #8733

Status and versioning classification:

  • 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)

BREAKING CHANGE: WebhookClient has been removed, use @discordjs/core instead or fetch webhooks. Alternative solutions are in the works
@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
discord-js Skipped Skipped Nov 13, 2025 8:38pm
discord-js-guide Skipped Skipped Nov 13, 2025 8:38pm

@github-project-automation github-project-automation bot moved this from Todo to Review Approved in discord.js Nov 11, 2025
Copy link
Contributor

@TAEMBO TAEMBO left a comment

Choose a reason for hiding this comment

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

Worth removing BaseClient as well imo due to Client being the only other thing using it

@ckohen
Copy link
Member Author

ckohen commented Nov 12, 2025

I decided not to unify the client class in this PR. I think we should in a PR following this one though.

BREAKING CHANGE: `WebhookURLInvalid` is no longer an error code (obsolete).
@vercel vercel bot temporarily deployed to Preview – discord-js November 13, 2025 20:38 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide November 13, 2025 20:38 Inactive
@ckohen ckohen merged commit 9f18cb2 into discordjs:main Nov 13, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js Nov 13, 2025
@ckohen ckohen deleted the refactor/remove-webhook-client branch November 13, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

WebookClient/REST memory leak

6 participants